From 6a2ac7aaf82d93f0e54a38c6d627e4423755da83 Mon Sep 17 00:00:00 2001 From: WenhaiLin Date: Thu, 15 Jan 2015 18:21:03 +0800 Subject: [PATCH 1/5] [ci skip]Fixed log level within the CocosPlayClient --- .../platform/android/jni/CocosPlayClient.cpp | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/cocos/platform/android/jni/CocosPlayClient.cpp b/cocos/platform/android/jni/CocosPlayClient.cpp index 8987e23cda..c9d934412f 100644 --- a/cocos/platform/android/jni/CocosPlayClient.cpp +++ b/cocos/platform/android/jni/CocosPlayClient.cpp @@ -32,9 +32,13 @@ using namespace cocos2d; #define LOG_TAG "CocosPlayClient.cpp" #if COCOS2D_DEBUG -#define LOGD(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) #else #define LOGD(...) +#define LOGW(...) +#define LOGE(...) #endif static std::string __gameRootPath; @@ -94,7 +98,7 @@ static bool getEnv(JNIEnv **env) bRet = true; break; default: - LOGD("%s", "Failed to get the environment using GetEnv()"); + LOGE("%s", "Failed to get the environment using GetEnv()"); break; } @@ -115,7 +119,7 @@ static void initClassLoaderForMultiThread() { env->ExceptionDescribe(); env->ExceptionClear(); - LOGD("Exception initClassLoaderForMultiThread cocos2dClass is exception"); + LOGW("Exception initClassLoaderForMultiThread cocos2dClass is exception"); break; } @@ -124,7 +128,7 @@ static void initClassLoaderForMultiThread() { env->ExceptionDescribe(); env->ExceptionClear(); - LOGD("Exception initClassLoaderForMultiThread classClass is exception"); + LOGW("Exception initClassLoaderForMultiThread classClass is exception"); break; } @@ -133,7 +137,7 @@ static void initClassLoaderForMultiThread() { env->ExceptionDescribe(); env->ExceptionClear(); - LOGD("Exception initClassLoaderForMultiThread classLoaderClass"); + LOGW("Exception initClassLoaderForMultiThread classLoaderClass"); break; } @@ -143,7 +147,7 @@ static void initClassLoaderForMultiThread() { env->ExceptionDescribe(); env->ExceptionClear(); - LOGD("Exception initClassLoaderForMultiThread classLoader"); + LOGW("Exception initClassLoaderForMultiThread classLoader"); break; } __classLoader = env->NewGlobalRef(classLoader); @@ -156,7 +160,7 @@ static void initClassLoaderForMultiThread() env->ExceptionClear(); __findClassMethod = NULL; __classLoader = NULL; - LOGD("Exception initClassLoaderForMultiThread findClassMethod"); + LOGW("Exception initClassLoaderForMultiThread findClassMethod"); break; } }while(0); @@ -189,7 +193,7 @@ static jclass getClassID_(const char *className, JNIEnv *env) if(ret) break; } - LOGD("Failed to find class of %s", className); + LOGE("Failed to find class of %s", className); break; } } while (0); @@ -216,7 +220,7 @@ static bool getStaticMethodInfo(cocos2d::JniMethodInfo &methodinfo, const char * methodID = pEnv->GetStaticMethodID(classID, methodName, paramCode); if (! methodID) { - LOGD("Failed to find static method id of %s", methodName); + LOGW("Failed to find static method id of %s", methodName); break; } @@ -257,7 +261,10 @@ void lazyInit() LOGD("isNotifyFileLoadedEnabled = %d", __isNotifyFileLoadedEnabled); } - initClassLoaderForMultiThread(); + if (__isCocosPlayEnabled) + { + initClassLoaderForMultiThread(); + } __isCocosPlayInited = true; } @@ -278,13 +285,8 @@ void updateAssets(const std::string& filePath) { lazyInit(); } - if (!__isCocosPlayEnabled) - { - LOGD("ERROR: CocosPlayClient isn't enabled!"); - return; - } - if (__isDemo) + if (!__isCocosPlayEnabled || __isDemo) { return; } @@ -360,7 +362,7 @@ std::string getGameRoot() { if (!__isCocosPlayEnabled) { - LOGD("ERROR: CocosPlayClient isn't enabled!"); + LOGW("CocosPlayClient isn't enabled!"); return ""; } From 4601331deee2a3f23e07cd527f023dfe5202a8ca Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 16 Jan 2015 09:50:22 +0800 Subject: [PATCH 2/5] Update the luaval_to_int32 conversional function to get correct value --- .../lua-bindings/manual/LuaBasicConversions.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index aff5722a60..16d87fb625 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -121,7 +121,22 @@ bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcName) if (ok) { - *outValue = (int)(unsigned int)lua_tonumber(L, lo); + /** + When we want to convert the number value from the Lua to int, we would call lua_tonumber to implement.It would + experience two phase conversion: int -> double, double->int.But,for the 0x80000000 which the min value of int, the + int cast may return an undefined result,like 0x7fffffff.So we must use the (int)(unsigned int)lua_tonumber() to get + predictable results for 0x80000000.In this place,we didn't use lua_tointeger, because it may produce differen results + depending on the compiler,e.g:for iPhone4s,it also get wrong value for 0x80000000. + */ + unsigned int estimateValue = (unsigned int)lua_tonumber(L, lo); + if (estimateValue == std::numeric_limits::min()) + { + *outValue = (int)estimateValue; + } + else + { + *outValue = (int)lua_tonumber(L, lo); + } } return ok; From 05e25601fc9b1eeb4ea37aaec9ca594ee0f8271c Mon Sep 17 00:00:00 2001 From: WenhaiLin Date: Fri, 16 Jan 2015 14:15:06 +0800 Subject: [PATCH 3/5] Fixed fail to query the shapes which add to PhysicsWorld in the current frame --- cocos/physics/CCPhysicsWorld.cpp | 28 ++++++++++++++++++++-------- cocos/physics/CCPhysicsWorld.h | 1 - 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index 4afeed85b8..1989ecd16a 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -332,6 +332,11 @@ void PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Vec2& point1, if (func != nullptr) { + if (!_delayAddBodies.empty() || !_delayRemoveBodies.empty()) + { + _scene->updatePhysicsBodyTransform(_scene, _scene->getNodeToParentTransform(), 0, 1.0f, 1.0f); + updateBodies(); + } RayCastCallbackInfo info = { this, func, point1, point2, data }; PhysicsWorldCallback::continues = true; @@ -351,6 +356,11 @@ void PhysicsWorld::queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect if (func != nullptr) { + if (!_delayAddBodies.empty() || !_delayRemoveBodies.empty()) + { + _scene->updatePhysicsBodyTransform(_scene, _scene->getNodeToParentTransform(), 0, 1.0f, 1.0f); + updateBodies(); + } RectQueryCallbackInfo info = {this, func, data}; PhysicsWorldCallback::continues = true; @@ -369,6 +379,11 @@ void PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Vec2& po if (func != nullptr) { + if (!_delayAddBodies.empty() || !_delayRemoveBodies.empty()) + { + _scene->updatePhysicsBodyTransform(_scene, _scene->getNodeToParentTransform(), 0, 1.0f, 1.0f); + updateBodies(); + } PointQueryCallbackInfo info = {this, func, data}; PhysicsWorldCallback::continues = true; @@ -493,7 +508,6 @@ void PhysicsWorld::addBodyOrDelay(PhysicsBody* body) if (_delayAddBodies.find(body) == _delayAddBodies.end()) { _delayAddBodies.pushBack(body); - _delayDirty = true; } } @@ -567,7 +581,6 @@ void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body) if (_delayRemoveBodies.getIndex(body) == CC_INVALID_INDEX) { _delayRemoveBodies.pushBack(body); - _delayDirty = true; } }else { @@ -598,7 +611,6 @@ void PhysicsWorld::removeJoint(PhysicsJoint* joint, bool destroy) if (std::find(_delayRemoveJoints.rbegin(), _delayRemoveJoints.rend(), joint) == _delayRemoveJoints.rend()) { _delayRemoveJoints.push_back(joint); - _delayDirty = true; } } else @@ -669,7 +681,6 @@ void PhysicsWorld::addJoint(PhysicsJoint* joint) if (std::find(_delayAddJoints.begin(), _delayAddJoints.end(), joint) == _delayAddJoints.end()) { _delayAddJoints.push_back(joint); - _delayDirty = true; } } } @@ -814,12 +825,14 @@ void PhysicsWorld::update(float delta, bool userCall/* = false*/) _scene->updatePhysicsBodyTransform(_scene, _scene->getNodeToParentTransform(), 0, 1.0f, 1.0f); - while (_delayDirty) + if (!_delayAddBodies.empty() || !_delayRemoveBodies.empty()) { updateBodies(); + } + + if (!_delayAddJoints.empty() || !_delayRemoveJoints.empty()) + { updateJoints(); - - _delayDirty = !(_delayAddBodies.size() == 0 && _delayRemoveBodies.size() == 0 && _delayAddJoints.size() == 0 && _delayRemoveJoints.size() == 0); } if (userCall) @@ -864,7 +877,6 @@ PhysicsWorld::PhysicsWorld() , _substeps(1) , _cpSpace(nullptr) , _scene(nullptr) -, _delayDirty(false) , _autoStep(true) , _debugDraw(nullptr) , _debugDrawMask(DEBUGDRAW_NONE) diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index f64852bf45..08224937c2 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -208,7 +208,6 @@ protected: std::list _joints; Scene* _scene; - bool _delayDirty; bool _autoStep; PhysicsDebugDraw* _debugDraw; int _debugDrawMask; From b1f9fb4b8e0a43d68d9afd1dea831e14458467df Mon Sep 17 00:00:00 2001 From: zhangbin Date: Fri, 16 Jan 2015 14:29:48 +0800 Subject: [PATCH 4/5] Rename the Xcode target of libsimulator. --- .../HelloLua.xcodeproj/project.pbxproj | 20 ++++----- .../simulator.xcodeproj/project.pbxproj | 20 ++++----- .../libsimulator.xcodeproj/project.pbxproj | 42 ++++++++++--------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 621fba2d66..086667e095 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -53,8 +53,8 @@ 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 */; }; + 9FF504861A5E881200AFDA55 /* libsimulator Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF5047E1A5E86D600AFDA55 /* libsimulator Mac.a */; }; + 9FF504871A5E88CE00AFDA55 /* libsimulator iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF504801A5E86D600AFDA55 /* libsimulator iOS.a */; }; 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 */; }; @@ -240,7 +240,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9FF504861A5E881200AFDA55 /* liblibsimulator.a in Frameworks */, + 9FF504861A5E881200AFDA55 /* libsimulator Mac.a in Frameworks */, 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */, 15427CEC198F24A600DC375D /* libluacocos2d Mac.a in Frameworks */, 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */, @@ -260,7 +260,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9FF504871A5E88CE00AFDA55 /* liblibsimulator_iOS.a in Frameworks */, + 9FF504871A5E88CE00AFDA55 /* libsimulator iOS.a in Frameworks */, 5200BECA1A53D9A500AC45E4 /* Security.framework in Frameworks */, 15427CD5198F222200DC375D /* libluacocos2d iOS.a in Frameworks */, 15427CD3198F221400DC375D /* libcocos2d iOS.a in Frameworks */, @@ -362,8 +362,8 @@ 9FF504791A5E86D600AFDA55 /* Products */ = { isa = PBXGroup; children = ( - 9FF5047E1A5E86D600AFDA55 /* liblibsimulator.a */, - 9FF504801A5E86D600AFDA55 /* liblibsimulator_iOS.a */, + 9FF5047E1A5E86D600AFDA55 /* libsimulator Mac.a */, + 9FF504801A5E86D600AFDA55 /* libsimulator iOS.a */, ); name = Products; sourceTree = ""; @@ -571,17 +571,17 @@ remoteRef = 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FF5047E1A5E86D600AFDA55 /* liblibsimulator.a */ = { + 9FF5047E1A5E86D600AFDA55 /* libsimulator Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = liblibsimulator.a; + path = "libsimulator Mac.a"; remoteRef = 9FF5047D1A5E86D600AFDA55 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FF504801A5E86D600AFDA55 /* liblibsimulator_iOS.a */ = { + 9FF504801A5E86D600AFDA55 /* libsimulator iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = liblibsimulator_iOS.a; + path = "libsimulator iOS.a"; remoteRef = 9FF5047F1A5E86D600AFDA55 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj b/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj index 53ffd493d8..062724948e 100644 --- a/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj +++ b/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj @@ -49,8 +49,8 @@ 521A8E7119F0C3D200D177D7 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */; }; 9F7214271A5C1E4C00DAED06 /* libluacocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F7213E01A5C19ED00DAED06 /* libluacocos2d Mac.a */; }; 9F7214281A5C1E5B00DAED06 /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F7213E21A5C19ED00DAED06 /* libluacocos2d iOS.a */; }; - 9FD6FC0B1A5D27870028EDC6 /* liblibsimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC081A5D26580028EDC6 /* liblibsimulator.a */; settings = {ATTRIBUTES = (Required, ); }; }; - 9FD6FC0C1A5D278E0028EDC6 /* liblibsimulator_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC0A1A5D26580028EDC6 /* liblibsimulator_iOS.a */; }; + 9FD6FC0B1A5D27870028EDC6 /* libsimulator Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */; settings = {ATTRIBUTES = (Required, ); }; }; + 9FD6FC0C1A5D278E0028EDC6 /* libsimulator iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */; }; 9FD6FC721A5D2A820028EDC6 /* ConsoleWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FD6FC6F1A5D2A820028EDC6 /* ConsoleWindow.xib */; }; 9FD6FC731A5D2A820028EDC6 /* ConsoleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */; }; 9FFC07261A4A739200AED399 /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FFC07061A4A739200AED399 /* lang */; }; @@ -231,7 +231,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9FD6FC0B1A5D27870028EDC6 /* liblibsimulator.a in Frameworks */, + 9FD6FC0B1A5D27870028EDC6 /* libsimulator Mac.a in Frameworks */, 9F7214271A5C1E4C00DAED06 /* libluacocos2d Mac.a in Frameworks */, 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */, 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */, @@ -251,7 +251,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9FD6FC0C1A5D278E0028EDC6 /* liblibsimulator_iOS.a in Frameworks */, + 9FD6FC0C1A5D278E0028EDC6 /* libsimulator iOS.a in Frameworks */, 9F7214281A5C1E5B00DAED06 /* libluacocos2d iOS.a in Frameworks */, 5200BECA1A53D9A500AC45E4 /* Security.framework in Frameworks */, 15427CD3198F221400DC375D /* libcocos2d iOS.a in Frameworks */, @@ -350,8 +350,8 @@ 9FD6FC031A5D26580028EDC6 /* Products */ = { isa = PBXGroup; children = ( - 9FD6FC081A5D26580028EDC6 /* liblibsimulator.a */, - 9FD6FC0A1A5D26580028EDC6 /* liblibsimulator_iOS.a */, + 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */, + 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */, ); name = Products; sourceTree = ""; @@ -547,17 +547,17 @@ remoteRef = 9F7213E11A5C19ED00DAED06 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FD6FC081A5D26580028EDC6 /* liblibsimulator.a */ = { + 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = liblibsimulator.a; + path = "libsimulator Mac.a"; remoteRef = 9FD6FC071A5D26580028EDC6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FD6FC0A1A5D26580028EDC6 /* liblibsimulator_iOS.a */ = { + 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = liblibsimulator_iOS.a; + path = "libsimulator iOS.a"; remoteRef = 9FD6FC091A5D26580028EDC6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj b/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj index 5b724a5b48..60e3d68a97 100644 --- a/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj +++ b/tools/simulator/libsimulator/proj.ios_mac/libsimulator.xcodeproj/project.pbxproj @@ -175,8 +175,8 @@ 9F2F21BB1A635F1C006B8BF1 /* RuntimeProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeProtocol.cpp; sourceTree = ""; }; 9F2F21BC1A635F1C006B8BF1 /* RuntimeProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeProtocol.h; sourceTree = ""; }; 9F2F21C61A635FFF006B8BF1 /* Runtime_ios-mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "Runtime_ios-mac.mm"; sourceTree = ""; }; - 9F7214351A5C271F00DAED06 /* liblibsimulator.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibsimulator.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 9F7214851A5C28BA00DAED06 /* liblibsimulator_iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibsimulator_iOS.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9F7214351A5C271F00DAED06 /* libsimulator Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libsimulator Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9F7214851A5C28BA00DAED06 /* libsimulator iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libsimulator iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 9FB638201A635BA300AAEC43 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; 9FB638231A635BA300AAEC43 /* extension_set.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extension_set.cc; sourceTree = ""; }; 9FB638241A635BA300AAEC43 /* extension_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extension_set.h; sourceTree = ""; }; @@ -315,8 +315,8 @@ 9F7214361A5C271F00DAED06 /* Products */ = { isa = PBXGroup; children = ( - 9F7214351A5C271F00DAED06 /* liblibsimulator.a */, - 9F7214851A5C28BA00DAED06 /* liblibsimulator_iOS.a */, + 9F7214351A5C271F00DAED06 /* libsimulator Mac.a */, + 9F7214851A5C28BA00DAED06 /* libsimulator iOS.a */, ); name = Products; sourceTree = ""; @@ -609,9 +609,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 9F7214341A5C271F00DAED06 /* libsimulator */ = { + 9F7214341A5C271F00DAED06 /* libsimulator Mac */ = { isa = PBXNativeTarget; - buildConfigurationList = 9F7214401A5C271F00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator" */; + buildConfigurationList = 9F7214401A5C271F00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator Mac" */; buildPhases = ( 9F7214311A5C271F00DAED06 /* Sources */, 9F7214321A5C271F00DAED06 /* Frameworks */, @@ -621,14 +621,14 @@ ); dependencies = ( ); - name = libsimulator; - productName = libsimulator; - productReference = 9F7214351A5C271F00DAED06 /* liblibsimulator.a */; + name = "libsimulator Mac"; + productName = "libsimulator Mac"; + productReference = 9F7214351A5C271F00DAED06 /* libsimulator Mac.a */; productType = "com.apple.product-type.library.static"; }; - 9F7214841A5C28BA00DAED06 /* libsimulator_iOS */ = { + 9F7214841A5C28BA00DAED06 /* libsimulator iOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 9F7214961A5C28BA00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator_iOS" */; + buildConfigurationList = 9F7214961A5C28BA00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator iOS" */; buildPhases = ( 9F7214811A5C28BA00DAED06 /* Sources */, 9F7214821A5C28BA00DAED06 /* Frameworks */, @@ -638,9 +638,9 @@ ); dependencies = ( ); - name = libsimulator_iOS; - productName = libsimulator_iOS; - productReference = 9F7214851A5C28BA00DAED06 /* liblibsimulator_iOS.a */; + name = "libsimulator iOS"; + productName = "libsimulator iOS"; + productReference = 9F7214851A5C28BA00DAED06 /* libsimulator iOS.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -672,8 +672,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 9F7214341A5C271F00DAED06 /* libsimulator */, - 9F7214841A5C28BA00DAED06 /* libsimulator_iOS */, + 9F7214341A5C271F00DAED06 /* libsimulator Mac */, + 9F7214841A5C28BA00DAED06 /* libsimulator iOS */, ); }; /* End PBXProject section */ @@ -868,7 +868,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_ENABLE_OBJC_ARC = NO; - EXECUTABLE_PREFIX = lib; + EXECUTABLE_PREFIX = ""; GCC_ENABLE_CPP_EXCEPTIONS = YES; GCC_ENABLE_CPP_RTTI = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -896,7 +896,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; CLANG_ENABLE_OBJC_ARC = NO; - EXECUTABLE_PREFIX = lib; + EXECUTABLE_PREFIX = ""; GCC_ENABLE_CPP_EXCEPTIONS = YES; GCC_ENABLE_CPP_RTTI = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -923,6 +923,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ios/Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -947,6 +948,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ios/Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -980,7 +982,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9F7214401A5C271F00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator" */ = { + 9F7214401A5C271F00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 9F7214411A5C271F00DAED06 /* Debug */, @@ -989,7 +991,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9F7214961A5C28BA00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator_iOS" */ = { + 9F7214961A5C28BA00DAED06 /* Build configuration list for PBXNativeTarget "libsimulator iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 9F7214971A5C28BA00DAED06 /* Debug */, From 19bb6a0c68d9b46a535e86d62d1d502c0d95efde Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 16 Jan 2015 15:21:23 +0800 Subject: [PATCH 5/5] fix opengl 502 by using glGetBooleanv --- cocos/2d/CCGrid.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index c156f624c1..67acc3b5ba 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -318,7 +318,10 @@ void Grid3D::beforeBlit() if(_needDepthTestForBlit) { _oldDepthTestValue = glIsEnabled(GL_DEPTH_TEST); - _oldDepthWriteValue = glIsEnabled(GL_DEPTH_WRITEMASK); + GLboolean depthWriteMask; + glGetBooleanv(GL_DEPTH_WRITEMASK, &depthWriteMask); + _oldDepthWriteValue = depthWriteMask; + CHECK_GL_ERROR_DEBUG(); glEnable(GL_DEPTH_TEST); glDepthMask(true); }