From f26ce4fb8442542fadcce6392648cc78c23ad836 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 21 Dec 2012 18:07:45 +0800 Subject: [PATCH 01/18] Made sys.localStorage support for jsb, works ok on win32. --- .../WatermelonWithMe/Classes/AppDelegate.cpp | 2 + .../javascript/bindings/js_bindings_core.h | 3 + .../bindings/js_bindings_system_functions.cpp | 78 +++++++++++++++++++ .../bindings/js_bindings_system_functions.h | 23 ++++++ ...s_bindings_system_functions_registration.h | 15 ++++ .../js_bindings_system_registration.cpp | 60 ++++++++++++++ .../js_bindings_system_registration.h | 31 ++++++++ .../bindings/js_manual_conversions.cpp | 30 +++++++ .../bindings/js_manual_conversions.h | 6 +- .../bindings/proj.win32/libJSBinding.vcxproj | 5 ++ .../proj.win32/libJSBinding.vcxproj.filters | 15 ++++ 11 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 scripting/javascript/bindings/js_bindings_system_functions.cpp create mode 100644 scripting/javascript/bindings/js_bindings_system_functions.h create mode 100644 scripting/javascript/bindings/js_bindings_system_functions_registration.h create mode 100644 scripting/javascript/bindings/js_bindings_system_registration.cpp create mode 100644 scripting/javascript/bindings/js_bindings_system_registration.h diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp index bd44bc4903..c2a8775505 100644 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp +++ b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp @@ -7,6 +7,7 @@ #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" #include "js_bindings_ccbreader.h" +#include "js_bindings_system_registration.h" USING_NS_CC; using namespace CocosDenshion; @@ -37,6 +38,7 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(register_cocos2dx_js_extensions); sc->addRegisterCallback(jsb_register_chipmunk); sc->addRegisterCallback(register_CCBuilderReader); + sc->addRegisterCallback(jsb_register_system); sc->start(); diff --git a/scripting/javascript/bindings/js_bindings_core.h b/scripting/javascript/bindings/js_bindings_core.h index b0eaff6c2b..f691936b42 100644 --- a/scripting/javascript/bindings/js_bindings_core.h +++ b/scripting/javascript/bindings/js_bindings_core.h @@ -21,6 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef __JS_BINDINGS_CORE_H__ +#define __JS_BINDINGS_CORE_H__ #include "jsapi.h" #include "jsfriendapi.h" @@ -84,3 +86,4 @@ extern "C" { } #endif +#endif /* __JS_BINDINGS_CORE_H__ */ diff --git a/scripting/javascript/bindings/js_bindings_system_functions.cpp b/scripting/javascript/bindings/js_bindings_system_functions.cpp new file mode 100644 index 0000000000..e17d969f03 --- /dev/null +++ b/scripting/javascript/bindings/js_bindings_system_functions.cpp @@ -0,0 +1,78 @@ +/* +* AUTOGENERATED FILE. DO NOT EDIT IT +* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17 +* Script version: v0.5 +*/ +#include "cocos2d.h" +#include "js_bindings_config.h" +//#ifdef JSB_INCLUDE_SYSTEM + +//#include "LocalStorage.h" + +#include "jsfriendapi.h" +#include "js_bindings_config.h" +#include "js_bindings_core.h" +#include "js_manual_conversions.h" +#include "js_bindings_system_functions.h" + +USING_NS_CC; + +// Arguments: char* +// Ret value: const char* +JSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp) { + JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, "Invalid number of arguments" ); + jsval *argvp = JS_ARGV(cx,vp); + JSBool ok = JS_TRUE; + const char* arg0; + + ok &= jsval_to_charptr( cx, *argvp++, &arg0 ); + JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments"); + std::string ret_val; + + //ret_val = localStorageGetItem((char*)arg0 ); + ret_val = CCUserDefault::sharedUserDefault()->getStringForKey(arg0); + + jsval ret_jsval = charptr_to_jsval( cx, ret_val.c_str() ); + JS_SET_RVAL(cx, vp, ret_jsval ); + + return JS_TRUE; +} + +// Arguments: char* +// Ret value: void +JSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp) { + JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, "Invalid number of arguments" ); + jsval *argvp = JS_ARGV(cx,vp); + JSBool ok = JS_TRUE; + const char* arg0; + + ok &= jsval_to_charptr( cx, *argvp++, &arg0 ); + JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments"); + + CCUserDefault::sharedUserDefault()->setStringForKey(arg0, ""); + + //localStorageRemoveItem((char*)arg0 ); + JS_SET_RVAL(cx, vp, JSVAL_VOID); + return JS_TRUE; +} + +// Arguments: char*, char* +// Ret value: void +JSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp) { + JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, "Invalid number of arguments" ); + jsval *argvp = JS_ARGV(cx,vp); + JSBool ok = JS_TRUE; + const char* arg0; const char* arg1; + + ok &= jsval_to_charptr( cx, *argvp++, &arg0 ); + ok &= jsval_to_charptr( cx, *argvp++, &arg1 ); + JSB_PRECONDITION2(ok, cx, JS_FALSE, "Error processing arguments"); + + //localStorageSetItem((char*)arg0 , (char*)arg1 ); + CCUserDefault::sharedUserDefault()->setStringForKey(arg0, arg1); + JS_SET_RVAL(cx, vp, JSVAL_VOID); + return JS_TRUE; +} + + +//#endif // JSB_INCLUDE_SYSTEM diff --git a/scripting/javascript/bindings/js_bindings_system_functions.h b/scripting/javascript/bindings/js_bindings_system_functions.h new file mode 100644 index 0000000000..26d4a97c99 --- /dev/null +++ b/scripting/javascript/bindings/js_bindings_system_functions.h @@ -0,0 +1,23 @@ +/* +* AUTOGENERATED FILE. DO NOT EDIT IT +* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17 +* Script version: v0.5 +*/ +#include "js_bindings_config.h" +//#ifdef JSB_INCLUDE_SYSTEM + +//#include "LocalStorage.h" + +#ifdef __cplusplus +extern "C" { +#endif +JSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp); +JSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp); +JSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp); + +#ifdef __cplusplus +} +#endif + + +//#endif // JSB_INCLUDE_SYSTEM diff --git a/scripting/javascript/bindings/js_bindings_system_functions_registration.h b/scripting/javascript/bindings/js_bindings_system_functions_registration.h new file mode 100644 index 0000000000..5bce81d241 --- /dev/null +++ b/scripting/javascript/bindings/js_bindings_system_functions_registration.h @@ -0,0 +1,15 @@ +/* +* AUTOGENERATED FILE. DO NOT EDIT IT +* Generated by "generate_js_bindings.py -c system_jsb.ini" on 2012-12-17 +* Script version: v0.5 +*/ +#include "js_bindings_config.h" +//#ifdef JSB_INCLUDE_SYSTEM + +//#include "LocalStorage.h" +JS_DefineFunction(_cx, system, "getItem", JSB_localStorageGetItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE ); +JS_DefineFunction(_cx, system, "removeItem", JSB_localStorageRemoveItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE ); +JS_DefineFunction(_cx, system, "setItem", JSB_localStorageSetItem, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE ); + + +//#endif // JSB_INCLUDE_SYSTEM diff --git a/scripting/javascript/bindings/js_bindings_system_registration.cpp b/scripting/javascript/bindings/js_bindings_system_registration.cpp new file mode 100644 index 0000000000..8987ea7f22 --- /dev/null +++ b/scripting/javascript/bindings/js_bindings_system_registration.cpp @@ -0,0 +1,60 @@ +/* + * JS Bindings: https://github.com/zynga/jsbindings + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "js_bindings_config.h" +#include "js_bindings_core.h" +//#include "LocalStorage.h" + + +// system +#include "js_bindings_system_functions.h" + + +void jsb_register_system( JSContext *_cx, JSObject *object) +{ + // + // sys + // + JSObject *sys = JS_NewObject(_cx, NULL, NULL, NULL); + jsval systemVal = OBJECT_TO_JSVAL(sys); + JS_SetProperty(_cx, object, "sys", &systemVal); + + + // sys.localStorage + JSObject *ls = JS_NewObject(_cx, NULL, NULL, NULL); + jsval lsVal = OBJECT_TO_JSVAL(ls); + JS_SetProperty(_cx, sys, "localStorage", &lsVal); + + // sys.localStorage functions + JSObject *system = ls; +#include "js_bindings_system_functions_registration.h" + + /* + // Init DB with full path + NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; + NSString *fullpath = [path stringByAppendingPathComponent:@"jsb.sqlite"]; + localStorageInit([fullpath UTF8String]); + */ +} + diff --git a/scripting/javascript/bindings/js_bindings_system_registration.h b/scripting/javascript/bindings/js_bindings_system_registration.h new file mode 100644 index 0000000000..1afb1b1081 --- /dev/null +++ b/scripting/javascript/bindings/js_bindings_system_registration.h @@ -0,0 +1,31 @@ +/* + * JS Bindings: https://github.com/zynga/jsbindings + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#ifndef __JSB_SYSTEM_REGISTRATION +#define __JSB_SYSTEM_REGISTRATION + +void jsb_register_system( JSContext *globalC, JSObject *globalO); + +#endif // __JSB_CHIPMUNK_REGISTRATION diff --git a/scripting/javascript/bindings/js_manual_conversions.cpp b/scripting/javascript/bindings/js_manual_conversions.cpp index f14be575ec..16c1828298 100644 --- a/scripting/javascript/bindings/js_manual_conversions.cpp +++ b/scripting/javascript/bindings/js_manual_conversions.cpp @@ -192,3 +192,33 @@ jsval longlong_to_jsval( JSContext *cx, long long number ) return OBJECT_TO_JSVAL(typedArray); #endif } + +JSBool jsval_to_charptr( JSContext *cx, jsval vp, const char **ret ) +{ + JSString *jsstr = JS_ValueToString( cx, vp ); + JSB_PRECONDITION2( jsstr, cx, JS_FALSE, "invalid string" ); + + // root it + vp = STRING_TO_JSVAL(jsstr); + + char *ptr = JS_EncodeString(cx, jsstr); + + JSB_PRECONDITION2(ptr, cx, JS_FALSE, "Error encoding string"); + + // XXX: It is converted to CCString and then back to char* to autorelease the created object. + CCString *tmp = CCString::create(ptr); + + JSB_PRECONDITION2( tmp, cx, JS_FALSE, "Error creating string from UTF8"); + + *ret = tmp->getCString(); + JS_free( cx, ptr ); + + return JS_TRUE; +} + +jsval charptr_to_jsval( JSContext *cx, const char *str) +{ + JSString *ret_obj = JS_NewStringCopyZ(cx, str); + return STRING_TO_JSVAL(ret_obj); +} + diff --git a/scripting/javascript/bindings/js_manual_conversions.h b/scripting/javascript/bindings/js_manual_conversions.h index 7e0dd25cd1..4a0a924860 100644 --- a/scripting/javascript/bindings/js_manual_conversions.h +++ b/scripting/javascript/bindings/js_manual_conversions.h @@ -24,8 +24,10 @@ extern jsval int_to_jsval( JSContext *cx, int number ); extern jsval uint_to_jsval( JSContext *cx, unsigned int number ); extern jsval long_to_jsval( JSContext *cx, long number ); extern jsval longlong_to_jsval( JSContext *cx, long long number ); - - +/** converts a jsval (JS string) into a char */ +extern JSBool jsval_to_charptr( JSContext *cx, jsval vp, const char **out); +/* Converts a char ptr into a jsval (using JS string) */ +extern jsval charptr_to_jsval( JSContext *cx, const char *str); //#ifdef __cplusplus //} //#endif diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj index f2a8ee1951..bbaa179b0c 100644 --- a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj +++ b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj @@ -20,6 +20,8 @@ + + @@ -36,6 +38,9 @@ + + + diff --git a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters index 31988f42a3..6f60b8a85f 100644 --- a/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters +++ b/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters @@ -47,6 +47,12 @@ manual + + manual + + + manual + @@ -94,6 +100,15 @@ manual + + manual + + + manual + + + manual + From ca00d50259b38a11bea293e5b92a7c4b136601ea Mon Sep 17 00:00:00 2001 From: Denis Mingulov Date: Fri, 21 Dec 2012 22:43:50 +0200 Subject: [PATCH 02/18] CocosDenshion Android - missing sound effects with some conditions Android SoundPool.load returns 0 if sound might not be loaded - for example, it does not exist. Previously - 0 has been ignored and incorrectly written to HashMap, so it was not possible to understand on the application side that something goes wrong (and use some additional workaround). Use case: 1) On the game loading - preload all possible sound effects (to speed up their playing later, when it will be needed) 2) Game APK does not have any sound file, they are downloaded later in a separate thread. 3) Application tries to play sound effects as usual, when needed. So due to this bug - as there was no any sound file exist during the game loading - internal HashMap contains incorrect 0 as id for every effect, and there is no any sound effect during the first application start. --- .../java/src/org/cocos2dx/lib/Cocos2dxSound.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java index b20b67b438..20b570d05a 100644 --- a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java +++ b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java @@ -108,7 +108,10 @@ public class Cocos2dxSound { if (soundID == null) { soundID = this.createSoundIDFromAsset(pPath); - this.mPathSoundIDMap.put(pPath, soundID); + // save value just in case if file is really loaded + if (soundID != Cocos2dxSound.INVALID_SOUND_ID) { + this.mPathSoundIDMap.put(pPath, soundID); + } } return soundID; @@ -272,6 +275,11 @@ public class Cocos2dxSound { Log.e(Cocos2dxSound.TAG, "error: " + e.getMessage(), e); } + // mSoundPool.load returns 0 if something goes wrong, for example a file does not exist + if (soundID == 0) { + soundID = Cocos2dxSound.INVALID_SOUND_ID; + } + return soundID; } From 0538b22300cea0ec37b29b86f34a302d0725a431 Mon Sep 17 00:00:00 2001 From: ivzave Date: Sat, 22 Dec 2012 04:14:15 +0400 Subject: [PATCH 03/18] repair linux cli build --- make-all-linux-project.sh | 40 +++++++++++++++---------- samples/Lua/TestLua/.gitignore | 3 ++ samples/Lua/TestLua/proj.linux/Makefile | 3 +- 3 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 samples/Lua/TestLua/.gitignore diff --git a/make-all-linux-project.sh b/make-all-linux-project.sh index 5663b169ae..ef110ca59c 100755 --- a/make-all-linux-project.sh +++ b/make-all-linux-project.sh @@ -54,21 +54,25 @@ make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux clean make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux debug check_make_result cp $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a $OUTPUT_DEBUG +rm $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux clean make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux release check_make_result cp $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a $OUTPUT_RELEASE +rm $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux clean make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux debug check_make_result cp $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a $OUTPUT_DEBUG +rm $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux clean make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux release check_make_result cp $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a $OUTPUT_RELEASE +rm $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux clean make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux debug @@ -86,47 +90,51 @@ make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux clean make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux debug check_make_result cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_DEBUG +rm $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux clean make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux release check_make_result cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_RELEASE +rm $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux debug check_make_result cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_DEBUG +rm $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux release check_make_result cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_RELEASE +rm $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so -make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux debug +make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux debug check_make_result -make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux release +make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux release check_make_result -make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux debug +make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux debug check_make_result -make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux release +make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux release check_make_result -make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux debug +make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux debug check_make_result -make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux release +make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux release check_make_result -make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux debug +make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux debug check_make_result -make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux clean -make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux release +make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux clean +make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux release check_make_result diff --git a/samples/Lua/TestLua/.gitignore b/samples/Lua/TestLua/.gitignore new file mode 100644 index 0000000000..c3b37a78af --- /dev/null +++ b/samples/Lua/TestLua/.gitignore @@ -0,0 +1,3 @@ +# resources get copied from TestCpp during build, ignore them +Resources/* +!Resources/luaScript diff --git a/samples/Lua/TestLua/proj.linux/Makefile b/samples/Lua/TestLua/proj.linux/Makefile index 869ab67c99..8d3c67aa79 100644 --- a/samples/Lua/TestLua/proj.linux/Makefile +++ b/samples/Lua/TestLua/proj.linux/Makefile @@ -86,7 +86,8 @@ release: $(TARGET) ####### Build rules $(TARGET): $(OBJECTS) mkdir -p $(BIN_DIR) - cp -R ../../../../samples/TestCpp/Resources ../../../../samples/TestLua/ + cp -R ../../../../samples/Cpp/TestCpp/Resources ../../../../samples/Lua/TestLua/ + rm ../../../../samples/TestLua/Resources/.gitignore $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS) ####### Compile From fcce93018894b43d6c5170894bd46dcf38ab2543 Mon Sep 17 00:00:00 2001 From: ivzave Date: Sat, 22 Dec 2012 07:14:59 +0400 Subject: [PATCH 04/18] repair linux eclipse build & add 64-bit project configurations --- CocosDenshion/proj.linux/.cproject | 249 +++++++++++++++---- cocos2dx/proj.linux/.cproject | 281 +++++++++++++++++++++- external/Box2D/proj.linux/.cproject | 131 +++++++++- external/chipmunk/proj.linux/.cproject | 118 ++++++++- samples/Cpp/HelloCpp/proj.linux/.cproject | 221 +++++++++++++++-- samples/Cpp/TestCpp/proj.linux/.cproject | 263 +++++++++++++++++--- samples/Cpp/TestCpp/proj.linux/.project | 2 +- samples/Lua/HelloLua/proj.linux/.cproject | 205 +++++++++++++++- samples/Lua/HelloLua/proj.linux/.project | 2 +- samples/Lua/TestLua/proj.linux/.cproject | 231 ++++++++++++++++-- samples/Lua/TestLua/proj.linux/.project | 2 +- scripting/lua/proj.linux/.cproject | 139 ++++++++++- 12 files changed, 1701 insertions(+), 143 deletions(-) diff --git a/CocosDenshion/proj.linux/.cproject b/CocosDenshion/proj.linux/.cproject index 8a0899731e..f1f3ad05f8 100755 --- a/CocosDenshion/proj.linux/.cproject +++ b/CocosDenshion/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -40,10 +38,7 @@ + @@ -77,8 +72,152 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -96,53 +235,51 @@ - - - - - - - - diff --git a/cocos2dx/proj.linux/.cproject b/cocos2dx/proj.linux/.cproject index 9e0dbc0a23..c258fffe38 100755 --- a/cocos2dx/proj.linux/.cproject +++ b/cocos2dx/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -48,6 +46,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/Box2D/proj.linux/.cproject b/external/Box2D/proj.linux/.cproject index 90ee353eae..ba1c68a473 100644 --- a/external/Box2D/proj.linux/.cproject +++ b/external/Box2D/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -12,7 +10,7 @@ - + @@ -44,7 +42,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/chipmunk/proj.linux/.cproject b/external/chipmunk/proj.linux/.cproject index c209c7a69a..18467c15ca 100644 --- a/external/chipmunk/proj.linux/.cproject +++ b/external/chipmunk/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -9,7 +7,7 @@ - + @@ -30,7 +28,7 @@ @@ -62,7 +60,7 @@ - + @@ -83,7 +81,7 @@ @@ -109,6 +107,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/Cpp/HelloCpp/proj.linux/.cproject b/samples/Cpp/HelloCpp/proj.linux/.cproject index edd02d726c..bdac8010df 100644 --- a/samples/Cpp/HelloCpp/proj.linux/.cproject +++ b/samples/Cpp/HelloCpp/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -22,7 +20,7 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + @@ -180,21 +355,29 @@ + + + + + + + + + + + + + + + + + + - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.linux/.cproject b/samples/Cpp/TestCpp/proj.linux/.cproject index 4363a225f9..8749c92e12 100644 --- a/samples/Cpp/TestCpp/proj.linux/.cproject +++ b/samples/Cpp/TestCpp/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -59,7 +57,7 @@ - + - + @@ -123,15 +112,15 @@ - + - - + - + @@ -210,16 +190,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + @@ -228,10 +407,20 @@ + + + + + + + + + + + + + + + - - - - - diff --git a/samples/Cpp/TestCpp/proj.linux/.project b/samples/Cpp/TestCpp/proj.linux/.project index 1f0233c8e6..0153f98c58 100644 --- a/samples/Cpp/TestCpp/proj.linux/.project +++ b/samples/Cpp/TestCpp/proj.linux/.project @@ -97,7 +97,7 @@ extensions 2 - PARENT-3-PROJECT_LOC/extensions + PARENT-4-PROJECT_LOC/extensions diff --git a/samples/Lua/HelloLua/proj.linux/.cproject b/samples/Lua/HelloLua/proj.linux/.cproject index 5ccf22ef44..5652be01fa 100644 --- a/samples/Lua/HelloLua/proj.linux/.cproject +++ b/samples/Lua/HelloLua/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -65,7 +63,7 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -200,6 +392,9 @@ + + + diff --git a/samples/Lua/HelloLua/proj.linux/.project b/samples/Lua/HelloLua/proj.linux/.project index 31ca58204c..5b6df85717 100644 --- a/samples/Lua/HelloLua/proj.linux/.project +++ b/samples/Lua/HelloLua/proj.linux/.project @@ -36,7 +36,7 @@ cocos2dx_support 2 - PARENT-3-PROJECT_LOC/scripting/lua/cocos2dx_support + PARENT-4-PROJECT_LOC/scripting/lua/cocos2dx_support diff --git a/samples/Lua/TestLua/proj.linux/.cproject b/samples/Lua/TestLua/proj.linux/.cproject index 54f06765ae..aa3e5a741c 100644 --- a/samples/Lua/TestLua/proj.linux/.cproject +++ b/samples/Lua/TestLua/proj.linux/.cproject @@ -1,7 +1,5 @@ - - - + @@ -16,7 +14,7 @@ - + @@ -64,7 +62,7 @@ - + - + @@ -161,7 +159,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - diff --git a/samples/Lua/TestLua/proj.linux/.project b/samples/Lua/TestLua/proj.linux/.project index 9b6bf99e14..ffdd86c367 100644 --- a/samples/Lua/TestLua/proj.linux/.project +++ b/samples/Lua/TestLua/proj.linux/.project @@ -38,7 +38,7 @@ cocos2dx_support 2 - PARENT-3-PROJECT_LOC/scripting/lua/cocos2dx_support + PARENT-4-PROJECT_LOC/scripting/lua/cocos2dx_support diff --git a/scripting/lua/proj.linux/.cproject b/scripting/lua/proj.linux/.cproject index 5a09d65ece..038298d420 100644 --- a/scripting/lua/proj.linux/.cproject +++ b/scripting/lua/proj.linux/.cproject @@ -75,7 +75,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -97,7 +97,7 @@ @@ -106,7 +106,7 @@ @@ -131,6 +131,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6d895e634c37be0a70e7fd7419443a118b06393b Mon Sep 17 00:00:00 2001 From: Denis Mingulov Date: Sat, 22 Dec 2012 07:58:30 +0200 Subject: [PATCH 05/18] Compilation fix for Android clang 3.1 --- CocosDenshion/android/opensl/OpenSLEngine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CocosDenshion/android/opensl/OpenSLEngine.cpp b/CocosDenshion/android/opensl/OpenSLEngine.cpp index 8495395de2..c96dc092aa 100644 --- a/CocosDenshion/android/opensl/OpenSLEngine.cpp +++ b/CocosDenshion/android/opensl/OpenSLEngine.cpp @@ -289,7 +289,8 @@ bool initAudioPlayer(AudioPlayer* player, const char* filename) } SLDataLocator_AndroidFD loc_fd = {SL_DATALOCATOR_ANDROIDFD, fd, start, length}; SLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED}; - (player->audioSrc) = {&loc_fd, &format_mime}; + player->audioSrc.pLocator = &loc_fd; + player->audioSrc.pFormat = &format_mime; return createAudioPlayerBySource(player); } From eb417274fbec1b58102f7750fcb810cee23837bd Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 24 Dec 2012 11:15:56 +0800 Subject: [PATCH 06/18] fixed #1621: fix compilation error of eclipe project. --- samples/Cpp/TestCpp/proj.linux/.cproject | 11 ++++++----- samples/Lua/TestLua/proj.linux/Makefile | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/Cpp/TestCpp/proj.linux/.cproject b/samples/Cpp/TestCpp/proj.linux/.cproject index 8749c92e12..d7dcde4db6 100644 --- a/samples/Cpp/TestCpp/proj.linux/.cproject +++ b/samples/Cpp/TestCpp/proj.linux/.cproject @@ -1,5 +1,7 @@ - + + + @@ -76,7 +78,6 @@ @@ -158,6 +159,7 @@ + From 79530616ea1b9b9387623e88ca3b2a521f9e2267 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 25 Dec 2012 12:57:24 +0800 Subject: [PATCH 16/18] issue #1603:modify windows auto-build script --- .../windows/android/build-android-2.2-3.2-release.bat | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat index c5e360c5ad..4eda8d2bd0 100755 --- a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat +++ b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat @@ -17,7 +17,7 @@ cd %_ROOT_% :project ::Copy build Configuration files to target directory -copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUANE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android @@ -148,11 +148,11 @@ move ant1.properties ant.properties ::Calculate the errorlevel and change build target. cd %_ROOT_% -IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) +if "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project +if "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project +if "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error +if %testresult% NEQ 0 goto error goto success From e7ca426b3df93222d3d4b99d6689fcde29f8e0ca Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 25 Dec 2012 14:20:35 +0800 Subject: [PATCH 17/18] issue #1603:modify android resource path --- tools/jenkins_scripts/windows/android/androidtestcommon.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins_scripts/windows/android/androidtestcommon.bat b/tools/jenkins_scripts/windows/android/androidtestcommon.bat index 5795940a4d..d7c674d4d1 100755 --- a/tools/jenkins_scripts/windows/android/androidtestcommon.bat +++ b/tools/jenkins_scripts/windows/android/androidtestcommon.bat @@ -58,7 +58,7 @@ mkdir %AndroidProject%\gen mkdir %AndroidProject%\src\org\cocos2dx\lib mkdir %AndroidProject%\bin ::mkdir %AndroidProject%\bin\classes -xcopy D:\cocos2d-x\cocos2dx\platform\android\java\src_common\org\cocos2dx\lib %AndroidProject%\src\org\cocos2dx\lib /s +xcopy D:\cocos2d-x\cocos2dx\platform\android\java\src\org\cocos2dx\lib %AndroidProject%\src\org\cocos2dx\lib /s echo generate R.java file %AndroidAAPT% package -f -m -J %AndroidProjectGen% -S %AndroidProjectRes% -I %AndroidJar% -M %AndroidProjectAndroidMainfest% From d94e4c30b848cf9bd9d999d3941581427a2c6b2b Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 26 Dec 2012 10:42:35 +0800 Subject: [PATCH 18/18] issue #1603:delete space when setting language --- .../windows/android/build-android-2.2-3.2-debug.bat | 2 +- .../windows/android/build-android-2.2-3.2-release.bat | 2 +- .../jenkins_scripts/windows/android/build-android-4.x-debug.bat | 2 +- .../windows/android/build-android-4.x-release.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat index 034cf4308e..f95720db38 100755 --- a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat +++ b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat @@ -132,7 +132,7 @@ move anttmp.properties ant.properties ::Calculate the errorlevel and change build target. cd %_ROOT_% if "%_PROJECTNAME%"=="TestCpp" set /a TestCpp_Result=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project -if "%_PROJECTNAME%"=="HelloCpp" set /a HelloCpp_Result=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project +if "%_PROJECTNAME%"=="HelloCpp" set /a HelloCpp_Result=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project if "%_PROJECTNAME%"=="HelloLua" set /a HelloLua_Result=(result8+result10+result11+result12+result13) set /a Compile_Result=(TestCpp_Result+HelloCpp_Result+HelloLua_Result) if %Compile_Result% NEQ 0 goto error diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat index 4eda8d2bd0..99b7702446 100755 --- a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat +++ b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat @@ -149,7 +149,7 @@ move ant1.properties ant.properties ::Calculate the errorlevel and change build target. cd %_ROOT_% if "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project -if "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project +if "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project if "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) set /a testresult=(testresult1+testresult2+testresult3) if %testresult% NEQ 0 goto error diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat b/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat index 77e4fc9b5b..167bddbf3f 100755 --- a/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat +++ b/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat @@ -88,7 +88,7 @@ move anttmp.properties ant.properties ::Calculate the errorlevel and change build target. cd %_ROOT_% IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) set /a testresult=(testresult1+testresult2+testresult3) IF %testresult% NEQ 0 goto error diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat b/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat index 8164a5ae6a..6ff32fee48 100755 --- a/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat +++ b/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat @@ -97,7 +97,7 @@ move ant1.properties ant.properties ::Calculate the errorlevel and change build target. cd %_ROOT_% IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua&& set _PROJECTNAME=HelloLua&& goto project IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) set /a testresult=(testresult1+testresult2+testresult3) IF %testresult% NEQ 0 goto error