Skip to content

Commit

Permalink
Updates for iOS7
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Williams committed Dec 7, 2014
1 parent fb648bf commit 616945a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/batterytech/src/batterytech/platform/ios/iosgeneral.mm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@
NSString *resourceName = [NSString stringWithCString:filename encoding: NSUTF8StringEncoding];
NSString *extString = [NSString stringWithCString:extension encoding: NSUTF8StringEncoding];
NSString *pathName = [NSString stringWithCString:path encoding: NSUTF8StringEncoding];
NSString *filePath = [[NSBundle mainBundle] pathForResource:resourceName ofType:extString inDirectory:pathName];
__block NSString *filePath = [[NSBundle mainBundle] pathForResource:resourceName ofType:extString inDirectory:pathName];
if (! filePath) {
NSLog(@"Error finding asset %@", resourceName);
}
const char *filePathCString = [filePath UTF8String];
return filePathCString;
}
Expand Down Expand Up @@ -150,12 +153,13 @@ S32 _platform_read_asset_chunk(const char *assetName, S32 offset, unsigned char
FILE *handle;
handle = fopen(filePathCString, "rb");
if (!handle) {
NSLog(@"No File Handle");
NSLog(@"read asset chunk No File Handle");
}
fseek(handle, offset, SEEK_SET);
int bytesRead = fread(buffer, sizeof(unsigned char), bufferLength, handle);
int error = ferror(handle);
if (error) {
NSLog(@"read asset chunk IO error %d", error);
//cout << "IO error " << error << endl;
}
if (feof(handle)) {
Expand All @@ -166,7 +170,9 @@ S32 _platform_read_asset_chunk(const char *assetName, S32 offset, unsigned char
}
fclose(handle);
return bytesRead;
}
} else {
NSLog(@"read asset chunk coudln't find path for %s", assetName);
}
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "../Context.h"
#include "GraphicsConfiguration.h"

#define MAX_TEXTURES 300
#define MAX_TEXTURES 400
#define MAX_OBJSCENES 100
#define MAX_ASSIMPS 100
#define MAX_SHADERS 100
Expand Down

0 comments on commit 616945a

Please sign in to comment.