Merge pull request #10023 from yinjimmy/bugfix_runtime

Fix compile error with lua-tempate-default / lua-template-runtime on Mac and iOS platform
This commit is contained in:
minggo 2015-01-15 14:18:23 +08:00
commit 107022f745
2 changed files with 37 additions and 14 deletions

View File

@ -49,12 +49,12 @@
5200BECA1A53D9A500AC45E4 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5200BEC91A53D9A500AC45E4 /* Security.framework */; };
521A8E7019F0C3D200D177D7 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6E19F0C3D200D177D7 /* Default-667h@2x.png */; };
521A8E7119F0C3D200D177D7 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */; };
9F82AE391A6514F3007BD5CD /* SimpleConfigParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F82AE371A6514F3007BD5CD /* SimpleConfigParser.cpp */; };
9FC760431A67791200D1E6E7 /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FC760401A67791200D1E6E7 /* lang */; };
9FC760451A677A4A00D1E6E7 /* SimpleConfigParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FC760411A67791200D1E6E7 /* SimpleConfigParser.cpp */; };
9FF504841A5E87B100AFDA55 /* ConsoleWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FF504811A5E87B100AFDA55 /* ConsoleWindow.xib */; };
9FF504851A5E87B100AFDA55 /* ConsoleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FF504831A5E87B100AFDA55 /* ConsoleWindowController.m */; };
9FF504861A5E881200AFDA55 /* liblibsimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF5047E1A5E86D600AFDA55 /* liblibsimulator.a */; };
9FF504871A5E88CE00AFDA55 /* liblibsimulator_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF504801A5E86D600AFDA55 /* liblibsimulator_iOS.a */; };
9FFC07261A4A739200AED399 /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FFC07061A4A739200AED399 /* lang */; };
9FFC07361A4A764100AED399 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FFC07341A4A764100AED399 /* MainMenu.xib */; };
C03781B918BF655400FE4F13 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C03781B718BF655400FE4F13 /* res */; };
C03781BA18BF655400FE4F13 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C03781B718BF655400FE4F13 /* res */; };
@ -204,16 +204,16 @@
5200BEC91A53D9A500AC45E4 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
521A8E6E19F0C3D200D177D7 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = "<group>"; };
521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = "<group>"; };
9F82AE371A6514F3007BD5CD /* SimpleConfigParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SimpleConfigParser.cpp; path = ../Classes/SimpleConfigParser.cpp; sourceTree = "<group>"; };
9F82AE381A6514F3007BD5CD /* SimpleConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleConfigParser.h; path = ../Classes/SimpleConfigParser.h; sourceTree = "<group>"; };
9FC7603F1A67791200D1E6E7 /* CodeIDESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeIDESupport.h; sourceTree = "<group>"; };
9FC760401A67791200D1E6E7 /* lang */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lang; sourceTree = "<group>"; };
9FC760411A67791200D1E6E7 /* SimpleConfigParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleConfigParser.cpp; sourceTree = "<group>"; };
9FC760421A67791200D1E6E7 /* SimpleConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleConfigParser.h; sourceTree = "<group>"; };
9FF504781A5E86D600AFDA55 /* libsimulator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libsimulator.xcodeproj; path = "../../cocos2d-x/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj"; sourceTree = "<group>"; };
9FF504811A5E87B100AFDA55 /* ConsoleWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ConsoleWindow.xib; sourceTree = "<group>"; };
9FF504821A5E87B100AFDA55 /* ConsoleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleWindowController.h; sourceTree = "<group>"; };
9FF504831A5E87B100AFDA55 /* ConsoleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleWindowController.m; sourceTree = "<group>"; };
9FFC07061A4A739200AED399 /* lang */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = lang; path = ../Classes/lang; sourceTree = "<group>"; };
9FFC07351A4A764100AED399 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
9FFC07371A4A765100AED399 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.xib"; sourceTree = "<group>"; };
9FFC07381A4A902500AED399 /* CodeIDESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodeIDESupport.h; path = ../Classes/CodeIDESupport.h; sourceTree = "<group>"; };
C03781AE18BF654500FE4F13 /* cocos2d_lua_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_lua_bindings.xcodeproj; path = "../../cocos2d-x/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj"; sourceTree = "<group>"; };
C03781B718BF655400FE4F13 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../../../res; sourceTree = "<group>"; };
C03781B818BF655400FE4F13 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../../../src; sourceTree = "<group>"; };
@ -347,6 +347,18 @@
name = Icons;
sourceTree = "<group>";
};
9FC7603E1A67791200D1E6E7 /* ide-support */ = {
isa = PBXGroup;
children = (
9FC7603F1A67791200D1E6E7 /* CodeIDESupport.h */,
9FC760401A67791200D1E6E7 /* lang */,
9FC760411A67791200D1E6E7 /* SimpleConfigParser.cpp */,
9FC760421A67791200D1E6E7 /* SimpleConfigParser.h */,
);
name = "ide-support";
path = "../Classes/ide-support";
sourceTree = "<group>";
};
9FF504791A5E86D600AFDA55 /* Products */ = {
isa = PBXGroup;
children = (
@ -419,10 +431,7 @@
F293BB7C15EB830F00256477 /* Classes */ = {
isa = PBXGroup;
children = (
9FFC07381A4A902500AED399 /* CodeIDESupport.h */,
9F82AE371A6514F3007BD5CD /* SimpleConfigParser.cpp */,
9F82AE381A6514F3007BD5CD /* SimpleConfigParser.h */,
9FFC07061A4A739200AED399 /* lang */,
9FC7603E1A67791200D1E6E7 /* ide-support */,
15427CE2198F237300DC375D /* lua_module_register.h */,
F293BB7E15EB831F00256477 /* AppDelegate.cpp */,
F293BB7F15EB831F00256477 /* AppDelegate.h */,
@ -586,7 +595,7 @@
C03781BA18BF655400FE4F13 /* res in Resources */,
C03781BC18BF655400FE4F13 /* src in Resources */,
9FF504841A5E87B100AFDA55 /* ConsoleWindow.xib in Resources */,
9FFC07261A4A739200AED399 /* lang in Resources */,
9FC760431A67791200D1E6E7 /* lang in Resources */,
5023817617EBBE3400990C9B /* Icon.icns in Resources */,
9FFC07361A4A764100AED399 /* MainMenu.xib in Resources */,
C05D1C131923449100B808A4 /* config.json in Resources */,
@ -655,6 +664,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9FC760451A677A4A00D1E6E7 /* SimpleConfigParser.cpp in Sources */,
5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */,
F293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */,
5023812417EBBCAC00990C9B /* main.m in Sources */,

View File

@ -26,6 +26,7 @@
#import "RootViewController.h"
#import "cocos2d.h"
#import "platform/ios/CCEAGLView-ios.h"
#include "ide-support/SimpleConfigParser.h"
@implementation RootViewController
@ -55,18 +56,30 @@
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
if (SimpleConfigParser::getInstance()->isLanscape()) {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}else{
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
if (SimpleConfigParser::getInstance()->isLanscape()) {
return UIInterfaceOrientationMaskLandscape;
}else{
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
#endif
}
- (BOOL) shouldAutorotate {
return YES;
if (SimpleConfigParser::getInstance()->isLanscape()) {
return YES;
}else{
return NO;
}
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {