Permalink
Browse files

FileUtils: "IgnoringResolutions" goes at the end

  • Loading branch information...
1 parent be21423 commit 58d7f5fcce5bfeb57ac5e7fad30cab3a0c5871ba @ricardoquesada ricardoquesada committed Nov 21, 2012
View
@@ -111,8 +111,8 @@ - (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentSha
- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename
{
- const GLchar * vertexSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathIgnoringResolutionsFromRelativePath:vShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
- const GLchar * fragmentSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathIgnoringResolutionsFromRelativePath:fShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
+ const GLchar * vertexSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathFromRelativePathIgnoringResolutions:vShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
+ const GLchar * fragmentSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathFromRelativePathIgnoringResolutions:fShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
return [self initWithVertexShaderByteArray:vertexSource fragmentShaderByteArray:fragmentSource];
}
@@ -241,7 +241,7 @@ enum {
@since v2.1
*/
--(NSString*) fullPathIgnoringResolutionsFromRelativePath:(NSString*)relPath;
+-(NSString*) fullPathFromRelativePathIgnoringResolutions:(NSString*)relPath;
@@ -40,7 +40,7 @@
NSString *kCCFileUtilsiPhone5 = @"iphone5";
NSString *kCCFileUtilsiPhone5HD = @"iphone5hd";
#elif __CC_PLATFORM_MAC
-NSString *kCCFileUtilsMac = @"";
+NSString *kCCFileUtilsMac = @"mac";
NSString *kCCFileUtilsMacHD = @"machd";
#endif
@@ -407,7 +407,7 @@ -(ccResolutionType) resolutionTypeForKey:(NSString*)k inDictionary:dictionary
}
--(NSString*) fullPathIgnoringResolutionsFromRelativePath:(NSString*)relPath
+-(NSString*) fullPathFromRelativePathIgnoringResolutions:(NSString*)relPath
{
if ([relPath isAbsolutePath])
return relPath;
View
@@ -115,6 +115,8 @@
#import "CCDrawNode.h"
#import "CCClippingNode.h"
+#import "ccFPSImages.h"
+
// Shaders
#import "CCGLProgram.h"
#import "ccGLStateCache.h"
@@ -18,29 +18,6 @@
// CLASS IMPLEMENTATIONS
-@interface BootLayer : CCLayer
-@end
-@implementation BootLayer
--(void) onEnter
-{
- [super onEnter];
-
- NSString *name = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
-
- if( [name isEqual:@"JS Watermelon"] )
- [[JSBCore sharedInstance] runScript:@"watermelon_with_me.js"];
- else if( [name isEqual:@"JS Tests"] )
- [[JSBCore sharedInstance] runScript:@"src/tests-boot-jsb.js"];
- else if( [name isEqual:@"JS Moon Warriors"] )
- [[JSBCore sharedInstance] runScript:@"MoonWarriors.js"];
- else if( [name isEqual:@"JS CocosDragon"] ) {
- [[CCFileUtils sharedFileUtils] setSearchMode:kCCFileUtilsSearchDirectory];
- [[JSBCore sharedInstance] runScript:@"main.js"];
- }
-}
-@end
-
-
@implementation AppController
#pragma mark - AppController - iOS
@@ -174,22 +151,26 @@ -(void)dealloc
}
-(void) run
-{
-// CCScene *scene = [CCScene node];
-// BootLayer *layer = [BootLayer node];
-// [scene addChild:layer];
-// [[CCDirector sharedDirector] runWithScene:scene];
-
+{
NSString *name = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
-
- if( [name isEqual:@"JS Watermelon"] )
+
+ CCFileUtils *fileutils = [CCFileUtils sharedFileUtils];
+
+ if( [name isEqual:@"JS Watermelon"] ) {
[[JSBCore sharedInstance] runScript:@"watermelon_with_me.js"];
+#if defined(__CC_PLATFORM_MAC)
+ // Use ipad resources for Mac
+ [[fileutils suffixesDict] setObject:@"-ipad" forKey:kCCFileUtilsMac];
+ [[fileutils suffixesDict] setObject:@"-ipadhd" forKey:kCCFileUtilsMacHD];
+ NSLog(@"%@", [fileutils suffixesDict]);
+#endif
+ }
else if( [name isEqual:@"JS Tests"] )
[[JSBCore sharedInstance] runScript:@"src/tests-boot-jsb.js"];
else if( [name isEqual:@"JS Moon Warriors"] )
[[JSBCore sharedInstance] runScript:@"MoonWarriors-native.js"];
else if( [name isEqual:@"JS CocosDragon"] ) {
- [[CCFileUtils sharedFileUtils] setSearchMode:kCCFileUtilsSearchDirectory];
+ [fileutils setSearchMode:kCCFileUtilsSearchDirectory];
[[JSBCore sharedInstance] runScript:@"main.js"];
}
}
Submodule cocos2d-js-tests updated 0 files

0 comments on commit 58d7f5f

Please sign in to comment.