Skip to content

Commit

Permalink
issue cocos2d#707: require works ok on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Sep 5, 2011
1 parent 3fa6e12 commit 58b6447
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions HelloLua/Classes/AppDelegate.cpp
Expand Up @@ -111,6 +111,7 @@ bool AppDelegate::applicationDidFinishLaunching()

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
string path = CCFileUtils::fullPathFromRelativePath("hello.lua");
CCScriptEngineManager::sharedScriptEngineManager()->getScriptEngine()->addSearchPath(path.substr(0, path.find_last_of("/")).c_str());
CCScriptEngineManager::sharedScriptEngineManager()->getScriptEngine()->executeScriptFile(path.c_str());
#endif

Expand Down
12 changes: 12 additions & 0 deletions HelloLua/ios/HelloLua.xcodeproj/project.pbxproj
Expand Up @@ -285,6 +285,9 @@
BF82FCF613A87F1A00616D55 /* tolua_map.c in Sources */ = {isa = PBXBuildFile; fileRef = BF82FCB713A87F1A00616D55 /* tolua_map.c */; };
BF82FCF713A87F1A00616D55 /* tolua_push.c in Sources */ = {isa = PBXBuildFile; fileRef = BF82FCB813A87F1A00616D55 /* tolua_push.c */; };
BF82FCF813A87F1A00616D55 /* tolua_to.c in Sources */ = {isa = PBXBuildFile; fileRef = BF82FCB913A87F1A00616D55 /* tolua_to.c */; };
BF87A2931414CC3B0025E979 /* Cocos2dxLuaLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF87A2911414CC3B0025E979 /* Cocos2dxLuaLoader.cpp */; };
BF87A2941414CC3B0025E979 /* Cocos2dxLuaLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = BF87A2921414CC3B0025E979 /* Cocos2dxLuaLoader.h */; };
BF87A2A21414CCF60025E979 /* hello2.lua in Resources */ = {isa = PBXBuildFile; fileRef = BF87A2A11414CCF60025E979 /* hello2.lua */; };
D403B5D9135D1AF1004B518D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D403B5D8135D1AF1004B518D /* libxml2.dylib */; };
D463AE1613F572CF00374EAA /* CCTexturePVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D463AE1513F572CF00374EAA /* CCTexturePVR.cpp */; };
D4742F4F13F6273F002ED151 /* FontLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = D4742F4413F6273F002ED151 /* FontLabel.h */; };
Expand Down Expand Up @@ -632,6 +635,9 @@
BF82FCB713A87F1A00616D55 /* tolua_map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_map.c; sourceTree = "<group>"; };
BF82FCB813A87F1A00616D55 /* tolua_push.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_push.c; sourceTree = "<group>"; };
BF82FCB913A87F1A00616D55 /* tolua_to.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_to.c; sourceTree = "<group>"; };
BF87A2911414CC3B0025E979 /* Cocos2dxLuaLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cocos2dxLuaLoader.cpp; sourceTree = "<group>"; };
BF87A2921414CC3B0025E979 /* Cocos2dxLuaLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cocos2dxLuaLoader.h; sourceTree = "<group>"; };
BF87A2A11414CCF60025E979 /* hello2.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hello2.lua; sourceTree = "<group>"; };
D403B5D8135D1AF1004B518D /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
D463AE1513F572CF00374EAA /* CCTexturePVR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexturePVR.cpp; sourceTree = "<group>"; };
D4742F4413F6273F002ED151 /* FontLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontLabel.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -826,6 +832,8 @@
BF23C09F13B038AB00F32062 /* cocos2dx_support */ = {
isa = PBXGroup;
children = (
BF87A2911414CC3B0025E979 /* Cocos2dxLuaLoader.cpp */,
BF87A2921414CC3B0025E979 /* Cocos2dxLuaLoader.h */,
BF23C0A013B038AB00F32062 /* LuaCocos2d.h */,
BF23C0A113B038AB00F32062 /* LuaEngineImpl.h */,
BF23C0A213B038AB00F32062 /* LuaEngine.h */,
Expand All @@ -847,6 +855,7 @@
BF82F40313A8647B00616D55 /* Resource */ = {
isa = PBXGroup;
children = (
BF87A2A11414CCF60025E979 /* hello2.lua */,
655118CB13FAC63F00A8A20B /* effect1.wav */,
655118CC13FAC63F00A8A20B /* background.mp3 */,
D4CEAD9313B4770300780515 /* land.png */,
Expand Down Expand Up @@ -1625,6 +1634,7 @@
D4742F5713F6273F002ED151 /* ZAttributedStringPrivate.h in Headers */,
D4742F5813F6273F002ED151 /* ZFont.h in Headers */,
655118C513FAC48300A8A20B /* LuaSimpleAudioEngine.h in Headers */,
BF87A2941414CC3B0025E979 /* Cocos2dxLuaLoader.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1707,6 +1717,7 @@
D4CEAD9A13B4770400780515 /* crop.png in Resources */,
655118CD13FAC63F00A8A20B /* effect1.wav in Resources */,
655118CE13FAC63F00A8A20B /* background.mp3 in Resources */,
BF87A2A21414CCF60025E979 /* hello2.lua in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1878,6 +1889,7 @@
D4742F5613F6273F002ED151 /* ZAttributedString.m in Sources */,
D4742F5913F6273F002ED151 /* ZFont.m in Sources */,
655118C413FAC48300A8A20B /* LuaSimpleAudioEngine.cpp in Sources */,
BF87A2931414CC3B0025E979 /* Cocos2dxLuaLoader.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit 58b6447

Please sign in to comment.