Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Commit

Permalink
Clean up deprecated methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
clobber committed Dec 13, 2015
1 parent 15ef9d5 commit 6f54fe2
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions HiganGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,11 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
}

- (void)executeFrame
{
[self executeFrameSkippingFrame:NO];
}

- (void)executeFrameSkippingFrame:(BOOL)skip
{
_interface->run();

signed samples[2];
while(_interface->resampler.pending())
{
while(_interface->resampler.pending()) {
_interface->resampler.read(samples);
[[self ringBufferAtIndex:0] write:&samples[0] maxLength:2];
[[self ringBufferAtIndex:0] write:&samples[1] maxLength:2];
Expand Down Expand Up @@ -252,20 +246,16 @@ - (BOOL)deserializeState:(NSData *)state withError:(NSError **)outError
unsigned int stateLength = [state length];
serializer stateToLoad(stateBytes, stateLength);

if(!_interface->active->unserialize(stateToLoad))
{
NSError *error = [NSError errorWithDomain:OEGameCoreErrorDomain
code:OEGameCoreCouldNotLoadStateError
userInfo:@{
NSLocalizedDescriptionKey : @"The save state data could not be read"
}];
if(outError)
{
*outError = error;
}
return NO;
if(_interface->active->unserialize(stateToLoad))
return YES;

if (outError) {
*outError = [NSError errorWithDomain:OEGameCoreErrorDomain code:OEGameCoreCouldNotLoadStateError userInfo:@{
NSLocalizedDescriptionKey : @"The save state data could not be read"
}];
}
return YES;

return NO;
}

- (void)saveStateToFileAtPath:(NSString *)fileName completionHandler:(void (^)(BOOL, NSError *))block
Expand Down

0 comments on commit 6f54fe2

Please sign in to comment.