diff --git a/.gitmodules b/.gitmodules index 91585f7b9a..24fc5625d3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,12 +4,12 @@ [submodule "cocos/scripting/auto-generated"] path = cocos/scripting/auto-generated url = git://github.com/cocos2d-x/bindings-auto-generated.git -[submodule "samples/Javascript/Shared"] - path = samples/Javascript/Shared - url = git://github.com/cocos2d/cocos2d-js-tests.git [submodule "tools/cocos2d-console"] path = tools/cocos2d-console url = git://github.com/cocos2d/cocos2d-console.git [submodule "plugin"] path = plugin url = https://github.com/cocos2d-x/plugin-x.git +[submodule "tests/test-javascript/tests"] + path = tests/test-javascript/tests + url = git://github.com/cocos2d/cocos2d-js-tests.git diff --git a/AUTHORS b/AUTHORS index 493859c5be..095386f830 100644 --- a/AUTHORS +++ b/AUTHORS @@ -95,6 +95,7 @@ Developers: Added Mingw-crt Support without breaking VS SDK CMake support for windows. Added support for x64 target of windows. + Added Dutch Language support. mchinen fix emulator issue for OpenGL ES 2.0 on Android diff --git a/CHANGELOG b/CHANGELOG index 6d3f9d1a82..3da3c6d302 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +cocos2d-x-3.0rc0 Feb.?? 2014 +[All] + [NEW] Adds Dutch Language support. + + [FIX] EGLView improvements: renamed to GLView, no longer a singleton, easier to customize + [FIX] Removes samples except testcpp|testjavascript|testlua. Moves sample games to `cocos2d/samples` repo. + cocos2d-x-3.0beta2 Jan.24 2014 [All] [NEW] Full screen support for desktop platforms. @@ -11,8 +18,7 @@ cocos2d-x-3.0beta2 Jan.24 2014 [NEW] Node: Added `setGlobalZOrder()`. Useful to change the Node's render order. Node::setZOrder() -> Node::setLocalZOrder() [NEW] Renderer: Added BatchCommand. This command is not "batchable" with other commands, but improves performance in about 10% - [FIX] Uses EventDispatcher to access event in LUA testcase. - [FIX] Exposes SAXParser class to JS, it is used for parsing XML in JS. + [FIX] event->stopPropagation can't work for EventListenerTouchAllAtOnce. [FIX] Uses unified `desktop/CCEGLView.h/cpp` for desktop platforms (windows, mac, linux). [FIX] Bindings-generator supports Windows again and remove dependency of LLVM since we only need binary(libclang.so/dll). [FIX] Removes unused files for MAC platform after using glfw3 to create opengl context. @@ -53,6 +59,7 @@ cocos2d-x-3.0beta2 Jan.24 2014 [FIX] Keyboard pressed events are being repeatedly fired before keyboard is released [Android] [FIX] Background music can't be resumed when back from foreground + [FIX] ANR (Application Not Responding) appears on android 2.3 when pressing hardware button. [lua binding] [NEW] Can bind classes that have the same class names but different namesapces [FIX] Use EventDispatcher to update some test cases @@ -819,7 +826,7 @@ cocos2d-2.0-x-2.0.2 @Aug.30 2012 Refactor #1399: adjust directory structure Refactor #1402: improve static creator function names to avoid confusion Refactor #1413: improve CCTouch::getLocation(), getDelta() which returns OpenGL coordinates directly - Refactor #1437: change the return type of CCApplication::sharedApplication() and CCEGLView::sharedOpenGLView() to a pointer + Refactor #1437: change the return type of CCApplication::sharedApplication() and CCGLView::sharedOpenGLView() to a pointer Refactor #1441: put hd and iPad resources of TestCpp into separate directories Refactor #1442: use CREATE_FUNC to replace LAYER_CREATE_FUNC and SCENE_CREATE_FUNC [iOS] @@ -853,7 +860,7 @@ cocos2d-2.0-rc2-x-2.0.1 @Jun.28 2012 Bug #1293: fix a bug that CCDirector::getFrames() returns wrong value Bug #1296: fix a logical error in CCTMXTiledMap::tilesetForLayer() Bug #1300: fix a typo of CC_ENABLE_CACHE_TEXTTURE_DATA - Bug #1301: apply scissor with points in CCEGLView::sharedOpenGLView().setScissorInPoints() + Bug #1301: apply scissor with points in CCGLView::sharedOpenGLView().setScissorInPoints() Bug #1302: change the parameter type of CCMenu::setHandlerPriority to signed int Bug #1308: fix a logical bug in CCTouchDispatcher Bug #1326: fix a bug that the compilation of HelloLua and testjs project was broken after synchronizing to rc2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 097c44290c..6bf32542eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,7 @@ option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON) -option(BUILD_HelloCpp "Only build HelloCpp sample" ON) option(BUILD_TestCpp "Only build TestCpp sample" ON) -option(BUILD_HelloLua "Only build HelloLua sample" OFF) option(BUILD_TestLua "Only build TestLua sample" OFF) else()#temp @@ -63,10 +61,7 @@ option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON) - -option(BUILD_HelloCpp "Only build HelloCpp sample" ON) option(BUILD_TestCpp "Only build TestCpp sample" ON) -option(BUILD_HelloLua "Only build HelloLua sample" ON) option(BUILD_TestLua "Only build TestLua sample" ON) endif()#temp @@ -284,20 +279,13 @@ add_subdirectory(external/lua/tolua) add_subdirectory(cocos/scripting) endif(BUILD_LIBS_LUA) -# build samples -if(BUILD_HelloCpp) -add_subdirectory(samples/Cpp/HelloCpp) -endif(BUILD_HelloCpp) +# build tests if(BUILD_TestCpp) -add_subdirectory(samples/Cpp/TestCpp) +add_subdirectory(tests/test-cpp) endif(BUILD_TestCpp) -if(BUILD_HelloLua) -add_subdirectory(samples/Lua/HelloLua) -endif(BUILD_HelloLua) - if(BUILD_TestLua) -add_subdirectory(samples/Lua/TestLua) +add_subdirectory(tests/test-lua) endif(BUILD_TestLua) diff --git a/build/android-build.py b/build/android-build.py index bc00812ace..b3b035799a 100755 --- a/build/android-build.py +++ b/build/android-build.py @@ -1,15 +1,15 @@ #!/usr/bin/python # android-build.py -# Build android samples +# Build android import sys import os, os.path import shutil from optparse import OptionParser -CPP_SAMPLES = ['hellocpp', 'testcpp', 'simplegame', 'assetsmanager'] -LUA_SAMPLES = ['hellolua', 'testlua'] -JSB_SAMPLES = ['cocosdragon', 'crystalcraze', 'moonwarriors', 'testjavascript', 'watermelonwithme'] +CPP_SAMPLES = ['testcpp'] +LUA_SAMPLES = ['testlua'] +JSB_SAMPLES = ['testjavascript'] ALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES + JSB_SAMPLES def get_num_of_cpu(): @@ -74,9 +74,9 @@ def select_toolchain_version(): def caculate_built_samples(args): ''' Compute the sampels to be built - 'cpp' for short of all cpp samples - 'lua' for short of all lua smpleas - 'jsb' for short of all javascript samples + 'cpp' for short of all cpp tests + 'lua' for short of all lua tests + 'jsb' for short of all javascript tests ''' if 'all' in args: @@ -159,47 +159,23 @@ def copy_resources(target, app_android_root): # jsb samples should copy javascript files and resources(shared with cocos2d-html5) if target in JSB_SAMPLES: - resources_dir = os.path.join(app_android_root, "../../../../cocos/scripting/javascript/script") + resources_dir = os.path.join(app_android_root, "../../../cocos/scripting/javascript/script") copy_files(resources_dir, assets_dir) - if target == "cocosdragon": - resources_dir = os.path.join(app_android_root, "../../Shared/games/CocosDragonJS/Published files Android") - if target == "crystalcraze": - resources_dir = os.path.join(app_android_root, "../../Shared/games/CrystalCraze/Published-Android") if target == "testjavascript": - resources_dir = os.path.join(app_android_root, "../../Shared/tests/") - if target == "watermelonwithme": - resources_dir = os.path.join(app_android_root, "../../Shared/games/WatermelonWithMe") - if target != "moonwarriors": - copy_files(resources_dir, assets_dir) - else: - resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors/res") - dst_dir = os.path.join(assets_dir, "res") - os.mkdir(dst_dir) - copy_files(resources_dir, dst_dir) - resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors/src") - dst_dir = os.path.join(assets_dir, "src") - os.mkdir(dst_dir) - copy_files(resources_dir, dst_dir) - resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors") - for item in os.listdir(resources_dir): - path = os.path.join(resources_dir, item) - if item.endswith('.js') and os.path.isfile(path): - shutil.copy(path, assets_dir) + resources_dir = os.path.join(app_android_root, "../tests/") - # AssetsManager test should also copy javascript files - if target == "assetsmanager": - resources_dir = os.path.join(app_android_root, "../../../../cocos/scripting/javascript/script") copy_files(resources_dir, assets_dir) + # lua samples should copy lua script if target in LUA_SAMPLES: - resources_dir = os.path.join(app_android_root, "../../../../cocos/scripting/lua/script") + resources_dir = os.path.join(app_android_root, "../../../cocos/scripting/lua/script") copy_files(resources_dir, assets_dir) # TestLua shared resources with TestCpp if target == "testlua": - resources_dir = os.path.join(app_android_root, "../../../Cpp/TestCpp/Resources") + resources_dir = os.path.join(app_android_root, "../../test-cpp/Resources") copy_files(resources_dir, assets_dir) def build_samples(target,ndk_build_param,android_platform,build_mode): @@ -213,12 +189,12 @@ def build_samples(target,ndk_build_param,android_platform,build_mode): cocos_root = os.path.join(current_dir, "..") if android_platform is not None: - sdk_root = check_environment_variables_sdk() - if android_platform.isdigit(): - android_platform = 'android-'+android_platform - else: - print 'please use vaild android platform' - exit(1) + sdk_root = check_environment_variables_sdk() + if android_platform.isdigit(): + android_platform = 'android-'+android_platform + else: + print 'please use vaild android platform' + exit(1) if build_mode is None: build_mode = 'debug' @@ -227,28 +203,12 @@ def build_samples(target,ndk_build_param,android_platform,build_mode): app_android_root = '' for target in build_targets: - if target == 'hellocpp': - app_android_root = os.path.join(cocos_root, 'samples/Cpp/HelloCpp/proj.android') - elif target == 'testcpp': - app_android_root = os.path.join(cocos_root, 'samples/Cpp/TestCpp/proj.android') - elif target == 'simplegame': - app_android_root = os.path.join(cocos_root, 'samples/Cpp/SimpleGame/proj.android') - elif target == 'assetsmanager': - app_android_root = os.path.join(cocos_root, 'samples/Cpp/AssetsManagerTest/proj.android') - elif target == 'hellolua': - app_android_root = os.path.join(cocos_root, 'samples/Lua/HelloLua/proj.android') + if target == 'testcpp': + app_android_root = os.path.join(cocos_root, 'tests/test-cpp/proj.android') elif target == 'testlua': - app_android_root = os.path.join(cocos_root, 'samples/Lua/TestLua/proj.android') - elif target == 'cocosdragon': - app_android_root = os.path.join(cocos_root, 'samples/Javascript/CocosDragonJS/proj.android') - elif target == 'crystalcraze': - app_android_root = os.path.join(cocos_root, 'samples/Javascript/CrystalCraze/proj.android') - elif target == 'moonwarriors': - app_android_root = os.path.join(cocos_root, 'samples/Javascript/MoonWarriors/proj.android') + app_android_root = os.path.join(cocos_root, 'tests/test-lua/proj.android') elif target == 'testjavascript': - app_android_root = os.path.join(cocos_root, 'samples/Javascript/TestJavascript/proj.android') - elif target == 'watermelonwithme': - app_android_root = os.path.join(cocos_root, 'samples/Javascript/WatermelonWithMe/proj.android') + app_android_root = os.path.join(cocos_root, 'tests/test-javascript/proj.android') else: print 'unknown target: %s' % target continue @@ -261,30 +221,30 @@ if __name__ == '__main__': #parse the params usage = """ - This script is mainy used for building samples built-in with cocos2d-x. + This script is mainy used for building tests built-in with cocos2d-x. Usage: %prog [options] target - Valid targets are: [hellocpp|testcpp|simplegame|assetsmanager|hellolua|testlua|cocosdragon|crystalcraze|moonwarriors|testjavascript|watermelonwithme]. You can combine them arbitrarily with a whitespace among two valid targets. + Valid targets are: [testcpp|testlua|testjavascript]. You can combine them arbitrarily with a whitespace among two valid targets. - You can use [all|cpp|lua|jsb], to build all the samples, or all the c++ samples, or all the lua samples, or all the jsb samples respectevely. + You can use [all|cpp|lua|jsb], to build all the tests, or all the c++ tests, or all the Lua tests, or all the JavaScript tests respectevely. - cpp = ['hellocpp', 'testcpp', 'simplegame', 'assetsmanager'] - lua = ['hellolua', 'testlua'] - jsb = ['cocosdragon', 'crystalcraze', 'moonwarriors', 'testjavascript', 'watermelonwithme'] + cpp = ['testcpp'] + lua = ['testlua'] + jsb = ['testjavascript'] all = cpp + lua + jsb // be careful with the all target, it may took a very long time to compile all the projects, do it under your own risk. - If you are new to cocos2d-x, I recommend you start with hellocpp,hellolua or testjavascript. + If you are new to cocos2d-x, I recommend you start with testcpp, testlua or testjavascript. You can combine these targets like this: //1. to build simplegame and assetsmanager - python android-build.py -p 10 simplegame assetsmanager + python android-build.py -p 10 testcpp testlua - //2. to build hellolua and all the jsb samples - python android-build.py -p 19 hellolua jsb + //2. to build testlua and all the jsb tests + python android-build.py -p 19 testlua jsb - Note: You should install ant to generate apk while building the andriod samples. But it is optional. You can generate apk with eclipse. + Note: You should install ant to generate apk while building the andriod tests. But it is optional. You can generate apk with eclipse. """ parser = OptionParser(usage=usage) diff --git a/build/cocos2d-win32.vc2012.sln b/build/cocos2d-win32.vc2012.sln index 3593a117d8..37798a321a 100644 --- a/build/cocos2d-win32.vc2012.sln +++ b/build/cocos2d-win32.vc2012.sln @@ -5,15 +5,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAudio", "..\cocos\audio\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "..\samples\Cpp\HelloCpp\proj.win32\HelloCpp.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "..\samples\Cpp\TestCpp\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpp", "..\tests\test-cpp\proj.win32\TestCpp.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj", "{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}" EndProject @@ -25,29 +23,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\netw EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssetsManagerTest", "..\samples\Cpp\AssetsManagerTest\proj.win32\AssetsManagerTest.vcxproj", "{6D37505F-A890-441D-BD3F-A61E2C0469CE}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding", "..\cocos\scripting\javascript\bindings\proj.win32\libJSBinding.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "..\samples\Javascript\TestJavascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestJavascript", "..\tests\test-javascript\proj.win32\TestJavascript.vcxproj", "{D0F06A44-A245-4D13-A498-0120C203B539}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos\storage\local-storage\proj.win32\libLocalStorage.vcxproj", "{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CocosDragonJS", "..\samples\Javascript\CocosDragonJS\proj.win32\CocosDragonJS.vcxproj", "{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrystalCraze", "..\samples\Javascript\CrystalCraze\proj.win32\CrystalCraze.vcxproj", "{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MoonWarriors", "..\samples\Javascript\MoonWarriors\proj.win32\MoonWarriors.vcxproj", "{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WatermelonWithMe", "..\samples\Javascript\WatermelonWithMe\proj.win32\WatermelonWithMe.vcxproj", "{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\cocos\scripting\lua\bindings\liblua.vcxproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "..\samples\Lua\HelloLua\proj.win32\HelloLua.vcxproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "..\samples\Lua\TestLua\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleGame", "..\samples\Cpp\SimpleGame\proj.win32\SimpleGame.vcxproj", "{E0E282F4-8487-452C-BFAB-CB960EB4D22F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLua", "..\tests\test-lua\proj.win32\TestLua.win32.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBindingForBuilder", "..\cocos\scripting\javascript\bindings\cocosbuilder\libJSBindingForBuilder.vcxproj", "{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}" EndProject diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index ab43aa8b01..9d609edff2 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3c7f70ab861d6d3348d4f598cf492b29b306d9d9 \ No newline at end of file +caae58ff83f2655d5ea4c19e00a2be17259f8559 \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index 3389050ae0..0000000000 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c958533394964fe0c38bd60c272a0b48ec38d9d6 \ No newline at end of file diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_tests.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..93894bc133 --- /dev/null +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +88d35147fd70ffbc353388aa9424bd2f0645ac95 \ No newline at end of file diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 432ace90c5..06baeeef45 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -111,7 +111,7 @@ cocos2d.cpp \ TGAlib.cpp \ TransformUtils.cpp \ ZipUtils.cpp \ -platform/CCEGLViewProtocol.cpp \ +platform/CCGLViewProtocol.cpp \ platform/CCFileUtils.cpp \ platform/CCSAXParser.cpp \ platform/CCThread.cpp \ diff --git a/cocos/2d/CCDeprecated.h b/cocos/2d/CCDeprecated.h index 05c1d618ee..783621a7e2 100644 --- a/cocos/2d/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -764,7 +764,7 @@ CC_DEPRECATED_ATTRIBUTE typedef TMXTiledMap CCTMXTiledMap; CC_DEPRECATED_ATTRIBUTE typedef TileMapAtlas CCTileMapAtlas; CC_DEPRECATED_ATTRIBUTE typedef Timer CCTimer; CC_DEPRECATED_ATTRIBUTE typedef Scheduler CCScheduler; -CC_DEPRECATED_ATTRIBUTE typedef EGLView CCEGLView; +CC_DEPRECATED_ATTRIBUTE typedef GLView CCEGLView; CC_DEPRECATED_ATTRIBUTE typedef Component CCComponent; CC_DEPRECATED_ATTRIBUTE typedef AffineTransform CCAffineTransform; diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index f7c8bcdd35..b7bee4df39 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -55,7 +55,7 @@ THE SOFTWARE. #include "kazmath/GL/matrix.h" #include "CCProfiling.h" #include "platform/CCImage.h" -#include "CCEGLView.h" +#include "CCGLView.h" #include "CCConfiguration.h" #include "CCEventDispatcher.h" #include "CCEventCustom.h" @@ -365,7 +365,7 @@ float Director::getDeltaTime() const { return _deltaTime; } -void Director::setOpenGLView(EGLView *openGLView) +void Director::setOpenGLView(GLView *openGLView) { CCASSERT(openGLView, "opengl view should not be null"); @@ -376,9 +376,10 @@ void Director::setOpenGLView(EGLView *openGLView) conf->gatherGPUInfo(); CCLOG("%s\n",conf->getInfo().c_str()); - // EAGLView is not a Object - delete _openGLView; // [openGLView_ release] + if(_openGLView) + _openGLView->release(); _openGLView = openGLView; + _openGLView->retain(); // set size _winSizeInPoints = _openGLView->getDesignResolutionSize(); @@ -941,7 +942,8 @@ void Director::createStatsLabel() Secondly, the size of this image is 480*320, to display the FPS label with correct size, a factor of design resolution ratio of 480x320 is also needed. */ - float factor = EGLView::getInstance()->getDesignResolutionSize().height / 320.0f; + auto glview = Director::getInstance()->getOpenGLView(); + float factor = glview->getDesignResolutionSize().height / 320.0f; _FPSLabel = LabelAtlas::create(); _FPSLabel->retain(); diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index 23bc8cda42..be553ea84a 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -49,7 +49,7 @@ NS_CC_BEGIN /* Forward declarations. */ class LabelAtlas; class Scene; -class EGLView; +class GLView; class DirectorDelegate; class Node; class Scheduler; @@ -143,12 +143,12 @@ public: /** seconds per frame */ inline float getSecondsPerFrame() { return _secondsPerFrame; } - /** Get the EGLView, where everything is rendered + /** Get the GLView, where everything is rendered * @js NA * @lua NA */ - inline EGLView* getOpenGLView() { return _openGLView; } - void setOpenGLView(EGLView *openGLView); + inline GLView* getOpenGLView() { return _openGLView; } + void setOpenGLView(GLView *openGLView); TextureCache* getTextureCache() const; @@ -202,7 +202,7 @@ public: /** returns visible size of the OpenGL view in points. * the value is equal to getWinSize if don't invoke - * EGLView::setDesignResolutionSize() + * GLView::setDesignResolutionSize() */ Size getVisibleSize() const; @@ -422,8 +422,8 @@ protected: /* delta time since last tick to main loop */ float _deltaTime; - /* The EGLView, where everything is rendered */ - EGLView *_openGLView; + /* The GLView, where everything is rendered */ + GLView *_openGLView; //texture cache belongs to this director TextureCache *_textureCache; @@ -492,8 +492,8 @@ protected: /* Console for the director */ Console *_console; - // EGLViewProtocol will recreate stats labels to fit visible rect - friend class EGLViewProtocol; + // GLViewProtocol will recreate stats labels to fit visible rect + friend class GLViewProtocol; }; /** diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index ac155142be..9c2603b57c 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -815,7 +815,7 @@ void EventDispatcher::dispatchTouchEvent(EventTouch* event) if (event->isStopped()) { updateListeners(event); - return false; + return true; } return false; diff --git a/cocos/2d/CCEventTouch.h b/cocos/2d/CCEventTouch.h index 9a8037d494..508241ca85 100644 --- a/cocos/2d/CCEventTouch.h +++ b/cocos/2d/CCEventTouch.h @@ -60,7 +60,7 @@ private: EventCode _eventCode; std::vector _touches; - friend class EGLViewProtocol; + friend class GLViewProtocol; }; diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 961e165cb9..1a158af323 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -85,6 +85,7 @@ void Font::setCurrentGlyphCollection(GlyphCollection glyphs, const char *customG break; } + _usedGlyphs = glyphs; } const char * Font::getCurrentGlyphCollection() const diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index b00a69bbdb..cb82c88be6 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCTextFieldTTF.h" #include "CCDirector.h" -#include "CCEGLView.h" +#include "CCGLView.h" NS_CC_BEGIN @@ -126,7 +126,7 @@ bool TextFieldTTF::attachWithIME() if (ret) { // open keyboard - EGLView * pGlView = Director::getInstance()->getOpenGLView(); + GLView * pGlView = Director::getInstance()->getOpenGLView(); if (pGlView) { pGlView->setIMEKeyboardState(true); @@ -141,7 +141,7 @@ bool TextFieldTTF::detachWithIME() if (ret) { // close keyboard - EGLView * glView = Director::getInstance()->getOpenGLView(); + GLView * glView = Director::getInstance()->getOpenGLView(); if (glView) { glView->setIMEKeyboardState(false); diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index 9eb8f27a19..18133edc9d 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -7,7 +7,7 @@ set(PLATFORM_SRC platform/win32/CCFileUtilsWin32.cpp platform/win32/CCCommon.cpp platform/win32/CCApplication.cpp - platform/win32/CCEGLView.cpp + platform/win32/CCGLView.cpp platform/win32/CCImage.cpp platform/win32/CCDevice.cpp ) @@ -21,7 +21,7 @@ set(PLATFORM_SRC platform/linux/CCFileUtilsLinux.cpp platform/linux/CCCommon.cpp platform/linux/CCApplication.cpp - platform/desktop/CCEGLView.cpp + platform/desktop/CCGLView.cpp platform/linux/CCImage.cpp platform/linux/CCDevice.cpp ) @@ -134,7 +134,7 @@ set(COCOS2D_SRC CCDeprecated.cpp platform/CCSAXParser.cpp platform/CCThread.cpp - platform/CCEGLViewProtocol.cpp + platform/CCGLViewProtocol.cpp platform/CCFileUtils.cpp ../../external/edtaa3func/edtaa3func.cpp renderer/CCCustomCommand.cpp diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index 83bb85f6c7..61db6419a1 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -154,42 +154,42 @@ THE SOFTWARE. #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #include "platform/ios/CCApplication.h" - #include "platform/ios/CCEGLView.h" + #include "platform/ios/CCGLView.h" #include "platform/ios/CCGL.h" #include "platform/ios/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCApplication.h" - #include "platform/android/CCEGLView.h" + #include "platform/android/CCGLView.h" #include "platform/android/CCGL.h" #include "platform/android/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) #include "platform/blackberry/CCApplication.h" - #include "platform/blackberry/CCEGLView.h" + #include "platform/blackberry/CCGLView.h" #include "platform/blackberry/CCGL.h" #include "platform/blackberry/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #include "platform/win32/CCApplication.h" - #include "platform/desktop/CCEGLView.h" + #include "platform/desktop/CCGLView.h" #include "platform/win32/CCGL.h" #include "platform/win32/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #include "platform/mac/CCApplication.h" - #include "platform/desktop/CCEGLView.h" + #include "platform/desktop/CCGLView.h" #include "platform/mac/CCGL.h" #include "platform/mac/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) #include "platform/linux/CCApplication.h" - #include "platform/desktop/CCEGLView.h" + #include "platform/desktop/CCGLView.h" #include "platform/linux/CCGL.h" #include "platform/linux/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index 0bf011772e..8a158e44f0 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -304,11 +304,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - + - + @@ -505,13 +505,13 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - + - + @@ -536,4 +536,4 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - \ No newline at end of file + diff --git a/cocos/2d/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters index c6e71f9d42..29491e4794 100644 --- a/cocos/2d/cocos2d.vcxproj.filters +++ b/cocos/2d/cocos2d.vcxproj.filters @@ -363,7 +363,7 @@ platform\win32 - + platform @@ -595,7 +595,7 @@ label_nodes - + platform\desktop @@ -876,7 +876,7 @@ platform - + platform @@ -1198,8 +1198,8 @@ label_nodes - + platform\desktop - \ No newline at end of file + diff --git a/cocos/2d/platform/CCApplicationProtocol.h b/cocos/2d/platform/CCApplicationProtocol.h index 9042c649d0..016fb4b988 100644 --- a/cocos/2d/platform/CCApplicationProtocol.h +++ b/cocos/2d/platform/CCApplicationProtocol.h @@ -33,6 +33,8 @@ NS_CC_BEGIN * @{ */ +class EAGLView; + class CC_DLL ApplicationProtocol { public: diff --git a/cocos/2d/platform/CCCommon.h b/cocos/2d/platform/CCCommon.h index fa300cd4fe..fcd28b4997 100644 --- a/cocos/2d/platform/CCCommon.h +++ b/cocos/2d/platform/CCCommon.h @@ -56,6 +56,7 @@ enum class LanguageType ITALIAN, GERMAN, SPANISH, + DUTCH, RUSSIAN, KOREAN, JAPANESE, diff --git a/cocos/2d/platform/CCEGLViewProtocol.cpp b/cocos/2d/platform/CCGLViewProtocol.cpp similarity index 83% rename from cocos/2d/platform/CCEGLViewProtocol.cpp rename to cocos/2d/platform/CCGLViewProtocol.cpp index f494ddf44d..0c0a6277e6 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.cpp +++ b/cocos/2d/platform/CCGLViewProtocol.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCEGLViewProtocol.h" +#include "CCGLViewProtocol.h" #include "CCTouch.h" #include "CCDirector.h" #include "CCSet.h" @@ -71,24 +71,23 @@ namespace { } -EGLViewProtocol::EGLViewProtocol() -: _delegate(nullptr) -, _scaleX(1.0f) +GLViewProtocol::GLViewProtocol() +: _scaleX(1.0f) , _scaleY(1.0f) , _resolutionPolicy(ResolutionPolicy::UNKNOWN) { } -EGLViewProtocol::~EGLViewProtocol() +GLViewProtocol::~GLViewProtocol() { } -void EGLViewProtocol::pollInputEvents() +void GLViewProtocol::pollInputEvents() { } -void EGLViewProtocol::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy) +void GLViewProtocol::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy) { CCASSERT(resolutionPolicy != ResolutionPolicy::UNKNOWN, "should set resolutionPolicy"); @@ -107,17 +106,17 @@ void EGLViewProtocol::setDesignResolutionSize(float width, float height, Resolut _scaleX = _scaleY = MAX(_scaleX, _scaleY); } - if (resolutionPolicy == ResolutionPolicy::SHOW_ALL) + else if (resolutionPolicy == ResolutionPolicy::SHOW_ALL) { _scaleX = _scaleY = MIN(_scaleX, _scaleY); } - if ( resolutionPolicy == ResolutionPolicy::FIXED_HEIGHT) { + else if ( resolutionPolicy == ResolutionPolicy::FIXED_HEIGHT) { _scaleX = _scaleY; _designResolutionSize.width = ceilf(_screenSize.width/_scaleX); } - if ( resolutionPolicy == ResolutionPolicy::FIXED_WIDTH) { + else if ( resolutionPolicy == ResolutionPolicy::FIXED_WIDTH) { _scaleY = _scaleX; _designResolutionSize.height = ceilf(_screenSize.height/_scaleY); } @@ -131,27 +130,28 @@ void EGLViewProtocol::setDesignResolutionSize(float width, float height, Resolut _resolutionPolicy = resolutionPolicy; // reset director's member variables to fit visible rect - Director::getInstance()->_winSizeInPoints = getDesignResolutionSize(); - Director::getInstance()->createStatsLabel(); - Director::getInstance()->setGLDefaultValues(); + auto director = Director::getInstance(); + director->_winSizeInPoints = getDesignResolutionSize(); + director->createStatsLabel(); + director->setGLDefaultValues(); } -const Size& EGLViewProtocol::getDesignResolutionSize() const +const Size& GLViewProtocol::getDesignResolutionSize() const { return _designResolutionSize; } -const Size& EGLViewProtocol::getFrameSize() const +const Size& GLViewProtocol::getFrameSize() const { return _screenSize; } -void EGLViewProtocol::setFrameSize(float width, float height) +void GLViewProtocol::setFrameSize(float width, float height) { _designResolutionSize = _screenSize = Size(width, height); } -Size EGLViewProtocol::getVisibleSize() const +Size GLViewProtocol::getVisibleSize() const { if (_resolutionPolicy == ResolutionPolicy::NO_BORDER) { @@ -163,7 +163,7 @@ Size EGLViewProtocol::getVisibleSize() const } } -Point EGLViewProtocol::getVisibleOrigin() const +Point GLViewProtocol::getVisibleOrigin() const { if (_resolutionPolicy == ResolutionPolicy::NO_BORDER) { @@ -176,12 +176,7 @@ Point EGLViewProtocol::getVisibleOrigin() const } } -void EGLViewProtocol::setTouchDelegate(EGLTouchDelegate * delegate) -{ - _delegate = delegate; -} - -void EGLViewProtocol::setViewPortInPoints(float x , float y , float w , float h) +void GLViewProtocol::setViewPortInPoints(float x , float y , float w , float h) { glViewport((GLint)(x * _scaleX + _viewPortRect.origin.x), (GLint)(y * _scaleY + _viewPortRect.origin.y), @@ -189,7 +184,7 @@ void EGLViewProtocol::setViewPortInPoints(float x , float y , float w , float h) (GLsizei)(h * _scaleY)); } -void EGLViewProtocol::setScissorInPoints(float x , float y , float w , float h) +void GLViewProtocol::setScissorInPoints(float x , float y , float w , float h) { glScissor((GLint)(x * _scaleX + _viewPortRect.origin.x), (GLint)(y * _scaleY + _viewPortRect.origin.y), @@ -197,12 +192,12 @@ void EGLViewProtocol::setScissorInPoints(float x , float y , float w , float h) (GLsizei)(h * _scaleY)); } -bool EGLViewProtocol::isScissorEnabled() +bool GLViewProtocol::isScissorEnabled() { return (GL_FALSE == glIsEnabled(GL_SCISSOR_TEST)) ? false : true; } -Rect EGLViewProtocol::getScissorRect() const +Rect GLViewProtocol::getScissorRect() const { GLfloat params[4]; glGetFloatv(GL_SCISSOR_BOX, params); @@ -213,17 +208,17 @@ Rect EGLViewProtocol::getScissorRect() const return Rect(x, y, w, h); } -void EGLViewProtocol::setViewName(const std::string& viewname ) +void GLViewProtocol::setViewName(const std::string& viewname ) { _viewName = viewname; } -const std::string& EGLViewProtocol::getViewName() const +const std::string& GLViewProtocol::getViewName() const { return _viewName; } -void EGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float ys[]) +void GLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float ys[]) { int id = 0; float x = 0.0f; @@ -273,7 +268,7 @@ void EGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float y dispatcher->dispatchEvent(&touchEvent); } -void EGLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float ys[]) +void GLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float ys[]) { int id = 0; float x = 0.0f; @@ -321,7 +316,7 @@ void EGLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float ys dispatcher->dispatchEvent(&touchEvent); } -void EGLViewProtocol::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num, int ids[], float xs[], float ys[]) +void GLViewProtocol::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num, int ids[], float xs[], float ys[]) { int id = 0; float x = 0.0f; @@ -381,27 +376,27 @@ void EGLViewProtocol::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode } } -void EGLViewProtocol::handleTouchesEnd(int num, int ids[], float xs[], float ys[]) +void GLViewProtocol::handleTouchesEnd(int num, int ids[], float xs[], float ys[]) { handleTouchesOfEndOrCancel(EventTouch::EventCode::ENDED, num, ids, xs, ys); } -void EGLViewProtocol::handleTouchesCancel(int num, int ids[], float xs[], float ys[]) +void GLViewProtocol::handleTouchesCancel(int num, int ids[], float xs[], float ys[]) { handleTouchesOfEndOrCancel(EventTouch::EventCode::CANCELLED, num, ids, xs, ys); } -const Rect& EGLViewProtocol::getViewPortRect() const +const Rect& GLViewProtocol::getViewPortRect() const { return _viewPortRect; } -float EGLViewProtocol::getScaleX() const +float GLViewProtocol::getScaleX() const { return _scaleX; } -float EGLViewProtocol::getScaleY() const +float GLViewProtocol::getScaleY() const { return _scaleY; } diff --git a/cocos/2d/platform/CCEGLViewProtocol.h b/cocos/2d/platform/CCGLViewProtocol.h similarity index 92% rename from cocos/2d/platform/CCEGLViewProtocol.h rename to cocos/2d/platform/CCGLViewProtocol.h index 45bea52eed..63ab1fa27a 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.h +++ b/cocos/2d/platform/CCGLViewProtocol.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CCEGLVIEWPROTOCOL_H__ -#define __CCEGLVIEWPROTOCOL_H__ +#ifndef __CCGLVIEWPROTOCOL_H__ +#define __CCGLVIEWPROTOCOL_H__ #include "ccTypes.h" #include "CCEventTouch.h" @@ -65,30 +65,30 @@ class EGLTouchDelegate; * @{ */ -class CC_DLL EGLViewProtocol +class CC_DLL GLViewProtocol { public: /** * @js ctor */ - EGLViewProtocol(); + GLViewProtocol(); /** * @js NA * @lua NA */ - virtual ~EGLViewProtocol(); + virtual ~GLViewProtocol(); /** Force destroying EGL view, subclass must implement this method. */ - virtual void end() = 0; + virtual void end() = 0; /** Get whether opengl render system is ready, subclass must implement this method. */ - virtual bool isOpenGLReady() = 0; + virtual bool isOpenGLReady() = 0; /** Exchanges the front and back buffers, subclass must implement this method. */ - virtual void swapBuffers() = 0; + virtual void swapBuffers() = 0; /** Open or close IME keyboard , subclass must implement this method. */ - virtual void setIMEKeyboardState(bool open) = 0; + virtual void setIMEKeyboardState(bool open) = 0; /** * Polls input events. Subclass must implement methods if platform @@ -133,9 +133,6 @@ public: */ virtual const Size& getDesignResolutionSize() const; - /** Set touch delegate */ - virtual void setTouchDelegate(EGLTouchDelegate * delegate); - /** * Set opengl view port rectangle with points. */ @@ -184,8 +181,6 @@ public: protected: void handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num, int ids[], float xs[], float ys[]); - EGLTouchDelegate* _delegate; - // real screen size Size _screenSize; // resolution size, it is the size appropriate for the app resources. @@ -195,8 +190,8 @@ protected: // the view name std::string _viewName; - float _scaleX; - float _scaleY; + float _scaleX; + float _scaleY; ResolutionPolicy _resolutionPolicy; }; @@ -205,4 +200,4 @@ protected: NS_CC_END -#endif /* __CCEGLVIEWPROTOCOL_H__ */ +#endif /* __CCGLVIEWPROTOCOL_H__ */ diff --git a/cocos/2d/platform/android/Android.mk b/cocos/2d/platform/android/Android.mk index db9bec71b9..3d27ede872 100644 --- a/cocos/2d/platform/android/Android.mk +++ b/cocos/2d/platform/android/Android.mk @@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \ CCApplication.cpp \ CCCommon.cpp \ CCDevice.cpp \ -CCEGLView.cpp \ +CCGLView.cpp \ CCFileUtilsAndroid.cpp \ CCImage.cpp \ nativeactivity.cpp \ diff --git a/cocos/2d/platform/android/CCApplication.cpp b/cocos/2d/platform/android/CCApplication.cpp index 3c5b3191b3..65990b7c08 100644 --- a/cocos/2d/platform/android/CCApplication.cpp +++ b/cocos/2d/platform/android/CCApplication.cpp @@ -22,11 +22,15 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "jni/JniHelper.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include "CCApplication.h" #include "CCDirector.h" -#include "CCEGLView.h" +#include "CCGLView.h" #include #include #include @@ -116,6 +120,10 @@ LanguageType Application::getCurrentLanguage() { ret = LanguageType::RUSSIAN; } + else if (0 == strcmp("nl", pLanguageName)) + { + ret = LanguageType::DUTCH; + } else if (0 == strcmp("ko", pLanguageName)) { ret = LanguageType::KOREAN; @@ -157,3 +165,6 @@ void Application::applicationScreenSizeChanged(int newWidth, int newHeight) { } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + diff --git a/cocos/2d/platform/android/CCApplication.h b/cocos/2d/platform/android/CCApplication.h index d3054c29d8..c3d3ce1a5d 100644 --- a/cocos/2d/platform/android/CCApplication.h +++ b/cocos/2d/platform/android/CCApplication.h @@ -22,9 +22,13 @@ 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 __CC_APPLICATION_ANDROID_H__ #define __CC_APPLICATION_ANDROID_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" @@ -87,4 +91,6 @@ protected: NS_CC_END -#endif // __CC_APPLICATION_ANDROID_H__ +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + +#endif // __CC_APPLICATION_ANDROID_H__ diff --git a/cocos/2d/platform/android/CCCommon.cpp b/cocos/2d/platform/android/CCCommon.cpp index b48aff2e5c..5a0b77605a 100644 --- a/cocos/2d/platform/android/CCCommon.cpp +++ b/cocos/2d/platform/android/CCCommon.cpp @@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "platform/CCCommon.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include @@ -44,3 +47,6 @@ void LuaLog(const char * pszFormat) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + diff --git a/cocos/2d/platform/android/CCDevice.cpp b/cocos/2d/platform/android/CCDevice.cpp index 41c4aa1e9d..74ea1cd858 100644 --- a/cocos/2d/platform/android/CCDevice.cpp +++ b/cocos/2d/platform/android/CCDevice.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "platform/CCDevice.h" #include "jni/DPIJni.h" #include "nativeactivity.h" @@ -56,3 +60,6 @@ void Device::setAccelerometerInterval(float interval) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp index 45f4876323..fe08de5e89 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "CCFileUtilsAndroid.h" #include "platform/CCCommon.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" @@ -353,3 +357,5 @@ string FileUtilsAndroid::getWritablePath() const } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.h b/cocos/2d/platform/android/CCFileUtilsAndroid.h index 2def6e2566..a5c990f47e 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.h +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.h @@ -25,6 +25,9 @@ Copyright (c) 2013-2014 Chukong Technologies Inc. #ifndef __CC_FILEUTILS_ANDROID_H__ #define __CC_FILEUTILS_ANDROID_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "platform/CCFileUtils.h" #include "CCPlatformMacros.h" #include "ccTypes.h" @@ -86,4 +89,6 @@ private: NS_CC_END -#endif // __CC_FILEUTILS_ANDROID_H__ +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + +#endif // __CC_FILEUTILS_ANDROID_H__ diff --git a/cocos/2d/platform/android/CCGL.h b/cocos/2d/platform/android/CCGL.h index 6c9a2468e0..c1c0f0a6d7 100644 --- a/cocos/2d/platform/android/CCGL.h +++ b/cocos/2d/platform/android/CCGL.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CCGL_H__ #define __CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #define glClearDepth glClearDepthf #define glDeleteVertexArrays glDeleteVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES @@ -63,4 +66,6 @@ extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT; #define glDeleteVertexArraysOES glDeleteVertexArraysOESEXT +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #endif // __CCGL_H__ diff --git a/cocos/2d/platform/android/CCEGLView.cpp b/cocos/2d/platform/android/CCGLView.cpp similarity index 65% rename from cocos/2d/platform/android/CCEGLView.cpp rename to cocos/2d/platform/android/CCGLView.cpp index e7da477e4e..2f826d6782 100644 --- a/cocos/2d/platform/android/CCEGLView.cpp +++ b/cocos/2d/platform/android/CCGLView.cpp @@ -22,7 +22,11 @@ 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 "CCEGLView.h" + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + +#include "CCGLView.h" #include "CCSet.h" #include "CCDirector.h" #include "ccMacros.h" @@ -48,46 +52,79 @@ void initExtensions() { NS_CC_BEGIN -EGLView::EGLView() +GLView* GLView::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + auto ret = new GLView; + if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::create(const std::string& viewName) +{ + auto ret = new GLView; + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::createWithFullScreen(const std::string& viewName) +{ + auto ret = new GLView(); + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView::GLView() { initExtensions(); } -EGLView::~EGLView() +GLView::~GLView() { } -bool EGLView::isOpenGLReady() +bool GLView::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + return true; +} + +bool GLView::initWithFullScreen(const std::string& viewName) +{ + return true; +} + + +bool GLView::isOpenGLReady() { return (_screenSize.width != 0 && _screenSize.height != 0); } -void EGLView::end() +void GLView::end() { terminateProcessJNI(); } -void EGLView::swapBuffers() +void GLView::swapBuffers() { } -EGLView* EGLView::getInstance() -{ - static EGLView instance; - return &instance; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - -void EGLView::setIMEKeyboardState(bool bOpen) +void GLView::setIMEKeyboardState(bool bOpen) { setKeyboardStateJNI((int)bOpen); } NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID diff --git a/cocos/2d/platform/android/CCEGLView.h b/cocos/2d/platform/android/CCGLView.h similarity index 64% rename from cocos/2d/platform/android/CCEGLView.h rename to cocos/2d/platform/android/CCGLView.h index dabb0a968d..ec83059d0d 100644 --- a/cocos/2d/platform/android/CCEGLView.h +++ b/cocos/2d/platform/android/CCGLView.h @@ -26,41 +26,40 @@ THE SOFTWARE. #ifndef __CC_EGLVIEW_ANDROID_H__ #define __CC_EGLVIEW_ANDROID_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + +#include "CCObject.h" #include "CCGeometry.h" -#include "platform/CCEGLViewProtocol.h" +#include "platform/CCGLViewProtocol.h" NS_CC_BEGIN -class CC_DLL EGLView : public EGLViewProtocol +class CC_DLL GLView : public Object, public GLViewProtocol { public: - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - bool isOpenGLReady(); - - // keep compatible - void end(); - void swapBuffers(); - void setIMEKeyboardState(bool bOpen); - // static function - /** - @brief get the shared main open gl window - */ - static EGLView* getInstance(); + static GLView* create(const std::string &viewname); + static GLView* createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor = 1.0f); + static GLView* createWithFullScreen(const std::string& viewName); - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); + bool isOpenGLReady() override; + void end() override; + void swapBuffers() override; + void setIMEKeyboardState(bool bOpen) override; + +protected: + GLView(); + virtual ~GLView(); + + bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor); + bool initWithFullScreen(const std::string& viewName); }; NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #endif // end of __CC_EGLVIEW_ANDROID_H__ + diff --git a/cocos/2d/platform/android/CCImage.cpp b/cocos/2d/platform/android/CCImage.cpp index 60ce678cd4..213ed4d6ee 100644 --- a/cocos/2d/platform/android/CCImage.cpp +++ b/cocos/2d/platform/android/CCImage.cpp @@ -23,7 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -//#define COCOS2D_DEBUG 1 +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #define __CC_PLATFORM_IMAGE_CPP__ #include "platform/CCImageCommon_cpp.h" @@ -246,3 +247,5 @@ extern "C" env->GetByteArrayRegion(pixels, 0, size, (jbyte*)bitmapDC._data); } }; + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID diff --git a/cocos/2d/platform/android/CCPlatformDefine.h b/cocos/2d/platform/android/CCPlatformDefine.h index 8d146ebc14..dccf9c758f 100644 --- a/cocos/2d/platform/android/CCPlatformDefine.h +++ b/cocos/2d/platform/android/CCPlatformDefine.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "android/log.h" #define CC_DLL @@ -59,4 +62,6 @@ THE SOFTWARE. #endif #endif +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/android/CCStdC.h b/cocos/2d/platform/android/CCStdC.h index 804abebceb..464249852a 100644 --- a/cocos/2d/platform/android/CCStdC.h +++ b/cocos/2d/platform/android/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "CCPlatformMacros.h" #include #include @@ -45,4 +48,6 @@ THE SOFTWARE. #define MAX(x,y) (((x) < (y)) ? (y) : (x)) #endif // MAX +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #endif // __CC_STD_C_H__ diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index 0e68cf0eb4..9666effc0e 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -21,6 +21,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "nativeactivity.h" #include @@ -43,7 +47,7 @@ THE SOFTWARE. #include "CCFileUtilsAndroid.h" #include "jni/JniHelper.h" -#include "CCEGLView.h" +#include "CCGLView.h" #include "CCDrawingPrimitives.h" #include "CCShaderCache.h" #include "CCTextureCache.h" @@ -111,29 +115,27 @@ extern EditTextCallback s_pfEditTextCallback; extern void* s_ctx; extern "C" { - JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetEditTextDialogResult(JNIEnv * env, jobject obj, jbyteArray text) { - jsize size = env->GetArrayLength(text); - pthread_mutex_lock(&(engine.app->mutex)); - if (size > 0) { - + JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetEditTextDialogResult(JNIEnv * env, jobject obj, jbyteArray text) { + jsize size = env->GetArrayLength(text); + pthread_mutex_lock(&(engine.app->mutex)); + if (size > 0) { + jbyte * data = (jbyte*)env->GetByteArrayElements(text, 0); + char* pBuf = (char*)malloc(size+1); + if (pBuf != NULL) { + memcpy(pBuf, data, size); + pBuf[size] = '\0'; + editboxText = pBuf; + } + env->ReleaseByteArrayElements(text, data, 0); - jbyte * data = (jbyte*)env->GetByteArrayElements(text, 0); - char* pBuf = (char*)malloc(size+1); - if (pBuf != NULL) { - memcpy(pBuf, data, size); - pBuf[size] = '\0'; - editboxText = pBuf; - } - env->ReleaseByteArrayElements(text, data, 0); - - } else { - char* pBuf = (char*)malloc(1); - pBuf[0] = '\0'; - editboxText = pBuf; - } - pthread_cond_broadcast(&engine.app->cond); - pthread_mutex_unlock(&(engine.app->mutex)); - } + } else { + char* pBuf = (char*)malloc(1); + pBuf[0] = '\0'; + editboxText = pBuf; + } + pthread_cond_broadcast(&engine.app->cond); + pthread_mutex_unlock(&(engine.app->mutex)); + } } typedef struct cocos_dimensions { @@ -141,17 +143,21 @@ typedef struct cocos_dimensions { int h; } cocos_dimensions; -static void cocos_init(cocos_dimensions d, struct android_app* app) { +static void cocos_init(cocos_dimensions d, struct android_app* app) +{ LOGI("cocos_init(...)"); pthread_t thisthread = pthread_self(); LOGI("pthread_self() = %X", thisthread); cocos2d::FileUtilsAndroid::setassetmanager(app->activity->assetManager); - if (!cocos2d::Director::getInstance()->getOpenGLView()) + auto director = cocos2d::Director::getInstance(); + auto glview = director->getOpenGLView(); + if (!glview) { - cocos2d::EGLView *view = cocos2d::EGLView::getInstance(); - view->setFrameSize(d.w, d.h); + glview = cocos2d::GLView::create("Android app"); + glview->setFrameSize(d.w, d.h); + director->setOpenGLView(glview); cocos_android_app_init(app); @@ -163,16 +169,18 @@ static void cocos_init(cocos_dimensions d, struct android_app* app) { cocos2d::ShaderCache::getInstance()->reloadDefaultShaders(); cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); + cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); - cocos2d::Director::getInstance()->setGLDefaultValues(); + director->getEventDispatcher()->dispatchEvent(&foregroundEvent); + director->setGLDefaultValues(); } } /** * Initialize an EGL context for the current display. */ -static cocos_dimensions engine_init_display(struct engine* engine) { +static cocos_dimensions engine_init_display(struct engine* engine) +{ cocos_dimensions r; r.w = -1; r.h = -1; @@ -245,6 +253,7 @@ static cocos_dimensions engine_init_display(struct engine* engine) { r.w = w; r.h = h; + return r; } @@ -275,7 +284,8 @@ static void dispatch_pending_runnables() { /** * Just the current frame in the display. */ -static void engine_draw_frame(struct engine* engine) { +static void engine_draw_frame(struct engine* engine) +{ LOG_RENDER_DEBUG("engine_draw_frame(...)"); pthread_t thisthread = pthread_self(); LOG_RENDER_DEBUG("pthread_self() = %X", thisthread); @@ -293,14 +303,14 @@ static void engine_draw_frame(struct engine* engine) { /* // Just fill the screen with a color. */ /* glClearColor(((float)engine->state.x)/engine->width, engine->state.angle, */ /* ((float)engine->state.y)/engine->height, 1); */ - /* glClear(GL_COLOR_BUFFER_BIT); */ - - if (s_pfEditTextCallback && editboxText) - { - s_pfEditTextCallback(editboxText, s_ctx); - free(editboxText); - editboxText = NULL; - } + /* glClear(GL_COLOR_BUFFER_BIT); */ + + if (s_pfEditTextCallback && editboxText) + { + s_pfEditTextCallback(editboxText, s_ctx); + free(editboxText); + editboxText = NULL; + } eglSwapBuffers(engine->display, engine->surface); } @@ -308,7 +318,8 @@ static void engine_draw_frame(struct engine* engine) { /** * Tear down the EGL context currently associated with the display. */ -static void engine_term_display(struct engine* engine) { +static void engine_term_display(struct engine* engine) +{ if (engine->display != EGL_NO_DISPLAY) { eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (engine->context != EGL_NO_CONTEXT) { @@ -390,7 +401,7 @@ static int32_t handle_touch_input(AInputEvent *event) { int ids[pointerCount]; float xs[pointerCount], ys[pointerCount]; getTouchPos(event, ids, xs, ys); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(pointerCount, ids, xs, ys); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(pointerCount, ids, xs, ys); return 1; } break; @@ -435,7 +446,7 @@ static int32_t handle_touch_input(AInputEvent *event) { int ids[pointerCount]; float xs[pointerCount], ys[pointerCount]; getTouchPos(event, ids, xs, ys); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(pointerCount, ids, xs, ys); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(pointerCount, ids, xs, ys); return 1; } break; @@ -458,7 +469,7 @@ static int32_t handle_key_input(AInputEvent *event) switch (AKeyEvent_getKeyCode(event)) { - case AKEYCODE_BACK: + case AKEYCODE_BACK: { cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_BACKSPACE, false); dispatcher->dispatchEvent(&event); @@ -494,8 +505,8 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) return handle_touch_input(event); } - else - return handle_key_input(event); + else + return handle_key_input(event); return 0; } @@ -533,7 +544,8 @@ void setAccelerometerIntervalJni(float interval) { /** * Process the next main command. */ -static void engine_handle_cmd(struct android_app* app, int32_t cmd) { +static void engine_handle_cmd(struct android_app* app, int32_t cmd) +{ struct engine* engine = (struct engine*)app->userData; switch (cmd) { case APP_CMD_SAVE_STATE: @@ -576,7 +588,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { case APP_CMD_GAINED_FOCUS: if (cocos2d::Director::getInstance()->getOpenGLView()) { cocos2d::Application::getInstance()->applicationWillEnterForeground(); - engine->animating = 1; + engine->animating = 1; } break; @@ -594,14 +606,14 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { } static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) { - timeRectChanged = std::chrono::steady_clock::now(); - isContentRectChanged = true; + timeRectChanged = std::chrono::steady_clock::now(); + isContentRectChanged = true; } -static void process_input(struct android_app* app, struct android_poll_source* source) { +static void process_input(struct android_app* app, struct android_poll_source* source) +{ AInputEvent* event = NULL; - int processed = 0; - while (AInputQueue_hasEvents( app->inputQueue ) && AInputQueue_getEvent(app->inputQueue, &event) >= 0) { + while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) { LOGV("New input event: type=%d\n", AInputEvent_getType(event)); if (AInputQueue_preDispatchEvent(app->inputQueue, event)) { continue; @@ -609,10 +621,6 @@ static void process_input(struct android_app* app, struct android_poll_source* s int32_t handled = 0; if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event); AInputQueue_finishEvent(app->inputQueue, event, handled); - processed = 1; - } - if (processed == 0) { - LOGE("Failure reading next input event: %s\n", strerror(errno)); } } /** @@ -644,8 +652,8 @@ void android_main(struct android_app* state) { engine.state = *(struct saved_state*)state->savedState; } - // Screen size change support - state->activity->callbacks->onContentRectChanged = onContentRectChanged; + // Screen size change support + state->activity->callbacks->onContentRectChanged = onContentRectChanged; // loop waiting for stuff to do. @@ -735,19 +743,21 @@ void android_main(struct android_app* state) { LOG_RENDER_DEBUG("android_main : !engine.animating"); } - // Check if screen size changed - if (isContentRectChanged) { - std::chrono::duration duration( - std::chrono::duration_cast>(std::chrono::steady_clock::now() - timeRectChanged)); + // Check if screen size changed + if (isContentRectChanged) { + std::chrono::duration duration( + std::chrono::duration_cast>(std::chrono::steady_clock::now() - timeRectChanged)); - // Wait about 30 ms to get new width and height. Without waiting we can get old values sometime - if (duration.count() > 30) { - isContentRectChanged = false; + // Wait about 30 ms to get new width and height. Without waiting we can get old values sometime + if (duration.count() > 30) { + isContentRectChanged = false; - int32_t newWidth = ANativeWindow_getWidth(engine.app->window); - int32_t newHeight = ANativeWindow_getHeight(engine.app->window); - cocos2d::Application::getInstance()->applicationScreenSizeChanged(newWidth, newHeight); - } - } + int32_t newWidth = ANativeWindow_getWidth(engine.app->window); + int32_t newHeight = ANativeWindow_getHeight(engine.app->window); + cocos2d::Application::getInstance()->applicationScreenSizeChanged(newWidth, newHeight); + } + } } } + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID diff --git a/cocos/2d/platform/android/nativeactivity.h b/cocos/2d/platform/android/nativeactivity.h index bc7517f3cb..ccd03cb149 100644 --- a/cocos/2d/platform/android/nativeactivity.h +++ b/cocos/2d/platform/android/nativeactivity.h @@ -24,6 +24,9 @@ THE SOFTWARE. #ifndef __COCOSNATIVEACTIVITY_H__ #define __COCOSNATIVEACTIVITY_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + /** * This is the interface to the Android native activity */ @@ -32,4 +35,6 @@ void enableAccelerometerJni(void); void disableAccelerometerJni(void); void setAccelerometerIntervalJni(float interval); +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #endif // __COCOSNATIVEACTIVITY_H__ diff --git a/cocos/2d/platform/desktop/CCEGLView.cpp b/cocos/2d/platform/desktop/CCGLView.cpp similarity index 87% rename from cocos/2d/platform/desktop/CCEGLView.cpp rename to cocos/2d/platform/desktop/CCGLView.cpp index 9a9b80c215..5c3370a828 100644 --- a/cocos/2d/platform/desktop/CCEGLView.cpp +++ b/cocos/2d/platform/desktop/CCGLView.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCEGLView.h" +#include "CCGLView.h" #include @@ -176,8 +176,8 @@ static keyCodeItem g_keyCodeStructArray[] = { }; -//begin EGLViewEventHandler -class EGLViewEventHandler +//begin GLViewEventHandler +class GLViewEventHandler { public: static bool s_captured; @@ -194,18 +194,18 @@ public: static void onGLFWframebuffersize(GLFWwindow* window, int w, int h); }; -bool EGLViewEventHandler::s_captured = false; -float EGLViewEventHandler::s_mouseX = 0; -float EGLViewEventHandler::s_mouseY = 0; +bool GLViewEventHandler::s_captured = false; +float GLViewEventHandler::s_mouseX = 0; +float GLViewEventHandler::s_mouseY = 0; -void EGLViewEventHandler::onGLFWError(int errorID, const char* errorDesc) +void GLViewEventHandler::onGLFWError(int errorID, const char* errorDesc) { CCLOGERROR("GLFWError #%d Happen, %s\n", errorID, errorDesc); } -void EGLViewEventHandler::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify) +void GLViewEventHandler::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify) { - EGLView* eglView = EGLView::getInstance(); + GLView* eglView = Director::getInstance()->getOpenGLView(); if(nullptr == eglView) return; if(GLFW_MOUSE_BUTTON_LEFT == button) { @@ -247,9 +247,9 @@ void EGLViewEventHandler::onGLFWMouseCallBack(GLFWwindow* window, int button, in } } -void EGLViewEventHandler::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) +void GLViewEventHandler::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) { - EGLView* eglView = EGLView::getInstance(); + GLView* eglView = Director::getInstance()->getOpenGLView(); if(nullptr == eglView) return; if (eglView->isRetina()) { @@ -278,9 +278,9 @@ void EGLViewEventHandler::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } -void EGLViewEventHandler::onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y) +void GLViewEventHandler::onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y) { - EGLView* eglView = EGLView::getInstance(); + GLView* eglView = Director::getInstance()->getOpenGLView(); if(nullptr == eglView) return; EventMouse event(EventMouse::MouseEventType::MOUSE_SCROLL); @@ -290,7 +290,7 @@ void EGLViewEventHandler::onGLFWMouseScrollCallback(GLFWwindow* window, double x Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } -void EGLViewEventHandler::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) +void GLViewEventHandler::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) { if (GLFW_REPEAT != action) { @@ -300,19 +300,19 @@ void EGLViewEventHandler::onGLFWKeyCallback(GLFWwindow *window, int key, int sca } } -void EGLViewEventHandler::onGLFWCharCallback(GLFWwindow *window, unsigned int character) +void GLViewEventHandler::onGLFWCharCallback(GLFWwindow *window, unsigned int character) { IMEDispatcher::sharedDispatcher()->dispatchInsertText((const char*) &character, 1); } -void EGLViewEventHandler::onGLFWWindowPosCallback(GLFWwindow *windows, int x, int y) +void GLViewEventHandler::onGLFWWindowPosCallback(GLFWwindow *windows, int x, int y) { Director::getInstance()->setViewport(); } -void EGLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h) +void GLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h) { - auto view = EGLView::getInstance(); + auto view = Director::getInstance()->getOpenGLView(); float frameSizeW = view->getFrameSize().width; float frameSizeH = view->getFrameSize().height; @@ -334,16 +334,48 @@ void EGLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h } -//end EGLViewEventHandler +//end GLViewEventHandler ////////////////////////////////////////////////////////////////////////// -// implement EGLView +// implement GLView ////////////////////////////////////////////////////////////////////////// -EGLView* EGLView::s_pEglView = nullptr; -EGLView::EGLView() +GLView* GLView::create(const std::string& viewName) +{ + auto ret = new GLView; + if(ret && ret->initWithRect(viewName, Rect(0, 0, 960, 640), 1)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + auto ret = new GLView; + if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::createWithFullScreen(const std::string& viewName) +{ + auto ret = new GLView(); + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView::GLView() : _captured(false) , _frameZoomFactor(1.0f) , _supportTouch(false) @@ -351,32 +383,26 @@ EGLView::EGLView() , _mainWindow(nullptr) , _primaryMonitor(nullptr) { - CCASSERT(nullptr == s_pEglView, "EGLView is singleton, Should be inited only one time\n"); _viewName = "cocos2dx"; - s_pEglView = this; g_keyCodeMap.clear(); for (auto& item : g_keyCodeStructArray) { g_keyCodeMap[item.glfwKeyCode] = item.keyCode; } - glfwSetErrorCallback(EGLViewEventHandler::onGLFWError); + glfwSetErrorCallback(GLViewEventHandler::onGLFWError); glfwInit(); } -EGLView::~EGLView() +GLView::~GLView() { - CCLOGINFO("deallocing EGLView: %p", this); + CCLOGINFO("deallocing GLView: %p", this); glfwTerminate(); - s_pEglView = nullptr; } -bool EGLView::init(const std::string& viewName, float width, float height, float frameZoomFactor) +bool GLView::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) { - if(_mainWindow != nullptr) - return true; - setViewName(viewName); - setFrameSize(width, height); + setFrameSize(rect.size.width, rect.size.height); setFrameZoomFactor(frameZoomFactor); glfwWindowHint(GLFW_RESIZABLE,GL_FALSE); @@ -397,16 +423,16 @@ bool EGLView::init(const std::string& viewName, float width, float height, float { _isRetina = true; setFrameZoomFactor(frameZoomFactor * 2); - glfwSetWindowSize(_mainWindow, width/2 * _frameZoomFactor, height/2 * _frameZoomFactor); + glfwSetWindowSize(_mainWindow, rect.size.width/2 * _frameZoomFactor, rect.size.height/2 * _frameZoomFactor); } - glfwSetMouseButtonCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseCallBack); - glfwSetCursorPosCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseMoveCallBack); - glfwSetScrollCallback(_mainWindow, EGLViewEventHandler::onGLFWMouseScrollCallback); - glfwSetCharCallback(_mainWindow, EGLViewEventHandler::onGLFWCharCallback); - glfwSetKeyCallback(_mainWindow, EGLViewEventHandler::onGLFWKeyCallback); - glfwSetWindowPosCallback(_mainWindow, EGLViewEventHandler::onGLFWWindowPosCallback); - glfwSetFramebufferSizeCallback(_mainWindow, EGLViewEventHandler::onGLFWframebuffersize); + glfwSetMouseButtonCallback(_mainWindow, GLViewEventHandler::onGLFWMouseCallBack); + glfwSetCursorPosCallback(_mainWindow, GLViewEventHandler::onGLFWMouseMoveCallBack); + glfwSetScrollCallback(_mainWindow, GLViewEventHandler::onGLFWMouseScrollCallback); + glfwSetCharCallback(_mainWindow, GLViewEventHandler::onGLFWCharCallback); + glfwSetKeyCallback(_mainWindow, GLViewEventHandler::onGLFWKeyCallback); + glfwSetWindowPosCallback(_mainWindow, GLViewEventHandler::onGLFWWindowPosCallback); + glfwSetFramebufferSizeCallback(_mainWindow, GLViewEventHandler::onGLFWframebuffersize); // check OpenGL version at first const GLubyte* glVersion = glGetString(GL_VERSION); @@ -428,34 +454,34 @@ bool EGLView::init(const std::string& viewName, float width, float height, float return true; } -bool EGLView::initWithFullScreen(const std::string& viewName) +bool GLView::initWithFullScreen(const std::string& viewName) { _primaryMonitor = glfwGetPrimaryMonitor(); if (nullptr == _primaryMonitor) return false; const GLFWvidmode* videoMode = glfwGetVideoMode(_primaryMonitor); - return init(viewName, videoMode->width, videoMode->height, 1.0f); + return initWithRect(viewName, Rect(0, 0, videoMode->width, videoMode->height), 1.0f); } -bool EGLView::isOpenGLReady() +bool GLView::isOpenGLReady() { return nullptr != _mainWindow; } -void EGLView::end() +void GLView::end() { if(_mainWindow) glfwSetWindowShouldClose(_mainWindow,1); } -void EGLView::swapBuffers() +void GLView::swapBuffers() { if(_mainWindow) glfwSwapBuffers(_mainWindow); } -bool EGLView::windowShouldClose() +bool GLView::windowShouldClose() { if(_mainWindow) return glfwWindowShouldClose(_mainWindow); @@ -463,33 +489,33 @@ bool EGLView::windowShouldClose() return true; } -void EGLView::pollEvents() +void GLView::pollEvents() { glfwPollEvents(); } -void EGLView::setIMEKeyboardState(bool /*bOpen*/) +void GLView::setIMEKeyboardState(bool /*bOpen*/) { } -void EGLView::setFrameZoomFactor(float zoomFactor) +void GLView::setFrameZoomFactor(float zoomFactor) { _frameZoomFactor = zoomFactor; Director::getInstance()->setProjection(Director::getInstance()->getProjection()); } -float EGLView::getFrameZoomFactor() +float GLView::getFrameZoomFactor() { return _frameZoomFactor; } -void EGLView::setFrameSize(float width, float height) +void GLView::setFrameSize(float width, float height) { - EGLViewProtocol::setFrameSize(width, height); + GLViewProtocol::setFrameSize(width, height); } -void EGLView::setViewPortInPoints(float x , float y , float w , float h) +void GLView::setViewPortInPoints(float x , float y , float w , float h) { glViewport((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor), (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), @@ -497,7 +523,7 @@ void EGLView::setViewPortInPoints(float x , float y , float w , float h) (GLsizei)(h * _scaleY * _frameZoomFactor)); } -void EGLView::setScissorInPoints(float x , float y , float w , float h) +void GLView::setScissorInPoints(float x , float y , float w , float h) { glScissor((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor), (GLint)(y * _scaleY * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor), @@ -505,18 +531,6 @@ void EGLView::setScissorInPoints(float x , float y , float w , float h) (GLsizei)(h * _scaleY * _frameZoomFactor)); } -EGLView* EGLView::getInstance() -{ - CCASSERT(nullptr != s_pEglView, "EGL singleton should not be null"); - return s_pEglView; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) static bool glew_dynamic_binding() { @@ -582,7 +596,7 @@ static bool glew_dynamic_binding() #endif // helper -bool EGLView::initGlew() +bool GLView::initGlew() { #if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) GLenum GlewInitResult = glewInit(); diff --git a/cocos/2d/platform/desktop/CCEGLView.h b/cocos/2d/platform/desktop/CCGLView.h similarity index 74% rename from cocos/2d/platform/desktop/CCEGLView.h rename to cocos/2d/platform/desktop/CCGLView.h index 12670e2458..07ee153c1f 100644 --- a/cocos/2d/platform/desktop/CCEGLView.h +++ b/cocos/2d/platform/desktop/CCGLView.h @@ -26,52 +26,29 @@ THE SOFTWARE. #ifndef __CC_EGLVIEW_DESKTOP_H__ #define __CC_EGLVIEW_DESKTOP_H__ +#include "CCObject.h" #include "platform/CCCommon.h" -#include "platform/CCEGLViewProtocol.h" +#include "platform/CCGLViewProtocol.h" #include "glfw3.h" NS_CC_BEGIN -class CC_DLL EGLView : public EGLViewProtocol +class CC_DLL GLView : public Object, public GLViewProtocol { public: - // static function - /** - @brief get the shared main open gl window - */ - static EGLView* getInstance(); + static GLView* create(const std::string& viewName); + static GLView* createWithRect(const std::string& viewName, Rect size, float frameZoomFactor = 1.0f); + static GLView* createWithFullScreen(const std::string& viewName); - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); - - /** - * @js ctor - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - virtual ~EGLView(); - - /* override functions */ - virtual bool isOpenGLReady(); - virtual void end(); - virtual void swapBuffers(); - virtual void setFrameSize(float width, float height); - virtual void setIMEKeyboardState(bool bOpen); /* *frameZoomFactor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. */ - bool init(const std::string& viewName, float width, float height, float frameZoomFactor = 1.0f); - bool initWithFullScreen(const std::string& viewName); //void resize(int width, int height); - float getFrameZoomFactor(); + float getFrameZoomFactor(); //void centerWindow(); - virtual void setViewPortInPoints(float x , float y , float w , float h); virtual void setScissorInPoints(float x , float y , float w , float h); @@ -80,7 +57,20 @@ public: void pollEvents(); GLFWwindow* getWindow() const { return _mainWindow; } + /* override functions */ + virtual bool isOpenGLReady() override; + virtual void end() override; + virtual void swapBuffers() override; + virtual void setFrameSize(float width, float height) override; + virtual void setIMEKeyboardState(bool bOpen) override; + protected: + GLView(); + virtual ~GLView(); + + bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor); + bool initWithFullScreen(const std::string& viewName); + /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. */ @@ -93,11 +83,13 @@ protected: bool _isRetina; float _frameZoomFactor; - static EGLView* s_pEglView; GLFWwindow* _mainWindow; GLFWmonitor* _primaryMonitor; - friend class EGLViewEventHandler; + friend class GLViewEventHandler; + +private: + CC_DISALLOW_COPY_AND_ASSIGN(GLView); }; NS_CC_END // end of namespace cocos2d diff --git a/cocos/2d/platform/ios/CCApplication.h b/cocos/2d/platform/ios/CCApplication.h index 843a5d5b99..b2a9ad8d95 100644 --- a/cocos/2d/platform/ios/CCApplication.h +++ b/cocos/2d/platform/ios/CCApplication.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_APPLICATION_IOS_H__ #define __CC_APPLICATION_IOS_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" @@ -90,4 +93,6 @@ protected: NS_CC_END +#endif // CC_PLATFORM_IOS + #endif // end of __CC_APPLICATION_IOS_H__ diff --git a/cocos/2d/platform/ios/CCApplication.mm b/cocos/2d/platform/ios/CCApplication.mm index 14b07975ca..052cfa0665 100644 --- a/cocos/2d/platform/ios/CCApplication.mm +++ b/cocos/2d/platform/ios/CCApplication.mm @@ -25,6 +25,8 @@ #import "CCApplication.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import "CCGeometry.h" @@ -108,6 +110,9 @@ LanguageType Application::getCurrentLanguage() else if ([languageCode isEqualToString:@"es"]){ ret = LanguageType::SPANISH; } + else if ([languageCode isEqualToString:@"nl"]){ + ret = LanguageType::DUTCH; + } else if ([languageCode isEqualToString:@"ru"]){ ret = LanguageType::RUSSIAN; } @@ -152,3 +157,5 @@ void Application::applicationScreenSizeChanged(int newWidth, int newHeight) { } NS_CC_END + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm index 28d0dd0e22..83012c3569 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/2d/platform/ios/CCCommon.mm @@ -23,6 +23,9 @@ THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "platform/CCCommon.h" #include @@ -54,3 +57,5 @@ void LuaLog(const char * format) } NS_CC_END + +#endif // CC_PLATFORM_IOS \ No newline at end of file diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm index a80efef136..cbf04d092f 100644 --- a/cocos/2d/platform/ios/CCDevice.mm +++ b/cocos/2d/platform/ios/CCDevice.mm @@ -22,6 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCDevice.h" #include "ccTypes.h" #include "CCEventDispatcher.h" @@ -174,3 +179,5 @@ void Device::setAccelerometerInterval(float interval) NS_CC_END + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/EAGLView.h b/cocos/2d/platform/ios/CCEAGLView.h similarity index 98% rename from cocos/2d/platform/ios/EAGLView.h rename to cocos/2d/platform/ios/CCEAGLView.h index 7a8f9c54d8..fe80ab099c 100644 --- a/cocos/2d/platform/ios/EAGLView.h +++ b/cocos/2d/platform/ios/CCEAGLView.h @@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import #import @@ -119,9 +122,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. /** creates an initializes an CCEAGLView with a frame, a color buffer format, a depth buffer format, a sharegroup, and multisamping */ + (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples; -// get the view object -+(id) sharedEGLView; - /** Initializes an CCEAGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer */ - (id) initWithFrame:(CGRect)frame; //These also set the current context /** Initializes an CCEAGLView with a frame, a color buffer format, and 0-bit depth buffer */ @@ -155,3 +155,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. -(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis; -(void) doAnimationWhenAnotherEditBeClicked; @end + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/EAGLView.mm b/cocos/2d/platform/ios/CCEAGLView.mm similarity index 93% rename from cocos/2d/platform/ios/EAGLView.mm rename to cocos/2d/platform/ios/CCEAGLView.mm index e6ab5db271..dcae32d0ea 100644 --- a/cocos/2d/platform/ios/EAGLView.mm +++ b/cocos/2d/platform/ios/CCEAGLView.mm @@ -61,22 +61,23 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import -#import "CCEGLView.h" -#import "EAGLView.h" +#import "CCGLView.h" +#import "CCEAGLView.h" #import "CCES2Renderer.h" #import "CCDirector.h" #import "CCSet.h" #import "CCTouch.h" #import "CCIMEDispatcher.h" #import "OpenGL_Internal.h" -#import "CCEGLView.h" +#import "CCGLView.h" //CLASS IMPLEMENTATIONS: #define IOS_MAX_TOUCHES_COUNT 10 -static CCEAGLView *__view = 0; - @interface CCEAGLView (Private) - (BOOL) setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup; - (unsigned int) convertPixelFormat:(NSString*) pixelFormat; @@ -115,11 +116,6 @@ static CCEAGLView *__view = 0; return [[[self alloc]initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:retained sharegroup:sharegroup multiSampling:multisampling numberOfSamples:samples] autorelease]; } -+ (id) sharedEGLView -{ - return __view; -} - - (id) initWithFrame:(CGRect)frame { return [self initWithFrame:frame pixelFormat:kEAGLColorFormatRGB565 depthFormat:0 preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0]; @@ -146,15 +142,13 @@ static CCEAGLView *__view = 0; return nil; } - - __view = self; - + originalRect_ = self.frame; self.keyboardShowNotification = nil; - if ([__view respondsToSelector:@selector(setContentScaleFactor:)]) + if ([self respondsToSelector:@selector(setContentScaleFactor:)]) { - __view.contentScaleFactor = [[UIScreen mainScreen] scale]; + self.contentScaleFactor = [[UIScreen mainScreen] scale]; } } @@ -180,7 +174,6 @@ static CCEAGLView *__view = 0; } } - __view = self; return self; } @@ -409,11 +402,13 @@ static CCEAGLView *__view = 0; int i = 0; for (UITouch *touch in touches) { ids[i] = touch; - xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;; - ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;; + xs[i] = [touch locationInView: [touch view]].x * self.contentScaleFactor;; + ys[i] = [touch locationInView: [touch view]].y * self.contentScaleFactor;; ++i; } - cocos2d::EGLView::getInstance()->handleTouchesBegin(i, (int*)ids, xs, ys); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + glview->handleTouchesBegin(i, (int*)ids, xs, ys); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event @@ -429,11 +424,13 @@ static CCEAGLView *__view = 0; int i = 0; for (UITouch *touch in touches) { ids[i] = touch; - xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;; - ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;; + xs[i] = [touch locationInView: [touch view]].x * self.contentScaleFactor;; + ys[i] = [touch locationInView: [touch view]].y * self.contentScaleFactor;; ++i; } - cocos2d::EGLView::getInstance()->handleTouchesMove(i, (int*)ids, xs, ys); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + glview->handleTouchesMove(i, (int*)ids, xs, ys); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event @@ -450,11 +447,13 @@ static CCEAGLView *__view = 0; int i = 0; for (UITouch *touch in touches) { ids[i] = touch; - xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;; - ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;; + xs[i] = [touch locationInView: [touch view]].x * self.contentScaleFactor;; + ys[i] = [touch locationInView: [touch view]].y * self.contentScaleFactor;; ++i; } - cocos2d::EGLView::getInstance()->handleTouchesEnd(i, (int*)ids, xs, ys); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + glview->handleTouchesEnd(i, (int*)ids, xs, ys); } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event @@ -471,11 +470,13 @@ static CCEAGLView *__view = 0; int i = 0; for (UITouch *touch in touches) { ids[i] = touch; - xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;; - ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;; + xs[i] = [touch locationInView: [touch view]].x * self.contentScaleFactor;; + ys[i] = [touch locationInView: [touch view]].y * self.contentScaleFactor;; ++i; } - cocos2d::EGLView::getInstance()->handleTouchesCancel(i, (int*)ids, xs, ys); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + glview->handleTouchesCancel(i, (int*)ids, xs, ys); } #pragma mark - UIView - Responder @@ -794,9 +795,10 @@ static CCEAGLView *__view = 0; default: break; } - - float scaleX = cocos2d::EGLView::getInstance()->getScaleX(); - float scaleY = cocos2d::EGLView::getInstance()->getScaleY(); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + float scaleX = glview->getScaleX(); + float scaleY = glview->getScaleY(); if (self.contentScaleFactor == 2.0f) @@ -807,7 +809,7 @@ static CCEAGLView *__view = 0; end = CGRectApplyAffineTransform(end, CGAffineTransformScale(CGAffineTransformIdentity, 2.0f, 2.0f)); } - float offestY = cocos2d::EGLView::getInstance()->getViewPortRect().origin.y; + float offestY = glview->getViewPortRect().origin.y; CCLOG("offestY = %f", offestY); if (offestY < 0.0f) { @@ -866,11 +868,12 @@ static CCEAGLView *__view = 0; [UIView setAnimationDuration:duration]; [UIView setAnimationBeginsFromCurrentState:YES]; - //NSLog(@"[animation] dis = %f, scale = %f \n", dis, cocos2d::EGLView::getInstance()->getScaleY()); + //NSLog(@"[animation] dis = %f, scale = %f \n", dis, cocos2d::GLView::getInstance()->getScaleY()); if (dis < 0.0f) dis = 0.0f; - dis *= cocos2d::EGLView::getInstance()->getScaleY(); + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + dis *= glview->getScaleY(); if (self.contentScaleFactor == 2.0f) { @@ -912,3 +915,5 @@ static CCEAGLView *__view = 0; } @end + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCEGLView.h b/cocos/2d/platform/ios/CCEGLView.h deleted file mode 100644 index 3dce046feb..0000000000 --- a/cocos/2d/platform/ios/CCEGLView.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - 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 __CC_EGLVIEW_IPHONE_H__ -#define __CC_EGLVIEW_IPHONE_H__ - -#include "platform/CCCommon.h" -#include "platform/CCEGLViewProtocol.h" - -NS_CC_BEGIN - - - -class CC_DLL EGLView : public EGLViewProtocol -{ -public: - /** - * @js NA - * @lua NA - */ - EGLView(); - /** - * @js NA - * @lua NA - */ - ~EGLView(); - /** - * @js NA - * @lua NA - */ - virtual bool isOpenGLReady(); - /** - * @js NA - * @lua NA - */ - virtual bool setContentScaleFactor(float contentScaleFactor); - - // keep compatible - /** - * @js NA - * @lua NA - */ - virtual void end(); - /** - * @js NA - * @lua NA - */ - virtual void swapBuffers(); - /** - * @js NA - * @lua NA - */ - virtual void setIMEKeyboardState(bool bOpen); - - /** returns the singleton - * @js NA - */ - static EGLView* getInstance(); - - /** @deprecated Use getInstance() instead - * @js NA - * @lua NA - */ - CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView(); - -}; - -NS_CC_END - -#endif // end of __CC_EGLVIEW_IPHONE_H__ diff --git a/cocos/2d/platform/ios/CCEGLView.mm b/cocos/2d/platform/ios/CCEGLView.mm deleted file mode 100644 index 399b365e56..0000000000 --- a/cocos/2d/platform/ios/CCEGLView.mm +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - 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 "EAGLView.h" -#include "CCDirectorCaller.h" -#include "CCEGLView.h" -#include "CCSet.h" -#include "CCTouch.h" - -NS_CC_BEGIN - -EGLView::EGLView() -{ - _screenSize.width = _designResolutionSize.width = [[CCEAGLView sharedEGLView] getWidth]; - _screenSize.height = _designResolutionSize.height = [[CCEAGLView sharedEGLView] getHeight]; -} - -EGLView::~EGLView() -{ - -} - -bool EGLView::isOpenGLReady() -{ - return [CCEAGLView sharedEGLView] != nullptr; -} - -bool EGLView::setContentScaleFactor(float contentScaleFactor) -{ - assert(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode - - _scaleX = _scaleY = contentScaleFactor; - [[CCEAGLView sharedEGLView] setNeedsLayout]; - - return true; -} - -void EGLView::end() -{ - [CCDirectorCaller destroy]; - - // destroy EAGLView - [[CCEAGLView sharedEGLView] removeFromSuperview]; -} - - -void EGLView::swapBuffers() -{ - [[CCEAGLView sharedEGLView] swapBuffers]; -} - -void EGLView::setIMEKeyboardState(bool bOpen) -{ - if (bOpen) - { - [[CCEAGLView sharedEGLView] becomeFirstResponder]; - } - else - { - [[CCEAGLView sharedEGLView] resignFirstResponder]; - } -} - -EGLView* EGLView::getInstance() -{ - static EGLView instance; - return &instance; -} - -// XXX: deprecated -EGLView* EGLView::sharedOpenGLView() -{ - return EGLView::getInstance(); -} - -NS_CC_END - diff --git a/cocos/2d/platform/ios/CCES2Renderer.h b/cocos/2d/platform/ios/CCES2Renderer.h index 1c25466fe4..5cd1fe47db 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.h +++ b/cocos/2d/platform/ios/CCES2Renderer.h @@ -27,6 +27,10 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import "CCPlatformMacros.h" #import "CCESRenderer.h" #import @@ -76,4 +80,4 @@ @end - +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCES2Renderer.m b/cocos/2d/platform/ios/CCES2Renderer.m index 3f3a226e82..4c687c2d38 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.m +++ b/cocos/2d/platform/ios/CCES2Renderer.m @@ -28,8 +28,11 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "CCPlatformMacros.h" #import "CCES2Renderer.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + +#import "CCPlatformMacros.h" #import "OpenGL_Internal.h" #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 @@ -251,3 +254,5 @@ @end +#endif // CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h index e35ea686e1..dd331a49d5 100644 --- a/cocos/2d/platform/ios/CCESRenderer.h +++ b/cocos/2d/platform/ios/CCESRenderer.h @@ -27,6 +27,10 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCPlatformMacros.h" #import @@ -48,3 +52,4 @@ - (unsigned int) msaaColorBuffer; @end +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCGL.h b/cocos/2d/platform/ios/CCGL.h index 6104a7fcfd..6b306950c3 100644 --- a/cocos/2d/platform/ios/CCGL.h +++ b/cocos/2d/platform/ios/CCGL.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __PLATFORM_IOS_CCGL_H__ #define __PLATFORM_IOS_CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #define glClearDepth glClearDepthf #define glDeleteVertexArrays glDeleteVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES @@ -39,5 +42,7 @@ THE SOFTWARE. #include #include +#endif // CC_PLATFORM_IOS #endif // __PLATFORM_IOS_CCGL_H__ + diff --git a/cocos/2d/platform/ios/CCGLView.h b/cocos/2d/platform/ios/CCGLView.h new file mode 100644 index 0000000000..0196066d36 --- /dev/null +++ b/cocos/2d/platform/ios/CCGLView.h @@ -0,0 +1,90 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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 __CC_EGLVIEW_IPHONE_H__ +#define __CC_EGLVIEW_IPHONE_H__ + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + +#include "CCObject.h" +#include "platform/CCCommon.h" +#include "platform/CCGLViewProtocol.h" + +NS_CC_BEGIN + + +/** Class that represent the OpenGL View + */ +class CC_DLL GLView : public Object, public GLViewProtocol +{ +public: + /** creates a GLView with a objective-c CCEAGLView instance */ + static GLView* createWithEAGLView(void* eaglview); + + /** creates a GLView with a title name in fullscreen mode */ + static GLView* create(const std::string& viewName); + + /** creates a GLView with a title name, a rect and the zoom factor */ + static GLView* createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor = 1.0f); + + /** creates a GLView with a name in fullscreen mode */ + static GLView* createWithFullScreen(const std::string& viewName); + + /** sets the content scale factor */ + bool setContentScaleFactor(float contentScaleFactor); + + /** returns the content scale factor */ + float getContentScaleFactor() const; + + /** returns whether or not the view is in Retina Display mode */ + bool isRetinaDisplay() const { return getContentScaleFactor() == 2.0; } + + /** returns the objective-c CCEAGLView instance */ + void* getEAGLView() const { return _eaglview; } + + // overrides + virtual bool isOpenGLReady() override; + virtual void end() override; + virtual void swapBuffers() override; + virtual void setIMEKeyboardState(bool bOpen) override; + +protected: + GLView(); + virtual ~GLView(); + + bool initWithEAGLView(void* eaglview); + bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor); + bool initWithFullScreen(const std::string& viewName); + + // the objective-c CCEAGLView instance + void *_eaglview; +}; + +NS_CC_END + +#endif // CC_PLATFORM_IOS + +#endif // end of __CC_EGLVIEW_IPHONE_H__ diff --git a/cocos/2d/platform/ios/CCGLView.mm b/cocos/2d/platform/ios/CCGLView.mm new file mode 100644 index 0000000000..87062f4f21 --- /dev/null +++ b/cocos/2d/platform/ios/CCGLView.mm @@ -0,0 +1,201 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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 "CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + +#import + +#include "CCEAGLView.h" +#include "CCDirectorCaller.h" +#include "CCGLView.h" +#include "CCSet.h" +#include "CCTouch.h" + +NS_CC_BEGIN + +GLView* GLView::createWithEAGLView(void *eaglview) +{ + auto ret = new GLView; + if(ret && ret->initWithEAGLView(eaglview)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::create(const std::string& viewName) +{ + auto ret = new GLView; + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + auto ret = new GLView; + if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView* GLView::createWithFullScreen(const std::string& viewName) +{ + auto ret = new GLView(); + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLView::GLView() +{ +} + +GLView::~GLView() +{ + CCEAGLView *glview = (CCEAGLView*) _eaglview; + [glview release]; +} + +bool GLView::initWithEAGLView(void *eaglview) +{ + _eaglview = eaglview; + CCEAGLView *glview = (CCEAGLView*) _eaglview; + + _screenSize.width = _designResolutionSize.width = [glview getWidth]; + _screenSize.height = _designResolutionSize.height = [glview getHeight]; +// _scaleX = _scaleY = [glview contentScaleFactor]; + + return true; +} + +bool GLView::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + CGRect r = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); + CCEAGLView *eaglview = [CCEAGLView viewWithFrame: r + pixelFormat: kEAGLColorFormatRGB565 + depthFormat: GL_DEPTH24_STENCIL8_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0]; + [eaglview setMultipleTouchEnabled:YES]; + + _screenSize.width = _designResolutionSize.width = [eaglview getWidth]; + _screenSize.height = _designResolutionSize.height = [eaglview getHeight]; +// _scaleX = _scaleY = [eaglview contentScaleFactor]; + + _eaglview = eaglview; + + return true; +} + +bool GLView::initWithFullScreen(const std::string& viewName) +{ + CGRect rect = [[UIScreen mainScreen] bounds]; + Rect r; + r.origin.x = rect.origin.x; + r.origin.y = rect.origin.y; + r.size.width = rect.size.width; + r.size.height = rect.size.height; + + return initWithRect(viewName, r, 1); +} + +bool GLView::isOpenGLReady() +{ + return _eaglview != nullptr; +} + +bool GLView::setContentScaleFactor(float contentScaleFactor) +{ + CC_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode + _scaleX = _scaleY = contentScaleFactor; + + CCEAGLView *eaglview = (CCEAGLView*) _eaglview; + [eaglview setNeedsLayout]; + + return true; +} + +float GLView::getContentScaleFactor() const +{ + CCEAGLView *eaglview = (CCEAGLView*) _eaglview; + + float scaleFactor = [eaglview contentScaleFactor]; + +// CCASSERT(scaleFactor == _scaleX == _scaleY, "Logic error in GLView::getContentScaleFactor"); + + return scaleFactor; +} + +void GLView::end() +{ + [CCDirectorCaller destroy]; + + // destroy EAGLView + CCEAGLView *eaglview = (CCEAGLView*) _eaglview; + + [eaglview removeFromSuperview]; + [eaglview release]; +} + + +void GLView::swapBuffers() +{ + CCEAGLView *eaglview = (CCEAGLView*) _eaglview; + [eaglview swapBuffers]; +} + +void GLView::setIMEKeyboardState(bool open) +{ + CCEAGLView *eaglview = (CCEAGLView*) _eaglview; + + if (open) + { + [eaglview becomeFirstResponder]; + } + else + { + [eaglview resignFirstResponder]; + } +} + +NS_CC_END + +#endif // CC_PLATFOR_IOS + diff --git a/cocos/2d/platform/ios/CCImage.mm b/cocos/2d/platform/ios/CCImage.mm index 5ad55ce594..4d5ba92fe9 100644 --- a/cocos/2d/platform/ios/CCImage.mm +++ b/cocos/2d/platform/ios/CCImage.mm @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCImageCommon_cpp.h" #import "CCImage.h" @@ -468,3 +472,5 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB) NS_CC_END +#endif // CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCPlatformDefine.h b/cocos/2d/platform/ios/CCPlatformDefine.h index 02f7c89eba..e6538ef662 100644 --- a/cocos/2d/platform/ios/CCPlatformDefine.h +++ b/cocos/2d/platform/ios/CCPlatformDefine.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include #define CC_DLL @@ -44,5 +47,6 @@ THE SOFTWARE. #endif +#endif // CC_PLATFORM_IOS #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h index 804abebceb..af440f0e6e 100644 --- a/cocos/2d/platform/ios/CCStdC.h +++ b/cocos/2d/platform/ios/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCPlatformMacros.h" #include #include @@ -45,4 +48,5 @@ THE SOFTWARE. #define MAX(x,y) (((x) < (y)) ? (y) : (x)) #endif // MAX +#endif // CC_PLATFORM_IOS #endif // __CC_STD_C_H__ diff --git a/cocos/2d/platform/ios/OpenGL_Internal.h b/cocos/2d/platform/ios/OpenGL_Internal.h index 9bc7a1860f..a0022582a8 100644 --- a/cocos/2d/platform/ios/OpenGL_Internal.h +++ b/cocos/2d/platform/ios/OpenGL_Internal.h @@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + /* Generic error reporting */ #define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String]) @@ -79,3 +82,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #endif #define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__)) #define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); } + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h index 972843302c..49ef7c1276 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h @@ -23,6 +23,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import // when compiling to ARM (iPhone device), hide everything and use system defaults @@ -73,4 +77,6 @@ THE SOFTWARE. @end -#endif +#endif // !TARGET_CPU_ARM + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m index 0a93a263e9..5056ce9522 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m @@ -26,6 +26,8 @@ THE SOFTWARE. #import "AccelerometerSimulation.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + // when compiling to ARM (iPhone device), hide everything and use system defaults // if you wish to use simulation mode even on the device, remove the #if/#endif #if !TARGET_CPU_ARM @@ -263,4 +265,6 @@ static CCAccelerometerSimulation *sharedAccelerometer = NULL; } @end -#endif +#endif // !TARGET_CPU_ARM + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/linux/CCApplication.cpp b/cocos/2d/platform/linux/CCApplication.cpp index f2efa5b7de..97ae71ba74 100644 --- a/cocos/2d/platform/linux/CCApplication.cpp +++ b/cocos/2d/platform/linux/CCApplication.cpp @@ -23,13 +23,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "CCApplication.h" #include #include #include #include "CCDirector.h" #include "platform/CCFileUtils.h" -#include "CCEGLView.h" +#include "CCGLView.h" NS_CC_BEGIN @@ -38,61 +41,62 @@ NS_CC_BEGIN Application * Application::sm_pSharedApplication = 0; static long getCurrentMillSecond() { - long lLastTime; - struct timeval stCurrentTime; + long lLastTime; + struct timeval stCurrentTime; - gettimeofday(&stCurrentTime,NULL); - lLastTime = stCurrentTime.tv_sec*1000+stCurrentTime.tv_usec*0.001; //millseconds - return lLastTime; + gettimeofday(&stCurrentTime,NULL); + lLastTime = stCurrentTime.tv_sec*1000+stCurrentTime.tv_usec*0.001; //millseconds + return lLastTime; } Application::Application() { - CC_ASSERT(! sm_pSharedApplication); - sm_pSharedApplication = this; + CC_ASSERT(! sm_pSharedApplication); + sm_pSharedApplication = this; } Application::~Application() { - CC_ASSERT(this == sm_pSharedApplication); - sm_pSharedApplication = NULL; - _animationInterval = 1.0f/60.0f*1000.0f; + CC_ASSERT(this == sm_pSharedApplication); + sm_pSharedApplication = NULL; + _animationInterval = 1.0f/60.0f*1000.0f; } int Application::run() { - // Initialize instance and cocos2d. - if (! applicationDidFinishLaunching()) - { - return 0; - } - - EGLView* pMainWnd = EGLView::getInstance(); - - while (!pMainWnd->windowShouldClose()) + // Initialize instance and cocos2d. + if (! applicationDidFinishLaunching()) { - long iLastTime = getCurrentMillSecond(); - Director::getInstance()->mainLoop(); - pMainWnd->pollEvents(); - long iCurTime = getCurrentMillSecond(); - if (iCurTime-iLastTime<_animationInterval){ - usleep((_animationInterval - iCurTime+iLastTime)*1000); - } + return 0; + } + + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + + while (!glview->windowShouldClose()) + { + long iLastTime = getCurrentMillSecond(); + director->mainLoop(); + glview->pollEvents(); + long iCurTime = getCurrentMillSecond(); + if (iCurTime-iLastTime<_animationInterval){ + usleep((_animationInterval - iCurTime+iLastTime)*1000); + } } /* Only work on Desktop * Director::mainLoop is really one frame logic * when we want to close the window, we should call Director::end(); * then call Director::mainLoop to do release of internal resources */ - Director::getInstance()->end(); - Director::getInstance()->mainLoop(); - return -1; + director->end(); + director->mainLoop(); + return -1; } void Application::setAnimationInterval(double interval) { - //TODO do something else - _animationInterval = interval*1000.0f; + //TODO do something else + _animationInterval = interval*1000.0f; } void Application::setResourceRootPath(const std::string& rootResDir) @@ -123,8 +127,8 @@ Application::Platform Application::getTargetPlatform() ////////////////////////////////////////////////////////////////////////// Application* Application::getInstance() { - CC_ASSERT(sm_pSharedApplication); - return sm_pSharedApplication; + CC_ASSERT(sm_pSharedApplication); + return sm_pSharedApplication; } // @deprecated Use getInstance() instead @@ -171,6 +175,10 @@ LanguageType Application::getCurrentLanguage() { ret = LanguageType::SPANISH; } + else if (0 == strcmp("nl", pLanguageName)) + { + ret = LanguageType::DUTCH; + } else if (0 == strcmp("ru", pLanguageName)) { ret = LanguageType::RUSSIAN; @@ -188,23 +196,26 @@ LanguageType Application::getCurrentLanguage() ret = LanguageType::HUNGARIAN; } else if (0 == strcmp("pt", pLanguageName)) - { - ret = LanguageType::PORTUGUESE; - } + { + ret = LanguageType::PORTUGUESE; + } else if (0 == strcmp("ar", pLanguageName)) - { - ret = LanguageType::ARABIC; - } - else if (0 == strcmp("nb", pLanguageName)) - { - ret = LanguageType::NORWEGIAN; - } - else if (0 == strcmp("pl", pLanguageName)) - { - ret = LanguageType::POLISH; - } - - return ret; + { + ret = LanguageType::ARABIC; + } + else if (0 == strcmp("nb", pLanguageName)) + { + ret = LanguageType::NORWEGIAN; + } + else if (0 == strcmp("pl", pLanguageName)) + { + ret = LanguageType::POLISH; + } + + return ret; } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + diff --git a/cocos/2d/platform/linux/CCApplication.h b/cocos/2d/platform/linux/CCApplication.h index 8c5c51ae60..e71e487f2f 100644 --- a/cocos/2d/platform/linux/CCApplication.h +++ b/cocos/2d/platform/linux/CCApplication.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef CCAPLICATION_H_ #define CCAPLICATION_H_ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" #include @@ -94,4 +97,6 @@ protected: NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #endif /* CCAPLICATION_H_ */ diff --git a/cocos/2d/platform/linux/CCCommon.cpp b/cocos/2d/platform/linux/CCCommon.cpp index c48307192b..8ef40e072c 100644 --- a/cocos/2d/platform/linux/CCCommon.cpp +++ b/cocos/2d/platform/linux/CCCommon.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "platform/CCCommon.h" #include "CCStdC.h" #include "CCConsole.h" @@ -39,3 +43,5 @@ void LuaLog(const char * format) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/platform/linux/CCDevice.cpp b/cocos/2d/platform/linux/CCDevice.cpp index 44457cdb6e..683522a337 100644 --- a/cocos/2d/platform/linux/CCDevice.cpp +++ b/cocos/2d/platform/linux/CCDevice.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "platform/CCDevice.h" #include #include @@ -64,3 +68,5 @@ void Device::setAccelerometerInterval(float interval) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp index 2d86c1ec87..7edfad170c 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "CCFileUtilsLinux.h" #include "platform/CCCommon.h" #include "ccMacros.h" @@ -114,3 +118,5 @@ bool FileUtilsLinux::isFileExist(const std::string& strFilePath) const } NS_CC_END + +#endif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.h b/cocos/2d/platform/linux/CCFileUtilsLinux.h index 20742b02f3..9a574edf6c 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.h +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CC_FILEUTILS_LINUX_H__ #define __CC_FILEUTILS_LINUX_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "platform/CCFileUtils.h" #include "CCPlatformMacros.h" #include "ccTypes.h" @@ -56,5 +59,6 @@ public: NS_CC_END -#endif // __CC_FILEUTILS_LINUX_H__ +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#endif // __CC_FILEUTILS_LINUX_H__ diff --git a/cocos/2d/platform/linux/CCGL.h b/cocos/2d/platform/linux/CCGL.h index 63b4b91b4a..f85e7b4640 100644 --- a/cocos/2d/platform/linux/CCGL.h +++ b/cocos/2d/platform/linux/CCGL.h @@ -25,8 +25,13 @@ THE SOFTWARE. #ifndef __CCGL_H__ #define __CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "GL/glew.h" #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #endif // __CCGL_H__ diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 9e1579f304..8add509d35 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include #include @@ -486,3 +490,5 @@ bool Image::initWithString( } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/platform/linux/CCPlatformDefine.h b/cocos/2d/platform/linux/CCPlatformDefine.h index 5d2a56ff31..77f17916da 100644 --- a/cocos/2d/platform/linux/CCPlatformDefine.h +++ b/cocos/2d/platform/linux/CCPlatformDefine.h @@ -22,9 +22,13 @@ 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 __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include #if defined(_USRDLL) @@ -47,5 +51,6 @@ THE SOFTWARE. #endif +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/linux/CCStdC.cpp b/cocos/2d/platform/linux/CCStdC.cpp index 9f47e9e17a..b72f1966b0 100644 --- a/cocos/2d/platform/linux/CCStdC.cpp +++ b/cocos/2d/platform/linux/CCStdC.cpp @@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "CCStdC.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) @@ -65,5 +68,6 @@ int CC_DLL gettimeofday(struct timeval * val, struct timezone *) return 0; } - #endif // CC_PLATFORM_WIN32 + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX diff --git a/cocos/2d/platform/linux/CCStdC.h b/cocos/2d/platform/linux/CCStdC.h index 5f3e24e8c0..4941bbe66b 100644 --- a/cocos/2d/platform/linux/CCStdC.h +++ b/cocos/2d/platform/linux/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #include "CCPlatformMacros.h" #include @@ -52,4 +55,6 @@ THE SOFTWARE. #define cosf cos #define sinf sin +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX + #endif // __CC_STD_C_H__ diff --git a/cocos/2d/platform/mac/CCApplication.h b/cocos/2d/platform/mac/CCApplication.h index 5a4c5bd8a5..ed39ee0f35 100644 --- a/cocos/2d/platform/mac/CCApplication.h +++ b/cocos/2d/platform/mac/CCApplication.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_APPLICATION_MAC_H__ #define __CC_APPLICATION_MAC_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" #include @@ -52,7 +55,7 @@ public: virtual void setAnimationInterval(double interval); /** - @brief Get status bar rectangle in EGLView window. + @brief Get status bar rectangle in GLView window. */ /** @@ -107,4 +110,6 @@ protected: NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #endif // end of __CC_APPLICATION_MAC_H__; diff --git a/cocos/2d/platform/mac/CCApplication.mm b/cocos/2d/platform/mac/CCApplication.mm index 0ece7367f4..99ac7613a6 100644 --- a/cocos/2d/platform/mac/CCApplication.mm +++ b/cocos/2d/platform/mac/CCApplication.mm @@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #import "CCApplication.h" #import #include @@ -30,7 +33,7 @@ THE SOFTWARE. #include "CCGeometry.h" #include "CCDirector.h" #import "CCDirectorCaller.h" -#include "CCEGLView.h" +#include "CCGLView.h" NS_CC_BEGIN @@ -54,12 +57,12 @@ int Application::run() { return 0; } - EGLView* pMainWnd = EGLView::getInstance(); + GLView* glview = Director::getInstance()->getOpenGLView(); - while (!pMainWnd->windowShouldClose()) + while (!glview->windowShouldClose()) { Director::getInstance()->mainLoop(); - pMainWnd->pollEvents(); + glview->pollEvents(); } /* Only work on Desktop @@ -130,6 +133,9 @@ LanguageType Application::getCurrentLanguage() else if ([languageCode isEqualToString:@"es"]){ ret = LanguageType::SPANISH; } + else if ([languageCode isEqualToString:@"nl"]){ + ret = LanguageType::DUTCH; + } else if ([languageCode isEqualToString:@"ru"]){ ret = LanguageType::RUSSIAN; } @@ -189,3 +195,5 @@ const std::string& Application::getStartupScriptFilename(void) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCCommon.mm b/cocos/2d/platform/mac/CCCommon.mm index d36241ee7b..5ff43269cd 100644 --- a/cocos/2d/platform/mac/CCCommon.mm +++ b/cocos/2d/platform/mac/CCCommon.mm @@ -22,8 +22,15 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include "platform/CCCommon.h" -#include "CCEGLView.h" + +#include "CCDirector.h" +#include "CCGLView.h" + #define GLFW_EXPOSE_NATIVE_NSGL #define GLFW_EXPOSE_NATIVE_COCOA #include "glfw3native.h" @@ -51,7 +58,8 @@ void MessageBox(const char * msg, const char * title) [alert setInformativeText:tmpTitle]; [alert setAlertStyle:NSWarningAlertStyle]; - id window = glfwGetCocoaWindow(EGLView::getInstance()->getWindow()); + GLView* glview = Director::getInstance()->getOpenGLView(); + id window = glfwGetCocoaWindow(glview->getWindow()); [alert beginSheetModalForWindow:window modalDelegate:[window delegate] didEndSelector:nil @@ -59,3 +67,6 @@ void MessageBox(const char * msg, const char * title) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC + diff --git a/cocos/2d/platform/mac/CCDevice.cpp b/cocos/2d/platform/mac/CCDevice.cpp index 4814ee8768..ec90cc36b6 100644 --- a/cocos/2d/platform/mac/CCDevice.cpp +++ b/cocos/2d/platform/mac/CCDevice.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include "platform/CCDevice.h" NS_CC_BEGIN @@ -43,3 +47,5 @@ void Device::setAccelerometerInterval(float interval) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCDirectorCaller.h b/cocos/2d/platform/mac/CCDirectorCaller.h index 87117073cb..7e7d9070c3 100644 --- a/cocos/2d/platform/mac/CCDirectorCaller.h +++ b/cocos/2d/platform/mac/CCDirectorCaller.h @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #import #import @@ -38,3 +42,5 @@ THE SOFTWARE. +(id) sharedDirectorCaller; @end + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCDirectorCaller.mm b/cocos/2d/platform/mac/CCDirectorCaller.mm index cb6536141c..ea32f5b6b2 100644 --- a/cocos/2d/platform/mac/CCDirectorCaller.mm +++ b/cocos/2d/platform/mac/CCDirectorCaller.mm @@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #import "CCDirectorCaller.h" #include "CCDirector.h" #include "CCAutoreleasePool.h" @@ -200,3 +203,5 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime } @end + +#endif //s CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCGL.h b/cocos/2d/platform/mac/CCGL.h index cfdb173068..5bd3bc4a58 100644 --- a/cocos/2d/platform/mac/CCGL.h +++ b/cocos/2d/platform/mac/CCGL.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __PLATFORM_MAC_CCGL_H__ #define __PLATFORM_MAC_CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #import #import #import @@ -42,3 +45,5 @@ THE SOFTWARE. #endif // __PLATFORM_MAC_CCGL_H__ + +#endif //s CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCImage.mm b/cocos/2d/platform/mac/CCImage.mm index fea424d8a6..5d27e0f9d0 100644 --- a/cocos/2d/platform/mac/CCImage.mm +++ b/cocos/2d/platform/mac/CCImage.mm @@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include "CCImageCommon_cpp.h" #include #include @@ -231,3 +234,4 @@ bool Image::initWithString( NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC diff --git a/cocos/2d/platform/mac/CCPlatformDefine.h b/cocos/2d/platform/mac/CCPlatformDefine.h index ca87ebf069..eaec140a36 100644 --- a/cocos/2d/platform/mac/CCPlatformDefine.h +++ b/cocos/2d/platform/mac/CCPlatformDefine.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include #define CC_DLL @@ -47,6 +50,6 @@ THE SOFTWARE. #endif #endif - +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/mac/CCStdC.h b/cocos/2d/platform/mac/CCStdC.h index 804abebceb..4f639579b5 100644 --- a/cocos/2d/platform/mac/CCStdC.h +++ b/cocos/2d/platform/mac/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #include "CCPlatformMacros.h" #include #include @@ -45,4 +48,6 @@ THE SOFTWARE. #define MAX(x,y) (((x) < (y)) ? (y) : (x)) #endif // MAX +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC + #endif // __CC_STD_C_H__ diff --git a/cocos/2d/platform/win32/CCApplication.cpp b/cocos/2d/platform/win32/CCApplication.cpp index 85fe2a4a4e..767917c0de 100644 --- a/cocos/2d/platform/win32/CCApplication.cpp +++ b/cocos/2d/platform/win32/CCApplication.cpp @@ -22,8 +22,12 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "CCApplication.h" -#include "CCEGLView.h" +#include "CCGLView.h" #include "CCDirector.h" #include #include "platform/CCFileUtils.h" @@ -72,16 +76,17 @@ int Application::run() return 0; } - EGLView* pMainWnd = EGLView::getInstance(); + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); - while(!pMainWnd->windowShouldClose()) + while(!glview->windowShouldClose()) { QueryPerformanceCounter(&nNow); if (nNow.QuadPart - nLast.QuadPart > _animationInterval.QuadPart) { nLast.QuadPart = nNow.QuadPart; - Director::getInstance()->mainLoop(); - pMainWnd->pollEvents(); + director->mainLoop(); + glview->pollEvents(); } else { @@ -94,8 +99,8 @@ int Application::run() * when we want to close the window, we should call Director::end(); * then call Director::mainLoop to do release of internal resources */ - Director::getInstance()->end(); - Director::getInstance()->mainLoop(); + director->end(); + director->mainLoop(); return true; } @@ -148,6 +153,9 @@ LanguageType Application::getCurrentLanguage() case LANG_SPANISH: ret = LanguageType::SPANISH; break; + case LANG_DUTCH: + ret = LanguageType::DUTCH; + break; case LANG_RUSSIAN: ret = LanguageType::RUSSIAN; break; @@ -245,3 +253,5 @@ static void PVRFrameEnableControlWindow(bool bEnable) RegCloseKey(hKey); } + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/2d/platform/win32/CCApplication.h b/cocos/2d/platform/win32/CCApplication.h index bd392a4f8c..c003280228 100644 --- a/cocos/2d/platform/win32/CCApplication.h +++ b/cocos/2d/platform/win32/CCApplication.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CC_APPLICATION_WIN32_H__ #define __CC_APPLICATION_WIN32_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "CCStdC.h" #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" @@ -101,4 +104,6 @@ protected: NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #endif // __CC_APPLICATION_WIN32_H__ diff --git a/cocos/2d/platform/win32/CCCommon.cpp b/cocos/2d/platform/win32/CCCommon.cpp index 3aa3d6458f..86aa90f293 100644 --- a/cocos/2d/platform/win32/CCCommon.cpp +++ b/cocos/2d/platform/win32/CCCommon.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "platform/CCCommon.h" #include "CCStdC.h" @@ -55,3 +59,5 @@ void LuaLog(const char *pszMsg) } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/2d/platform/win32/CCDevice.cpp b/cocos/2d/platform/win32/CCDevice.cpp index e934679bdc..50c0bb579c 100644 --- a/cocos/2d/platform/win32/CCDevice.cpp +++ b/cocos/2d/platform/win32/CCDevice.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "platform/CCDevice.h" #include "CCStdC.h" @@ -47,4 +51,6 @@ void Device::setAccelerometerEnabled(bool isEnabled) void Device::setAccelerometerInterval(float interval) {} -NS_CC_END \ No newline at end of file +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp index 8f70d1ba88..a1ce524bbe 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp @@ -22,6 +22,10 @@ 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 "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "CCFileUtilsWin32.h" #include "platform/CCCommon.h" #include @@ -303,3 +307,6 @@ string FileUtilsWin32::getWritablePath() const } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.h b/cocos/2d/platform/win32/CCFileUtilsWin32.h index d11d148f07..6441e61037 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.h +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CC_FILEUTILS_WIN32_H__ #define __CC_FILEUTILS_WIN32_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "platform/CCFileUtils.h" #include "CCPlatformMacros.h" #include "ccTypes.h" @@ -101,5 +104,7 @@ protected: NS_CC_END +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #endif // __CC_FILEUTILS_WIN32_H__ diff --git a/cocos/2d/platform/win32/CCGL.h b/cocos/2d/platform/win32/CCGL.h index 4d2d0f9002..6f6a9fee9f 100644 --- a/cocos/2d/platform/win32/CCGL.h +++ b/cocos/2d/platform/win32/CCGL.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CCGL_H__ #define __CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #include "GL/glew.h" #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 @@ -36,4 +39,6 @@ THE SOFTWARE. #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #endif // __CCGL_H__ diff --git a/cocos/2d/platform/win32/CCImage.cpp b/cocos/2d/platform/win32/CCImage.cpp index 8cc3f508e5..a753d3e9c7 100644 --- a/cocos/2d/platform/win32/CCImage.cpp +++ b/cocos/2d/platform/win32/CCImage.cpp @@ -23,6 +23,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #define __CC_PLATFORM_IMAGE_CPP__ + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #if _MSC_VER #include #endif @@ -440,3 +444,5 @@ bool Image::initWithString( } NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/2d/platform/win32/CCPlatformDefine.h b/cocos/2d/platform/win32/CCPlatformDefine.h index 964544860a..d0e3e4cb1e 100644 --- a/cocos/2d/platform/win32/CCPlatformDefine.h +++ b/cocos/2d/platform/win32/CCPlatformDefine.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #ifdef __MINGW32__ #include #endif @@ -55,6 +58,6 @@ THE SOFTWARE. #endif #endif - +#endif //s CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/win32/CCStdC.cpp b/cocos/2d/platform/win32/CCStdC.cpp index 15862bc0ad..5b7683cea0 100644 --- a/cocos/2d/platform/win32/CCStdC.cpp +++ b/cocos/2d/platform/win32/CCStdC.cpp @@ -25,6 +25,9 @@ THE SOFTWARE. #include "CCStdC.h" +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #ifndef __MINGW32__ NS_CC_BEGIN @@ -45,3 +48,5 @@ int gettimeofday(struct timeval * val, struct timezone *) NS_CC_END #endif // __MINGW32__ + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index 47677d29c9..cdac427c5b 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + //typedef SSIZE_T ssize_t; // ssize_t was redefined as int in libwebsockets.h. // Therefore, to avoid conflict, we needs the same definition. @@ -151,5 +154,9 @@ inline errno_t strcpy_s(char *strDestination, size_t numberOfElements, #undef min #undef max +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #endif // __CC_STD_C_H__ + + diff --git a/cocos/2d/platform/win32/compat/stdint.h b/cocos/2d/platform/win32/compat/stdint.h index c66fbb817c..a7130075ca 100644 --- a/cocos/2d/platform/win32/compat/stdint.h +++ b/cocos/2d/platform/win32/compat/stdint.h @@ -29,13 +29,16 @@ // /////////////////////////////////////////////////////////////////////////////// +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - #if _MSC_VER > 1000 #pragma once #endif @@ -243,5 +246,6 @@ typedef uint64_t uintmax_t; #endif // __STDC_CONSTANT_MACROS ] +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #endif // _MSC_STDINT_H_ ] diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index eea6c483c8..ac7e62c855 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -158,10 +158,8 @@ static void _log(const char *format, va_list args) WCHAR wszBuf[MAX_LOG_LENGTH] = {0}; MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); - OutputDebugStringA("\n"); - WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE); - printf("%s\n", buf); + printf("%s", buf); #else // Linux, Mac, iOS, etc @@ -516,7 +514,7 @@ void Console::loop() timeout.tv_sec = 0; /* 0.016 seconds. Wake up once per frame at 60PFS */ - timeout.tv_usec = 016000; + timeout.tv_usec = 16000; while(!_endThread) { diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index e73a2cab3a..93889d7ce0 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -324,7 +324,8 @@ void Layout::onBeforeVisitScissor() { Rect clippingRect = getClippingRect(); glEnable(GL_SCISSOR_TEST); - EGLView::getInstance()->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width, clippingRect.size.height); + auto glview = Director::getInstance()->getOpenGLView(); + glview->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width, clippingRect.size.height); } void Layout::onAfterVisitScissor() diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index 9e0b19c081..39c9922862 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit 9e0b19c08146ef6fa0a23d57517a13b4404f03bd +Subproject commit 39c992286292b7cb04fc6c8c55a9b117e92b7472 diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 59b4664eaa..73409beae2 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -631,7 +631,7 @@ color3B = Color3B::WHITE; | Director::sharedDirector() | Director::getInstance() | | FileUtils::sharedFileUtils | FileUtils::getInstance | | FileUtils::purgeFileUtils | FileUtils::destroyInstance | - | EGLView::sharedOpenGLView | EGLView::getInstance | + | GLView::sharedOpenGLView | GLView::getInstance | | ShaderCache::sharedShaderCache | ShaderCache::getInstance | | ShaderCache::purgeSharedShaderCache | ShaderCache::destroyInstance | | AnimationCache::sharedAnimationCache | AnimationCache::getInstance | diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index 8f0db2c967..3b8bfb3f20 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -29,15 +29,18 @@ #define kLabelZOrder 9999 #include "CCEditBox.h" -#import "EAGLView.h" +#import "CCEAGLView.h" #define getEditBoxImplIOS() ((cocos2d::extension::EditBoxImplIOS*)editBox_) static const int CC_EDIT_BOX_PADDING = 5; @implementation CCCustomUITextField -- (CGRect)textRectForBounds:(CGRect)bounds { - float padding = CC_EDIT_BOX_PADDING * cocos2d::EGLView::getInstance()->getScaleX() / [[CCEAGLView sharedEGLView] contentScaleFactor ]; +- (CGRect)textRectForBounds:(CGRect)bounds +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + + float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding, bounds.size.width - padding*2, bounds.size.height - padding*2); } @@ -92,8 +95,10 @@ static const int CC_EDIT_BOX_PADDING = 5; -(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance { - id eglView = [CCEAGLView sharedEGLView]; - [eglView doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; } -(void) setPosition:(CGPoint) pos @@ -117,7 +122,10 @@ static const int CC_EDIT_BOX_PADDING = 5; -(void) openKeyboard { - [[CCEAGLView sharedEGLView] addSubview:textField_]; + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview addSubview:textField_]; [textField_ becomeFirstResponder]; } @@ -137,16 +145,21 @@ static const int CC_EDIT_BOX_PADDING = 5; -(void)animationSelector { - id eglView = [CCEAGLView sharedEGLView]; - [eglView doAnimationWhenAnotherEditBeClicked]; + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview doAnimationWhenAnotherEditBeClicked]; } - (BOOL)textFieldShouldBeginEditing:(UITextField *)sender // return NO to disallow editing. { CCLOG("textFieldShouldBeginEditing..."); editState_ = YES; - id eglView = [CCEAGLView sharedEGLView]; - if ([eglView isKeyboardShown]) + + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + if ([eaglview isKeyboardShown]) { [self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f]; } @@ -261,7 +274,9 @@ EditBoxImplIOS::EditBoxImplIOS(EditBox* pEditText) , _systemControl(NULL) , _maxTextLength(-1) { - _inRetinaMode = [[CCEAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false; + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + + _inRetinaMode = view->isRetinaDisplay(); } EditBoxImplIOS::~EditBoxImplIOS() @@ -281,9 +296,9 @@ bool EditBoxImplIOS::initWithSize(const Size& size) { do { - EGLViewProtocol* eglView = EGLView::getInstance(); + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - CGRect rect = CGRectMake(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); + CGRect rect = CGRectMake(0, 0, size.width * glview->getScaleX(),size.height * glview->getScaleY()); if (_inRetinaMode) { @@ -360,7 +375,10 @@ void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; NSString * fntName = [NSString stringWithUTF8String:pFontName]; - float scaleFactor = EGLView::getInstance()->getScaleX(); + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + + float scaleFactor = glview->getScaleX(); UIFont *textFont = nil; if (isValidFontName) { textFont = [UIFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor]; @@ -536,11 +554,13 @@ void EditBoxImplIOS::setPlaceHolder(const char* pText) static CGPoint convertDesignCoordToScreenCoord(const Point& designCoord, bool bInRetinaMode) { - EGLViewProtocol* eglView = EGLView::getInstance(); - float viewH = (float)[[CCEAGLView sharedEGLView] getHeight]; + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) glview->getEAGLView(); + + float viewH = (float)[eaglview getHeight]; - Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); - Point screenGLPos = visiblePos + eglView->getViewPortRect().origin; + Point visiblePos = Point(designCoord.x * glview->getScaleX(), designCoord.y * glview->getScaleY()); + Point screenGLPos = visiblePos + glview->getViewPortRect().origin; CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y); @@ -569,8 +589,8 @@ void EditBoxImplIOS::setContentSize(const Size& size) _contentSize = size; CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); placeInactiveLabels(); - EGLViewProtocol* eglView = EGLView::getInstance(); - CGSize controlSize = CGSizeMake(size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + CGSize controlSize = CGSizeMake(size.width * glview->getScaleX(),size.height * glview->getScaleY()); if (_inRetinaMode) { diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm index cdfab6a402..5fa5b32039 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm @@ -24,6 +24,7 @@ ****************************************************************************/ #include "CCEditBoxImplMac.h" +#include "CCDirector.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) @@ -63,8 +64,10 @@ @synthesize editState = editState_; @synthesize editBox = editBox_; -- (id) getNSWindow { - return glfwGetCocoaWindow(cocos2d::EGLView::getInstance()->getWindow()); +- (id) getNSWindow +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + return glfwGetCocoaWindow(glview->getWindow()); } - (void)dealloc @@ -265,7 +268,7 @@ void EditBoxImplMac::doAnimationWhenKeyboardMove(float duration, float distance) bool EditBoxImplMac::initWithSize(const Size& size) { - EGLViewProtocol* eglView = EGLView::getInstance(); + GLViewProtocol* eglView = Director::getInstance()->getOpenGLView(); NSRect rect = NSMakeRect(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); @@ -356,7 +359,7 @@ NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Point& designCoord NSRect frame = [_sysEdit.textField frame]; CGFloat height = frame.size.height; - EGLViewProtocol* eglView = EGLView::getInstance(); + GLViewProtocol* eglView = Director::getInstance()->getOpenGLView(); Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); Point screenGLPos = visiblePos + eglView->getViewPortRect().origin; diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 4cc76e6dde..b88f7fea03 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCScrollView.h" -#include "CCEGLView.h" +#include "CCGLView.h" #include "platform/CCDevice.h" #include "CCActionInstant.h" #include "CCActionInterval.h" @@ -44,7 +44,8 @@ NS_CC_EXT_BEGIN static float convertDistanceFromPointToInch(float pointDis) { - float factor = ( EGLView::getInstance()->getScaleX() + EGLView::getInstance()->getScaleY() ) / 2; + auto glview = Director::getInstance()->getOpenGLView(); + float factor = ( glview->getScaleX() + glview->getScaleY() ) / 2; return pointDis * factor / Device::getDPI(); } @@ -508,21 +509,23 @@ void ScrollView::onBeforeDraw() { _scissorRestored = false; Rect frame = getViewRect(); - if (EGLView::getInstance()->isScissorEnabled()) { + auto glview = Director::getInstance()->getOpenGLView(); + + if (glview->isScissorEnabled()) { _scissorRestored = true; - _parentScissorRect = EGLView::getInstance()->getScissorRect(); + _parentScissorRect = glview->getScissorRect(); //set the intersection of _parentScissorRect and frame as the new scissor rect if (frame.intersectsRect(_parentScissorRect)) { float x = MAX(frame.origin.x, _parentScissorRect.origin.x); float y = MAX(frame.origin.y, _parentScissorRect.origin.y); float xx = MIN(frame.origin.x+frame.size.width, _parentScissorRect.origin.x+_parentScissorRect.size.width); float yy = MIN(frame.origin.y+frame.size.height, _parentScissorRect.origin.y+_parentScissorRect.size.height); - EGLView::getInstance()->setScissorInPoints(x, y, xx-x, yy-y); + glview->setScissorInPoints(x, y, xx-x, yy-y); } } else { glEnable(GL_SCISSOR_TEST); - EGLView::getInstance()->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); + glview->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); } } } @@ -543,7 +546,9 @@ void ScrollView::onAfterDraw() if (_clippingToBounds) { if (_scissorRestored) {//restore the parent's scissor rect - EGLView::getInstance()->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y, _parentScissorRect.size.width, _parentScissorRect.size.height); + auto glview = Director::getInstance()->getOpenGLView(); + + glview->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y, _parentScissorRect.size.width, _parentScissorRect.size.height); } else { glDisable(GL_SCISSOR_TEST); diff --git a/plugin b/plugin index 47efb364e3..9c95a240d7 160000 --- a/plugin +++ b/plugin @@ -1 +1 @@ -Subproject commit 47efb364e3b037ed7d9e529c1c2697582fa00c95 +Subproject commit 9c95a240d705507f4d33eda7435ea52da321c0d2 diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt deleted file mode 100644 index 198764a991..0000000000 --- a/samples/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -if(BUILD_HelloCpp) -add_subdirectory(Cpp/HelloCpp) -endif(BUILD_HelloCpp) - -if(BUILD_TestCpp) -add_subdirectory(Cpp/TestCpp) -endif(BUILD_TestCpp) - -if(BUILD_HelloLua) -add_subdirectory(Lua/HelloLua) -endif(BUILD_HelloLua) - -if(BUILD_TestLua) -add_subdirectory(Lua/TestLua) -endif(BUILD_TestLua) \ No newline at end of file diff --git a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp deleted file mode 100644 index 3d6ed9ec1a..0000000000 --- a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// -// AssetsManagerTestAppDelegate.cpp -// AssetsManagerTest -// - -#include "AppDelegate.h" - -#include "cocos2d.h" -#include "SimpleAudioEngine.h" -#include "ScriptingCore.h" -#include "jsb_cocos2dx_auto.hpp" -#include "cocos2d_specifics.hpp" - -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) -#include -#include -#endif - -USING_NS_CC; -USING_NS_CC_EXT; -using namespace std; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ - -} - -AppDelegate::~AppDelegate() -{ -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto director = Director::getInstance(); - director->setOpenGLView(EGLView::getInstance()); - - // turn on display FPS - //director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - - - sc->start(); - - auto scene = Scene::create(); - auto updateLayer = new UpdateLayer(); - scene->addChild(updateLayer); - updateLayer->release(); - - director->runWithScene(scene); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} - -UpdateLayer::UpdateLayer() -: pItemEnter(NULL) -, pItemReset(NULL) -, pItemUpdate(NULL) -, pProgressLabel(NULL) -, isUpdateItemClicked(false) -{ - init(); -} - -UpdateLayer::~UpdateLayer() -{ -} - -void UpdateLayer::update(cocos2d::Object *pSender) -{ - pProgressLabel->setString(""); - - // update resources - pAssetsManager->update(); - - isUpdateItemClicked = true; -} - -void UpdateLayer::reset(cocos2d::Object *pSender) -{ - pProgressLabel->setString(" "); - - // Remove downloaded files -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) - string command = "rm -r "; - // Path may include space. - command += "\"" + pathToSave + "\""; - system(command.c_str()); -#else - string command = "rd /s /q "; - // Path may include space. - command += "\"" + pathToSave + "\""; - system(command.c_str()); -#endif - // Delete recorded version codes. - pAssetsManager->deleteVersion(); - - createDownloadedDir(); -} - -void UpdateLayer::enter(cocos2d::Object *pSender) -{ - // Should set search resource path before running script if "update" is not clicked. - // Because AssetsManager will set - if (! isUpdateItemClicked) - { - vector searchPaths = FileUtils::getInstance()->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), pathToSave); - FileUtils::getInstance()->setSearchPaths(searchPaths); - } - - auto pEngine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("main.js"); -} - -bool UpdateLayer::init() -{ - Layer::init(); - - createDownloadedDir(); - - /** Creates assets manager */ - pAssetsManager = new AssetsManager("https://raw.github.com/minggo/AssetsManagerTest/master/package.zip", - "https://raw.github.com/minggo/AssetsManagerTest/master/version", - pathToSave.c_str()); - pAssetsManager->setDelegate(this); - pAssetsManager->setConnectionTimeout(3); - addChild(pAssetsManager); - pAssetsManager->release(); - - auto size = Director::getInstance()->getWinSize(); - - pItemReset = MenuItemFont::create("reset", CC_CALLBACK_1(UpdateLayer::reset,this)); - pItemEnter = MenuItemFont::create("enter", CC_CALLBACK_1(UpdateLayer::enter, this)); - pItemUpdate = MenuItemFont::create("update", CC_CALLBACK_1(UpdateLayer::update, this)); - - pItemEnter->setPosition(Point(size.width/2, size.height/2 + 50)); - pItemReset->setPosition(Point(size.width/2, size.height/2)); - pItemUpdate->setPosition(Point(size.width/2, size.height/2 - 50)); - - auto menu = Menu::create(pItemUpdate, pItemEnter, pItemReset, NULL); - menu->setPosition(Point(0,0)); - addChild(menu); - - pProgressLabel = LabelTTF::create("", "Arial", 20); - pProgressLabel->setPosition(Point(100, 50)); - addChild(pProgressLabel); - - return true; -} - -void UpdateLayer::createDownloadedDir() -{ - pathToSave = FileUtils::getInstance()->getWritablePath(); - pathToSave += "tmpdir"; - - // Create the folder if it doesn't exist -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) - DIR *pDir = NULL; - - pDir = opendir (pathToSave.c_str()); - if (! pDir) - { - mkdir(pathToSave.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); - } -#else - if ((GetFileAttributesA(pathToSave.c_str())) == INVALID_FILE_ATTRIBUTES) - { - CreateDirectoryA(pathToSave.c_str(), 0); - } -#endif -} - -void UpdateLayer::onError(AssetsManager::ErrorCode errorCode) -{ - if (errorCode == AssetsManager::ErrorCode::NO_NEW_VERSION) - { - pProgressLabel->setString("no new version"); - } - - if (errorCode == AssetsManager::ErrorCode::NETWORK) - { - pProgressLabel->setString("network error"); - } -} - -void UpdateLayer::onProgress(int percent) -{ - char progress[20]; - snprintf(progress, 20, "downloading %d%%", percent); - pProgressLabel->setString(progress); -} - -void UpdateLayer::onSuccess() -{ - pProgressLabel->setString("download ok"); -} diff --git a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h deleted file mode 100644 index 2a0dae6d7b..0000000000 --- a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// AssetsManagerTestAppDelegate.h -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" -#include "cocos2d.h" -#include "extensions/assets-manager/AssetsManager.h" - -/** -@brief The cocos2d Application. - -The reason to implement with private inheritance is to hide some interface details of Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function is called when the application enters the background - @param the pointer of the application instance - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function is called when the application enters the foreground - @param the pointer of the application instance - */ - virtual void applicationWillEnterForeground(); -}; - -class UpdateLayer : public cocos2d::Layer, public cocos2d::extension::AssetsManagerDelegateProtocol -{ -public: - UpdateLayer(); - ~UpdateLayer(); - virtual bool init(); - - void enter(cocos2d::Object *pSender); - void reset(cocos2d::Object *pSender); - void update(cocos2d::Object *pSender); - - virtual void onError(cocos2d::extension::AssetsManager::ErrorCode errorCode); - virtual void onProgress(int percent); - virtual void onSuccess(); - -private: - cocos2d::extension::AssetsManager* pAssetsManager; - void createDownloadedDir(); - - cocos2d::MenuItemFont *pItemEnter; - cocos2d::MenuItemFont *pItemReset; - cocos2d::MenuItemFont *pItemUpdate; - cocos2d::LabelTTF *pProgressLabel; - std::string pathToSave; - bool isUpdateItemClicked; -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Cpp/AssetsManagerTest/README.md b/samples/Cpp/AssetsManagerTest/README.md deleted file mode 100644 index 9d39a99748..0000000000 --- a/samples/Cpp/AssetsManagerTest/README.md +++ /dev/null @@ -1,37 +0,0 @@ -This sample shows how to use AssetsManager to auto-update application resources(pictures or scripts). - -In this sample, there is a scene which contains three items: -* enter - - Start to run script. -* reset - - Delete downloaded resources and delete recorded version code. -* update - - Download new version of package if it exits. - -You can use this sample like this: -* Run original version application(refered as v1) - -``` -start application -click "enter" -``` -* Run new version application(v2) - -``` -start application -click "update" -click "enter" -``` -You will find the changes. -* Run v1 again after running v2 - -``` -start application -click "reset" -click "enter" -``` -The application turns back to v1. Ofcourse you can run v2 again as mentioned abave. - diff --git a/samples/Cpp/AssetsManagerTest/Resources/Background.png.REMOVED.git-id b/samples/Cpp/AssetsManagerTest/Resources/Background.png.REMOVED.git-id deleted file mode 100644 index f02d84fd8f..0000000000 --- a/samples/Cpp/AssetsManagerTest/Resources/Background.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5fe89fb5bd58cedf13b0363f97b20e3ea7ff255d \ No newline at end of file diff --git a/samples/Cpp/AssetsManagerTest/Resources/main.js b/samples/Cpp/AssetsManagerTest/Resources/main.js deleted file mode 100644 index a796a32e50..0000000000 --- a/samples/Cpp/AssetsManagerTest/Resources/main.js +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - - 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. - ****************************************************************************/ - -// boot code needed for cocos2d + JS bindings. -// Not needed by cocos2d-html5 - -require('jsb_cocos2d.js'); - -var appFiles = [ - 'myApp.js' -]; - -cc.dumpConfig(); - -for( var i=0; i < appFiles.length; i++) { - require( appFiles[i] ); -} - -var director = cc.Director.getInstance(); -director.setDisplayStats(true); - -// set FPS. the default value is 1.0/60 if you don't call this -director.setAnimationInterval(1.0 / 60); - -// create a scene. it's an autorelease object -var myScene = new MyScene(); - -// run -director.replaceScene(myScene); - diff --git a/samples/Cpp/AssetsManagerTest/Resources/myApp.js b/samples/Cpp/AssetsManagerTest/Resources/myApp.js deleted file mode 100644 index e2e6342648..0000000000 --- a/samples/Cpp/AssetsManagerTest/Resources/myApp.js +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011 Zynga Inc. - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -var MyLayer = cc.Layer.extend({ - isMouseDown:false, - helloImg:null, - helloLabel:null, - circle:null, - sprite:null, - - ctor:function() { - this._super(); - cc.associateWithNative( this, cc.Layer ); - }, - - init:function () { - - ////////////////////////////// - // 1. super init first - this._super(); - - ///////////////////////////// - // 2. add a menu item with "X" image, which is clicked to quit the program - // you may modify it. - // ask director the window size - var size = cc.Director.getInstance().getWinSize(); - - // add a "close" icon to exit the progress. it's an autorelease object - var closeItem = cc.MenuItemImage.create( - "CloseNormal.png", - "CloseSelected.png", - function () { - cc.log("close button was clicked."); - },this); - closeItem.setAnchorPoint(cc.p(0.5, 0.5)); - - var menu = cc.Menu.create(closeItem); - menu.setPosition(cc.p(0, 0)); - this.addChild(menu, 1); - closeItem.setPosition(cc.p(size.width - 20, 20)); - - ///////////////////////////// - // 3. add your codes below... - // add a label shows "Hello World" - // create and initialize a label - this.helloLabel = cc.LabelTTF.create("Hello World", "Arial", 38); - // position the label on the center of the screen - this.helloLabel.setPosition(cc.p(size.width / 2, size.height - 40)); - // add the label as a child to this layer - this.addChild(this.helloLabel, 5); - - // add "Helloworld" splash screen" - this.sprite = cc.Sprite.create("Background.png"); - this.sprite.setAnchorPoint(cc.p(0.5, 0.5)); - this.sprite.setPosition(cc.p(size.width / 2, size.height / 2)); - - this.addChild(this.sprite, 0); - - return true; - } - -}); - -var MyScene = cc.Scene.extend({ - ctor:function() { - this._super(); - cc.associateWithNative( this, cc.Scene ); - }, - - onEnter:function () { - this._super(); - var layer = new MyLayer(); - this.addChild(layer); - layer.init(); - } -}); diff --git a/samples/Cpp/AssetsManagerTest/proj.android/.project b/samples/Cpp/AssetsManagerTest/proj.android/.project deleted file mode 100644 index 515077d245..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/.project +++ /dev/null @@ -1,70 +0,0 @@ - - - AssetsManagerTest - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Cpp/AssetsManagerTest/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Cpp/AssetsManagerTest/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Cpp/AssetsManagerTest/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml b/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml deleted file mode 100644 index b236420d07..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/AssetsManagerTest/proj.android/build.xml b/samples/Cpp/AssetsManagerTest/proj.android/build.xml deleted file mode 100644 index 94460967a5..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk b/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk deleted file mode 100644 index 28588e400a..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/jni/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := game_shared - -LOCAL_MODULE_FILENAME := libgame - -LOCAL_SRC_FILES := hellocpp/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static - -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/javascript/bindings) -$(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/extension) -$(call import-module,scripting/javascript/bindings/localstorage) -$(call import-module,scripting/javascript/bindings/network) -$(call import-module,scripting/javascript/bindings/cocosbuilder) diff --git a/samples/Cpp/AssetsManagerTest/proj.android/jni/Application.mk b/samples/Cpp/AssetsManagerTest/proj.android/jni/Application.mk deleted file mode 100644 index 74af9626ab..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/jni/Application.mk +++ /dev/null @@ -1,5 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char diff --git a/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp deleted file mode 100644 index 0d0564246f..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "AppDelegate.h" -#include "platform/android/jni/JniHelper.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Cpp/AssetsManagerTest/proj.android/project.properties b/samples/Cpp/AssetsManagerTest/proj.android/project.properties deleted file mode 100644 index f7e62936d0..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-10 -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Cpp/AssetsManagerTest/proj.android/res/values/strings.xml b/samples/Cpp/AssetsManagerTest/proj.android/res/values/strings.xml deleted file mode 100644 index 99a292d37c..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - AssetsManager - diff --git a/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java b/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java deleted file mode 100644 index c30457e9fb..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.android/src/org/cocos2dx/AssetsManagerTest/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.AssetsManagerTest; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/AppController.h b/samples/Cpp/AssetsManagerTest/proj.ios/AppController.h deleted file mode 100644 index 0979818386..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/AppController.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// AssetsManagerTestAppController.h -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@property (nonatomic, retain) UIWindow *window; -@property (nonatomic, retain) RootViewController *viewController; - -@end - diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/AppController.mm b/samples/Cpp/AssetsManagerTest/proj.ios/AppController.mm deleted file mode 100644 index e009328669..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/AppController.mm +++ /dev/null @@ -1,122 +0,0 @@ -// -// AssetsManagerTestAppController.mm -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -@synthesize window; -@synthesize viewController; - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples:0 ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/Prefix.pch b/samples/Cpp/AssetsManagerTest/proj.ios/Prefix.pch deleted file mode 100644 index 5d8be4921e..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'AssetsManagerTest' target in the 'AssetsManagerTest' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.h b/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.h deleted file mode 100644 index 17d8b1ca23..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// AssetsManagerTestAppController.h -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.mm b/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.mm deleted file mode 100644 index 779facc5b7..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ -// -// AssetsManagerTestAppController.h -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskLandscape; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/iTunesArtwork b/samples/Cpp/AssetsManagerTest/proj.ios/iTunesArtwork deleted file mode 100644 index b1cc056ba5..0000000000 Binary files a/samples/Cpp/AssetsManagerTest/proj.ios/iTunesArtwork and /dev/null differ diff --git a/samples/Cpp/AssetsManagerTest/proj.ios/main.m b/samples/Cpp/AssetsManagerTest/proj.ios/main.m deleted file mode 100644 index 2f4612f6a2..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// AssetsManagerTest -// -// Created by minggo on 2/5/13. -// Copyright __MyCompanyName__ 2013. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj b/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj deleted file mode 100644 index 7851565229..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {6D37505F-A890-441D-BD3F-A61E2C0469CE} - AssetsManagerTest - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)res.tlb - res.h - - - res_i.c - res_p.c - - - Disabled - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;libcurl_imp.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\AssetsManagerTestRes" rd /s /q "$(OutDir)\AssetsManagerTestRes" -mkdir "$(OutDir)\AssetsManagerTestRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\AssetsManagerTestRes\" /e /Y -xcopy "$(ProjectDir)..\Resources" "$(OutDir)\AssetsManagerTestRes\" /e /Y - - - Copy js and resource files. - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)res.tlb - res.h - - - res_i.c - res_p.c - - - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(EngineRoot)external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;libcurl_imp.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\AssetsManagerTestRes" rd /s /q "$(OutDir)\AssetsManagerTestRes" -mkdir "$(OutDir)\AssetsManagerTestRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\AssetsManagerTestRes\" /e /Y -xcopy "$(ProjectDir)..\Resources" "$(OutDir)\AssetsManagerTestRes\" /e /Y - Copy js and resource files. - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {625f7391-9a91-48a1-8cfc-79508c822637} - - - {39379840-825a-45a0-b363-c09ffef864bd} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.filters b/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.filters deleted file mode 100644 index de7f9d6f3e..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.filters +++ /dev/null @@ -1,44 +0,0 @@ - - - - - {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest - - - {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} - - - {e93a77e1-af1e-4400-87d3-504b62ebdbb0} - - - - - win32 - - - Classes - - - - - win32 - - - Classes - - - win32 - - - - - resource - - - - - resource - - - \ No newline at end of file diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.user b/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.user deleted file mode 100644 index 806c7a2dd6..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.win32/AssetsManagerTest.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(OutDir)\AssetsManagerTestRes - WindowsLocalDebugger - - - $(OutDir)\AssetsManagerTestRes - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/main.cpp b/samples/Cpp/AssetsManagerTest/proj.win32/main.cpp deleted file mode 100644 index 48e2af43a1..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -// #define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("AssetsManagerTest",900,640); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/res.rc b/samples/Cpp/AssetsManagerTest/proj.win32/res.rc deleted file mode 100644 index 8bb32cb5e8..0000000000 --- a/samples/Cpp/AssetsManagerTest/proj.win32/res.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\res.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "res Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "res\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "AssetsManagerTest.exe\0" - VALUE "ProductName", "AssetsManagerTest Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/res/res.ico b/samples/Cpp/AssetsManagerTest/proj.win32/res/res.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/samples/Cpp/AssetsManagerTest/proj.win32/res/res.ico and /dev/null differ diff --git a/samples/Cpp/HelloCpp/CMakeLists.txt b/samples/Cpp/HelloCpp/CMakeLists.txt deleted file mode 100644 index 861118b09b..0000000000 --- a/samples/Cpp/HelloCpp/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ -set(APP_NAME hellocpp) - -if(QT) - set(PLATFORM_SRC - proj.qt/main.cpp - ) -elseif(ANDROID) - set(PLATFORM_SRC - proj.android/jni/hellocpp/main.cpp - ) -elseif(WIN32) - set(PLATFORM_SRC - proj.win32/main.cpp - ) -elseif(APPLE) - if(IOS) - set(PLATFORM_SRC - proj.ios/main.m - proj.ios/AppController.mm - proj.ios/RootViewController.mm - ) - else() - set(PLATFORM_SRC - proj.mac/main.m - ) - endif() -else() - set(PLATFORM_SRC - proj.linux/main.cpp - ) - endif() - -set(SAMPLE_SRC - ${PLATFORM_SRC} - Classes/AppDelegate.cpp - Classes/HelloWorldScene.cpp -) - -# add the executable -add_executable(${APP_NAME} - ${SAMPLE_SRC} -) - -if(WIN32 AND MSVC) - #get our resources - add_custom_command(TARGET ${APP_NAME} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${CMAKE_CURRENT_BINARY_DIR}) - #get our dlls - add_custom_command(TARGET ${APP_NAME} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/../../../external/win32-specific/gles/prebuilt/glew32.dll - ${CMAKE_CURRENT_BINARY_DIR}) - - add_custom_command(TARGET ${APP_NAME} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/../../../external/win32-specific/zlib/prebuilt/zlib1.dll - ${CMAKE_CURRENT_BINARY_DIR}/Debug) - - #Visual Studio Defaults to wrong type - set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") - set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") -else() - set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") - - set_target_properties(${APP_NAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") - - pre_build(${APP_NAME} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources - ) -endif() - -target_link_libraries(${APP_NAME} audio cocos2d) diff --git a/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp b/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp deleted file mode 100644 index 97fb7366c3..0000000000 --- a/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "AppDelegate.h" - -#include -#include - -#include "HelloWorldScene.h" -#include "AppMacros.h" - -USING_NS_CC; -using namespace std; - -AppDelegate::AppDelegate() { - -} - -AppDelegate::~AppDelegate() -{ -} - -bool AppDelegate::applicationDidFinishLaunching() { - // initialize director - auto director = Director::getInstance(); - auto glView = EGLView::getInstance(); - - director->setOpenGLView(glView); - - // Set the design resolution - glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER); - - Size frameSize = glView->getFrameSize(); - - vector searchPath; - - // In this demo, we select resource according to the frame's height. - // If the resource size is different from design resolution size, you need to set contentScaleFactor. - // We use the ratio of resource's height to the height of design resolution, - // this can make sure that the resource's height could fit for the height of design resolution. - - // if the frame's height is larger than the height of medium resource size, select large resource. - if (frameSize.height > mediumResource.size.height) - { - searchPath.push_back(largeResource.directory); - - director->setContentScaleFactor(MIN(largeResource.size.height/designResolutionSize.height, largeResource.size.width/designResolutionSize.width)); - } - // if the frame's height is larger than the height of small resource size, select medium resource. - else if (frameSize.height > smallResource.size.height) - { - searchPath.push_back(mediumResource.directory); - - director->setContentScaleFactor(MIN(mediumResource.size.height/designResolutionSize.height, mediumResource.size.width/designResolutionSize.width)); - } - // if the frame's height is smaller than the height of medium resource size, select small resource. - else - { - searchPath.push_back(smallResource.directory); - - director->setContentScaleFactor(MIN(smallResource.size.height/designResolutionSize.height, smallResource.size.width/designResolutionSize.width)); - } - - // set searching path - FileUtils::getInstance()->setSearchPaths(searchPath); - - // turn on display FPS - director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - - // create a scene. it's an autorelease object - auto scene = HelloWorld::scene(); - - // run - director->runWithScene(scene); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() { - Director::getInstance()->stopAnimation(); - - // if you use SimpleAudioEngine, it must be pause - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() { - Director::getInstance()->startAnimation(); - - // if you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); -} diff --git a/samples/Cpp/HelloCpp/Classes/AppDelegate.h b/samples/Cpp/HelloCpp/Classes/AppDelegate.h deleted file mode 100644 index 18ee8aeb63..0000000000 --- a/samples/Cpp/HelloCpp/Classes/AppDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "cocos2d.h" - -/** -@brief The cocos2d Application. - -The reason for implement as private inheritance is to hide some interface call by Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Cpp/HelloCpp/Classes/AppMacros.h b/samples/Cpp/HelloCpp/Classes/AppMacros.h deleted file mode 100644 index 6e6aa0ea2e..0000000000 --- a/samples/Cpp/HelloCpp/Classes/AppMacros.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __APPMACROS_H__ -#define __APPMACROS_H__ - -#include "cocos2d.h" - -/* For demonstrating using one design resolution to match different resources, - or one resource to match different design resolutions. - - [Situation 1] Using one design resolution to match different resources. - Please look into Appdelegate::applicationDidFinishLaunching. - We check current device frame size to decide which resource need to be selected. - So if you want to test this situation which said in title '[Situation 1]', - you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina), - or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform - and modify "proj.mac/AppController.mm" by changing the window rectangle. - - [Situation 2] Using one resource to match different design resolutions. - The coordinates in your codes is based on your current design resolution rather than resource size. - Therefore, your design resolution could be very large and your resource size could be small. - To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' - and open iphone simulator or create a window of 480x320 size. - - [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources. - */ - -#define DESIGN_RESOLUTION_480X320 0 -#define DESIGN_RESOLUTION_1024X768 1 -#define DESIGN_RESOLUTION_2048X1536 2 - -/* If you want to switch design resolution, change next line */ -#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_480X320 - -typedef struct tagResource -{ - cocos2d::Size size; - char directory[100]; -}Resource; - -static Resource smallResource = { cocos2d::Size(480, 320), "iphone" }; -static Resource mediumResource = { cocos2d::Size(1024, 768), "ipad" }; -static Resource largeResource = { cocos2d::Size(2048, 1536), "ipadhd" }; - -#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320) -static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768) -static cocos2d::Size designResolutionSize = cocos2d::Size(1024, 768); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536) -static cocos2d::Size designResolutionSize = cocos2d::Size(2048, 1536); -#else -#error unknown target design resolution! -#endif - -// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution -#define TITLE_FONT_SIZE (cocos2d::EGLView::getInstance()->getDesignResolutionSize().width / smallResource.size.width * 24) - -#endif /* __APPMACROS_H__ */ diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp deleted file mode 100644 index 077a92aa11..0000000000 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "HelloWorldScene.h" -#include "AppMacros.h" - -#include "CCEventListenerTouch.h" - -USING_NS_CC; - - -Scene* HelloWorld::scene() -{ - // 'scene' is an autorelease object - auto scene = Scene::create(); - - // 'layer' is an autorelease object - HelloWorld *layer = HelloWorld::create(); - - // add layer as a child to scene - scene->addChild(layer); - - // return the scene - return scene; -} - -// on "init" you need to initialize your instance -bool HelloWorld::init() -{ - ////////////////////////////// - // 1. super init first - if ( !Layer::init() ) - { - return false; - } - - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - - ///////////////////////////// - // 2. add a menu item with "X" image, which is clicked to quit the program - // you may modify it. - - // add a "close" icon to exit the progress. it's an autorelease object - auto closeItem = MenuItemImage::create( - "CloseNormal.png", - "CloseSelected.png", - CC_CALLBACK_1(HelloWorld::menuCloseCallback,this)); - - closeItem->setPosition(origin + Point(visibleSize) - Point(closeItem->getContentSize() / 2)); - - // create menu, it's an autorelease object - auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Point::ZERO); - this->addChild(menu, 1); - - ///////////////////////////// - // 3. add your codes below... - - // add a label shows "Hello World" - // create and initialize a label - - auto label = LabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE); - - // position the label on the center of the screen - label->setPosition(Point(origin.x + visibleSize.width/2, - origin.y + visibleSize.height - label->getContentSize().height)); - - // add the label as a child to this layer - this->addChild(label, 1); - - // add "HelloWorld" splash screen" - auto sprite = Sprite::create("HelloWorld.png"); - - // position the sprite on the center of the screen - sprite->setPosition(Point(visibleSize / 2) + origin); - - // add the sprite as a child to this layer - this->addChild(sprite); - - return true; -} - -void HelloWorld::menuCloseCallback(Object* sender) -{ - Director::getInstance()->end(); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif -} diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h deleted file mode 100644 index 876073cdb5..0000000000 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __HELLOWORLD_SCENE_H__ -#define __HELLOWORLD_SCENE_H__ - -#include "cocos2d.h" - -class HelloWorld : public cocos2d::Layer -{ -public: - // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone - virtual bool init(); - - // there's no 'id' in cpp, so we recommend returning the class instance pointer - static cocos2d::Scene* scene(); - - // a selector callback - void menuCloseCallback(Object* sender); - - // implement the "static node()" method manually - CREATE_FUNC(HelloWorld); -}; - -#endif // __HELLOWORLD_SCENE_H__ diff --git a/samples/Cpp/HelloCpp/Resources/ipad/HelloWorld.png.REMOVED.git-id b/samples/Cpp/HelloCpp/Resources/ipad/HelloWorld.png.REMOVED.git-id deleted file mode 100644 index fda9923fa3..0000000000 --- a/samples/Cpp/HelloCpp/Resources/ipad/HelloWorld.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -709d78b7f3eab27056a98d63e9153b35d57b84bc \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/Resources/ipadhd/HelloWorld.png.REMOVED.git-id b/samples/Cpp/HelloCpp/Resources/ipadhd/HelloWorld.png.REMOVED.git-id deleted file mode 100644 index 45e6087f95..0000000000 --- a/samples/Cpp/HelloCpp/Resources/ipadhd/HelloWorld.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7aa1e9dc799acf384a1c4603054242cc09c1b63e \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/Resources/iphone/HelloWorld.png.REMOVED.git-id b/samples/Cpp/HelloCpp/Resources/iphone/HelloWorld.png.REMOVED.git-id deleted file mode 100644 index d391882e7d..0000000000 --- a/samples/Cpp/HelloCpp/Resources/iphone/HelloWorld.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9d6facb31897d010352e7b57f4a82715c260408a \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Cpp/HelloCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Cpp/HelloCpp/proj.android/AndroidManifest.xml b/samples/Cpp/HelloCpp/proj.android/AndroidManifest.xml deleted file mode 100644 index 79a643c03a..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/HelloCpp/proj.android/build.xml b/samples/Cpp/HelloCpp/proj.android/build.xml deleted file mode 100644 index e225e378da..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/build.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk deleted file mode 100644 index cfd4cb14b5..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk +++ /dev/null @@ -1,20 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := hellocpp_shared - -LOCAL_MODULE_FILENAME := libhellocpp - -LOCAL_SRC_FILES := hellocpp/main.cpp \ - ../../Classes/AppDelegate.cpp \ - ../../Classes/HelloWorldScene.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,2d) -$(call import-module,audio/android) diff --git a/samples/Cpp/HelloCpp/proj.android/jni/Application.mk b/samples/Cpp/HelloCpp/proj.android/jni/Application.mk deleted file mode 100644 index 74af9626ab..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/jni/Application.mk +++ /dev/null @@ -1,5 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char diff --git a/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp deleted file mode 100644 index 2b344d9e04..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "platform/android/jni/JniHelper.h" -#include -#include - -#include "cocos2d.h" - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Cpp/HelloCpp/proj.android/jni/list.sh b/samples/Cpp/HelloCpp/proj.android/jni/list.sh deleted file mode 100755 index b29f678cb8..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/jni/list.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -append_str=' \' - -list_alldir() -{ - for file in $1/* - do - if [ -f $file ]; then - echo $file$append_str | grep .cpp - fi - - if [ -d $file ]; then - list_alldir $file - fi - done -} - -if [ $# -gt 0 ]; then - list_alldir "$1" -else - list_alldir "." -fi diff --git a/samples/Cpp/HelloCpp/proj.android/ndkgdb.sh b/samples/Cpp/HelloCpp/proj.android/ndkgdb.sh deleted file mode 100755 index de49075f36..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/ndkgdb.sh +++ /dev/null @@ -1,47 +0,0 @@ -APPNAME="HelloCpp" -APP_ANDROID_NAME="org.cocos2dx.hellocpp" - -if [ -z "${SDK_ROOT+aaa}" ]; then -# ... if SDK_ROOT is not set, use "$HOME/bin/android-sdk" - SDK_ROOT="$HOME/bin/android-sdk" -fi - -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" -fi - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android" -fi - -echo "NDK_ROOT = $NDK_ROOT" -echo "SDK_ROOT = $SDK_ROOT" -echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" -echo "APP_ROOT = $APP_ROOT" -echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" -echo "APP_ANDROID_NAME = $APP_ANDROID_NAME" - -echo -echo "Killing and restarting ${APP_ANDROID_NAME}" -echo - -set -x - -"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}" - -NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \ - "${NDK_ROOT}"/ndk-gdb \ - --adb="${SDK_ROOT}"/platform-tools/adb \ - --verbose \ - --start \ - --force diff --git a/samples/Cpp/HelloCpp/proj.android/res/values/strings.xml b/samples/Cpp/HelloCpp/proj.android/res/values/strings.xml deleted file mode 100644 index d70da2da7a..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - HelloCpp - diff --git a/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java b/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java deleted file mode 100644 index ed4f339cee..0000000000 --- a/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.cocos2dx.hellocpp; - -import android.app.NativeActivity; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity{ - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Cpp/HelloCpp/proj.ios/AppController.mm b/samples/Cpp/HelloCpp/proj.ios/AppController.mm deleted file mode 100644 index 5e2010ba4c..0000000000 --- a/samples/Cpp/HelloCpp/proj.ios/AppController.mm +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 - preserveBackbuffer: NO - sharegroup:nil - multiSampling:NO - numberOfSamples:0]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Cpp/HelloCpp/proj.ios/HelloCpp_Prefix.pch b/samples/Cpp/HelloCpp/proj.ios/HelloCpp_Prefix.pch deleted file mode 100644 index b8914281d2..0000000000 --- a/samples/Cpp/HelloCpp/proj.ios/HelloCpp_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'HelloWorld' target in the 'HelloWorld' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Cpp/HelloCpp/proj.ios/RootViewController.mm b/samples/Cpp/HelloCpp/proj.ios/RootViewController.mm deleted file mode 100644 index 4984955c8a..0000000000 --- a/samples/Cpp/HelloCpp/proj.ios/RootViewController.mm +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations -{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Cpp/HelloCpp/proj.ios/main.m b/samples/Cpp/HelloCpp/proj.ios/main.m deleted file mode 100644 index bd577a036e..0000000000 --- a/samples/Cpp/HelloCpp/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// iphone -// -// Created by Walzer on 10-11-16. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Cpp/HelloCpp/proj.mac/HelloCpp_Prefix.pch b/samples/Cpp/HelloCpp/proj.mac/HelloCpp_Prefix.pch deleted file mode 100644 index 46c36a7e99..0000000000 --- a/samples/Cpp/HelloCpp/proj.mac/HelloCpp_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj b/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj deleted file mode 100644 index 6da099a164..0000000000 --- a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {B8BF9E81-35FD-4582-BA1C-B85FA365BABB} - HelloCppwin32 - Win32Proj - - - - Application - Unicode - true - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - Disabled - ..\Classes;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - - - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - libcocos2d.lib;libchipmunk.lib;%(AdditionalDependencies) - - - - - - - - - MaxSpeed - true - ..\Classes;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4267;4251;4244;%(DisableSpecificWarnings) - - - libcocos2d.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.filters b/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.filters deleted file mode 100644 index eb52c5e24c..0000000000 --- a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.filters +++ /dev/null @@ -1,38 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Classes - - - Classes - - - win32 - - - - - Classes - - - Classes - - - win32 - - - Classes - - - \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.user b/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.user deleted file mode 100644 index 32a6296820..0000000000 --- a/samples/Cpp/HelloCpp/proj.win32/HelloCpp.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/proj.win32/main.cpp b/samples/Cpp/HelloCpp/proj.win32/main.cpp deleted file mode 100644 index bcc0e091d4..0000000000 --- a/samples/Cpp/HelloCpp/proj.win32/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("HelloCpp",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp b/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp deleted file mode 100644 index 03b9b81ae4..0000000000 --- a/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "AppDelegate.h" -#include "HelloWorldScene.h" - -USING_NS_CC; - - -AppDelegate::AppDelegate() { - -} - -AppDelegate::~AppDelegate() -{ -} - -bool AppDelegate::applicationDidFinishLaunching() { - // initialize director - auto director = Director::getInstance(); - - director->setOpenGLView(EGLView::getInstance()); - - auto screenSize = EGLView::getInstance()->getFrameSize(); - auto designSize = Size(480, 320); - std::vector searchPaths; - - if (screenSize.height > 320) - { - searchPaths.push_back("hd"); - searchPaths.push_back("sd"); - director->setContentScaleFactor(640.0f/designSize.height); - } - else - { - searchPaths.push_back("sd"); - director->setContentScaleFactor(320.0f/designSize.height); - } - - FileUtils::getInstance()->setSearchPaths(searchPaths); - - EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); - - // turn on display FPS - director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - - // create a scene. it's an autorelease object - auto scene = HelloWorld::scene(); - - // run - director->runWithScene(scene); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() { - Director::getInstance()->stopAnimation(); - - // if you use SimpleAudioEngine, it must be pause - // CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() { - Director::getInstance()->startAnimation(); - - // if you use SimpleAudioEngine, it must resume here - // CocosDenshion::SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); -} diff --git a/samples/Cpp/SimpleGame/Classes/AppDelegate.h b/samples/Cpp/SimpleGame/Classes/AppDelegate.h deleted file mode 100644 index 18ee8aeb63..0000000000 --- a/samples/Cpp/SimpleGame/Classes/AppDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "cocos2d.h" - -/** -@brief The cocos2d Application. - -The reason for implement as private inheritance is to hide some interface call by Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp b/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp deleted file mode 100644 index a7b72e8b3c..0000000000 --- a/samples/Cpp/SimpleGame/Classes/GameOverScene.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ray Wenderlich - - http://www.cocos2d-x.org - - 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 "GameOverScene.h" -#include "HelloWorldScene.h" - -using namespace cocos2d; - -bool GameOverScene::init() -{ - if( Scene::init() ) - { - this->_layer = GameOverLayer::create(); - this->_layer->retain(); - this->addChild(_layer); - - return true; - } - else - { - return false; - } -} - -GameOverScene::~GameOverScene() -{ - if (_layer) - { - _layer->release(); - _layer = NULL; - } -} - - -bool GameOverLayer::init() -{ - if ( LayerColor::initWithColor( Color4B(255,255,255,255) ) ) - { - auto winSize = Director::getInstance()->getWinSize(); - this->_label = LabelTTF::create("","Artial", 32); - _label->retain(); - _label->setColor( Color3B(0, 0, 0) ); - _label->setPosition( Point(winSize.width/2, winSize.height/2) ); - this->addChild(_label); - - this->runAction( Sequence::create( - DelayTime::create(3), - CallFunc::create( CC_CALLBACK_0(GameOverLayer::gameOverDone, this)), - NULL)); - - return true; - } - else - { - return false; - } -} - -void GameOverLayer::gameOverDone() -{ - Director::getInstance()->replaceScene( HelloWorld::scene() ); -} - -GameOverLayer::~GameOverLayer() -{ - if (_label) - { - _label->release(); - _label = NULL; - } -} diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp deleted file mode 100644 index 85d2f97be9..0000000000 --- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp +++ /dev/null @@ -1,316 +0,0 @@ -#include "HelloWorldScene.h" -#include "GameOverScene.h" -#include "SimpleAudioEngine.h" - -using namespace cocos2d; - -HelloWorld::~HelloWorld() -{ - if (_targets) - { - _targets->release(); - _targets = NULL; - } - - if (_projectiles) - { - _projectiles->release(); - _projectiles = NULL; - } - - // cpp don't need to call super dealloc - // virtual destructor will do this -} - -HelloWorld::HelloWorld() -:_targets(NULL) -,_projectiles(NULL) -,_projectilesDestroyed(0) -{ -} - -Scene* HelloWorld::scene() -{ - Scene * scene = NULL; - do - { - // 'scene' is an autorelease object - scene = Scene::create(); - CC_BREAK_IF(! scene); - - // 'layer' is an autorelease object - HelloWorld *layer = HelloWorld::create(); - CC_BREAK_IF(! layer); - - // add layer as a child to scene - scene->addChild(layer); - } while (0); - - // return the scene - return scene; -} - -// on "init" you need to initialize your instance -bool HelloWorld::init() -{ - bool bRet = false; - do - { - ////////////////////////////////////////////////////////////////////////// - // super init first - ////////////////////////////////////////////////////////////////////////// - - CC_BREAK_IF(! LayerColor::initWithColor( Color4B(255,255,255,255) ) ); - - ////////////////////////////////////////////////////////////////////////// - // add your codes below... - ////////////////////////////////////////////////////////////////////////// - - // 1. Add a menu item with "X" image, which is clicked to quit the program. - - // Create a "close" menu item with close icon, it's an auto release object. - auto closeItem = MenuItemImage::create( - "CloseNormal.png", - "CloseSelected.png", - CC_CALLBACK_1(HelloWorld::menuCloseCallback,this)); - CC_BREAK_IF(! closeItem); - - // Place the menu item bottom-right conner. - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - - closeItem->setPosition(Point(origin.x + visibleSize.width - closeItem->getContentSize().width/2, - origin.y + closeItem->getContentSize().height/2)); - - // Create a menu with the "close" menu item, it's an auto release object. - auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Point::ZERO); - CC_BREAK_IF(! menu); - - // Add the menu to HelloWorld layer as a child layer. - this->addChild(menu, 1); - - ///////////////////////////// - // 2. add your codes below... - auto player = Sprite::create("Player.png", Rect(0, 0, 27, 40) ); - - player->setPosition( Point(origin.x + player->getContentSize().width/2, - origin.y + visibleSize.height/2) ); - this->addChild(player); - - this->schedule( schedule_selector(HelloWorld::gameLogic), 1.0 ); - - auto dispatcher = Director::getInstance()->getEventDispatcher(); - auto listener = EventListenerTouchAllAtOnce::create(); - listener->onTouchesEnded = CC_CALLBACK_2(HelloWorld::onTouchesEnded, this); - dispatcher->addEventListenerWithSceneGraphPriority(listener, this); - - _targets = new Array(); - _targets->init(); - - _projectiles = new Array(); - _projectiles->init(); - - // use updateGame instead of update, otherwise it will conflit with SelectorProtocol::update - // see http://www.cocos2d-x.org/boards/6/topics/1478 - this->schedule( schedule_selector(HelloWorld::updateGame) ); - - CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic("background-music-aac.wav", true); - - bRet = true; - } while (0); - - return bRet; -} - -void HelloWorld::menuCloseCallback(Object* sender) -{ - // "close" menu item clicked - Director::getInstance()->end(); -} - -// cpp with cocos2d-x -void HelloWorld::addTarget() -{ - Sprite *target = Sprite::create("Target.png", Rect(0,0,27,40) ); - - // Determine where to spawn the target along the Y axis - Size winSize = Director::getInstance()->getVisibleSize(); - float minY = target->getContentSize().height/2; - float maxY = winSize.height - target->getContentSize().height/2; - int rangeY = (int)(maxY - minY); - // srand( TimGetTicks() ); - int actualY = ( rand() % rangeY ) + (int)minY; - - // Create the target slightly off-screen along the right edge, - // and along a random position along the Y axis as calculated - target->setPosition( - Point(winSize.width + (target->getContentSize().width/2), - Director::getInstance()->getVisibleOrigin().y + actualY) ); - this->addChild(target); - - // Determine speed of the target - int minDuration = (int)2.0; - int maxDuration = (int)4.0; - int rangeDuration = maxDuration - minDuration; - // srand( TimGetTicks() ); - int actualDuration = ( rand() % rangeDuration ) + minDuration; - - // Create the actions - FiniteTimeAction* actionMove = MoveTo::create( (float)actualDuration, - Point(0 - target->getContentSize().width/2, actualY) ); - FiniteTimeAction* actionMoveDone = CallFuncN::create( CC_CALLBACK_1(HelloWorld::spriteMoveFinished, this)); - target->runAction( Sequence::create(actionMove, actionMoveDone, NULL) ); - - // Add to targets array - target->setTag(1); - _targets->addObject(target); -} - -void HelloWorld::spriteMoveFinished(Node* sender) -{ - Sprite *sprite = (Sprite *)sender; - this->removeChild(sprite, true); - - if (sprite->getTag() == 1) // target - { - _targets->removeObject(sprite); - - auto gameOverScene = GameOverScene::create(); - gameOverScene->getLayer()->getLabel()->setString("You Lose :["); - Director::getInstance()->replaceScene(gameOverScene); - - } - else if (sprite->getTag() == 2) // projectile - { - _projectiles->removeObject(sprite); - } -} - -void HelloWorld::gameLogic(float dt) -{ - this->addTarget(); -} - -// cpp with cocos2d-x -void HelloWorld::onTouchesEnded(const std::vector& touches, Event* event) -{ - // Choose one of the touches to work with - Touch* touch = touches[0]; - Point location = touch->getLocation(); - - log("++++++++after x:%f, y:%f", location.x, location.y); - - // Set up initial location of projectile - Size winSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - Sprite *projectile = Sprite::create("Projectile.png", Rect(0, 0, 20, 20)); - projectile->setPosition( Point(origin.x+20, origin.y+winSize.height/2) ); - - // Determinie offset of location to projectile - float offX = location.x - projectile->getPosition().x; - float offY = location.y - projectile->getPosition().y; - - // Bail out if we are shooting down or backwards - if (offX <= 0) return; - - // Ok to add now - we've double checked position - this->addChild(projectile); - - // Determine where we wish to shoot the projectile to - float realX = origin.x+winSize.width + (projectile->getContentSize().width/2); - float ratio = offY / offX; - float realY = (realX * ratio) + projectile->getPosition().y; - Point realDest = Point(realX, realY); - - // Determine the length of how far we're shooting - float offRealX = realX - projectile->getPosition().x; - float offRealY = realY - projectile->getPosition().y; - float length = sqrtf((offRealX * offRealX) + (offRealY*offRealY)); - float velocity = 480/1; // 480pixels/1sec - float realMoveDuration = length/velocity; - - // Move projectile to actual endpoint - projectile->runAction( Sequence::create( - MoveTo::create(realMoveDuration, realDest), - CallFuncN::create(CC_CALLBACK_1(HelloWorld::spriteMoveFinished, this)), - NULL) ); - - // Add to projectiles array - projectile->setTag(2); - _projectiles->addObject(projectile); - - CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("pew-pew-lei.wav"); -} - -void HelloWorld::updateGame(float dt) -{ - Array *projectilesToDelete = new Array(); - projectilesToDelete->init(); - - Object* it = NULL; - Object* jt = NULL; - - // for (it = _projectiles->begin(); it != _projectiles->end(); it++) - CCARRAY_FOREACH(_projectiles, it) - { - auto projectile = dynamic_cast(it); - auto projectileRect = Rect( - projectile->getPosition().x - (projectile->getContentSize().width/2), - projectile->getPosition().y - (projectile->getContentSize().height/2), - projectile->getContentSize().width, - projectile->getContentSize().height); - - auto targetsToDelete = new Array(); - targetsToDelete->init(); - - // for (jt = _targets->begin(); jt != _targets->end(); jt++) - CCARRAY_FOREACH(_targets, jt) - { - auto target = dynamic_cast(jt); - auto targetRect = Rect( - target->getPosition().x - (target->getContentSize().width/2), - target->getPosition().y - (target->getContentSize().height/2), - target->getContentSize().width, - target->getContentSize().height); - - // if (Rect::RectIntersectsRect(projectileRect, targetRect)) - if (projectileRect.intersectsRect(targetRect)) - { - targetsToDelete->addObject(target); - } - } - - // for (jt = targetsToDelete->begin(); jt != targetsToDelete->end(); jt++) - CCARRAY_FOREACH(targetsToDelete, jt) - { - auto target = dynamic_cast(jt); - _targets->removeObject(target); - this->removeChild(target, true); - - _projectilesDestroyed++; - if (_projectilesDestroyed >= 5) - { - auto gameOverScene = GameOverScene::create(); - gameOverScene->getLayer()->getLabel()->setString("You Win!"); - Director::getInstance()->replaceScene(gameOverScene); - } - } - - if (targetsToDelete->count() > 0) - { - projectilesToDelete->addObject(projectile); - } - targetsToDelete->release(); - } - - // for (it = projectilesToDelete->begin(); it != projectilesToDelete->end(); it++) - CCARRAY_FOREACH(projectilesToDelete, it) - { - auto projectile = dynamic_cast(it); - _projectiles->removeObject(projectile); - this->removeChild(projectile, true); - } - projectilesToDelete->release(); -} - diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h deleted file mode 100644 index ee65eb2f08..0000000000 --- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __HELLOWORLD_SCENE_H__ -#define __HELLOWORLD_SCENE_H__ - -#include "cocos2d.h" - -//#include "SimpleAudioEngine.h" - -class HelloWorld : public cocos2d::LayerColor -{ -public: - HelloWorld(); - ~HelloWorld(); - - // Here's a difference. Method 'init' in cocos2d-x returns bool, - // instead of returning 'id' in cocos2d-iphone - virtual bool init(); - - // there's no 'id' in cpp, so we recommand to return the exactly class pointer - static cocos2d::Scene* scene(); - - // a selector callback - virtual void menuCloseCallback(cocos2d::Object* sender); - - // implement the "static node()" method manually - CREATE_FUNC(HelloWorld); - - void spriteMoveFinished(cocos2d::Node* sender); - - void gameLogic(float dt); - - void updateGame(float dt); - - void onTouchesEnded(const std::vector& touches, cocos2d::Event* event); - - -protected: - cocos2d::Array *_targets; - cocos2d::Array *_projectiles; - int _projectilesDestroyed; - - void addTarget(); - - -}; - -#endif // __HELLOWORLD_SCENE_H__ diff --git a/samples/Cpp/SimpleGame/Resources/.gitignore b/samples/Cpp/SimpleGame/Resources/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/samples/Cpp/SimpleGame/Resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/samples/Cpp/SimpleGame/Resources/app.config.txt b/samples/Cpp/SimpleGame/Resources/app.config.txt deleted file mode 100644 index b39bf0b1db..0000000000 --- a/samples/Cpp/SimpleGame/Resources/app.config.txt +++ /dev/null @@ -1,10 +0,0 @@ -# This .config.txt file documents configuration settings for your -# application -# The syntax is similar to that in .icf files: -# -# [GroupName] -# Setting Documentation for setting -# -# e.g. -# [MyApplicationGroup] -# MySetting Description of what MySetting is for, its default values, etc diff --git a/samples/Cpp/SimpleGame/proj.android/.classpath b/samples/Cpp/SimpleGame/proj.android/.classpath deleted file mode 100644 index c06dfcb8e5..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Cpp/SimpleGame/proj.android/.project b/samples/Cpp/SimpleGame/proj.android/.project deleted file mode 100644 index bf3f3d0350..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/.project +++ /dev/null @@ -1,65 +0,0 @@ - - - SimpleGame - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Cpp/SimpleGame/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - diff --git a/samples/Cpp/SimpleGame/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Cpp/SimpleGame/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Cpp/SimpleGame/proj.android/AndroidManifest.xml b/samples/Cpp/SimpleGame/proj.android/AndroidManifest.xml deleted file mode 100644 index a0a36be837..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/SimpleGame/proj.android/README.md b/samples/Cpp/SimpleGame/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Cpp/SimpleGame/proj.android/build.xml b/samples/Cpp/SimpleGame/proj.android/build.xml deleted file mode 100644 index e9678a9b14..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk b/samples/Cpp/SimpleGame/proj.android/jni/Android.mk deleted file mode 100644 index cdc6ac3234..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/jni/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := game_shared - -LOCAL_MODULE_FILENAME := libgame - -LOCAL_SRC_FILES := hellocpp/main.cpp \ - ../../Classes/AppDelegate.cpp \ - ../../Classes/HelloWorldScene.cpp \ - ../../Classes/GameOverScene.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,audio/android) -$(call import-module,2d) diff --git a/samples/Cpp/SimpleGame/proj.android/jni/Application.mk b/samples/Cpp/SimpleGame/proj.android/jni/Application.mk deleted file mode 100644 index 74af9626ab..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/jni/Application.mk +++ /dev/null @@ -1,5 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char diff --git a/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp deleted file mode 100644 index ab92fe0f5a..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "platform/android/jni/JniHelper.h" -#include -#include - -#include "HelloWorldScene.h" - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Cpp/SimpleGame/proj.android/jni/list.sh b/samples/Cpp/SimpleGame/proj.android/jni/list.sh deleted file mode 100755 index b29f678cb8..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/jni/list.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -append_str=' \' - -list_alldir() -{ - for file in $1/* - do - if [ -f $file ]; then - echo $file$append_str | grep .cpp - fi - - if [ -d $file ]; then - list_alldir $file - fi - done -} - -if [ $# -gt 0 ]; then - list_alldir "$1" -else - list_alldir "." -fi diff --git a/samples/Cpp/SimpleGame/proj.android/ndkgdb.sh b/samples/Cpp/SimpleGame/proj.android/ndkgdb.sh deleted file mode 100755 index ed934f9bfb..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/ndkgdb.sh +++ /dev/null @@ -1,62 +0,0 @@ -APPNAME="SimpleGame" -APP_ANDROID_NAME="org.cocos2dx.simplegame" - -# read local.properties - -_LOCALPROPERTIES_FILE=$(dirname "$0")"/local.properties" -if [ -f "$_LOCALPROPERTIES_FILE" ] -then - [ -r "$_LOCALPROPERTIES_FILE" ] || die "Fatal Error: $_LOCALPROPERTIES_FILE exists but is unreadable" - - # strip out entries with a "." because Bash cannot process variables with a "." - _PROPERTIES=$(sed '/\./d' "$_LOCALPROPERTIES_FILE") - for line in $_PROPERTIES - do - declare "$line" - done -fi - -if [ -z "${SDK_ROOT+aaa}" ]; then -echo "SDK_ROOT not defined. Please define SDK_ROOT in your environment or in local.properties" -exit 1 -fi - -if [ -z "${NDK_ROOT+aaa}" ]; then -echo "NDK_ROOT not defined. Please define NDK_ROOT in your environment or in local.properties" -exit 1 -fi - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android" -fi - -echo "NDK_ROOT = $NDK_ROOT" -echo "SDK_ROOT = $SDK_ROOT" -echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" -echo "APP_ROOT = $APP_ROOT" -echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" -echo "APP_ANDROID_NAME = $APP_ANDROID_NAME" - -echo -echo "Killing and restarting ${APP_ANDROID_NAME}" -echo - -set -x - -"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}" - -NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \ - "${NDK_ROOT}"/ndk-gdb \ - --adb="${SDK_ROOT}"/platform-tools/adb \ - --verbose \ - --start \ - --force diff --git a/samples/Cpp/SimpleGame/proj.android/project.properties b/samples/Cpp/SimpleGame/proj.android/project.properties deleted file mode 100644 index f7e62936d0..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-10 -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Cpp/SimpleGame/proj.android/res/values/strings.xml b/samples/Cpp/SimpleGame/proj.android/res/values/strings.xml deleted file mode 100644 index f197c895b7..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - SimpleGame - diff --git a/samples/Cpp/SimpleGame/proj.android/run.sh b/samples/Cpp/SimpleGame/proj.android/run.sh deleted file mode 100755 index 6f21bffa98..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/run.sh +++ /dev/null @@ -1 +0,0 @@ -~/bin/android-sdk/platform-tools/adb shell am start org.cocos2dx.simplegame/android.app.NativeActivity diff --git a/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java b/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java deleted file mode 100644 index 09065bdd15..0000000000 --- a/samples/Cpp/SimpleGame/proj.android/src/org/cocos2dx/simplegame/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.simplegame; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Cpp/SimpleGame/proj.ios/SimpleGame_Prefix.pch b/samples/Cpp/SimpleGame/proj.ios/SimpleGame_Prefix.pch deleted file mode 100644 index b8914281d2..0000000000 --- a/samples/Cpp/SimpleGame/proj.ios/SimpleGame_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'HelloWorld' target in the 'HelloWorld' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Cpp/SimpleGame/proj.ios/main.m b/samples/Cpp/SimpleGame/proj.ios/main.m deleted file mode 100644 index bd577a036e..0000000000 --- a/samples/Cpp/SimpleGame/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// iphone -// -// Created by Walzer on 10-11-16. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Cpp/SimpleGame/proj.linux/main.cpp b/samples/Cpp/SimpleGame/proj.linux/main.cpp deleted file mode 100644 index 33e1052ebd..0000000000 --- a/samples/Cpp/SimpleGame/proj.linux/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("SimpleGame",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/SimpleGame/proj.mac/SampleGame_Prefix.pch b/samples/Cpp/SimpleGame/proj.mac/SampleGame_Prefix.pch deleted file mode 100644 index 46c36a7e99..0000000000 --- a/samples/Cpp/SimpleGame/proj.mac/SampleGame_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/samples/Cpp/SimpleGame/proj.mac/en.lproj/MainMenu.xib b/samples/Cpp/SimpleGame/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 07f04dbab1..0000000000 --- a/samples/Cpp/SimpleGame/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1080 - 12D78 - 3084 - 1187.37 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - YES - NSCustomObject - NSMenu - NSMenuItem - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - SampleGame - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - SampleGame - - YES - - - About SampleGame - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide HelloCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit HelloCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - SampleGame Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - NSWindow - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {11, 11} - {10, 3} - - - - diff --git a/samples/Cpp/SimpleGame/proj.mac/main.cpp b/samples/Cpp/SimpleGame/proj.mac/main.cpp deleted file mode 100644 index edc200d976..0000000000 --- a/samples/Cpp/SimpleGame/proj.mac/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("SimpleGame",900,640); - return Application::getInstance()->run(); -} - diff --git a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj b/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj deleted file mode 100644 index cb3c74751e..0000000000 --- a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {E0E282F4-8487-452C-BFAB-CB960EB4D22F} - SimpleGame - Win32Proj - - - - Application - Unicode - true - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - Disabled - ..\Classes;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - - - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - libcocos2d.lib;libchipmunk.lib;%(AdditionalDependencies) - - - - - - - - - MaxSpeed - true - ..\Classes;$(EngineRoot)cocos\audio\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4267;4251;4244;%(DisableSpecificWarnings) - - - libcocos2d.lib;%(AdditionalDependencies) - $(OutDir)$(ProjectName).exe - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - false - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.filters b/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.filters deleted file mode 100644 index cf39562aaa..0000000000 --- a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Classes - - - Classes - - - win32 - - - Classes - - - - - Classes - - - Classes - - - win32 - - - Classes - - - \ No newline at end of file diff --git a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.user b/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.user deleted file mode 100644 index 32a6296820..0000000000 --- a/samples/Cpp/SimpleGame/proj.win32/SimpleGame.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Cpp/SimpleGame/proj.win32/main.cpp b/samples/Cpp/SimpleGame/proj.win32/main.cpp deleted file mode 100644 index d819bb02e0..0000000000 --- a/samples/Cpp/SimpleGame/proj.win32/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "main.h" -#include "../Classes/AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("SimpleGame",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/SimpleGame/proj.win32/main.h b/samples/Cpp/SimpleGame/proj.win32/main.h deleted file mode 100644 index e74708bdf2..0000000000 --- a/samples/Cpp/SimpleGame/proj.win32/main.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Cpp/TestCpp/.cproject b/samples/Cpp/TestCpp/.cproject deleted file mode 100644 index fc4e7a2557..0000000000 --- a/samples/Cpp/TestCpp/.cproject +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/.externalToolBuilders/Javah_jni_builder.launch b/samples/Cpp/TestCpp/.externalToolBuilders/Javah_jni_builder.launch deleted file mode 100644 index 3506e4e944..0000000000 --- a/samples/Cpp/TestCpp/.externalToolBuilders/Javah_jni_builder.launch +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp deleted file mode 100644 index 285d9b17ae..0000000000 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "AppDelegate.h" - -#include "cocos2d.h" -#include "controller.h" -#include "SimpleAudioEngine.h" -#include "cocostudio/CocoStudio.h" -#include "extensions/cocos-ext.h" - -USING_NS_CC; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ -} - -AppDelegate::~AppDelegate() -{ -// SimpleAudioEngine::end(); - cocostudio::ArmatureDataManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // As an example, load config file - // XXX: This should be loaded before the Director is initialized, - // XXX: but at this point, the director is already initialized - Configuration::getInstance()->loadConfigFile("configs/config-example.plist"); - - // initialize director - auto director = Director::getInstance(); - director->setOpenGLView(EGLView::getInstance()); - - director->setDisplayStats(true); - director->setAnimationInterval(1.0 / 60); - - auto screenSize = EGLView::getInstance()->getFrameSize(); - - auto designSize = Size(480, 320); - - auto pFileUtils = FileUtils::getInstance(); - std::vector searchPaths; - - if (screenSize.height > 320) - { - auto resourceSize = Size(960, 640); - searchPaths.push_back("hd"); - searchPaths.push_back("hd/scenetest"); - searchPaths.push_back("hd/scenetest/ArmatureComponentTest"); - searchPaths.push_back("hd/scenetest/AttributeComponentTest"); - searchPaths.push_back("hd/scenetest/BackgroundComponentTest"); - searchPaths.push_back("hd/scenetest/EffectComponentTest"); - searchPaths.push_back("hd/scenetest/LoadSceneEdtiorFileTest"); - searchPaths.push_back("hd/scenetest/ParticleComponentTest"); - searchPaths.push_back("hd/scenetest/SpriteComponentTest"); - searchPaths.push_back("hd/scenetest/TmxMapComponentTest"); - searchPaths.push_back("hd/scenetest/UIComponentTest"); - searchPaths.push_back("hd/scenetest/TriggerTest"); - director->setContentScaleFactor(resourceSize.height/designSize.height); - } - else - { - searchPaths.push_back("scenetest/ArmatureComponentTest"); - searchPaths.push_back("scenetest/AttributeComponentTest"); - searchPaths.push_back("scenetest/BackgroundComponentTest"); - searchPaths.push_back("scenetest/EffectComponentTest"); - searchPaths.push_back("scenetest/LoadSceneEdtiorFileTest"); - searchPaths.push_back("scenetest/ParticleComponentTest"); - searchPaths.push_back("scenetest/SpriteComponentTest"); - searchPaths.push_back("scenetest/TmxMapComponentTest"); - searchPaths.push_back("scenetest/UIComponentTest"); - searchPaths.push_back("scenetest/TriggerTest"); - } - - pFileUtils->setSearchPaths(searchPaths); - - EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); - - auto scene = Scene::create(); - auto layer = new TestController(); - layer->autorelease(); - - scene->addChild(layer); - director->runWithScene(scene); - - // Enable Remote Console - auto console = director->getConsole(); - console->listenOnTCP(5678); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.h b/samples/Cpp/TestCpp/Classes/AppDelegate.h deleted file mode 100644 index 18ee8aeb63..0000000000 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "cocos2d.h" - -/** -@brief The cocos2d Application. - -The reason for implement as private inheritance is to hide some interface call by Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Cpp/TestCpp/Resources/.gitignore b/samples/Cpp/TestCpp/Resources/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/samples/Cpp/TestCpp/Resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/samples/Cpp/TestCpp/Resources/background-music-aac.wav.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/background-music-aac.wav.REMOVED.git-id deleted file mode 100644 index 584ed4de8a..0000000000 --- a/samples/Cpp/TestCpp/Resources/background-music-aac.wav.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -db5624cd760ef3e8dfad2f751d94fac652d6667f \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.android/.classpath b/samples/Cpp/TestCpp/proj.android/.classpath deleted file mode 100644 index c06dfcb8e5..0000000000 --- a/samples/Cpp/TestCpp/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.android/.externalToolBuilders/Javah_jni_builder.launch b/samples/Cpp/TestCpp/proj.android/.externalToolBuilders/Javah_jni_builder.launch deleted file mode 100644 index 3506e4e944..0000000000 --- a/samples/Cpp/TestCpp/proj.android/.externalToolBuilders/Javah_jni_builder.launch +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.android/.project b/samples/Cpp/TestCpp/proj.android/.project deleted file mode 100644 index dd5dee2a3b..0000000000 --- a/samples/Cpp/TestCpp/proj.android/.project +++ /dev/null @@ -1,65 +0,0 @@ - - - TestCpp - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Cpp/TestCpp/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - diff --git a/samples/Cpp/TestCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Cpp/TestCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Cpp/TestCpp/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Cpp/TestCpp/proj.android/README.md b/samples/Cpp/TestCpp/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Cpp/TestCpp/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Cpp/TestCpp/proj.android/ant.properties b/samples/Cpp/TestCpp/proj.android/ant.properties deleted file mode 100644 index b0971e891e..0000000000 --- a/samples/Cpp/TestCpp/proj.android/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked into Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.h b/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.h deleted file mode 100644 index 1401055c5c..0000000000 --- a/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// RootViewController.h -// test -// -// Created by Walzer on 11-4-28. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.mm b/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.mm deleted file mode 100644 index 137ff450a6..0000000000 --- a/samples/Cpp/TestCpp/proj.ios/Classes/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ - // -// RootViewController.mm -// test -// -// Created by Walzer on 11-4-28. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.h b/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.h deleted file mode 100644 index aeed186767..0000000000 --- a/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// iphoneAppDelegate.h -// iphone -// -// Created by Walzer on 10-11-16. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.mm b/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.mm deleted file mode 100644 index 55b5156c7f..0000000000 --- a/samples/Cpp/TestCpp/proj.ios/Classes/testsAppDelegate.mm +++ /dev/null @@ -1,122 +0,0 @@ -// -// iphoneAppDelegate.m -// iphone -// -// Created by Walzer on 10-11-16. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import "testsAppDelegate.h" - -#import "EAGLView.h" -#import "cocos2d.h" -#import "AppDelegate.h" -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - - // Init the CCEAGLView - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGB565 - depthFormat: GL_DEPTH24_STENCIL8_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0]; - [__glView setMultipleTouchEnabled:YES]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden:true]; - - cocos2d::Application::getInstance()->run(); - - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - -- (void)dealloc { - [window release]; - [super dealloc]; -} - - -@end diff --git a/samples/Cpp/TestCpp/proj.linux/main.cpp b/samples/Cpp/TestCpp/proj.linux/main.cpp deleted file mode 100644 index fe87d9a1cd..0000000000 --- a/samples/Cpp/TestCpp/proj.linux/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCEGLView.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Cpp/TestCpp/proj.win32/main.h b/samples/Cpp/TestCpp/proj.win32/main.h deleted file mode 100644 index e74708bdf2..0000000000 --- a/samples/Cpp/TestCpp/proj.win32/main.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp deleted file mode 100644 index d8ec78b296..0000000000 --- a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "AppDelegate.h" - -#include -#include - -#include "cocos2d.h" -#include "SimpleAudioEngine.h" -#include "ScriptingCore.h" -#include "jsb_cocos2dx_auto.hpp" -#include "jsb_cocos2dx_extension_auto.hpp" -#include "jsb_cocos2dx_builder_auto.hpp" -#include "extension/jsb_cocos2dx_extension_manual.h" -#include "cocos2d_specifics.hpp" -#include "cocosbuilder/js_bindings_ccbreader.h" -#include "localstorage/js_bindings_system_registration.h" -#include "chipmunk/js_bindings_chipmunk_registration.h" -#include "jsb_opengl_registration.h" - -USING_NS_CC; -using namespace CocosDenshion; -using namespace std; - -AppDelegate::AppDelegate() -{ -} - -AppDelegate::~AppDelegate() -{ - ScriptEngineManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); - pDirector->setProjection(Director::Projection::_2D); - - - FileUtils::getInstance()->addSearchPath("script"); - - auto screenSize = EGLView::getInstance()->getFrameSize(); - - auto designSize = Size(320, 480); - auto resourceSize = Size(320, 480); - - std::vector resDirOrders; - - Platform platform = Application::getInstance()->getTargetPlatform(); - if (platform == Application::Platform::OS_IPHONE || platform == Application::Platform::OS_IPAD || platform == Application::Platform::OS_MAC) - { - std::vector searchPaths = FileUtils::getInstance()->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), "Published files iOS"); - FileUtils::getInstance()->setSearchPaths(searchPaths); - if (screenSize.height > 1024) - { - resourceSize = Size(1536, 2048); - resDirOrders.push_back("resources-ipadhd"); - resDirOrders.push_back("resources-ipad"); - resDirOrders.push_back("resources-iphonehd"); - } - else if (screenSize.height > 960) - { - resourceSize = Size(768, 1024); - resDirOrders.push_back("resources-ipad"); - resDirOrders.push_back("resources-iphonehd"); - } - else if (screenSize.height > 480) - { - resourceSize = Size(640, 960); - resDirOrders.push_back("resources-iphonehd"); - resDirOrders.push_back("resources-iphone"); - } - else - { - resourceSize = Size(320, 480); - resDirOrders.push_back("resources-iphone"); - } - - } - else if (platform == Application::Platform::OS_ANDROID || platform == Application::Platform::OS_WINDOWS) - { - if (screenSize.height > 960) - { - resourceSize = Size(1280, 1920); - resDirOrders.push_back("resources-xlarge"); - resDirOrders.push_back("resources-large"); - resDirOrders.push_back("resources-medium"); - resDirOrders.push_back("resources-small"); - } - else if (screenSize.height > 720) - { - resourceSize = Size(640, 960); - resDirOrders.push_back("resources-large"); - resDirOrders.push_back("resources-medium"); - resDirOrders.push_back("resources-small"); - } - else if (screenSize.height > 480) - { - resourceSize = Size(480, 720); - resDirOrders.push_back("resources-medium"); - resDirOrders.push_back("resources-small"); - } - else - { - resourceSize = Size(320, 480); - resDirOrders.push_back("resources-small"); - } - } - - FileUtils::getInstance()->setSearchResolutionsOrder(resDirOrders); - - pDirector->setContentScaleFactor(resourceSize.width/designSize.width); - - EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); - - // turn on display FPS - pDirector->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_all_cocos2dx_extension); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_all_cocos2dx_builder); - sc->addRegisterCallback(register_CCBuilderReader); - sc->addRegisterCallback(jsb_register_system); - sc->addRegisterCallback(JSB_register_opengl); - sc->addRegisterCallback(jsb_register_chipmunk); - - sc->start(); - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) - sc->enableDebugger(); -#endif - - js_log("RUNNING Main"); - auto pEngine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("main.js"); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} diff --git a/samples/Javascript/CocosDragonJS/proj.android/.project b/samples/Javascript/CocosDragonJS/proj.android/.project deleted file mode 100644 index 0a52fa2ab9..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/.project +++ /dev/null @@ -1,70 +0,0 @@ - - - CocosDragonJS - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Javascript/CocosDragonJS/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Javascript/CocosDragonJS/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Javascript/CocosDragonJS/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Javascript/CocosDragonJS/proj.android/AndroidManifest.xml b/samples/Javascript/CocosDragonJS/proj.android/AndroidManifest.xml deleted file mode 100644 index a215673a7c..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/CocosDragonJS/proj.android/README.md b/samples/Javascript/CocosDragonJS/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Javascript/CocosDragonJS/proj.android/build.xml b/samples/Javascript/CocosDragonJS/proj.android/build.xml deleted file mode 100644 index b5b34f9013..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/CocosDragonJS/proj.android/jni/Android.mk b/samples/Javascript/CocosDragonJS/proj.android/jni/Android.mk deleted file mode 100644 index 1e65b8e7a5..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/jni/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := cocosdragonjs_shared - -LOCAL_MODULE_FILENAME := libcocosdragonjs - -LOCAL_SRC_FILES := cocosdragonjs/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static - -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/javascript/bindings) -$(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/extension) -$(call import-module,scripting/javascript/bindings/localstorage) -$(call import-module,scripting/javascript/bindings/network) -$(call import-module,scripting/javascript/bindings/cocosbuilder) - diff --git a/samples/Javascript/CocosDragonJS/proj.android/jni/Application.mk b/samples/Javascript/CocosDragonJS/proj.android/jni/Application.mk deleted file mode 100644 index 3666985a1f..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/jni/Application.mk +++ /dev/null @@ -1,6 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char - diff --git a/samples/Javascript/CocosDragonJS/proj.android/ndkgdb.sh b/samples/Javascript/CocosDragonJS/proj.android/ndkgdb.sh deleted file mode 100755 index 779acc425f..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/ndkgdb.sh +++ /dev/null @@ -1,47 +0,0 @@ -APPNAME="CocosDragonJS" -APP_ANDROID_NAME="org.cocos2dx.cocosdragonjs" - -if [ -z "${SDK_ROOT+aaa}" ]; then -# ... if SDK_ROOT is not set, use "$HOME/bin/android-sdk" - SDK_ROOT="$HOME/bin/android-sdk" -fi - -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" -fi - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android" -fi - -echo "NDK_ROOT = $NDK_ROOT" -echo "SDK_ROOT = $SDK_ROOT" -echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" -echo "APP_ROOT = $APP_ROOT" -echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" -echo "APP_ANDROID_NAME = $APP_ANDROID_NAME" - -echo -echo "Killing and restarting ${APP_ANDROID_NAME}" -echo - -set -x - -"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}" - -NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \ - "${NDK_ROOT}"/ndk-gdb \ - --adb="${SDK_ROOT}"/platform-tools/adb \ - --verbose \ - --start \ - --force diff --git a/samples/Javascript/CocosDragonJS/proj.android/proguard-project.txt b/samples/Javascript/CocosDragonJS/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Javascript/CocosDragonJS/proj.android/res/values/strings.xml b/samples/Javascript/CocosDragonJS/proj.android/res/values/strings.xml deleted file mode 100644 index 1cc07c9cad..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - CocosDragonJS - diff --git a/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java b/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java deleted file mode 100644 index bde3e3a5a0..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.android/src/org/cocos2dx/cocosdragonjs/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.cocosdragonjs; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Javascript/CocosDragonJS/proj.ios/AppController.h b/samples/Javascript/CocosDragonJS/proj.ios/AppController.h deleted file mode 100644 index 10287bd13f..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.ios/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Javascript/CocosDragonJS/proj.ios/AppController.mm b/samples/Javascript/CocosDragonJS/proj.ios/AppController.mm deleted file mode 100644 index ca23f1b7f8..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.ios/AppController.mm +++ /dev/null @@ -1,119 +0,0 @@ -// -// testjsAppController.mm -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 //_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Javascript/CocosDragonJS/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Javascript/CocosDragonJS/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Javascript/CocosDragonJS/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.ios/RootViewController.h b/samples/Javascript/CocosDragonJS/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Javascript/CocosDragonJS/proj.mac/main.cpp b/samples/Javascript/CocosDragonJS/proj.mac/main.cpp deleted file mode 100644 index cc76835ef2..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.mac/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("CocosDragonJS", 480, 720); - return Application::getInstance()->run(); -} diff --git a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj b/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj deleted file mode 100644 index 2e7cc9a5d5..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj +++ /dev/null @@ -1,228 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7} - CocosDragonJS - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - Disabled - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes" -mkdir "$(OutDir)\CocosDragonJSRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$(OutDir)\CocosDragonJSRes\" /e /Y - - - Copy js and resource files. - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\CocosDragonJSRes" rd /s /q "$(OutDir)\CocosDragonJSRes" -mkdir "$(OutDir)\CocosDragonJSRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\CocosDragonJSRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$(OutDir)\CocosDragonJSRes\" /e /Y - Copy js and resource files. - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - - - {21070e58-eec6-4e16-8b4f-6d083df55790} - - - {f9da0fc1-651b-457b-962e-a4d61cebf5fd} - - - {625f7391-9a91-48a1-8cfc-79508c822637} - - - {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - - - {39379840-825a-45a0-b363-c09ffef864bd} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.filters b/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.filters deleted file mode 100644 index 56df37ce6f..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.filters +++ /dev/null @@ -1,44 +0,0 @@ - - - - - {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest - - - {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} - - - {e93a77e1-af1e-4400-87d3-504b62ebdbb0} - - - - - win32 - - - Classes - - - - - win32 - - - win32 - - - Classes - - - - - resource - - - - - resource - - - \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.user b/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.user deleted file mode 100644 index 9d1dc0a360..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/CocosDragonJS.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(OutDir)\CocosDragonJSRes - WindowsLocalDebugger - - - $(OutDir)\CocosDragonJSRes - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/proj.win32/main.cpp b/samples/Javascript/CocosDragonJS/proj.win32/main.cpp deleted file mode 100644 index 32adc1cd52..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -// #define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("CocosDragonJS", 480, 720); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Javascript/CocosDragonJS/proj.win32/main.h b/samples/Javascript/CocosDragonJS/proj.win32/main.h deleted file mode 100644 index e29aeedb3a..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __WINMAIN_H__ diff --git a/samples/Javascript/CocosDragonJS/proj.win32/resource.h b/samples/Javascript/CocosDragonJS/proj.win32/resource.h deleted file mode 100644 index a4cfa38af8..0000000000 --- a/samples/Javascript/CocosDragonJS/proj.win32/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by testjs.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 32775 -#endif -#endif diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp deleted file mode 100644 index f8cd0ab32d..0000000000 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "AppDelegate.h" - -#include "cocos2d.h" -#include "SimpleAudioEngine.h" -#include "ScriptingCore.h" -#include "jsb_cocos2dx_auto.hpp" -#include "jsb_cocos2dx_extension_auto.hpp" -#include "jsb_cocos2dx_builder_auto.hpp" -#include "extension/jsb_cocos2dx_extension_manual.h" -#include "cocos2d_specifics.hpp" -#include "cocosbuilder/js_bindings_ccbreader.h" -#include "localstorage/js_bindings_system_registration.h" -#include "chipmunk/js_bindings_chipmunk_registration.h" -#include "jsb_opengl_registration.h" - -USING_NS_CC; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ -} - -AppDelegate::~AppDelegate() -{ - ScriptEngineManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); - pDirector->setProjection(Director::Projection::_2D); - - FileUtils::getInstance()->addSearchPath("script"); - - auto screenSize = EGLView::getInstance()->getFrameSize(); - - auto designSize = Size(320, 480); - auto resourceSize = Size(320, 480); - - std::vector searchPaths = FileUtils::getInstance()->getSearchPaths(); - std::vector resDirOrders; - - Application::Platform platform = Application::getInstance()->getTargetPlatform(); - if (platform == Application::Platform::OS_IPHONE || platform == Application::Platform::OS_IPAD || platform == Application::Platform::OS_MAC) - { - searchPaths.push_back("Published-iOS"); // Resources/Published-iOS - FileUtils::getInstance()->setSearchPaths(searchPaths); - - if (screenSize.height > 480) - { - resourceSize = Size(640, 960); - resDirOrders.push_back("resources-iphonehd"); - } - else - { - resDirOrders.push_back("resources-iphone"); - } - - FileUtils::getInstance()->setSearchResolutionsOrder(resDirOrders); - } - else if (platform == Application::Platform::OS_ANDROID || platform == Application::Platform::OS_WINDOWS) - { - // Comments it since opengles2.0 only supports texture size within 2048x2048. -// if (screenSize.height > 1024) -// { -// resourceSize = Size(1280, 1920); -// resDirOrders.push_back("resources-xlarge"); -// resDirOrders.push_back(""); -// } -// else - if (screenSize.height > 960) - { - resourceSize = Size(640, 960); - resDirOrders.push_back("resources-large"); - resDirOrders.push_back("resources-medium"); - resDirOrders.push_back("resources-small"); - } - else if (screenSize.height > 480) - { - resourceSize = Size(480, 720); - resDirOrders.push_back("resources-medium"); - resDirOrders.push_back("resources-small"); - } - else - { - resourceSize = Size(320, 568); - resDirOrders.push_back("resources-small"); - } - - FileUtils::getInstance()->setSearchResolutionsOrder(resDirOrders); - } - pDirector->setContentScaleFactor(resourceSize.width/designSize.width); - - EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL); - - // turn on display FPS - pDirector->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_all_cocos2dx_extension); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - sc->addRegisterCallback(jsb_register_chipmunk); - sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_all_cocos2dx_builder); - sc->addRegisterCallback(register_CCBuilderReader); - sc->addRegisterCallback(jsb_register_system); - sc->addRegisterCallback(JSB_register_opengl); - - sc->start(); - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) - sc->enableDebugger(); -#endif - - js_log("RUNNING Main"); - auto pEngine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("main.js"); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.h b/samples/Javascript/CrystalCraze/Classes/AppDelegate.h deleted file mode 100644 index df8f12f70f..0000000000 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// GCTestAppDelegate.h -// GCTest -// -// Created by Rohan Kuruvilla on 06/08/2012. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" -/** - @brief The cocos2d Application. - - The reason for implement as private inheritance is to hide some interface call by Director. - */ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Javascript/CrystalCraze/proj.android/.classpath b/samples/Javascript/CrystalCraze/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Javascript/CrystalCraze/proj.android/.project b/samples/Javascript/CrystalCraze/proj.android/.project deleted file mode 100644 index 48f68239f6..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/.project +++ /dev/null @@ -1,70 +0,0 @@ - - - CrystalCraze - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Javascript/CrystalCraze/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Javascript/CrystalCraze/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Javascript/CrystalCraze/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Javascript/CrystalCraze/proj.android/AndroidManifest.xml b/samples/Javascript/CrystalCraze/proj.android/AndroidManifest.xml deleted file mode 100644 index 25c83ab747..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/CrystalCraze/proj.android/README.md b/samples/Javascript/CrystalCraze/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Javascript/CrystalCraze/proj.android/ant.properties b/samples/Javascript/CrystalCraze/proj.android/ant.properties deleted file mode 100644 index f8af38bfb4..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/ant.properties +++ /dev/null @@ -1 +0,0 @@ -aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/samples/Javascript/CrystalCraze/proj.android/build.xml b/samples/Javascript/CrystalCraze/proj.android/build.xml deleted file mode 100644 index 1bb22c3efd..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/CrystalCraze/proj.android/jni/Android.mk b/samples/Javascript/CrystalCraze/proj.android/jni/Android.mk deleted file mode 100644 index 9c8854568c..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/jni/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := crystalcraze_shared - -LOCAL_MODULE_FILENAME := libcrystalcraze - -LOCAL_SRC_FILES := crystalcraze/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static - -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/javascript/bindings) -$(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/extension) -$(call import-module,scripting/javascript/bindings/localstorage) -$(call import-module,scripting/javascript/bindings/network) -$(call import-module,scripting/javascript/bindings/cocosbuilder) diff --git a/samples/Javascript/CrystalCraze/proj.android/jni/Application.mk b/samples/Javascript/CrystalCraze/proj.android/jni/Application.mk deleted file mode 100644 index 3666985a1f..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/jni/Application.mk +++ /dev/null @@ -1,6 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char - diff --git a/samples/Javascript/CrystalCraze/proj.android/jni/crystalcraze/main.cpp b/samples/Javascript/CrystalCraze/proj.android/jni/crystalcraze/main.cpp deleted file mode 100644 index 9793beefb1..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/jni/crystalcraze/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "cocos2d.h" -#include "platform/android/jni/JniHelper.h" -#include "CCEventType.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Javascript/CrystalCraze/proj.android/ndkgdb.sh b/samples/Javascript/CrystalCraze/proj.android/ndkgdb.sh deleted file mode 100755 index b62f46024e..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/ndkgdb.sh +++ /dev/null @@ -1,47 +0,0 @@ -APPNAME="CrystalCraze" -APP_ANDROID_NAME="org.cocos2dx.cocosdragonjs" - -if [ -z "${SDK_ROOT+aaa}" ]; then -# ... if SDK_ROOT is not set, use "$HOME/bin/android-sdk" - SDK_ROOT="$HOME/bin/android-sdk" -fi - -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" -fi - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android" -fi - -echo "NDK_ROOT = $NDK_ROOT" -echo "SDK_ROOT = $SDK_ROOT" -echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" -echo "APP_ROOT = $APP_ROOT" -echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" -echo "APP_ANDROID_NAME = $APP_ANDROID_NAME" - -echo -echo "Killing and restarting ${APP_ANDROID_NAME}" -echo - -set -x - -"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}" - -NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \ - "${NDK_ROOT}"/ndk-gdb \ - --adb="${SDK_ROOT}"/platform-tools/adb \ - --verbose \ - --start \ - --force diff --git a/samples/Javascript/CrystalCraze/proj.android/proguard-project.txt b/samples/Javascript/CrystalCraze/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Javascript/CrystalCraze/proj.android/project.properties b/samples/Javascript/CrystalCraze/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Javascript/CrystalCraze/proj.android/res/values/strings.xml b/samples/Javascript/CrystalCraze/proj.android/res/values/strings.xml deleted file mode 100644 index 3e26a6a118..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - CrystalCraze - diff --git a/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java b/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java deleted file mode 100644 index f4dfa7e83b..0000000000 --- a/samples/Javascript/CrystalCraze/proj.android/src/org/cocos2dx/crystalcraze/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.crystalcraze; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Javascript/CrystalCraze/proj.ios/AppController.h b/samples/Javascript/CrystalCraze/proj.ios/AppController.h deleted file mode 100644 index 10287bd13f..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Javascript/CrystalCraze/proj.ios/AppController.mm b/samples/Javascript/CrystalCraze/proj.ios/AppController.mm deleted file mode 100644 index ca23f1b7f8..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/AppController.mm +++ /dev/null @@ -1,119 +0,0 @@ -// -// testjsAppController.mm -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 //_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Javascript/CrystalCraze/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Javascript/CrystalCraze/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Javascript/CrystalCraze/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.ios/Prefix.pch b/samples/Javascript/CrystalCraze/proj.ios/Prefix.pch deleted file mode 100644 index b056d8694a..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'testjs' target in the 'testjs' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Javascript/CrystalCraze/proj.ios/RootViewController.h b/samples/Javascript/CrystalCraze/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Javascript/CrystalCraze/proj.ios/RootViewController.mm b/samples/Javascript/CrystalCraze/proj.ios/RootViewController.mm deleted file mode 100644 index 8438d7a420..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Javascript/CrystalCraze/proj.ios/main.m b/samples/Javascript/CrystalCraze/proj.ios/main.m deleted file mode 100644 index e3dedca28b..0000000000 --- a/samples/Javascript/CrystalCraze/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 3dacdedbd0..0000000000 --- a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - TestCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - TestCpp - - YES - - - About TestCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide TestCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit TestCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - TestCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - NSWindow - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/samples/Javascript/CrystalCraze/proj.mac/main.cpp b/samples/Javascript/CrystalCraze/proj.mac/main.cpp deleted file mode 100644 index fecfe31ab8..0000000000 --- a/samples/Javascript/CrystalCraze/proj.mac/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("CrystalCraze", 480, 720); - return Application::getInstance()->run(); -} diff --git a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj b/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj deleted file mode 100644 index 36fd882002..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {9A17D9A4-4B11-4E32-94F6-895FF4909EC5} - CrystalCraze - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - Disabled - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\CrystalCrazeRes" rd /s /q "$(OutDir)\CrystalCrazeRes" -mkdir "$(OutDir)\CrystalCrazeRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\CrystalCrazeRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\CrystalCraze\Published-Android" "$(OutDir)\CrystalCrazeRes\" /e /Y - - - Copy js and resource files. - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\CrystalCrazeRes" rd /s /q "$(OutDir)\CrystalCrazeRes" -mkdir "$(OutDir)\CrystalCrazeRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\CrystalCrazeRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\CrystalCraze\Published-Android" "$(OutDir)\CrystalCrazeRes\" /e /Y - Copy js and resource files. - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - - - {b57cf53f-2e49-4031-9822-047cc0e6bde2} - - - {df2638c0-8128-4847-867c-6eafe3dee7b5} - - - {21070e58-eec6-4e16-8b4f-6d083df55790} - - - {f9da0fc1-651b-457b-962e-a4d61cebf5fd} - - - {625f7391-9a91-48a1-8cfc-79508c822637} - - - {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - - - {39379840-825a-45a0-b363-c09ffef864bd} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.filters b/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.filters deleted file mode 100644 index 56df37ce6f..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.filters +++ /dev/null @@ -1,44 +0,0 @@ - - - - - {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest - - - {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} - - - {e93a77e1-af1e-4400-87d3-504b62ebdbb0} - - - - - win32 - - - Classes - - - - - win32 - - - win32 - - - Classes - - - - - resource - - - - - resource - - - \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.user b/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.user deleted file mode 100644 index 17116bfa9e..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/CrystalCraze.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(OutDir)\CrystalCrazeRes - WindowsLocalDebugger - - - $(OutDir)\CrystalCrazeRes - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/proj.win32/main.cpp b/samples/Javascript/CrystalCraze/proj.win32/main.cpp deleted file mode 100644 index 6064ff7dd8..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -// #define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("CrystalCraze", 480, 720); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Javascript/CrystalCraze/proj.win32/main.h b/samples/Javascript/CrystalCraze/proj.win32/main.h deleted file mode 100644 index e29aeedb3a..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __WINMAIN_H__ diff --git a/samples/Javascript/CrystalCraze/proj.win32/res/testjs.ico b/samples/Javascript/CrystalCraze/proj.win32/res/testjs.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/samples/Javascript/CrystalCraze/proj.win32/res/testjs.ico and /dev/null differ diff --git a/samples/Javascript/CrystalCraze/proj.win32/resource.h b/samples/Javascript/CrystalCraze/proj.win32/resource.h deleted file mode 100644 index a4cfa38af8..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by testjs.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 32775 -#endif -#endif diff --git a/samples/Javascript/CrystalCraze/proj.win32/testjs.rc b/samples/Javascript/CrystalCraze/proj.win32/testjs.rc deleted file mode 100644 index 99e7360397..0000000000 --- a/samples/Javascript/CrystalCraze/proj.win32/testjs.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\testjs.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "testjs Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "testjs\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "testjs.exe\0" - VALUE "ProductName", "testjs Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp deleted file mode 100644 index ee9406b274..0000000000 --- a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "AppDelegate.h" - -#include "cocos2d.h" -#include "SimpleAudioEngine.h" -#include "ScriptingCore.h" -#include "jsb_cocos2dx_auto.hpp" -#include "jsb_cocos2dx_extension_auto.hpp" -#include "jsb_cocos2dx_builder_auto.hpp" -#include "extension/jsb_cocos2dx_extension_manual.h" -#include "cocos2d_specifics.hpp" -#include "cocosbuilder/js_bindings_ccbreader.h" -#include "localstorage/js_bindings_system_registration.h" -#include "chipmunk/js_bindings_chipmunk_registration.h" -#include "jsb_opengl_registration.h" - -USING_NS_CC; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ -} - -AppDelegate::~AppDelegate() -{ - ScriptEngineManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); - pDirector->setProjection(Director::Projection::_2D); - - // Set the design resolution - EGLView::getInstance()->setDesignResolutionSize(320, 480, ResolutionPolicy::SHOW_ALL); - - // turn on display FPS - pDirector->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); - - FileUtils::getInstance()->addSearchPath("script"); - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_all_cocos2dx_extension); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - sc->addRegisterCallback(jsb_register_chipmunk); - sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_all_cocos2dx_builder); - sc->addRegisterCallback(register_CCBuilderReader); - sc->addRegisterCallback(jsb_register_system); - sc->addRegisterCallback(JSB_register_opengl); - - sc->start(); - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) - sc->enableDebugger(); -#endif - - auto pEngine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - - ScriptingCore::getInstance()->runScript("MoonWarriors-jsb.js"); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} diff --git a/samples/Javascript/MoonWarriors/Classes/AppDelegate.h b/samples/Javascript/MoonWarriors/Classes/AppDelegate.h deleted file mode 100644 index df8f12f70f..0000000000 --- a/samples/Javascript/MoonWarriors/Classes/AppDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// GCTestAppDelegate.h -// GCTest -// -// Created by Rohan Kuruvilla on 06/08/2012. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" -/** - @brief The cocos2d Application. - - The reason for implement as private inheritance is to hide some interface call by Director. - */ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Javascript/MoonWarriors/proj.android/.classpath b/samples/Javascript/MoonWarriors/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Javascript/MoonWarriors/proj.android/.project b/samples/Javascript/MoonWarriors/proj.android/.project deleted file mode 100644 index 4bdf70520e..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/.project +++ /dev/null @@ -1,70 +0,0 @@ - - - MoonWarriors - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Javascript/MoonWarriors/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Javascript/MoonWarriors/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Javascript/MoonWarriors/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Javascript/MoonWarriors/proj.android/AndroidManifest.xml b/samples/Javascript/MoonWarriors/proj.android/AndroidManifest.xml deleted file mode 100644 index 0ba17d3e4a..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/MoonWarriors/proj.android/README.md b/samples/Javascript/MoonWarriors/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Javascript/MoonWarriors/proj.android/ant.properties b/samples/Javascript/MoonWarriors/proj.android/ant.properties deleted file mode 100644 index f8af38bfb4..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/ant.properties +++ /dev/null @@ -1 +0,0 @@ -aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/samples/Javascript/MoonWarriors/proj.android/build.xml b/samples/Javascript/MoonWarriors/proj.android/build.xml deleted file mode 100644 index ae419c802d..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/MoonWarriors/proj.android/jni/Android.mk b/samples/Javascript/MoonWarriors/proj.android/jni/Android.mk deleted file mode 100644 index 93726f5b70..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/jni/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := moonwarriors_shared - -LOCAL_MODULE_FILENAME := libmoonwarriors - -LOCAL_SRC_FILES := moonwarriors/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static - -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/javascript/bindings) -$(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/extension) -$(call import-module,scripting/javascript/bindings/localstorage) -$(call import-module,scripting/javascript/bindings/network) -$(call import-module,scripting/javascript/bindings/cocosbuilder) diff --git a/samples/Javascript/MoonWarriors/proj.android/jni/moonwarriors/main.cpp b/samples/Javascript/MoonWarriors/proj.android/jni/moonwarriors/main.cpp deleted file mode 100644 index 9793beefb1..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/jni/moonwarriors/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "cocos2d.h" -#include "platform/android/jni/JniHelper.h" -#include "CCEventType.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Javascript/MoonWarriors/proj.android/proguard-project.txt b/samples/Javascript/MoonWarriors/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Javascript/MoonWarriors/proj.android/project.properties b/samples/Javascript/MoonWarriors/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Javascript/MoonWarriors/proj.android/res/values/strings.xml b/samples/Javascript/MoonWarriors/proj.android/res/values/strings.xml deleted file mode 100644 index 707408a4d7..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - MoonWarriors - diff --git a/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java b/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java deleted file mode 100644 index c979c4d044..0000000000 --- a/samples/Javascript/MoonWarriors/proj.android/src/org/cocos2dx/moonwarriors/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.moonwarriors; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Javascript/MoonWarriors/proj.ios/AppController.h b/samples/Javascript/MoonWarriors/proj.ios/AppController.h deleted file mode 100644 index 10287bd13f..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Javascript/MoonWarriors/proj.ios/AppController.mm b/samples/Javascript/MoonWarriors/proj.ios/AppController.mm deleted file mode 100644 index ca23f1b7f8..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/AppController.mm +++ /dev/null @@ -1,119 +0,0 @@ -// -// testjsAppController.mm -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 //_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Javascript/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Javascript/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Javascript/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.ios/Prefix.pch b/samples/Javascript/MoonWarriors/proj.ios/Prefix.pch deleted file mode 100644 index b056d8694a..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'testjs' target in the 'testjs' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Javascript/MoonWarriors/proj.ios/RootViewController.mm b/samples/Javascript/MoonWarriors/proj.ios/RootViewController.mm deleted file mode 100644 index 3a37088ebd..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsPortrait(interfaceOrientation); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Javascript/MoonWarriors/proj.ios/main.m b/samples/Javascript/MoonWarriors/proj.ios/main.m deleted file mode 100644 index e3dedca28b..0000000000 --- a/samples/Javascript/MoonWarriors/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 3dacdedbd0..0000000000 --- a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - TestCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - TestCpp - - YES - - - About TestCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide TestCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit TestCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - TestCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - NSWindow - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/samples/Javascript/MoonWarriors/proj.mac/main.cpp b/samples/Javascript/MoonWarriors/proj.mac/main.cpp deleted file mode 100644 index 1c421ad511..0000000000 --- a/samples/Javascript/MoonWarriors/proj.mac/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("MoonWarriors", 480, 720); - return Application::getInstance()->run(); -} - diff --git a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj b/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj deleted file mode 100644 index d0dfa15e88..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2} - MoonWarriors - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - Disabled - .;..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\MoonWarriorsRes" rd /s /q "$(OutDir)\MoonWarriorsRes" -mkdir "$(OutDir)\MoonWarriorsRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\MoonWarriorsRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\MoonWarriors" "$(OutDir)\MoonWarriorsRes\" /e /Y - Copy js and resource files. - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - .;..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\MoonWarriorsRes" rd /s /q "$(OutDir)\MoonWarriorsRes" -mkdir "$(OutDir)\MoonWarriorsRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\MoonWarriorsRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\MoonWarriors" "$(OutDir)\MoonWarriorsRes\" /e /Y - Copy js and resource files. - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - - - {b57cf53f-2e49-4031-9822-047cc0e6bde2} - - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - - - {df2638c0-8128-4847-867c-6eafe3dee7b5} - - - {21070e58-eec6-4e16-8b4f-6d083df55790} - - - {f9da0fc1-651b-457b-962e-a4d61cebf5fd} - - - {625f7391-9a91-48a1-8cfc-79508c822637} - - - {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - - - {39379840-825a-45a0-b363-c09ffef864bd} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.filters b/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.filters deleted file mode 100644 index 56df37ce6f..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.filters +++ /dev/null @@ -1,44 +0,0 @@ - - - - - {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest - - - {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} - - - {e93a77e1-af1e-4400-87d3-504b62ebdbb0} - - - - - win32 - - - Classes - - - - - win32 - - - win32 - - - Classes - - - - - resource - - - - - resource - - - \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.user b/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.user deleted file mode 100644 index 475efbea21..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/MoonWarriors.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(OutDir)\MoonWarriorsRes - WindowsLocalDebugger - - - $(OutDir)\MoonWarriorsRes - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/proj.win32/main.h b/samples/Javascript/MoonWarriors/proj.win32/main.h deleted file mode 100644 index e29aeedb3a..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __WINMAIN_H__ diff --git a/samples/Javascript/MoonWarriors/proj.win32/res/testjs.ico b/samples/Javascript/MoonWarriors/proj.win32/res/testjs.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/samples/Javascript/MoonWarriors/proj.win32/res/testjs.ico and /dev/null differ diff --git a/samples/Javascript/MoonWarriors/proj.win32/resource.h b/samples/Javascript/MoonWarriors/proj.win32/resource.h deleted file mode 100644 index a4cfa38af8..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by testjs.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 32775 -#endif -#endif diff --git a/samples/Javascript/MoonWarriors/proj.win32/testjs.rc b/samples/Javascript/MoonWarriors/proj.win32/testjs.rc deleted file mode 100644 index 99e7360397..0000000000 --- a/samples/Javascript/MoonWarriors/proj.win32/testjs.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\testjs.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "testjs Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "testjs\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "testjs.exe\0" - VALUE "ProductName", "testjs Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared deleted file mode 160000 index 68e023e91b..0000000000 --- a/samples/Javascript/Shared +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 68e023e91b697c461fe986099189bc594ecab6c2 diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.h b/samples/Javascript/TestJavascript/Classes/AppDelegate.h deleted file mode 100644 index df8f12f70f..0000000000 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// GCTestAppDelegate.h -// GCTest -// -// Created by Rohan Kuruvilla on 06/08/2012. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" -/** - @brief The cocos2d Application. - - The reason for implement as private inheritance is to hide some interface call by Director. - */ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Javascript/TestJavascript/proj.android/.classpath b/samples/Javascript/TestJavascript/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Javascript/TestJavascript/proj.android/.project b/samples/Javascript/TestJavascript/proj.android/.project deleted file mode 100644 index 48030971da..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.project +++ /dev/null @@ -1,76 +0,0 @@ - - - TestJavascript - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.wst.jsdt.core.jsNature - - - - Classes - 2 - COCOS2DX/samples/Javascript/TestJavascript/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Javascript/TestJavascript/proj.android/.settings/.jsdtscope b/samples/Javascript/TestJavascript/proj.android/.settings/.jsdtscope deleted file mode 100644 index bbf7a521cc..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.settings/.jsdtscope +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.prefs b/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.prefs deleted file mode 100644 index 6bf5ec1a0a..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.wst.jsdt.ui.text.custom_code_templates= diff --git a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.container b/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100644 index 3bd5d0a480..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.name b/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100644 index 05bd71b6ec..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Window \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.android/README.md b/samples/Javascript/TestJavascript/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Javascript/TestJavascript/proj.android/ant.properties b/samples/Javascript/TestJavascript/proj.android/ant.properties deleted file mode 100644 index f8af38bfb4..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/ant.properties +++ /dev/null @@ -1 +0,0 @@ -aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Application.mk b/samples/Javascript/TestJavascript/proj.android/jni/Application.mk deleted file mode 100644 index 47d8add103..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/jni/Application.mk +++ /dev/null @@ -1,5 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char diff --git a/samples/Javascript/TestJavascript/proj.android/jni/testjavascript/main.cpp b/samples/Javascript/TestJavascript/proj.android/jni/testjavascript/main.cpp deleted file mode 100644 index 9793beefb1..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/jni/testjavascript/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "cocos2d.h" -#include "platform/android/jni/JniHelper.h" -#include "CCEventType.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Javascript/TestJavascript/proj.android/proguard-project.txt b/samples/Javascript/TestJavascript/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Javascript/TestJavascript/proj.android/project.properties b/samples/Javascript/TestJavascript/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Javascript/TestJavascript/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Javascript/TestJavascript/proj.ios/AppController.h b/samples/Javascript/TestJavascript/proj.ios/AppController.h deleted file mode 100644 index 10287bd13f..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Javascript/TestJavascript/proj.ios/AppController.mm b/samples/Javascript/TestJavascript/proj.ios/AppController.mm deleted file mode 100644 index 5cd84017c9..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/AppController.mm +++ /dev/null @@ -1,121 +0,0 @@ -// -// testjsAppController.mm -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH24_STENCIL8_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - [__glView setMultipleTouchEnabled:YES]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Javascript/TestJavascript/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.ios/Prefix.pch b/samples/Javascript/TestJavascript/proj.ios/Prefix.pch deleted file mode 100644 index b056d8694a..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'testjs' target in the 'testjs' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Javascript/TestJavascript/proj.ios/RootViewController.h b/samples/Javascript/TestJavascript/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Javascript/TestJavascript/proj.ios/RootViewController.mm b/samples/Javascript/TestJavascript/proj.ios/RootViewController.mm deleted file mode 100644 index 8438d7a420..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Javascript/TestJavascript/proj.ios/main.m b/samples/Javascript/TestJavascript/proj.ios/main.m deleted file mode 100644 index e3dedca28b..0000000000 --- a/samples/Javascript/TestJavascript/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 3dacdedbd0..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - TestCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - TestCpp - - YES - - - About TestCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide TestCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit TestCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - TestCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - NSWindow - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/samples/Javascript/TestJavascript/proj.mac/main.cpp b/samples/Javascript/TestJavascript/proj.mac/main.cpp deleted file mode 100644 index 993742b406..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("TestJavascript",900,640); - return Application::getInstance()->run(); -} - diff --git a/samples/Javascript/TestJavascript/proj.win32/main.cpp b/samples/Javascript/TestJavascript/proj.win32/main.cpp deleted file mode 100644 index 0f4c16d7c8..0000000000 --- a/samples/Javascript/TestJavascript/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -// #define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("TestJavascript",900,640); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Javascript/TestJavascript/proj.win32/main.h b/samples/Javascript/TestJavascript/proj.win32/main.h deleted file mode 100644 index e29aeedb3a..0000000000 --- a/samples/Javascript/TestJavascript/proj.win32/main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __WINMAIN_H__ diff --git a/samples/Javascript/TestJavascript/proj.win32/res/testjs.ico b/samples/Javascript/TestJavascript/proj.win32/res/testjs.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/samples/Javascript/TestJavascript/proj.win32/res/testjs.ico and /dev/null differ diff --git a/samples/Javascript/TestJavascript/proj.win32/resource.h b/samples/Javascript/TestJavascript/proj.win32/resource.h deleted file mode 100644 index a4cfa38af8..0000000000 --- a/samples/Javascript/TestJavascript/proj.win32/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by testjs.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 32775 -#endif -#endif diff --git a/samples/Javascript/TestJavascript/proj.win32/testjs.rc b/samples/Javascript/TestJavascript/proj.win32/testjs.rc deleted file mode 100644 index 99e7360397..0000000000 --- a/samples/Javascript/TestJavascript/proj.win32/testjs.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\testjs.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "testjs Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "testjs\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "testjs.exe\0" - VALUE "ProductName", "testjs Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp deleted file mode 100644 index a6798abad9..0000000000 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "AppDelegate.h" - -#include "cocos2d.h" -#include "SimpleAudioEngine.h" -#include "ScriptingCore.h" -#include "jsb_cocos2dx_auto.hpp" -#include "jsb_cocos2dx_extension_auto.hpp" -#include "jsb_cocos2dx_builder_auto.hpp" -#include "extension/jsb_cocos2dx_extension_manual.h" -#include "cocos2d_specifics.hpp" -#include "chipmunk/js_bindings_chipmunk_registration.h" -#include "cocosbuilder/js_bindings_ccbreader.h" -#include "localstorage/js_bindings_system_registration.h" -#include "jsb_opengl_registration.h" - -USING_NS_CC; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ -} - -AppDelegate::~AppDelegate() -{ - ScriptEngineManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); - - // turn on display FPS - pDirector->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); - - EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::FIXED_HEIGHT); - - FileUtils::getInstance()->addSearchPath("script"); - - ScriptingCore* sc = ScriptingCore::getInstance(); - sc->addRegisterCallback(register_all_cocos2dx); - sc->addRegisterCallback(register_all_cocos2dx_extension); - sc->addRegisterCallback(register_all_cocos2dx_extension_manual); - sc->addRegisterCallback(register_cocos2dx_js_extensions); - sc->addRegisterCallback(jsb_register_chipmunk); - sc->addRegisterCallback(register_all_cocos2dx_builder); - sc->addRegisterCallback(register_CCBuilderReader); - sc->addRegisterCallback(jsb_register_system); - sc->addRegisterCallback(JSB_register_opengl); - - sc->start(); - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) - sc->enableDebugger(); -#endif - - auto pEngine = ScriptingCore::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("boot-jsb.js"); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); - SimpleAudioEngine::getInstance()->pauseAllEffects(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); - SimpleAudioEngine::getInstance()->resumeAllEffects(); -} diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.h b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.h deleted file mode 100644 index df8f12f70f..0000000000 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// GCTestAppDelegate.h -// GCTest -// -// Created by Rohan Kuruvilla on 06/08/2012. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" -/** - @brief The cocos2d Application. - - The reason for implement as private inheritance is to hide some interface call by Director. - */ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/.classpath b/samples/Javascript/WatermelonWithMe/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/.project b/samples/Javascript/WatermelonWithMe/proj.android/.project deleted file mode 100644 index 1a3080f5bb..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/.project +++ /dev/null @@ -1,70 +0,0 @@ - - - WatermelonWithMe - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Classes - 2 - COCOS2DX/samples/Javascript/WatermelonWithMe/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - cocosdenshion - 2 - COCOS2DX/CocosDenshion - - - extensions - 2 - COCOS2DX/extensions - - - scripting - 2 - COCOS2DX/scripting - - - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Javascript/WatermelonWithMe/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Javascript/WatermelonWithMe/proj.android/AndroidManifest.xml b/samples/Javascript/WatermelonWithMe/proj.android/AndroidManifest.xml deleted file mode 100644 index 517c887410..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/README.md b/samples/Javascript/WatermelonWithMe/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/samples/Javascript/WatermelonWithMe/proj.android/ant.properties b/samples/Javascript/WatermelonWithMe/proj.android/ant.properties deleted file mode 100644 index f8af38bfb4..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/ant.properties +++ /dev/null @@ -1 +0,0 @@ -aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/samples/Javascript/WatermelonWithMe/proj.android/build.xml b/samples/Javascript/WatermelonWithMe/proj.android/build.xml deleted file mode 100644 index f3fd9b9293..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/jni/Android.mk b/samples/Javascript/WatermelonWithMe/proj.android/jni/Android.mk deleted file mode 100644 index 2d7b4097ab..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/jni/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := watermelonwithme_shared - -LOCAL_MODULE_FILENAME := libwatermelonwithme - -LOCAL_SRC_FILES := watermelonwithme/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_chipmunk_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_localstorage_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_network_static -LOCAL_WHOLE_STATIC_LIBRARIES += jsb_builder_static - -LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/javascript/bindings) -$(call import-module,scripting/javascript/bindings/chipmunk) -$(call import-module,scripting/javascript/bindings/extension) -$(call import-module,scripting/javascript/bindings/localstorage) -$(call import-module,scripting/javascript/bindings/network) -$(call import-module,scripting/javascript/bindings/cocosbuilder) diff --git a/samples/Javascript/WatermelonWithMe/proj.android/jni/Application.mk b/samples/Javascript/WatermelonWithMe/proj.android/jni/Application.mk deleted file mode 100644 index 47d8add103..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/jni/Application.mk +++ /dev/null @@ -1,5 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char diff --git a/samples/Javascript/WatermelonWithMe/proj.android/jni/watermelonwithme/main.cpp b/samples/Javascript/WatermelonWithMe/proj.android/jni/watermelonwithme/main.cpp deleted file mode 100644 index 9793beefb1..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/jni/watermelonwithme/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "AppDelegate.h" -#include "cocos2d.h" -#include "platform/android/jni/JniHelper.h" -#include "CCEventType.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Javascript/WatermelonWithMe/proj.android/ndkgdb.sh b/samples/Javascript/WatermelonWithMe/proj.android/ndkgdb.sh deleted file mode 100644 index 5df7332ceb..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/ndkgdb.sh +++ /dev/null @@ -1,47 +0,0 @@ -APPNAME="TestJavascript" -APP_ANDROID_NAME="org.cocos2dx.testjavascript" - -if [ -z "${SDK_ROOT+aaa}" ]; then -# ... if SDK_ROOT is not set, use "$HOME/bin/android-sdk" - SDK_ROOT="$HOME/bin/android-sdk" -fi - -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" -fi - -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android" -fi - -echo "NDK_ROOT = $NDK_ROOT" -echo "SDK_ROOT = $SDK_ROOT" -echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" -echo "APP_ROOT = $APP_ROOT" -echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" -echo "APP_ANDROID_NAME = $APP_ANDROID_NAME" - -echo -echo "Killing and restarting ${APP_ANDROID_NAME}" -echo - -set -x - -"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}" - -NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \ - "${NDK_ROOT}"/ndk-gdb \ - --adb="${SDK_ROOT}"/platform-tools/adb \ - --verbose \ - --start \ - --force diff --git a/samples/Javascript/WatermelonWithMe/proj.android/proguard-project.txt b/samples/Javascript/WatermelonWithMe/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Javascript/WatermelonWithMe/proj.android/project.properties b/samples/Javascript/WatermelonWithMe/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Javascript/WatermelonWithMe/proj.android/res/values/strings.xml b/samples/Javascript/WatermelonWithMe/proj.android/res/values/strings.xml deleted file mode 100644 index 89aa34dcac..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - WatermelonWithMe - diff --git a/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java b/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java deleted file mode 100644 index 3fd0f293cf..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.android/src/org/cocos2dx/watermelonwithme/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.watermelonwithme; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/AppController.h b/samples/Javascript/WatermelonWithMe/proj.ios/AppController.h deleted file mode 100644 index 10287bd13f..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/AppController.mm b/samples/Javascript/WatermelonWithMe/proj.ios/AppController.mm deleted file mode 100644 index ca23f1b7f8..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/AppController.mm +++ /dev/null @@ -1,119 +0,0 @@ -// -// testjsAppController.mm -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" - -#import "RootViewController.h" - -@implementation AppController - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 //_OES - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Use RootViewController manage CCEAGLView - viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; - viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; - - // Set RootViewController to window - if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview: viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - - cocos2d::Application::getInstance()->run(); - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - cocos2d::Director::getInstance()->pause(); -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ - cocos2d::Director::getInstance()->resume(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - cocos2d::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ - cocos2d::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ - cocos2d::Director::getInstance()->purgeCachedData(); -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Javascript/WatermelonWithMe/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Javascript/WatermelonWithMe/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/Prefix.pch b/samples/Javascript/WatermelonWithMe/proj.ios/Prefix.pch deleted file mode 100644 index b056d8694a..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'testjs' target in the 'testjs' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.h b/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.mm b/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.mm deleted file mode 100644 index 8438d7a420..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/RootViewController.mm +++ /dev/null @@ -1,79 +0,0 @@ -// -// testjsAppController.h -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Javascript/WatermelonWithMe/proj.ios/main.m b/samples/Javascript/WatermelonWithMe/proj.ios/main.m deleted file mode 100644 index e3dedca28b..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.ios/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// testjs -// -// Created by Rolando Abarca on 3/19/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 3dacdedbd0..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - TestCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - TestCpp - - YES - - - About TestCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide TestCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit TestCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - TestCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - NSWindow - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - NSWindow - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/main.cpp b/samples/Javascript/WatermelonWithMe/proj.mac/main.cpp deleted file mode 100644 index b4bf804f38..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.mac/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("WatermelonWithMe",900,640); - return Application::getInstance()->run(); -} - diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj b/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj deleted file mode 100644 index 0f76fa0e57..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj +++ /dev/null @@ -1,237 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {BE092D9E-95AE-4F86-84CE-F4519E4F3F15} - WatermelonWithMe - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - Disabled - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\WatermelonWithMeRes" rd /s /q "$(OutDir)\WatermelonWithMeRes" -mkdir "$(OutDir)\WatermelonWithMeRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\WatermelonWithMe" "$(OutDir)\WatermelonWithMeRes\" /e /Y - - - Copy js and resource files. - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)testjs.tlb - testjs.h - - - testjs_i.c - testjs_p.c - - - $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\scripting\auto-generated\js-bindings;$(EngineRoot)cocos\scripting\javascript\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" - - - - libcurl_imp.lib;mozjs-25.0.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - if not exist "$(OutDir)" mkdir "$(OutDir)" -if exist "$(OutDir)\WatermelonWithMeRes" rd /s /q "$(OutDir)\WatermelonWithMeRes" -mkdir "$(OutDir)\WatermelonWithMeRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y -xcopy "$(ProjectDir)..\..\Shared\games\WatermelonWithMe" "$(OutDir)\WatermelonWithMeRes\" /e /Y - Copy js and resource files. - - - - - - - - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - - - {b57cf53f-2e49-4031-9822-047cc0e6bde2} - - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - - - {df2638c0-8128-4847-867c-6eafe3dee7b5} - - - {21070e58-eec6-4e16-8b4f-6d083df55790} - - - {f9da0fc1-651b-457b-962e-a4d61cebf5fd} - - - {625f7391-9a91-48a1-8cfc-79508c822637} - - - {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - - - {39379840-825a-45a0-b363-c09ffef864bd} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.filters b/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.filters deleted file mode 100644 index 56df37ce6f..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.filters +++ /dev/null @@ -1,44 +0,0 @@ - - - - - {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest - - - {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} - - - {e93a77e1-af1e-4400-87d3-504b62ebdbb0} - - - - - win32 - - - Classes - - - - - win32 - - - win32 - - - Classes - - - - - resource - - - - - resource - - - \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.user b/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.user deleted file mode 100644 index 93f348ba68..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/WatermelonWithMe.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(OutDir)\WatermelonWithMeRes - WindowsLocalDebugger - - - $(OutDir)\WatermelonWithMeRes - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/main.cpp b/samples/Javascript/WatermelonWithMe/proj.win32/main.cpp deleted file mode 100644 index 3c69549eac..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -// #define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("WatermelonWithMe",900,640); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/main.h b/samples/Javascript/WatermelonWithMe/proj.win32/main.h deleted file mode 100644 index e29aeedb3a..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __WINMAIN_H__ diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/res/testjs.ico b/samples/Javascript/WatermelonWithMe/proj.win32/res/testjs.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/samples/Javascript/WatermelonWithMe/proj.win32/res/testjs.ico and /dev/null differ diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/resource.h b/samples/Javascript/WatermelonWithMe/proj.win32/resource.h deleted file mode 100644 index a4cfa38af8..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by testjs.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 201 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 32775 -#endif -#endif diff --git a/samples/Javascript/WatermelonWithMe/proj.win32/testjs.rc b/samples/Javascript/WatermelonWithMe/proj.win32/testjs.rc deleted file mode 100644 index 99e7360397..0000000000 --- a/samples/Javascript/WatermelonWithMe/proj.win32/testjs.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\testjs.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "testjs Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "testjs\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "testjs.exe\0" - VALUE "ProductName", "testjs Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/samples/Lua/HelloLua/CMakeLists.txt b/samples/Lua/HelloLua/CMakeLists.txt deleted file mode 100644 index 894fc66565..0000000000 --- a/samples/Lua/HelloLua/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -set(APP_NAME hellolua) - -set(SAMPLE_SRC - proj.linux/main.cpp - Classes/AppDelegate.cpp -) - -include_directories( - Classes - ../../../cocos/scripting/lua/bindings - ../../../external/lua/lua - ../../../external/lua/tolua -) - -# add the executable -add_executable(${APP_NAME} - ${SAMPLE_SRC} -) - -target_link_libraries(${APP_NAME} - luabinding - gui - network - cocostudio - cocosbuilder - extensions - audio - cocos2d -) - -set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}") - -set_target_properties(${APP_NAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") - -pre_build(${APP_NAME} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua/script ${APP_BIN_DIR}/Resources - ) diff --git a/samples/Lua/HelloLua/Classes/AppDelegate.cpp b/samples/Lua/HelloLua/Classes/AppDelegate.cpp deleted file mode 100644 index d693936216..0000000000 --- a/samples/Lua/HelloLua/Classes/AppDelegate.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "cocos2d.h" -#include "AppDelegate.h" -#include "SimpleAudioEngine.h" -#include "CCScriptSupport.h" -#include "CCLuaEngine.h" - -USING_NS_CC; -using namespace CocosDenshion; - -AppDelegate::AppDelegate() -{ - // fixed me - //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); -} - -AppDelegate::~AppDelegate() -{ - // end simple audio engine here, or it may crashed on win32 - SimpleAudioEngine::getInstance()->end(); - //CCScriptEngineManager::destroyInstance(); -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); - - EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); - - // turn on display FPS - pDirector->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); - - // register lua engine - LuaEngine* pEngine = LuaEngine::getInstance(); - ScriptEngineManager::getInstance()->setScriptEngine(pEngine); - - std::string path = FileUtils::getInstance()->fullPathForFilename("hello.lua"); - pEngine->executeScriptFile(path.c_str()); - - return true; -} - -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); -} diff --git a/samples/Lua/HelloLua/Classes/AppDelegate.h b/samples/Lua/HelloLua/Classes/AppDelegate.h deleted file mode 100644 index b708f4bdca..0000000000 --- a/samples/Lua/HelloLua/Classes/AppDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "CCApplication.h" - -/** -@brief The cocos2d Application. - -The reason for implement as private inheritance is to hide some interface call by Director. -*/ -class AppDelegate : private cocos2d::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - virtual bool applicationDidFinishLaunching(); - - /** - @brief The function be called when the application enter background - @param the pointer of the application - */ - virtual void applicationDidEnterBackground(); - - /** - @brief The function be called when the application enter foreground - @param the pointer of the application - */ - virtual void applicationWillEnterForeground(); -}; - -#endif // _APP_DELEGATE_H_ - diff --git a/samples/Lua/HelloLua/Resources/.gitignore b/samples/Lua/HelloLua/Resources/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/samples/Lua/HelloLua/Resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/samples/Lua/HelloLua/Resources/Resources/.gitignore b/samples/Lua/HelloLua/Resources/Resources/.gitignore deleted file mode 100644 index 1d65afe366..0000000000 --- a/samples/Lua/HelloLua/Resources/Resources/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#Do now ignore Marmalade icf files -!*.icf diff --git a/samples/Lua/HelloLua/Resources/Resources/background.mp3.REMOVED.git-id b/samples/Lua/HelloLua/Resources/Resources/background.mp3.REMOVED.git-id deleted file mode 100644 index cfc16a8a4e..0000000000 --- a/samples/Lua/HelloLua/Resources/Resources/background.mp3.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aec1c0a8c8068377fddca5ddd32084d8c3c3c419 \ No newline at end of file diff --git a/samples/Lua/HelloLua/Resources/background.mp3.REMOVED.git-id b/samples/Lua/HelloLua/Resources/background.mp3.REMOVED.git-id deleted file mode 100644 index cfc16a8a4e..0000000000 --- a/samples/Lua/HelloLua/Resources/background.mp3.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aec1c0a8c8068377fddca5ddd32084d8c3c3c419 \ No newline at end of file diff --git a/samples/Lua/HelloLua/Resources/farm.jpg.REMOVED.git-id b/samples/Lua/HelloLua/Resources/farm.jpg.REMOVED.git-id deleted file mode 100644 index 4609f3cf02..0000000000 --- a/samples/Lua/HelloLua/Resources/farm.jpg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d7290c34702d1c6bdb368acb060d93b42d5deff8 \ No newline at end of file diff --git a/samples/Lua/HelloLua/Resources/hello.lua b/samples/Lua/HelloLua/Resources/hello.lua deleted file mode 100644 index 620f28f34c..0000000000 --- a/samples/Lua/HelloLua/Resources/hello.lua +++ /dev/null @@ -1,208 +0,0 @@ -require "Cocos2d" --- cclog -cclog = function(...) - print(string.format(...)) -end - --- for CCLuaEngine traceback -function __G__TRACKBACK__(msg) - cclog("----------------------------------------") - cclog("LUA ERROR: " .. tostring(msg) .. "\n") - cclog(debug.traceback()) - cclog("----------------------------------------") -end - -local function main() - -- avoid memory leak - collectgarbage("setpause", 100) - collectgarbage("setstepmul", 5000) - - --support debug - local targetPlatform = cc.Application:getInstance():getTargetPlatform() - if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or - (cc.PLATFORM_OS_ANDROID == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or - (cc.PLATFORM_OS_MAC == targetPlatform) then - require('mobdebug').start() - end - require "hello2" - cclog("result is " .. myadd(1, 1)) - - --------------- - - local visibleSize = cc.Director:getInstance():getVisibleSize() - local origin = cc.Director:getInstance():getVisibleOrigin() - - -- add the moving dog - local function creatDog() - local frameWidth = 105 - local frameHeight = 95 - - -- create dog animate - local textureDog = cc.TextureCache:getInstance():addImage("dog.png") - local rect = cc.rect(0, 0, frameWidth, frameHeight) - local frame0 = cc.SpriteFrame:createWithTexture(textureDog, rect) - rect = cc.rect(frameWidth, 0, frameWidth, frameHeight) - local frame1 = cc.SpriteFrame:createWithTexture(textureDog, rect) - - local spriteDog = cc.Sprite:createWithSpriteFrame(frame0) - spriteDog.isPaused = false - spriteDog:setPosition(origin.x, origin.y + visibleSize.height / 4 * 3) ---[[ - local animFrames = CCArray:create() - - animFrames:addObject(frame0) - animFrames:addObject(frame1) -]]-- - - local animation = cc.Animation:createWithSpriteFrames({frame0,frame1}, 0.5) - local animate = cc.Animate:create(animation); - spriteDog:runAction(cc.RepeatForever:create(animate)) - - -- moving dog at every frame - local function tick() - if spriteDog.isPaused then return end - local x, y = spriteDog:getPosition() - if x > origin.x + visibleSize.width then - x = origin.x - else - x = x + 1 - end - - spriteDog:setPositionX(x) - end - - cc.Director:getInstance():getScheduler():scheduleScriptFunc(tick, 0, false) - - return spriteDog - end - - -- create farm - local function createLayerFarm() - local layerFarm = cc.Layer:create() - - -- add in farm background - local bg = cc.Sprite:create("farm.jpg") - bg:setPosition(origin.x + visibleSize.width / 2 + 80, origin.y + visibleSize.height / 2) - layerFarm:addChild(bg) - - -- add land sprite - for i = 0, 3 do - for j = 0, 1 do - local spriteLand = cc.Sprite:create("land.png") - spriteLand:setPosition(200 + j * 180 - i % 2 * 90, 10 + i * 95 / 2) - layerFarm:addChild(spriteLand) - end - end - - -- add crop - local frameCrop = cc.SpriteFrame:create("crop.png", cc.rect(0, 0, 105, 95)) - for i = 0, 3 do - for j = 0, 1 do - local spriteCrop = cc.Sprite:createWithSpriteFrame(frameCrop); - spriteCrop:setPosition(10 + 200 + j * 180 - i % 2 * 90, 30 + 10 + i * 95 / 2) - layerFarm:addChild(spriteCrop) - end - end - - -- add moving dog - local spriteDog = creatDog() - layerFarm:addChild(spriteDog) - - -- handing touch events - local touchBeginPoint = nil - local function onTouchBegan(touch, event) - local location = touch:getLocation() - cclog("onTouchBegan: %0.2f, %0.2f", location.x, location.y) - touchBeginPoint = {x = location.x, y = location.y} - spriteDog.isPaused = true - -- CCTOUCHBEGAN event must return true - return true - end - - local function onTouchMoved(touch, event) - local location = touch:getLocation() - cclog("onTouchMoved: %0.2f, %0.2f", location.x, location.y) - if touchBeginPoint then - local cx, cy = layerFarm:getPosition() - layerFarm:setPosition(cx + location.x - touchBeginPoint.x, - cy + location.y - touchBeginPoint.y) - touchBeginPoint = {x = location.x, y = location.y} - end - end - - local function onTouchEnded(touch, event) - local location = touch:getLocation() - cclog("onTouchEnded: %0.2f, %0.2f", location.x, location.y) - touchBeginPoint = nil - spriteDog.isPaused = false - end - - local listener = cc.EventListenerTouchOneByOne:create() - listener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN ) - listener:registerScriptHandler(onTouchMoved,cc.Handler.EVENT_TOUCH_MOVED ) - listener:registerScriptHandler(onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED ) - local eventDispatcher = layerFarm:getEventDispatcher() - eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layerFarm) - - return layerFarm - end - - - -- create menu - local function createLayerMenu() - local layerMenu = cc.Layer:create() - - local menuPopup, menuTools, effectID - - local function menuCallbackClosePopup() - -- stop test sound effect - cc.SimpleAudioEngine:getInstance():stopEffect(effectID) - menuPopup:setVisible(false) - end - - local function menuCallbackOpenPopup() - -- loop test sound effect - local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav") - effectID = cc.SimpleAudioEngine:getInstance():playEffect(effectPath) - menuPopup:setVisible(true) - end - - -- add a popup menu - local menuPopupItem = cc.MenuItemImage:create("menu2.png", "menu2.png") - menuPopupItem:setPosition(0, 0) - menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) - menuPopup = cc.Menu:create(menuPopupItem) - menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2) - menuPopup:setVisible(false) - layerMenu:addChild(menuPopup) - - -- add the left-bottom "tools" menu to invoke menuPopup - local menuToolsItem = cc.MenuItemImage:create("menu1.png", "menu1.png") - menuToolsItem:setPosition(0, 0) - menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) - menuTools = cc.Menu:create(menuToolsItem) - local itemWidth = menuToolsItem:getContentSize().width - local itemHeight = menuToolsItem:getContentSize().height - menuTools:setPosition(origin.x + itemWidth/2, origin.y + itemHeight/2) - layerMenu:addChild(menuTools) - - return layerMenu - end - - -- play background music, preload effect - - -- uncomment below for the BlackBerry version - -- local bgMusicPath = CCFileUtils:getInstance():fullPathForFilename("background.ogg") - local bgMusicPath = cc.FileUtils:getInstance():fullPathForFilename("background.mp3") - cc.SimpleAudioEngine:getInstance():playMusic(bgMusicPath, true) - local effectPath = cc.FileUtils:getInstance():fullPathForFilename("effect1.wav") - cc.SimpleAudioEngine:getInstance():preloadEffect(effectPath) - - -- run - local sceneGame = cc.Scene:create() - sceneGame:addChild(createLayerFarm()) - sceneGame:addChild(createLayerMenu()) - cc.Director:getInstance():runWithScene(sceneGame) -end - -xpcall(main, __G__TRACKBACK__) diff --git a/samples/Lua/HelloLua/Resources/hello2.lua b/samples/Lua/HelloLua/Resources/hello2.lua deleted file mode 100644 index 27158aa788..0000000000 --- a/samples/Lua/HelloLua/Resources/hello2.lua +++ /dev/null @@ -1,3 +0,0 @@ -function myadd(x, y) - return x + y -end \ No newline at end of file diff --git a/samples/Lua/HelloLua/Resources/mobdebug.lua b/samples/Lua/HelloLua/Resources/mobdebug.lua deleted file mode 100644 index 31ef8af06b..0000000000 --- a/samples/Lua/HelloLua/Resources/mobdebug.lua +++ /dev/null @@ -1,1465 +0,0 @@ --- --- MobDebug 0.542 --- Copyright 2011-13 Paul Kulchenko --- Based on RemDebug 1.0 Copyright Kepler Project 2005 --- - -local mobdebug = { - _NAME = "mobdebug", - _VERSION = 0.542, - _COPYRIGHT = "Paul Kulchenko", - _DESCRIPTION = "Mobile Remote Debugger for the Lua programming language", - port = os and os.getenv and os.getenv("MOBDEBUG_PORT") or 8172, - checkcount = 200, - yieldtimeout = 0.02, -} - -local coroutine = coroutine -local error = error -local getfenv = getfenv -local setfenv = setfenv -local loadstring = loadstring or load -- "load" replaced "loadstring" in Lua 5.2 -local io = io -local os = os -local pairs = pairs -local require = require -local setmetatable = setmetatable -local string = string -local tonumber = tonumber -local unpack = table.unpack or unpack -local rawget = rawget - --- if strict.lua is used, then need to avoid referencing some global --- variables, as they can be undefined; --- use rawget to to avoid complaints from strict.lua at run-time. --- it's safe to do the initialization here as all these variables --- should get defined values (of any) before the debugging starts. --- there is also global 'wx' variable, which is checked as part of --- the debug loop as 'wx' can be loaded at any time during debugging. -local genv = _G or _ENV -local jit = rawget(genv, "jit") -local MOAICoroutine = rawget(genv, "MOAICoroutine") - -if not setfenv then -- Lua 5.2 - -- based on http://lua-users.org/lists/lua-l/2010-06/msg00314.html - -- this assumes f is a function - local function findenv(f) - local level = 1 - repeat - local name, value = debug.getupvalue(f, level) - if name == '_ENV' then return level, value end - level = level + 1 - until name == nil - return nil end - getfenv = function (f) return(select(2, findenv(f)) or _G) end - setfenv = function (f, t) - local level = findenv(f) - if level then debug.setupvalue(f, level, t) end - return f end -end - --- check for OS and convert file names to lower case on windows --- (its file system is case insensitive, but case preserving), as setting a --- breakpoint on x:\Foo.lua will not work if the file was loaded as X:\foo.lua. --- OSX and Windows behave the same way (case insensitive, but case preserving) -local iscasepreserving = os and os.getenv and (os.getenv('WINDIR') - or (os.getenv('OS') or ''):match('[Ww]indows') - or os.getenv('DYLD_LIBRARY_PATH')) - or not io.open("/proc") - --- turn jit off based on Mike Pall's comment in this discussion: --- http://www.freelists.org/post/luajit/Debug-hooks-and-JIT,2 --- "You need to turn it off at the start if you plan to receive --- reliable hook calls at any later point in time." -if jit and jit.off then jit.off() end - -local socket = require "socket" -local debug = require "debug" -local coro_debugger -local coro_debugee -local coroutines = {}; setmetatable(coroutines, {__mode = "k"}) -- "weak" keys -local events = { BREAK = 1, WATCH = 2, RESTART = 3, STACK = 4 } -local breakpoints = {} -local watches = {} -local lastsource -local lastfile -local watchescnt = 0 -local abort -- default value is nil; this is used in start/loop distinction -local seen_hook = false -local checkcount = 0 -local step_into = false -local step_over = false -local step_level = 0 -local stack_level = 0 -local server -local buf -local outputs = {} -local iobase = {print = print} -local basedir = "" -local deferror = "execution aborted at default debugee" -local debugee = function () - local a = 1 - for _ = 1, 10 do a = a + 1 end - error(deferror) -end -local function q(s) return s:gsub('([%(%)%.%%%+%-%*%?%[%^%$%]])','%%%1') end - -local serpent = (function() ---- include Serpent module for serialization -local n, v = "serpent", 0.25 -- (C) 2012-13 Paul Kulchenko; MIT License -local c, d = "Paul Kulchenko", "Lua serializer and pretty printer" -local snum = {[tostring(1/0)]='1/0 --[[math.huge]]',[tostring(-1/0)]='-1/0 --[[-math.huge]]',[tostring(0/0)]='0/0'} -local badtype = {thread = true, userdata = true, cdata = true} -local keyword, globals, G = {}, {}, (_G or _ENV) -for _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false', - 'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', - 'return', 'then', 'true', 'until', 'while'}) do keyword[k] = true end -for k,v in pairs(G) do globals[v] = k end -- build func to name mapping -for _,g in ipairs({'coroutine', 'debug', 'io', 'math', 'string', 'table', 'os'}) do - for k,v in pairs(G[g]) do globals[v] = g..'.'..k end end - -local function s(t, opts) - local name, indent, fatal, maxnum = opts.name, opts.indent, opts.fatal, opts.maxnum - local sparse, custom, huge = opts.sparse, opts.custom, not opts.nohuge - local space, maxl = (opts.compact and '' or ' '), (opts.maxlevel or math.huge) - local iname, comm = '_'..(name or ''), opts.comment and (tonumber(opts.comment) or math.huge) - local seen, sref, syms, symn = {}, {'local '..iname..'={}'}, {}, 0 - local function gensym(val) return '_'..(tostring(tostring(val)):gsub("[^%w]",""):gsub("(%d%w+)", - -- tostring(val) is needed because __tostring may return a non-string value - function(s) if not syms[s] then symn = symn+1; syms[s] = symn end return syms[s] end)) end - local function safestr(s) return type(s) == "number" and (huge and snum[tostring(s)] or s) - or type(s) ~= "string" and tostring(s) -- escape NEWLINE/010 and EOF/026 - or ("%q"):format(s):gsub("\010","n"):gsub("\026","\\026") end - local function comment(s,l) return comm and (l or 0) < comm and ' --[['..tostring(s)..']]' or '' end - local function globerr(s,l) return globals[s] and globals[s]..comment(s,l) or not fatal - and safestr(select(2, pcall(tostring, s))) or error("Can't serialize "..tostring(s)) end - local function safename(path, name) -- generates foo.bar, foo[3], or foo['b a r'] - local n = name == nil and '' or name - local plain = type(n) == "string" and n:match("^[%l%u_][%w_]*$") and not keyword[n] - local safe = plain and n or '['..safestr(n)..']' - return (path or '')..(plain and path and '.' or '')..safe, safe end - local alphanumsort = type(opts.sortkeys) == 'function' and opts.sortkeys or function(k, o, n) -- k=keys, o=originaltable, n=padding - local maxn, to = tonumber(n) or 12, {number = 'a', string = 'b'} - local function padnum(d) return ("%0"..maxn.."d"):format(d) end - table.sort(k, function(a,b) - -- sort numeric keys first: k[key] is non-nil for numeric keys - return (k[a] and 0 or to[type(a)] or 'z')..(tostring(a):gsub("%d+",padnum)) - < (k[b] and 0 or to[type(b)] or 'z')..(tostring(b):gsub("%d+",padnum)) end) end - local function val2str(t, name, indent, insref, path, plainindex, level) - local ttype, level, mt = type(t), (level or 0), getmetatable(t) - local spath, sname = safename(path, name) - local tag = plainindex and - ((type(name) == "number") and '' or name..space..'='..space) or - (name ~= nil and sname..space..'='..space or '') - if seen[t] then -- already seen this element - sref[#sref+1] = spath..space..'='..space..seen[t] - return tag..'nil'..comment('ref', level) end - if type(mt) == 'table' and (mt.__serialize or mt.__tostring) then -- knows how to serialize itself - seen[t] = insref or spath - if mt.__serialize then t = mt.__serialize(t) else t = tostring(t) end - ttype = type(t) end -- new value falls through to be serialized - if ttype == "table" then - if level >= maxl then return tag..'{}'..comment('max', level) end - seen[t] = insref or spath - if next(t) == nil then return tag..'{}'..comment(t, level) end -- table empty - local maxn, o, out = math.min(#t, maxnum or #t), {}, {} - for key = 1, maxn do o[key] = key end - if not maxnum or #o < maxnum then - local n = #o -- n = n + 1; o[n] is much faster than o[#o+1] on large tables - for key in pairs(t) do if o[key] ~= key then n = n + 1; o[n] = key end end end - if maxnum and #o > maxnum then o[maxnum+1] = nil end - if opts.sortkeys and #o > maxn then alphanumsort(o, t, opts.sortkeys) end - local sparse = sparse and #o > maxn -- disable sparsness if only numeric keys (shorter output) - for n, key in ipairs(o) do - local value, ktype, plainindex = t[key], type(key), n <= maxn and not sparse - if opts.valignore and opts.valignore[value] -- skip ignored values; do nothing - or opts.keyallow and not opts.keyallow[key] - or opts.valtypeignore and opts.valtypeignore[type(value)] -- skipping ignored value types - or sparse and value == nil then -- skipping nils; do nothing - elseif ktype == 'table' or ktype == 'function' or badtype[ktype] then - if not seen[key] and not globals[key] then - sref[#sref+1] = 'placeholder' - local sname = safename(iname, gensym(key)) -- iname is table for local variables - sref[#sref] = val2str(key,sname,indent,sname,iname,true) end - sref[#sref+1] = 'placeholder' - local path = seen[t]..'['..(seen[key] or globals[key] or gensym(key))..']' - sref[#sref] = path..space..'='..space..(seen[value] or val2str(value,nil,indent,path)) - else - out[#out+1] = val2str(value,key,indent,insref,seen[t],plainindex,level+1) - end - end - local prefix = string.rep(indent or '', level) - local head = indent and '{\n'..prefix..indent or '{' - local body = table.concat(out, ','..(indent and '\n'..prefix..indent or space)) - local tail = indent and "\n"..prefix..'}' or '}' - return (custom and custom(tag,head,body,tail) or tag..head..body..tail)..comment(t, level) - elseif badtype[ttype] then - seen[t] = insref or spath - return tag..globerr(t, level) - elseif ttype == 'function' then - seen[t] = insref or spath - local ok, res = pcall(string.dump, t) - local func = ok and ((opts.nocode and "function() --[[..skipped..]] end" or - "loadstring("..safestr(res)..",'@serialized')")..comment(t, level)) - return tag..(func or globerr(t, level)) - else return tag..safestr(t) end -- handle all other types - end - local sepr = indent and "\n" or ";"..space - local body = val2str(t, name, indent) -- this call also populates sref - local tail = #sref>1 and table.concat(sref, sepr)..sepr or '' - local warn = opts.comment and #sref>1 and space.."--[[incomplete output with shared/self-references skipped]]" or '' - return not name and body..warn or "do local "..body..sepr..tail.."return "..name..sepr.."end" -end - -local function merge(a, b) if b then for k,v in pairs(b) do a[k] = v end end; return a; end -return { _NAME = n, _COPYRIGHT = c, _DESCRIPTION = d, _VERSION = v, serialize = s, - dump = function(a, opts) return s(a, merge({name = '_', compact = true, sparse = true}, opts)) end, - line = function(a, opts) return s(a, merge({sortkeys = true, comment = true}, opts)) end, - block = function(a, opts) return s(a, merge({indent = ' ', sortkeys = true, comment = true}, opts)) end } -end)() ---- end of Serpent module - -local function removebasedir(path, basedir) - if iscasepreserving then - -- check if the lowercased path matches the basedir - -- if so, return substring of the original path (to not lowercase it) - return path:lower():find('^'..q(basedir:lower())) - and path:sub(#basedir+1) or path - else - return string.gsub(path, '^'..q(basedir), '') - end -end - -local function stack(start) - local function vars(f) - local func = debug.getinfo(f, "f").func - local i = 1 - local locals = {} - while true do - local name, value = debug.getlocal(f, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then locals[name] = {value, tostring(value)} end - i = i + 1 - end - i = 1 - local ups = {} - while func and true do -- check for func as it may be nil for tail calls - local name, value = debug.getupvalue(func, i) - if not name then break end - ups[name] = {value, tostring(value)} - i = i + 1 - end - return locals, ups - end - - local stack = {} - for i = (start or 0), 100 do - local source = debug.getinfo(i, "Snl") - if not source then break end - - local src = source.source - if src:find("@") == 1 then - src = src:sub(2):gsub("\\", "/") - if src:find("%./") == 1 then src = src:sub(3) end - end - - table.insert(stack, { -- remove basedir from source - {source.name, removebasedir(src, basedir), source.linedefined, - source.currentline, source.what, source.namewhat, source.short_src}, - vars(i+1)}) - if source.what == 'main' then break end - end - return stack -end - -local function set_breakpoint(file, line) - if file == '-' and lastfile then file = lastfile - elseif iscasepreserving then file = string.lower(file) end - if not breakpoints[line] then breakpoints[line] = {} end - breakpoints[line][file] = true -end - -local function remove_breakpoint(file, line) - if file == '-' and lastfile then file = lastfile - elseif iscasepreserving then file = string.lower(file) end - if breakpoints[line] then breakpoints[line][file] = nil end -end - -local function has_breakpoint(file, line) - return breakpoints[line] - and breakpoints[line][iscasepreserving and string.lower(file) or file] -end - -local function restore_vars(vars) - if type(vars) ~= 'table' then return end - - -- locals need to be processed in the reverse order, starting from - -- the inner block out, to make sure that the localized variables - -- are correctly updated with only the closest variable with - -- the same name being changed - -- first loop find how many local variables there is, while - -- the second loop processes them from i to 1 - local i = 1 - while true do - local name = debug.getlocal(3, i) - if not name then break end - i = i + 1 - end - i = i - 1 - local written_vars = {} - while i > 0 do - local name = debug.getlocal(3, i) - if not written_vars[name] then - if string.sub(name, 1, 1) ~= '(' then - debug.setlocal(3, i, rawget(vars, name)) - end - written_vars[name] = true - end - i = i - 1 - end - - i = 1 - local func = debug.getinfo(3, "f").func - while true do - local name = debug.getupvalue(func, i) - if not name then break end - if not written_vars[name] then - if string.sub(name, 1, 1) ~= '(' then - debug.setupvalue(func, i, rawget(vars, name)) - end - written_vars[name] = true - end - i = i + 1 - end -end - -local function capture_vars(level) - local vars = {} - local func = debug.getinfo(level or 3, "f").func - local i = 1 - while true do - local name, value = debug.getupvalue(func, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then vars[name] = value end - i = i + 1 - end - i = 1 - while true do - local name, value = debug.getlocal(level or 3, i) - if not name then break end - if string.sub(name, 1, 1) ~= '(' then vars[name] = value end - i = i + 1 - end - -- returned 'vars' table plays a dual role: (1) it captures local values - -- and upvalues to be restored later (in case they are modified in "eval"), - -- and (2) it provides an environment for evaluated chunks. - -- getfenv(func) is needed to provide proper environment for functions, - -- including access to globals, but this causes vars[name] to fail in - -- restore_vars on local variables or upvalues with `nil` values when - -- 'strict' is in effect. To avoid this `rawget` is used in restore_vars. - setmetatable(vars, { __index = getfenv(func), __newindex = getfenv(func) }) - return vars -end - -local function stack_depth(start_depth) - for i = start_depth, 0, -1 do - if debug.getinfo(i, "l") then return i+1 end - end - return start_depth -end - -local function is_safe(stack_level) - -- the stack grows up: 0 is getinfo, 1 is is_safe, 2 is debug_hook, 3 is user function - if stack_level == 3 then return true end - for i = 3, stack_level do - -- return if it is not safe to abort - local info = debug.getinfo(i, "S") - if not info then return true end - if info.what == "C" then return false end - end - return true -end - -local function in_debugger() - local this = debug.getinfo(1, "S").source - -- only need to check few frames as mobdebug frames should be close - for i = 3, 7 do - local info = debug.getinfo(i, "S") - if not info then return false end - if info.source == this then return true end - end - return false -end - -local function is_pending(peer) - -- if there is something already in the buffer, skip check - if not buf and checkcount >= mobdebug.checkcount then - peer:settimeout(0) -- non-blocking - buf = peer:receive(1) - peer:settimeout() -- back to blocking - checkcount = 0 - end - return buf -end - -local function debug_hook(event, line) - -- (1) LuaJIT needs special treatment. Because debug_hook is set for - -- *all* coroutines, and not just the one being debugged as in regular Lua - -- (http://lua-users.org/lists/lua-l/2011-06/msg00513.html), - -- need to avoid debugging mobdebug's own code as LuaJIT doesn't - -- always correctly generate call/return hook events (there are more - -- calls than returns, which breaks stack depth calculation and - -- 'step' and 'step over' commands stop working; possibly because - -- 'tail return' events are not generated by LuaJIT). - -- the next line checks if the debugger is run under LuaJIT and if - -- one of debugger methods is present in the stack, it simply returns. - if jit then - -- when luajit is compiled with LUAJIT_ENABLE_LUA52COMPAT, - -- coroutine.running() returns non-nil for the main thread. - local coro, main = coroutine.running() - if not coro or main then coro = 'main' end - local disabled = coroutines[coro] == false - or coroutines[coro] == nil and coro ~= (coro_debugee or 'main') - if coro_debugee and disabled or not coro_debugee and (disabled or in_debugger()) - then return end - end - - -- (2) check if abort has been requested and it's safe to abort - if abort and is_safe(stack_level) then error(abort) end - - -- (3) also check if this debug hook has not been visited for any reason. - -- this check is needed to avoid stepping in too early - -- (for example, when coroutine.resume() is executed inside start()). - if not seen_hook and in_debugger() then return end - - if event == "call" then - stack_level = stack_level + 1 - elseif event == "return" or event == "tail return" then - stack_level = stack_level - 1 - elseif event == "line" then - -- may need to fall through because of the following: - -- (1) step_into - -- (2) step_over and stack_level <= step_level (need stack_level) - -- (3) breakpoint; check for line first as it's known; then for file - -- (4) socket call (only do every Xth check) - -- (5) at least one watch is registered - if not ( - step_into or step_over or breakpoints[line] or watchescnt > 0 - or is_pending(server) - ) then checkcount = checkcount + 1; return end - - checkcount = mobdebug.checkcount -- force check on the next command - - -- this is needed to check if the stack got shorter or longer. - -- unfortunately counting call/return calls is not reliable. - -- the discrepancy may happen when "pcall(load, '')" call is made - -- or when "error()" is called in a function. - -- in either case there are more "call" than "return" events reported. - -- this validation is done for every "line" event, but should be "cheap" - -- as it checks for the stack to get shorter (or longer by one call). - -- start from one level higher just in case we need to grow the stack. - -- this may happen after coroutine.resume call to a function that doesn't - -- have any other instructions to execute. it triggers three returns: - -- "return, tail return, return", which needs to be accounted for. - stack_level = stack_depth(stack_level+1) - - local caller = debug.getinfo(2, "S") - - -- grab the filename and fix it if needed - local file = lastfile - if (lastsource ~= caller.source) then - file, lastsource = caller.source, caller.source - -- technically, users can supply names that may not use '@', - -- for example when they call loadstring('...', 'filename.lua'). - -- Unfortunately, there is no reliable/quick way to figure out - -- what is the filename and what is the source code. - -- The following will work if the supplied filename uses Unix path. - if file:find("^@") then - file = file:gsub("^@", ""):gsub("\\", "/") - -- need this conversion to be applied to relative and absolute - -- file names as you may write "require 'Foo'" to - -- load "foo.lua" (on a case insensitive file system) and breakpoints - -- set on foo.lua will not work if not converted to the same case. - if iscasepreserving then file = string.lower(file) end - if file:find("%./") == 1 then file = file:sub(3) - else file = file:gsub('^'..q(basedir), '') end - -- some file systems allow newlines in file names; remove these. - file = file:gsub("\n", ' ') - else - -- this is either a file name coming from loadstring("chunk", "file"), - -- or the actual source code that needs to be serialized (as it may - -- include newlines); assume it's a file name if it's all on one line. - file = file:find("[\r\n]") and serpent.line(file) or file - end - - -- set to true if we got here; this only needs to be done once per - -- session, so do it here to at least avoid setting it for every line. - seen_hook = true - lastfile = file - end - - local vars, status, res - if (watchescnt > 0) then - vars = capture_vars() - for index, value in pairs(watches) do - setfenv(value, vars) - local ok, fired = pcall(value) - if ok and fired then - status, res = coroutine.resume(coro_debugger, events.WATCH, vars, file, line, index) - break -- any one watch is enough; don't check multiple times - end - end - end - - -- need to get into the "regular" debug handler, but only if there was - -- no watch that was fired. If there was a watch, handle its result. - local getin = (status == nil) and - (step_into - or (step_over and stack_level <= step_level) - or has_breakpoint(file, line) - or is_pending(server)) - - if getin then - vars = vars or capture_vars() - step_into = false - step_over = false - status, res = coroutine.resume(coro_debugger, events.BREAK, vars, file, line) - end - - -- handle 'stack' command that provides stack() information to the debugger - if status and res == 'stack' then - while status and res == 'stack' do - -- resume with the stack trace and variables - if vars then restore_vars(vars) end -- restore vars so they are reflected in stack values - -- this may fail if __tostring method fails at run-time - local ok, snapshot = pcall(stack, 4) - status, res = coroutine.resume(coro_debugger, ok and events.STACK or events.BREAK, snapshot, file, line) - end - end - - -- need to recheck once more as resume after 'stack' command may - -- return something else (for example, 'exit'), which needs to be handled - if status and res and res ~= 'stack' then - if abort == nil and res == "exit" then os.exit(1); return end - abort = res - -- only abort if safe; if not, there is another (earlier) check inside - -- debug_hook, which will abort execution at the first safe opportunity - if is_safe(stack_level) then error(abort) end - elseif not status and res then - error(res, 2) -- report any other (internal) errors back to the application - end - - if vars then restore_vars(vars) end - end -end - -local function stringify_results(status, ...) - if not status then return status, ... end -- on error report as it - - local t = {...} - for i,v in pairs(t) do -- stringify each of the returned values - local ok, res = pcall(serpent.line, v, {nocode = true, comment = 1}) - t[i] = ok and res or ("%q"):format(res):gsub("\010","n"):gsub("\026","\\026") - end - -- stringify table with all returned values - -- this is done to allow each returned value to be used (serialized or not) - -- intependently and to preserve "original" comments - return pcall(serpent.dump, t, {sparse = false}) -end - -local function debugger_loop(sev, svars, sfile, sline) - local command - local app, osname - local eval_env = svars or {} - local function emptyWatch () return false end - local loaded = {} - for k in pairs(package.loaded) do loaded[k] = true end - - while true do - local line, err - local wx = rawget(genv, "wx") -- use rawread to make strict.lua happy - if (wx or mobdebug.yield) and server.settimeout then server:settimeout(mobdebug.yieldtimeout) end - while true do - line, err = server:receive() - if not line and err == "timeout" then - -- yield for wx GUI applications if possible to avoid "busyness" - app = app or (wx and wx.wxGetApp and wx.wxGetApp()) - if app then - local win = app:GetTopWindow() - local inloop = app:IsMainLoopRunning() - osname = osname or wx.wxPlatformInfo.Get():GetOperatingSystemFamilyName() - if win and not inloop then - -- process messages in a regular way - -- and exit as soon as the event loop is idle - if osname == 'Unix' then wx.wxTimer(app):Start(10, true) end - local exitLoop = function() - win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_IDLE) - win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_TIMER) - app:ExitMainLoop() - end - win:Connect(wx.wxEVT_IDLE, exitLoop) - win:Connect(wx.wxEVT_TIMER, exitLoop) - app:MainLoop() - end - elseif mobdebug.yield then mobdebug.yield() - end - elseif not line and err == "closed" then - error("Debugger connection unexpectedly closed", 0) - else - -- if there is something in the pending buffer, prepend it to the line - if buf then line = buf .. line; buf = nil end - break - end - end - if server.settimeout then server:settimeout() end -- back to blocking - command = string.sub(line, string.find(line, "^[A-Z]+")) - if command == "SETB" then - local _, _, _, file, line = string.find(line, "^([A-Z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - set_breakpoint(file, tonumber(line)) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "DELB" then - local _, _, _, file, line = string.find(line, "^([A-Z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - remove_breakpoint(file, tonumber(line)) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "EXEC" then - local _, _, chunk = string.find(line, "^[A-Z]+%s+(.+)$") - if chunk then - local func, res = loadstring(chunk) - local status - if func then - setfenv(func, eval_env) - status, res = stringify_results(pcall(func)) - end - if status then - server:send("200 OK " .. #res .. "\n") - server:send(res) - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - elseif command == "LOAD" then - local _, _, size, name = string.find(line, "^[A-Z]+%s+(%d+)%s+(%S.-)%s*$") - size = tonumber(size) - - if abort == nil then -- no LOAD/RELOAD allowed inside start() - if size > 0 then server:receive(size) end - if sfile and sline then - server:send("201 Started " .. sfile .. " " .. sline .. "\n") - else - server:send("200 OK 0\n") - end - else - -- reset environment to allow required modules to load again - -- remove those packages that weren't loaded when debugger started - for k in pairs(package.loaded) do - if not loaded[k] then package.loaded[k] = nil end - end - - if size == 0 and name == '-' then -- RELOAD the current script being debugged - server:send("200 OK 0\n") - coroutine.yield("load") - else - -- receiving 0 bytes blocks (at least in luasocket 2.0.2), so skip reading - local chunk = size == 0 and "" or server:receive(size) - if chunk then -- LOAD a new script for debugging - local func, res = loadstring(chunk, "@"..name) - if func then - server:send("200 OK 0\n") - debugee = func - coroutine.yield("load") - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - end - end - elseif command == "SETW" then - local _, _, exp = string.find(line, "^[A-Z]+%s+(.+)%s*$") - if exp then - local func, res = loadstring("return(" .. exp .. ")") - if func then - watchescnt = watchescnt + 1 - local newidx = #watches + 1 - watches[newidx] = func - server:send("200 OK " .. newidx .. "\n") - else - server:send("401 Error in Expression " .. #res .. "\n") - server:send(res) - end - else - server:send("400 Bad Request\n") - end - elseif command == "DELW" then - local _, _, index = string.find(line, "^[A-Z]+%s+(%d+)%s*$") - index = tonumber(index) - if index > 0 and index <= #watches then - watchescnt = watchescnt - (watches[index] ~= emptyWatch and 1 or 0) - watches[index] = emptyWatch - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "RUN" then - server:send("200 OK\n") - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "STEP" then - server:send("200 OK\n") - step_into = true - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "OVER" or command == "OUT" then - server:send("200 OK\n") - step_over = true - - -- OVER and OUT are very similar except for - -- the stack level value at which to stop - if command == "OUT" then step_level = stack_level - 1 - else step_level = stack_level end - - local ev, vars, file, line, idx_watch = coroutine.yield() - eval_env = vars - if ev == events.BREAK then - server:send("202 Paused " .. file .. " " .. line .. "\n") - elseif ev == events.WATCH then - server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n") - elseif ev == events.RESTART then - -- nothing to do - else - server:send("401 Error in Execution " .. #file .. "\n") - server:send(file) - end - elseif command == "BASEDIR" then - local _, _, dir = string.find(line, "^[A-Z]+%s+(.+)%s*$") - if dir then - basedir = iscasepreserving and string.lower(dir) or dir - -- reset cached source as it may change with basedir - lastsource = nil - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "SUSPEND" then - -- do nothing; it already fulfilled its role - elseif command == "STACK" then - -- first check if we can execute the stack command - -- as it requires yielding back to debug_hook it cannot be executed - -- if we have not seen the hook yet as happens after start(). - -- in this case we simply return an empty result - local vars, ev = {} - if seen_hook then - ev, vars = coroutine.yield("stack") - end - if ev and ev ~= events.STACK then - server:send("401 Error in Execution " .. #vars .. "\n") - server:send(vars) - else - local ok, res = pcall(serpent.dump, vars, {nocode = true, sparse = false}) - if ok then - server:send("200 OK " .. res .. "\n") - else - server:send("401 Error in Execution " .. #res .. "\n") - server:send(res) - end - end - elseif command == "OUTPUT" then - local _, _, stream, mode = string.find(line, "^[A-Z]+%s+(%w+)%s+([dcr])%s*$") - if stream and mode and stream == "stdout" then - -- assign "print" in the global environment - genv.print = mode == 'd' and iobase.print or coroutine.wrap(function(...) - -- wrapping into coroutine.wrap protects this function from - -- being stepped through in the debugger - local tbl = {...} - while true do - if mode == 'c' then iobase.print(unpack(tbl)) end - for n = 1, #tbl do - tbl[n] = select(2, pcall(serpent.line, tbl[n], {nocode = true, comment = false})) end - local file = table.concat(tbl, "\t").."\n" - server:send("204 Output " .. stream .. " " .. #file .. "\n" .. file) - tbl = {coroutine.yield()} - end - end) - server:send("200 OK\n") - else - server:send("400 Bad Request\n") - end - elseif command == "EXIT" then - server:send("200 OK\n") - coroutine.yield("exit") - else - server:send("400 Bad Request\n") - end - end -end - -local function connect(controller_host, controller_port) - return (socket.connect4 or socket.connect)(controller_host, controller_port) -end - -local function isrunning() - return coro_debugger and coroutine.status(coro_debugger) == 'suspended' -end - -local lasthost, lastport - --- Starts a debug session by connecting to a controller -local function start(controller_host, controller_port) - -- only one debugging session can be run (as there is only one debug hook) - if isrunning() then return end - - lasthost = controller_host or lasthost - lastport = controller_port or lastport - - controller_host = lasthost or "localhost" - controller_port = lastport or mobdebug.port - - local err - server, err = (socket.connect4 or socket.connect)(controller_host, controller_port) - if server then - -- correct stack depth which already has some calls on it - -- so it doesn't go into negative when those calls return - -- as this breaks subsequence checks in stack_depth(). - -- start from 16th frame, which is sufficiently large for this check. - stack_level = stack_depth(16) - - -- provide our own traceback function to report the error remotely - do - local dtraceback = debug.traceback - debug.traceback = function (...) - if select('#', ...) >= 1 then - local err, lvl = ... - if err and type(err) ~= 'thread' then - local trace = dtraceback(err, (lvl or 2)+1) - if genv.print == iobase.print then -- no remote redirect - return trace - else - genv.print(trace) -- report the error remotely - return -- don't report locally to avoid double reporting - end - end - end - -- direct call to debug.traceback: return the original. - -- debug.traceback(nil, level) doesn't work in Lua 5.1 - -- (http://lua-users.org/lists/lua-l/2011-06/msg00574.html), so - -- simply remove first frame from the stack trace - return (dtraceback(...):gsub("(stack traceback:\n)[^\n]*\n", "%1")) - end - end - coro_debugger = coroutine.create(debugger_loop) - debug.sethook(debug_hook, "lcr") - seen_hook = nil -- reset in case the last start() call was refused - step_into = true -- start with step command - return true - else - print(("Could not connect to %s:%s: %s") - :format(controller_host, controller_port, err or "unknown error")) - end -end - -local function controller(controller_host, controller_port, scratchpad) - -- only one debugging session can be run (as there is only one debug hook) - if isrunning() then return end - - lasthost = controller_host or lasthost - lastport = controller_port or lastport - - controller_host = lasthost or "localhost" - controller_port = lastport or mobdebug.port - - local exitonerror = not scratchpad - local err - server, err = (socket.connect4 or socket.connect)(controller_host, controller_port) - if server then - local function report(trace, err) - local msg = err .. "\n" .. trace - server:send("401 Error in Execution " .. #msg .. "\n") - server:send(msg) - return err - end - - seen_hook = true -- allow to accept all commands - coro_debugger = coroutine.create(debugger_loop) - - while true do - step_into = true -- start with step command - abort = false -- reset abort flag from the previous loop - if scratchpad then checkcount = mobdebug.checkcount end -- force suspend right away - - coro_debugee = coroutine.create(debugee) - debug.sethook(coro_debugee, debug_hook, "lcr") - local status, err = coroutine.resume(coro_debugee) - - -- was there an error or is the script done? - -- 'abort' state is allowed here; ignore it - if abort then - if tostring(abort) == 'exit' then break end - else - if status then -- normal execution is done - break - elseif err and not tostring(err):find(deferror) then - -- report the error back - -- err is not necessarily a string, so convert to string to report - report(debug.traceback(coro_debugee), tostring(err)) - if exitonerror then break end - -- resume once more to clear the response the debugger wants to send - -- need to use capture_vars(2) as three would be the level of - -- the caller for controller(), but because of the tail call, - -- the caller may not exist; - -- This is not entirely safe as the user may see the local - -- variable from console, but they will be reset anyway. - -- This functionality is used when scratchpad is paused to - -- gain access to remote console to modify global variables. - local status, err = coroutine.resume(coro_debugger, events.RESTART, capture_vars(2)) - if not status or status and err == "exit" then break end - end - end - end - else - print(("Could not connect to %s:%s: %s") - :format(controller_host, controller_port, err or "unknown error")) - return false - end - return true -end - -local function scratchpad(controller_host, controller_port) - return controller(controller_host, controller_port, true) -end - -local function loop(controller_host, controller_port) - return controller(controller_host, controller_port, false) -end - -local function on() - if not (isrunning() and server) then return end - - -- main is set to true under Lua5.2 for the "main" chunk. - -- Lua5.1 returns co as `nil` in that case. - local co, main = coroutine.running() - if main then co = nil end - if co then - coroutines[co] = true - debug.sethook(co, debug_hook, "lcr") - else - if jit then coroutines.main = true end - debug.sethook(debug_hook, "lcr") - end -end - -local function off() - if not (isrunning() and server) then return end - - -- main is set to true under Lua5.2 for the "main" chunk. - -- Lua5.1 returns co as `nil` in that case. - local co, main = coroutine.running() - if main then co = nil end - - -- don't remove coroutine hook under LuaJIT as there is only one (global) hook - if co then - coroutines[co] = false - if not jit then debug.sethook(co) end - else - if jit then coroutines.main = false end - if not jit then debug.sethook() end - end - - -- check if there is any thread that is still being debugged under LuaJIT; - -- if not, turn the debugging off - if jit then - local remove = true - for co, debugged in pairs(coroutines) do - if debugged then remove = false; break end - end - if remove then debug.sethook() end - end -end - --- Handles server debugging commands -local function handle(params, client, options) - local _, _, command = string.find(params, "^([a-z]+)") - local file, line, watch_idx - if command == "run" or command == "step" or command == "out" - or command == "over" or command == "exit" then - client:send(string.upper(command) .. "\n") - client:receive() -- this should consume the first '200 OK' response - while true do - local done = true - local breakpoint = client:receive() - if not breakpoint then - print("Program finished") - os.exit() - return -- use return here for those cases where os.exit() is not wanted - end - local _, _, status = string.find(breakpoint, "^(%d+)") - if status == "200" then - -- don't need to do anything - elseif status == "202" then - _, _, file, line = string.find(breakpoint, "^202 Paused%s+(.-)%s+(%d+)%s*$") - if file and line then - print("Paused at file " .. file .. " line " .. line) - end - elseif status == "203" then - _, _, file, line, watch_idx = string.find(breakpoint, "^203 Paused%s+(.-)%s+(%d+)%s+(%d+)%s*$") - if file and line and watch_idx then - print("Paused at file " .. file .. " line " .. line .. " (watch expression " .. watch_idx .. ": [" .. watches[watch_idx] .. "])") - end - elseif status == "204" then - local _, _, stream, size = string.find(breakpoint, "^204 Output (%w+) (%d+)$") - if stream and size then - local msg = client:receive(tonumber(size)) - print(msg) - if outputs[stream] then outputs[stream](msg) end - -- this was just the output, so go back reading the response - done = false - end - elseif status == "401" then - local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)$") - if size then - local msg = client:receive(tonumber(size)) - print("Error in remote application: " .. msg) - os.exit(1) - return nil, nil, msg -- use return here for those cases where os.exit() is not wanted - end - else - print("Unknown error") - os.exit(1) - -- use return here for those cases where os.exit() is not wanted - return nil, nil, "Debugger error: unexpected response '" .. breakpoint .. "'" - end - if done then break end - end - elseif command == "setb" then - _, _, _, file, line = string.find(params, "^([a-z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - -- if this is a file name, and not a file source - if not file:find('^".*"$') then - file = string.gsub(file, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - end - client:send("SETB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - set_breakpoint(file, line) - else - print("Error: breakpoint not inserted") - end - else - print("Invalid command") - end - elseif command == "setw" then - local _, _, exp = string.find(params, "^[a-z]+%s+(.+)$") - if exp then - client:send("SETW " .. exp .. "\n") - local answer = client:receive() - local _, _, watch_idx = string.find(answer, "^200 OK (%d+)%s*$") - if watch_idx then - watches[watch_idx] = exp - print("Inserted watch exp no. " .. watch_idx) - else - local _, _, size = string.find(answer, "^401 Error in Expression (%d+)$") - if size then - local err = client:receive(tonumber(size)):gsub(".-:%d+:%s*","") - print("Error: watch expression not set: " .. err) - else - print("Error: watch expression not set") - end - end - else - print("Invalid command") - end - elseif command == "delb" then - _, _, _, file, line = string.find(params, "^([a-z]+)%s+(.-)%s+(%d+)%s*$") - if file and line then - -- if this is a file name, and not a file source - if not file:find('^".*"$') then - file = string.gsub(file, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - end - client:send("DELB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - remove_breakpoint(file, line) - else - print("Error: breakpoint not removed") - end - else - print("Invalid command") - end - elseif command == "delallb" then - for line, breaks in pairs(breakpoints) do - for file, _ in pairs(breaks) do - client:send("DELB " .. file .. " " .. line .. "\n") - if client:receive() == "200 OK" then - remove_breakpoint(file, line) - else - print("Error: breakpoint at file " .. file .. " line " .. line .. " not removed") - end - end - end - elseif command == "delw" then - local _, _, index = string.find(params, "^[a-z]+%s+(%d+)%s*$") - if index then - client:send("DELW " .. index .. "\n") - if client:receive() == "200 OK" then - watches[index] = nil - else - print("Error: watch expression not removed") - end - else - print("Invalid command") - end - elseif command == "delallw" then - for index, exp in pairs(watches) do - client:send("DELW " .. index .. "\n") - if client:receive() == "200 OK" then - watches[index] = nil - else - print("Error: watch expression at index " .. index .. " [" .. exp .. "] not removed") - end - end - elseif command == "eval" or command == "exec" - or command == "load" or command == "loadstring" - or command == "reload" then - local _, _, exp = string.find(params, "^[a-z]+%s+(.+)$") - if exp or (command == "reload") then - if command == "eval" or command == "exec" then - exp = (exp:gsub("%-%-%[(=*)%[.-%]%1%]", "") -- remove comments - :gsub("%-%-.-\n", " ") -- remove line comments - :gsub("\n", " ")) -- convert new lines - if command == "eval" then exp = "return " .. exp end - client:send("EXEC " .. exp .. "\n") - elseif command == "reload" then - client:send("LOAD 0 -\n") - elseif command == "loadstring" then - local _, _, _, file, lines = string.find(exp, "^([\"'])(.-)%1%s+(.+)") - if not file then - _, _, file, lines = string.find(exp, "^(%S+)%s+(.+)") - end - client:send("LOAD " .. #lines .. " " .. file .. "\n") - client:send(lines) - else - local file = io.open(exp, "r") - if not file and pcall(require, "winapi") then - -- if file is not open and winapi is there, try with a short path; - -- this may be needed for unicode paths on windows - winapi.set_encoding(winapi.CP_UTF8) - file = io.open(winapi.short_path(exp), "r") - end - if not file then error("Cannot open file " .. exp) end - -- read the file and remove the shebang line as it causes a compilation error - local lines = file:read("*all"):gsub("^#!.-\n", "\n") - file:close() - - local file = string.gsub(exp, "\\", "/") -- convert slash - file = removebasedir(file, basedir) - client:send("LOAD " .. #lines .. " " .. file .. "\n") - if #lines > 0 then client:send(lines) end - end - while true do - local params, err = client:receive() - if not params then - return nil, nil, "Debugger connection " .. (err or "error") - end - local done = true - local _, _, status, len = string.find(params, "^(%d+).-%s+(%d+)%s*$") - if status == "200" then - len = tonumber(len) - if len > 0 then - local status, res - local str = client:receive(len) - -- handle serialized table with results - local func, err = loadstring(str) - if func then - status, res = pcall(func) - if not status then err = res - elseif type(res) ~= "table" then - err = "received "..type(res).." instead of expected 'table'" - end - end - if err then - print("Error in processing results: " .. err) - return nil, nil, "Error in processing results: " .. err - end - print(unpack(res)) - return res[1], res - end - elseif status == "201" then - _, _, file, line = string.find(params, "^201 Started%s+(.-)%s+(%d+)%s*$") - elseif status == "202" or params == "200 OK" then - -- do nothing; this only happens when RE/LOAD command gets the response - -- that was for the original command that was aborted - elseif status == "204" then - local _, _, stream, size = string.find(params, "^204 Output (%w+) (%d+)$") - if stream and size then - local msg = client:receive(tonumber(size)) - print(msg) - if outputs[stream] then outputs[stream](msg) end - -- this was just the output, so go back reading the response - done = false - end - elseif status == "401" then - len = tonumber(len) - local res = client:receive(len) - print("Error in expression: " .. res) - return nil, nil, res - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after EXEC/LOAD '" .. params .. "'" - end - if done then break end - end - else - print("Invalid command") - end - elseif command == "listb" then - for l, v in pairs(breakpoints) do - for f in pairs(v) do - print(f .. ": " .. l) - end - end - elseif command == "listw" then - for i, v in pairs(watches) do - print("Watch exp. " .. i .. ": " .. v) - end - elseif command == "suspend" then - client:send("SUSPEND\n") - elseif command == "stack" then - client:send("STACK\n") - local resp = client:receive() - local _, _, status, res = string.find(resp, "^(%d+)%s+%w+%s+(.+)%s*$") - if status == "200" then - local func, err = loadstring(res) - if func == nil then - print("Error in stack information: " .. err) - return nil, nil, err - end - local ok, stack = pcall(func) - if not ok then - print("Error in stack information: " .. stack) - return nil, nil, stack - end - for _,frame in ipairs(stack) do - print(serpent.line(frame[1], {comment = false})) - end - return stack - elseif status == "401" then - local _, _, len = string.find(resp, "%s+(%d+)%s*$") - len = tonumber(len) - local res = len > 0 and client:receive(len) or "Invalid stack information." - print("Error in expression: " .. res) - return nil, nil, res - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after STACK" - end - elseif command == "output" then - local _, _, stream, mode = string.find(params, "^[a-z]+%s+(%w+)%s+([dcr])%s*$") - if stream and mode then - client:send("OUTPUT "..stream.." "..mode.."\n") - local resp = client:receive() - local _, _, status = string.find(resp, "^(%d+)%s+%w+%s*$") - if status == "200" then - print("Stream "..stream.." redirected") - outputs[stream] = type(options) == 'table' and options.handler or nil - else - print("Unknown error") - return nil, nil, "Debugger error: can't redirect "..stream - end - else - print("Invalid command") - end - elseif command == "basedir" then - local _, _, dir = string.find(params, "^[a-z]+%s+(.+)$") - if dir then - dir = string.gsub(dir, "\\", "/") -- convert slash - if not string.find(dir, "/$") then dir = dir .. "/" end - - local remdir = dir:match("\t(.+)") - if remdir then dir = dir:gsub("/?\t.+", "/") end - basedir = dir - - client:send("BASEDIR "..(remdir or dir).."\n") - local resp = client:receive() - local _, _, status = string.find(resp, "^(%d+)%s+%w+%s*$") - if status == "200" then - print("New base directory is " .. basedir) - else - print("Unknown error") - return nil, nil, "Debugger error: unexpected response after BASEDIR" - end - else - print(basedir) - end - elseif command == "help" then - print("setb -- sets a breakpoint") - print("delb -- removes a breakpoint") - print("delallb -- removes all breakpoints") - print("setw -- adds a new watch expression") - print("delw -- removes the watch expression at index") - print("delallw -- removes all watch expressions") - print("run -- runs until next breakpoint") - print("step -- runs until next line, stepping into function calls") - print("over -- runs until next line, stepping over function calls") - print("out -- runs until line after returning from current function") - print("listb -- lists breakpoints") - print("listw -- lists watch expressions") - print("eval -- evaluates expression on the current context and returns its value") - print("exec -- executes statement on the current context") - print("load -- loads a local file for debugging") - print("reload -- restarts the current debugging session") - print("stack -- reports stack trace") - print("output stdout -- capture and redirect io stream (default|copy|redirect)") - print("basedir [] -- sets the base path of the remote application, or shows the current one") - print("exit -- exits debugger") - else - local _, _, spaces = string.find(params, "^(%s*)$") - if not spaces then - print("Invalid command") - return nil, nil, "Invalid command" - end - end - return file, line -end - --- Starts debugging server -local function listen(host, port) - host = host or "*" - port = port or mobdebug.port - - local socket = require "socket" - - print("Lua Remote Debugger") - print("Run the program you wish to debug") - - local server = socket.bind(host, port) - local client = server:accept() - - client:send("STEP\n") - client:receive() - - local breakpoint = client:receive() - local _, _, file, line = string.find(breakpoint, "^202 Paused%s+(.-)%s+(%d+)%s*$") - if file and line then - print("Paused at file " .. file ) - print("Type 'help' for commands") - else - local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)%s*$") - if size then - print("Error in remote application: ") - print(client:receive(size)) - end - end - - while true do - io.write("> ") - local line = io.read("*line") - handle(line, client) - end -end - -local cocreate -local function coro() - if cocreate then return end -- only set once - cocreate = cocreate or coroutine.create - coroutine.create = function(f, ...) - return cocreate(function(...) - require("mobdebug").on() - return f(...) - end, ...) - end -end - -local moconew -local function moai() - if moconew then return end -- only set once - moconew = moconew or (MOAICoroutine and MOAICoroutine.new) - if not moconew then return end - MOAICoroutine.new = function(...) - local thread = moconew(...) - -- need to support both thread.run and getmetatable(thread).run, which - -- was used in earlier MOAI versions - local mt = thread.run and thread or getmetatable(thread) - local patched = mt.run - mt.run = function(self, f, ...) - return patched(self, function(...) - require("mobdebug").on() - return f(...) - end, ...) - end - return thread - end -end - --- this is a function that removes all hooks and closes the socket to --- report back to the controller that the debugging is done. --- the script that called `done` can still continue. -local function done() - if not (isrunning() and server) then return end - - if not jit then - for co, debugged in pairs(coroutines) do - if debugged then debug.sethook(co) end - end - end - - debug.sethook() - server:close() - - coro_debugger = nil -- to make sure isrunning() returns `false` - seen_hook = nil -- to make sure that the next start() call works - abort = nil -- to make sure that callback calls use proper "abort" value -end - --- make public functions available -mobdebug.listen = listen -mobdebug.loop = loop -mobdebug.scratchpad = scratchpad -mobdebug.handle = handle -mobdebug.connect = connect -mobdebug.start = start -mobdebug.on = on -mobdebug.off = off -mobdebug.moai = moai -mobdebug.coro = coro -mobdebug.done = done -mobdebug.line = serpent.line -mobdebug.dump = serpent.dump -mobdebug.yield = nil -- callback - --- this is needed to make "require 'modebug'" to work when mobdebug --- module is loaded manually -package.loaded.mobdebug = mobdebug - -return mobdebug diff --git a/samples/Lua/HelloLua/proj.android/.classpath b/samples/Lua/HelloLua/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Lua/HelloLua/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.android/.externalToolBuilders/Javah_jni_builder.launch b/samples/Lua/HelloLua/proj.android/.externalToolBuilders/Javah_jni_builder.launch deleted file mode 100644 index 3506e4e944..0000000000 --- a/samples/Lua/HelloLua/proj.android/.externalToolBuilders/Javah_jni_builder.launch +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.android/.settings/org.eclipse.cdt.codan.core.prefs b/samples/Lua/HelloLua/proj.android/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index bad4196993..0000000000 --- a/samples/Lua/HelloLua/proj.android/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,68 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=-Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=-Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=-Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=-Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=-Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=-Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -useParentScope=false diff --git a/samples/Lua/HelloLua/proj.android/AndroidManifest.xml b/samples/Lua/HelloLua/proj.android/AndroidManifest.xml deleted file mode 100644 index 0703d5285d..0000000000 --- a/samples/Lua/HelloLua/proj.android/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.android/ant.properties b/samples/Lua/HelloLua/proj.android/ant.properties deleted file mode 100644 index b0971e891e..0000000000 --- a/samples/Lua/HelloLua/proj.android/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked into Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/samples/Lua/HelloLua/proj.android/build.xml b/samples/Lua/HelloLua/proj.android/build.xml deleted file mode 100644 index ff293087f2..0000000000 --- a/samples/Lua/HelloLua/proj.android/build.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Lua/HelloLua/proj.android/jni/Android.mk b/samples/Lua/HelloLua/proj.android/jni/Android.mk deleted file mode 100644 index 2c3b9124cf..0000000000 --- a/samples/Lua/HelloLua/proj.android/jni/Android.mk +++ /dev/null @@ -1,20 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := hellolua_shared - -LOCAL_MODULE_FILENAME := libhellolua - -LOCAL_SRC_FILES := hellolua/main.cpp \ - ../../Classes/AppDelegate.cpp - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ - $(LOCAL_PATH)/../../../../../external/lua/tolua \ - -LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static - - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,scripting/lua/bindings) diff --git a/samples/Lua/HelloLua/proj.android/jni/Application.mk b/samples/Lua/HelloLua/proj.android/jni/Application.mk deleted file mode 100644 index 540e49c358..0000000000 --- a/samples/Lua/HelloLua/proj.android/jni/Application.mk +++ /dev/null @@ -1,8 +0,0 @@ -APP_STL := gnustl_static - -# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] -# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9 -APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char - -APP_CPPFLAGS += -fexceptions - diff --git a/samples/Lua/HelloLua/proj.android/jni/hellolua/main.cpp b/samples/Lua/HelloLua/proj.android/jni/hellolua/main.cpp deleted file mode 100644 index 20e2ea1f45..0000000000 --- a/samples/Lua/HelloLua/proj.android/jni/hellolua/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "AppDelegate.h" -#include "cocos2d.h" -#include "platform/android/jni/JniHelper.h" -#include -#include - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) - -using namespace cocos2d; - -void cocos_android_app_init (struct android_app* app) { - LOGD("cocos_android_app_init"); - AppDelegate *pAppDelegate = new AppDelegate(); -} diff --git a/samples/Lua/HelloLua/proj.android/proguard-project.txt b/samples/Lua/HelloLua/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Lua/HelloLua/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Lua/HelloLua/proj.android/project.properties b/samples/Lua/HelloLua/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Lua/HelloLua/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Lua/HelloLua/proj.android/res/values/strings.xml b/samples/Lua/HelloLua/proj.android/res/values/strings.xml deleted file mode 100644 index d2c2ebdfb1..0000000000 --- a/samples/Lua/HelloLua/proj.android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - HelloLua - diff --git a/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java b/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java deleted file mode 100644 index 9933cf14fd..0000000000 --- a/samples/Lua/HelloLua/proj.android/src/org/cocos2dx/hellolua/Cocos2dxActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cocos2dx.hellolua; - -import android.app.NativeActivity; -import android.graphics.PixelFormat; -import android.os.Bundle; - -public class Cocos2dxActivity extends NativeActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - - //For supports translucency - - //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp - /*const EGLint attribs[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - //EGL_BLUE_SIZE, 5, -->delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/samples/Lua/HelloLua/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Lua/HelloLua/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Lua/HelloLua/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Lua/HelloLua/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Lua/HelloLua/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.ios/HelloLua_Prefix.pch b/samples/Lua/HelloLua/proj.ios/HelloLua_Prefix.pch deleted file mode 100644 index b4311a0a3d..0000000000 --- a/samples/Lua/HelloLua/proj.ios/HelloLua_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'HelloLua' target in the 'HelloLua' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/samples/Lua/HelloLua/proj.ios/RootViewController.h b/samples/Lua/HelloLua/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Lua/HelloLua/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Lua/HelloLua/proj.ios/main.m b/samples/Lua/HelloLua/proj.ios/main.m deleted file mode 100644 index 27ca9796f7..0000000000 --- a/samples/Lua/HelloLua/proj.ios/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// HelloLua -// -// Created by Walzer on 11-6-15. -// Copyright __MyCompanyName__ 2011. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; -} diff --git a/samples/Lua/HelloLua/proj.mac/HelloLua_Prefix.pch b/samples/Lua/HelloLua/proj.mac/HelloLua_Prefix.pch deleted file mode 100644 index 46c36a7e99..0000000000 --- a/samples/Lua/HelloLua/proj.mac/HelloLua_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.mac/en.lproj/InfoPlist.strings b/samples/Lua/HelloLua/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Lua/HelloLua/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Lua/HelloLua/proj.mac/en.lproj/MainMenu.xib b/samples/Lua/HelloLua/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 9f99439250..0000000000 --- a/samples/Lua/HelloLua/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - HelloCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - HelloCpp - - YES - - - About HelloCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide HelloCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit HelloCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - HelloCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - Window - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - Window - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/samples/Lua/HelloLua/proj.mac/main.cpp b/samples/Lua/HelloLua/proj.mac/main.cpp deleted file mode 100644 index 0a43aa7cd7..0000000000 --- a/samples/Lua/HelloLua/proj.mac/main.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_CC; - -int main(int argc, char *argv[]) -{ - AppDelegate app; - EGLView eglView; - eglView.init("HelloLua",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj deleted file mode 100644 index 0cc2b4270a..0000000000 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {13E55395-94A2-4CD9-BFC2-1A051F80C17D} - HelloLua.win32 - - - - Application - Unicode - v100 - v110 - v110_xp - - - Application - Unicode - v100 - v110 - v110_xp - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - true - $(SolutionDir)$(Configuration).win32\ - $(Configuration).win32\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) - - - - _DEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)HelloLua.tlb - HelloLua.h - - - HelloLua_i.c - HelloLua_p.c - - - Disabled - $(ProjectDir)..\Classes;$(EngineRoot)cocos\scripting\auto-generated\lua-bindings;$(EngineRoot)cocos\scripting\lua\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua\script" "$(ProjectDir)..\..\HelloLua\Resources" /e /Y - - - - - NDEBUG;%(PreprocessorDefinitions) - false - Win32 - true - $(IntDir)HelloLua.tlb - HelloLua.h - - - HelloLua_i.c - HelloLua_p.c - - - $(ProjectDir)..\Classes;$(EngineRoot)cocos\scripting\auto-generated\lua-bindings;$(EngineRoot)cocos\scripting\lua\bindings;$(EngineRoot)cocos\audio\include;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;STRICT;NDEBUG;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - MultiThreadedDLL - - - Level3 - - - 4267;4251;4244;%(DisableSpecificWarnings) - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - - - libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) - $(OutDir);%(AdditionalLibraryDirectories) - Windows - MachineX86 - true - - - - - - - - - - - - - {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - - - {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - - - {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - - - {b57cf53f-2e49-4031-9822-047cc0e6bde2} - - - {b7c2a162-dec9-4418-972e-240ab3cbfcae} - - - {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - - - {df2638c0-8128-4847-867c-6eafe3dee7b5} - - - {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - - - {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - - - {21b2c324-891f-48ea-ad1a-5ae13de12e28} - - - {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} - - - - - - \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.filters b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.filters deleted file mode 100644 index 5de7838f8f..0000000000 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.filters +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {83371666-be62-4e91-b8cc-395730853621} - - - {917fb40f-fc6d-4ee9-9a20-26debabe41aa} - - - - - Classes - - - win32 - - - - - Classes - - - win32 - - - \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.user b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.user deleted file mode 100644 index 32a6296820..0000000000 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj.user +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - - $(ProjectDir)..\Resources - WindowsLocalDebugger - - \ No newline at end of file diff --git a/samples/Lua/HelloLua/proj.win32/main.cpp b/samples/Lua/HelloLua/proj.win32/main.cpp deleted file mode 100644 index b07e50bc66..0000000000 --- a/samples/Lua/HelloLua/proj.win32/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "main.h" -#include "AppDelegate.h" -#include "CCEGLView.h" - -USING_NS_CC; - -// uncomment below line, open debug console -#define USE_WIN32_CONSOLE - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - -#ifdef USE_WIN32_CONSOLE - AllocConsole(); - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); -#endif - - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("HelloLua",900,640); - - int ret = Application::getInstance()->run(); - -#ifdef USE_WIN32_CONSOLE - FreeConsole(); -#endif - - return ret; -} diff --git a/samples/Lua/HelloLua/proj.win32/main.h b/samples/Lua/HelloLua/proj.win32/main.h deleted file mode 100644 index e74708bdf2..0000000000 --- a/samples/Lua/HelloLua/proj.win32/main.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "CCStdC.h" - -#endif // __MAIN_H__ diff --git a/samples/Lua/TestLua/proj.android/.classpath b/samples/Lua/TestLua/proj.android/.classpath deleted file mode 100644 index 0b08408342..0000000000 --- a/samples/Lua/TestLua/proj.android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/Lua/TestLua/proj.android/ant.properties b/samples/Lua/TestLua/proj.android/ant.properties deleted file mode 100644 index b0971e891e..0000000000 --- a/samples/Lua/TestLua/proj.android/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked into Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/samples/Lua/TestLua/proj.android/proguard-project.txt b/samples/Lua/TestLua/proj.android/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/samples/Lua/TestLua/proj.android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/samples/Lua/TestLua/proj.android/project.properties b/samples/Lua/TestLua/proj.android/project.properties deleted file mode 100644 index 0a6dc6664d..0000000000 --- a/samples/Lua/TestLua/proj.android/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-10 - -android.library.reference.1=../../../../cocos/2d/platform/android/java diff --git a/samples/Lua/TestLua/proj.ios/AppController.h b/samples/Lua/TestLua/proj.ios/AppController.h deleted file mode 100644 index 3d51064ca0..0000000000 --- a/samples/Lua/TestLua/proj.ios/AppController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -@class RootViewController; - -@interface AppController : NSObject { - UIWindow *window; - RootViewController *viewController; -} - -@end - diff --git a/samples/Lua/TestLua/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/Lua/TestLua/proj.ios/Default-568h@2x.png.REMOVED.git-id deleted file mode 100644 index 8f5838f3a8..0000000000 --- a/samples/Lua/TestLua/proj.ios/Default-568h@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/Lua/TestLua/proj.ios/Default@2x.png.REMOVED.git-id b/samples/Lua/TestLua/proj.ios/Default@2x.png.REMOVED.git-id deleted file mode 100644 index 8843505b20..0000000000 --- a/samples/Lua/TestLua/proj.ios/Default@2x.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/Lua/TestLua/proj.ios/RootViewController.h b/samples/Lua/TestLua/proj.ios/RootViewController.h deleted file mode 100644 index 11dfc4bf88..0000000000 --- a/samples/Lua/TestLua/proj.ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import - - -@interface RootViewController : UIViewController { - -} -- (BOOL)prefersStatusBarHidden; -@end diff --git a/samples/Lua/TestLua/proj.ios/RootViewController.mm b/samples/Lua/TestLua/proj.ios/RootViewController.mm deleted file mode 100644 index a00da00584..0000000000 --- a/samples/Lua/TestLua/proj.ios/RootViewController.mm +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - - http://www.cocos2d-x.org - - 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. - ****************************************************************************/ - -#import "RootViewController.h" - - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { -} -*/ - -/* -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - -*/ -// Override to allow orientations other than the default portrait orientation. -// This method is deprecated on ios6 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return UIInterfaceOrientationIsLandscape( interfaceOrientation ); -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -- (NSUInteger) supportedInterfaceOrientations{ -#ifdef __IPHONE_6_0 - return UIInterfaceOrientationMaskAllButUpsideDown; -#endif -} - -- (BOOL) shouldAutorotate { - return YES; -} - -//fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/samples/Lua/TestLua/proj.linux/main.cpp b/samples/Lua/TestLua/proj.linux/main.cpp deleted file mode 100644 index 67f1f00575..0000000000 --- a/samples/Lua/TestLua/proj.linux/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../Classes/AppDelegate.h" -#include "cocos2d.h" -#include "CCEGLView.h" - -#include -#include -#include -#include - -USING_NS_CC; - -int main(int argc, char **argv) -{ - // create the application instance - AppDelegate app; - EGLView eglView; - eglView.init("TestLua",900,640); - return Application::getInstance()->run(); -} diff --git a/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id deleted file mode 100644 index 9874ec6979..0000000000 --- a/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/TestLua/proj.mac/en.lproj/InfoPlist.strings b/samples/Lua/TestLua/proj.mac/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f..0000000000 --- a/samples/Lua/TestLua/proj.mac/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/Lua/TestLua/proj.mac/en.lproj/MainMenu.xib b/samples/Lua/TestLua/proj.mac/en.lproj/MainMenu.xib deleted file mode 100644 index 9f99439250..0000000000 --- a/samples/Lua/TestLua/proj.mac/en.lproj/MainMenu.xib +++ /dev/null @@ -1,812 +0,0 @@ - - - - 1060 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSMenuItem - NSCustomObject - NSMenu - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - HelloCpp - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - HelloCpp - - YES - - - About HelloCpp - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide HelloCpp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit HelloCpp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Toggle Fullscreen - f - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - HelloCpp Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - AppController - - - NSFontManager - - - - - YES - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - showHelp: - - - - 493 - - - - toggleFullScreen: - - - - 537 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - 420 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 536 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 420.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 536.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 541 - - - - YES - - AppController - NSObject - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - id - id - - - - YES - - YES - exitFullScreen: - toggleFullScreen: - - - YES - - exitFullScreen: - id - - - toggleFullScreen: - id - - - - - YES - - YES - glView - window - - - YES - EAGLView - Window - - - - YES - - YES - glView - window - - - YES - - glView - EAGLView - - - window - Window - - - - - IBProjectSource - ./Classes/AppController.h - - - - EAGLView - NSOpenGLView - - IBProjectSource - ./Classes/EAGLView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/template/multi-platform-cpp/Classes/AppDelegate.cpp b/template/multi-platform-cpp/Classes/AppDelegate.cpp index 41659181d6..6b5298dab3 100644 --- a/template/multi-platform-cpp/Classes/AppDelegate.cpp +++ b/template/multi-platform-cpp/Classes/AppDelegate.cpp @@ -14,10 +14,12 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); - auto eglView = EGLView::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::create("My Game"); + director->setOpenGLView(glview); + } - director->setOpenGLView(eglView); - // turn on display FPS director->setDisplayStats(true); diff --git a/template/multi-platform-cpp/proj.ios_mac/ios/AppController.mm b/template/multi-platform-cpp/proj.ios_mac/ios/AppController.mm index c9c837397c..08a83f6b99 100644 --- a/template/multi-platform-cpp/proj.ios_mac/ios/AppController.mm +++ b/template/multi-platform-cpp/proj.ios_mac/ios/AppController.mm @@ -1,5 +1,29 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + 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. + ****************************************************************************/ + #import "AppController.h" -#import "EAGLView.h" +#import "CCEAGLView.h" #import "cocos2d.h" #import "AppDelegate.h" #import "RootViewController.h" @@ -13,14 +37,14 @@ static AppDelegate s_sharedApplication; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - + // Override point for customization after application launch. // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - + // Init the CCEAGLView - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] pixelFormat: kEAGLColorFormatRGB565 depthFormat: GL_DEPTH24_STENCIL8_OES preserveBackbuffer: NO @@ -31,7 +55,7 @@ static AppDelegate s_sharedApplication; // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -44,11 +68,15 @@ static AppDelegate s_sharedApplication; // use this method on ios6 [window setRootViewController:viewController]; } - + [window makeKeyAndVisible]; - + [[UIApplication sharedApplication] setStatusBarHidden:true]; - + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + cocos2d::Application::getInstance()->run(); return YES; diff --git a/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h b/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h index 25f728b12d..a1669019e2 100644 --- a/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h +++ b/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h @@ -1,3 +1,28 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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. + ****************************************************************************/ + #import diff --git a/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm b/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm index 187b274b91..b7d78629ab 100644 --- a/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm +++ b/template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm @@ -1,6 +1,31 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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. + ****************************************************************************/ + #import "RootViewController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" @implementation RootViewController @@ -25,7 +50,7 @@ - (void)viewDidLoad { [super viewDidLoad]; } - + */ // Override to allow orientations other than the default portrait orientation. // This method is deprecated on ios6 @@ -47,7 +72,10 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; - CGSize s = CGSizeMake([[CCEAGLView sharedEGLView] getWidth], [[CCEAGLView sharedEGLView] getHeight]); + cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView(); + + CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); } @@ -61,7 +89,7 @@ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; - + // Release any cached data, images, etc that aren't in use. } diff --git a/template/multi-platform-cpp/proj.ios_mac/mac/main.cpp b/template/multi-platform-cpp/proj.ios_mac/mac/main.cpp index d990ea0a55..1814d16c15 100644 --- a/template/multi-platform-cpp/proj.ios_mac/mac/main.cpp +++ b/template/multi-platform-cpp/proj.ios_mac/mac/main.cpp @@ -29,7 +29,5 @@ USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("Hello World",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-cpp/proj.linux/main.cpp b/template/multi-platform-cpp/proj.linux/main.cpp index 32be76659d..c5b735da78 100644 --- a/template/multi-platform-cpp/proj.linux/main.cpp +++ b/template/multi-platform-cpp/proj.linux/main.cpp @@ -11,7 +11,5 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("Cocos2d-x Game",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-cpp/proj.win32/main.cpp b/template/multi-platform-cpp/proj.win32/main.cpp index 354a66f49f..46ce5bf290 100644 --- a/template/multi-platform-cpp/proj.win32/main.cpp +++ b/template/multi-platform-cpp/proj.win32/main.cpp @@ -13,7 +13,5 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-js/Classes/AppDelegate.cpp b/template/multi-platform-js/Classes/AppDelegate.cpp index 8e35153453..53be703216 100644 --- a/template/multi-platform-js/Classes/AppDelegate.cpp +++ b/template/multi-platform-js/Classes/AppDelegate.cpp @@ -26,15 +26,19 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { // initialize director - Director *director = Director::getInstance(); - director->setOpenGLView(EGLView::getInstance()); - + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::create("My Game"); + director->setOpenGLView(glview); + } + // turn on display FPS director->setDisplayStats(true); - + // set FPS. the default value is 1.0/60 if you don't call this director->setAnimationInterval(1.0 / 60); - + ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); sc->addRegisterCallback(register_all_cocos2dx_extension); @@ -44,11 +48,11 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(JSB_register_opengl); sc->addRegisterCallback(jsb_register_system); sc->start(); - + ScriptEngineProtocol *engine = ScriptingCore::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); ScriptingCore::getInstance()->runScript("cocos2d-jsb.js"); - + return true; } diff --git a/template/multi-platform-js/proj.ios_mac/mac/main.cpp b/template/multi-platform-js/proj.ios_mac/mac/main.cpp index d990ea0a55..1814d16c15 100644 --- a/template/multi-platform-js/proj.ios_mac/mac/main.cpp +++ b/template/multi-platform-js/proj.ios_mac/mac/main.cpp @@ -29,7 +29,5 @@ USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("Hello World",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-js/proj.win32/main.cpp b/template/multi-platform-js/proj.win32/main.cpp index 2b549700f2..69c3b8c9bb 100644 --- a/template/multi-platform-js/proj.win32/main.cpp +++ b/template/multi-platform-js/proj.win32/main.cpp @@ -23,9 +23,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",900,640); - int ret = Application::getInstance()->run(); #ifdef USE_WIN32_CONSOLE diff --git a/template/multi-platform-lua/Classes/AppDelegate.cpp b/template/multi-platform-lua/Classes/AppDelegate.cpp index 2c5265ff46..38c73e160f 100644 --- a/template/multi-platform-lua/Classes/AppDelegate.cpp +++ b/template/multi-platform-lua/Classes/AppDelegate.cpp @@ -19,9 +19,13 @@ bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); - director->setOpenGLView(EGLView::getInstance()); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::create("My Game"); + director->setOpenGLView(glview); + } - EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); + glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); // turn on display FPS director->setDisplayStats(true); @@ -32,10 +36,11 @@ bool AppDelegate::applicationDidFinishLaunching() // register lua engine auto engine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); - - std::string path = FileUtils::getInstance()->fullPathForFilename("hello.lua"); - engine->executeScriptFile(path.c_str()); + //The call was commented because it will lead to ZeroBrane Studio can't find correct context when debugging + //engine->executeScriptFile("hello.lua"); + engine->executeString("require 'hello.lua'"); + return true; } diff --git a/template/multi-platform-lua/Resources/hello.lua b/template/multi-platform-lua/Resources/hello.lua index 620f28f34c..770e922c9d 100644 --- a/template/multi-platform-lua/Resources/hello.lua +++ b/template/multi-platform-lua/Resources/hello.lua @@ -22,7 +22,8 @@ local function main() if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_ANDROID == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or (cc.PLATFORM_OS_MAC == targetPlatform) then - require('mobdebug').start() + local host = 'localhost' -- please change localhost to your PC's IP for on-device debugging + require('mobdebug').start(host) end require "hello2" cclog("result is " .. myadd(1, 1)) diff --git a/template/multi-platform-lua/proj.ios_mac/mac/main.cpp b/template/multi-platform-lua/proj.ios_mac/mac/main.cpp index d990ea0a55..1814d16c15 100644 --- a/template/multi-platform-lua/proj.ios_mac/mac/main.cpp +++ b/template/multi-platform-lua/proj.ios_mac/mac/main.cpp @@ -29,7 +29,5 @@ USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("Hello World",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-lua/proj.linux/main.cpp b/template/multi-platform-lua/proj.linux/main.cpp index bc7ccac735..c5b735da78 100644 --- a/template/multi-platform-lua/proj.linux/main.cpp +++ b/template/multi-platform-lua/proj.linux/main.cpp @@ -11,7 +11,5 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("Cocos2d-x Game Using LUA",900,640); return Application::getInstance()->run(); } diff --git a/template/multi-platform-lua/proj.win32/main.cpp b/template/multi-platform-lua/proj.win32/main.cpp index 4dfce357f9..d9b2ddaa2e 100644 --- a/template/multi-platform-lua/proj.win32/main.cpp +++ b/template/multi-platform-lua/proj.win32/main.cpp @@ -24,9 +24,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",900,640); - int ret = Application::getInstance()->run(); #ifdef USE_WIN32_CONSOLE diff --git a/samples/Cpp/TestCpp/Android.mk b/tests/test-cpp/Android.mk similarity index 100% rename from samples/Cpp/TestCpp/Android.mk rename to tests/test-cpp/Android.mk diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/tests/test-cpp/CMakeLists.txt similarity index 100% rename from samples/Cpp/TestCpp/CMakeLists.txt rename to tests/test-cpp/CMakeLists.txt diff --git a/samples/Cpp/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp b/tests/test-cpp/Classes/AccelerometerTest/AccelerometerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp rename to tests/test-cpp/Classes/AccelerometerTest/AccelerometerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/AccelerometerTest/AccelerometerTest.h b/tests/test-cpp/Classes/AccelerometerTest/AccelerometerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/AccelerometerTest/AccelerometerTest.h rename to tests/test-cpp/Classes/AccelerometerTest/AccelerometerTest.h diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/test-cpp/Classes/ActionManagerTest/ActionManagerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp rename to tests/test-cpp/Classes/ActionManagerTest/ActionManagerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h b/tests/test-cpp/Classes/ActionManagerTest/ActionManagerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h rename to tests/test-cpp/Classes/ActionManagerTest/ActionManagerTest.h diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/tests/test-cpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp rename to tests/test-cpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h b/tests/test-cpp/Classes/ActionsEaseTest/ActionsEaseTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h rename to tests/test-cpp/Classes/ActionsEaseTest/ActionsEaseTest.h diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/tests/test-cpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp rename to tests/test-cpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h b/tests/test-cpp/Classes/ActionsProgressTest/ActionsProgressTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h rename to tests/test-cpp/Classes/ActionsProgressTest/ActionsProgressTest.h diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/tests/test-cpp/Classes/ActionsTest/ActionsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp rename to tests/test-cpp/Classes/ActionsTest/ActionsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h b/tests/test-cpp/Classes/ActionsTest/ActionsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h rename to tests/test-cpp/Classes/ActionsTest/ActionsTest.h diff --git a/tests/test-cpp/Classes/AppDelegate.cpp b/tests/test-cpp/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..8c577cd02c --- /dev/null +++ b/tests/test-cpp/Classes/AppDelegate.cpp @@ -0,0 +1,136 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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 "AppDelegate.h" + +#include "cocos2d.h" +#include "controller.h" +#include "SimpleAudioEngine.h" +#include "cocostudio/CocoStudio.h" +#include "extensions/cocos-ext.h" + +USING_NS_CC; +using namespace CocosDenshion; + +AppDelegate::AppDelegate() +{ +} + +AppDelegate::~AppDelegate() +{ +// SimpleAudioEngine::end(); + cocostudio::ArmatureDataManager::destroyInstance(); +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + // As an example, load config file + // XXX: This should be loaded before the Director is initialized, + // XXX: but at this point, the director is already initialized + Configuration::getInstance()->loadConfigFile("configs/config-example.plist"); + + // initialize director + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::create("Test Cpp"); + director->setOpenGLView(glview); + } + + director->setDisplayStats(true); + director->setAnimationInterval(1.0 / 60); + + auto screenSize = glview->getFrameSize(); + + auto designSize = Size(480, 320); + + auto fileUtils = FileUtils::getInstance(); + std::vector searchPaths; + + if (screenSize.height > 320) + { + auto resourceSize = Size(960, 640); + searchPaths.push_back("hd"); + searchPaths.push_back("hd/scenetest"); + searchPaths.push_back("hd/scenetest/ArmatureComponentTest"); + searchPaths.push_back("hd/scenetest/AttributeComponentTest"); + searchPaths.push_back("hd/scenetest/BackgroundComponentTest"); + searchPaths.push_back("hd/scenetest/EffectComponentTest"); + searchPaths.push_back("hd/scenetest/LoadSceneEdtiorFileTest"); + searchPaths.push_back("hd/scenetest/ParticleComponentTest"); + searchPaths.push_back("hd/scenetest/SpriteComponentTest"); + searchPaths.push_back("hd/scenetest/TmxMapComponentTest"); + searchPaths.push_back("hd/scenetest/UIComponentTest"); + searchPaths.push_back("hd/scenetest/TriggerTest"); + director->setContentScaleFactor(resourceSize.height/designSize.height); + } + else + { + searchPaths.push_back("scenetest/ArmatureComponentTest"); + searchPaths.push_back("scenetest/AttributeComponentTest"); + searchPaths.push_back("scenetest/BackgroundComponentTest"); + searchPaths.push_back("scenetest/EffectComponentTest"); + searchPaths.push_back("scenetest/LoadSceneEdtiorFileTest"); + searchPaths.push_back("scenetest/ParticleComponentTest"); + searchPaths.push_back("scenetest/SpriteComponentTest"); + searchPaths.push_back("scenetest/TmxMapComponentTest"); + searchPaths.push_back("scenetest/UIComponentTest"); + searchPaths.push_back("scenetest/TriggerTest"); + } + + fileUtils->setSearchPaths(searchPaths); + +// glview->setDesignResolutionSize(screenSize.width, screenSize.height, ResolutionPolicy::NO_BORDER); + glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); + + auto scene = Scene::create(); + auto layer = new TestController(); + layer->autorelease(); + + scene->addChild(layer); + director->runWithScene(scene); + + // Enable Remote Console + auto console = director->getConsole(); + console->listenOnTCP(5678); + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + Director::getInstance()->stopAnimation(); + SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); + SimpleAudioEngine::getInstance()->pauseAllEffects(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + Director::getInstance()->startAnimation(); + SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); + SimpleAudioEngine::getInstance()->resumeAllEffects(); +} diff --git a/samples/Cpp/SimpleGame/Classes/GameOverScene.h b/tests/test-cpp/Classes/AppDelegate.h similarity index 55% rename from samples/Cpp/SimpleGame/Classes/GameOverScene.h rename to tests/test-cpp/Classes/AppDelegate.h index 1bbf1907e1..bd170afca7 100644 --- a/samples/Cpp/SimpleGame/Classes/GameOverScene.h +++ b/tests/test-cpp/Classes/AppDelegate.h @@ -1,19 +1,19 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ray Wenderlich - + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 @@ -23,33 +23,41 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef _GAME_OVER_SCENE_H_ -#define _GAME_OVER_SCENE_H_ +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ #include "cocos2d.h" -class GameOverLayer : public cocos2d::LayerColor +/** +@brief The cocos2d Application. + +The reason for implement as private inheritance is to hide some interface call by Director. +*/ +class AppDelegate : private cocos2d::Application { public: - GameOverLayer():_label(NULL) {}; - virtual ~GameOverLayer(); - bool init(); - CREATE_FUNC(GameOverLayer); + AppDelegate(); + virtual ~AppDelegate(); - void gameOverDone(); + /** + @brief Implement Director and Scene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); - CC_SYNTHESIZE_READONLY(cocos2d::LabelTTF*, _label, Label); + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); }; -class GameOverScene : public cocos2d::Scene -{ -public: - GameOverScene():_layer(NULL) {}; - ~GameOverScene(); - bool init(); - CREATE_FUNC(GameOverScene); - - CC_SYNTHESIZE_READONLY(GameOverLayer*, _layer, Layer); -}; +#endif // _APP_DELEGATE_H_ -#endif // _GAME_OVER_SCENE_H_ diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.cpp b/tests/test-cpp/Classes/BaseTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BaseTest.cpp rename to tests/test-cpp/Classes/BaseTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.h b/tests/test-cpp/Classes/BaseTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BaseTest.h rename to tests/test-cpp/Classes/BaseTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/tests/test-cpp/Classes/Box2DTest/Box2dTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp rename to tests/test-cpp/Classes/Box2DTest/Box2dTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.h b/tests/test-cpp/Classes/Box2DTest/Box2dTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.h rename to tests/test-cpp/Classes/Box2DTest/Box2dTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp b/tests/test-cpp/Classes/Box2DTestBed/Box2dView.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp rename to tests/test-cpp/Classes/Box2DTestBed/Box2dView.cpp diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.h b/tests/test-cpp/Classes/Box2DTestBed/Box2dView.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.h rename to tests/test-cpp/Classes/Box2DTestBed/Box2dView.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp b/tests/test-cpp/Classes/Box2DTestBed/GLES-Render.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp rename to tests/test-cpp/Classes/Box2DTestBed/GLES-Render.cpp diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.h b/tests/test-cpp/Classes/Box2DTestBed/GLES-Render.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.h rename to tests/test-cpp/Classes/Box2DTestBed/GLES-Render.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Test.cpp b/tests/test-cpp/Classes/Box2DTestBed/Test.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Test.cpp rename to tests/test-cpp/Classes/Box2DTestBed/Test.cpp diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Test.h b/tests/test-cpp/Classes/Box2DTestBed/Test.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Test.h rename to tests/test-cpp/Classes/Box2DTestBed/Test.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp b/tests/test-cpp/Classes/Box2DTestBed/TestEntries.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/TestEntries.cpp rename to tests/test-cpp/Classes/Box2DTestBed/TestEntries.cpp diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/AddPair.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/AddPair.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/AddPair.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/AddPair.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ApplyForce.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/ApplyForce.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ApplyForce.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/ApplyForce.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/BodyTypes.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/BodyTypes.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/BodyTypes.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/BodyTypes.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Breakable.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Breakable.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Breakable.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Breakable.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Bridge.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Bridge.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Bridge.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Bridge.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/BulletTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/BulletTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/BulletTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/BulletTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Cantilever.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Cantilever.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Cantilever.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Cantilever.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Car.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Car.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Car.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Car.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Chain.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Chain.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Chain.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Chain.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CharacterCollision.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/CharacterCollision.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CharacterCollision.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/CharacterCollision.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CollisionFiltering.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/CollisionFiltering.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CollisionFiltering.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/CollisionFiltering.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CollisionProcessing.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/CollisionProcessing.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CollisionProcessing.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/CollisionProcessing.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CompoundShapes.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/CompoundShapes.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/CompoundShapes.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/CompoundShapes.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Confined.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Confined.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Confined.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Confined.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ContinuousTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/ContinuousTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ContinuousTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/ContinuousTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ConvexHull.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/ConvexHull.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ConvexHull.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/ConvexHull.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ConveyorBelt.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/ConveyorBelt.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ConveyorBelt.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/ConveyorBelt.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DistanceTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/DistanceTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DistanceTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/DistanceTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Dominos.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Dominos.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Dominos.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Dominos.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/DumpShell.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DumpShell.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/DumpShell.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DynamicTreeTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/DynamicTreeTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/DynamicTreeTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/DynamicTreeTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeShapes.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/EdgeShapes.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeShapes.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/EdgeShapes.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/EdgeTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/EdgeTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/EdgeTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Gears.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Gears.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Gears.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Gears.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Mobile.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Mobile.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Mobile.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Mobile.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/MobileBalanced.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/MobileBalanced.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/MobileBalanced.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/MobileBalanced.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/MotorJoint.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/MotorJoint.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/MotorJoint.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/MotorJoint.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/OneSidedPlatform.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/OneSidedPlatform.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/OneSidedPlatform.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/OneSidedPlatform.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pinball.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Pinball.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pinball.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Pinball.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/PolyCollision.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/PolyCollision.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/PolyCollision.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/PolyCollision.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/PolyShapes.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/PolyShapes.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/PolyShapes.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/PolyShapes.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Prismatic.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Prismatic.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Prismatic.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Prismatic.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pulleys.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Pulleys.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pulleys.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Pulleys.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pyramid.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Pyramid.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Pyramid.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Pyramid.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/RayCast.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/RayCast.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/RayCast.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/RayCast.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Revolute.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Revolute.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Revolute.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Revolute.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Rope.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Rope.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Rope.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Rope.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/RopeJoint.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/RopeJoint.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/RopeJoint.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/RopeJoint.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SensorTest.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/SensorTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SensorTest.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/SensorTest.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ShapeEditing.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/ShapeEditing.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/ShapeEditing.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/ShapeEditing.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SliderCrank.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/SliderCrank.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SliderCrank.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/SliderCrank.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SphereStack.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/SphereStack.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/SphereStack.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/SphereStack.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/TheoJansen.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/TheoJansen.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/TheoJansen.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/TheoJansen.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Tiles.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Tiles.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Tiles.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Tiles.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/TimeOfImpact.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/TimeOfImpact.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/TimeOfImpact.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/TimeOfImpact.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Tumbler.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Tumbler.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Tumbler.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Tumbler.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VaryingFriction.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/VaryingFriction.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VaryingFriction.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/VaryingFriction.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VaryingRestitution.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/VaryingRestitution.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VaryingRestitution.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/VaryingRestitution.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VerticalStack.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/VerticalStack.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/VerticalStack.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/VerticalStack.h diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Web.h b/tests/test-cpp/Classes/Box2DTestBed/Tests/Web.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Box2DTestBed/Tests/Web.h rename to tests/test-cpp/Classes/Box2DTestBed/Tests/Web.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp b/tests/test-cpp/Classes/BugsTest/Bug-1159.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-1159.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h b/tests/test-cpp/Classes/BugsTest/Bug-1159.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h rename to tests/test-cpp/Classes/BugsTest/Bug-1159.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1174.cpp b/tests/test-cpp/Classes/BugsTest/Bug-1174.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-1174.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-1174.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1174.h b/tests/test-cpp/Classes/BugsTest/Bug-1174.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-1174.h rename to tests/test-cpp/Classes/BugsTest/Bug-1174.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-350.cpp b/tests/test-cpp/Classes/BugsTest/Bug-350.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-350.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-350.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-350.h b/tests/test-cpp/Classes/BugsTest/Bug-350.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-350.h rename to tests/test-cpp/Classes/BugsTest/Bug-350.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-422.cpp b/tests/test-cpp/Classes/BugsTest/Bug-422.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-422.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-422.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-422.h b/tests/test-cpp/Classes/BugsTest/Bug-422.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-422.h rename to tests/test-cpp/Classes/BugsTest/Bug-422.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp b/tests/test-cpp/Classes/BugsTest/Bug-458/Bug-458.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-458/Bug-458.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.h b/tests/test-cpp/Classes/BugsTest/Bug-458/Bug-458.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/Bug-458.h rename to tests/test-cpp/Classes/BugsTest/Bug-458/Bug-458.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp b/tests/test-cpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.h b/tests/test-cpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.h rename to tests/test-cpp/Classes/BugsTest/Bug-458/QuestionContainerSprite.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp b/tests/test-cpp/Classes/BugsTest/Bug-624.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-624.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.h b/tests/test-cpp/Classes/BugsTest/Bug-624.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-624.h rename to tests/test-cpp/Classes/BugsTest/Bug-624.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-886.cpp b/tests/test-cpp/Classes/BugsTest/Bug-886.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-886.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-886.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-886.h b/tests/test-cpp/Classes/BugsTest/Bug-886.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-886.h rename to tests/test-cpp/Classes/BugsTest/Bug-886.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-899.cpp b/tests/test-cpp/Classes/BugsTest/Bug-899.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-899.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-899.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-899.h b/tests/test-cpp/Classes/BugsTest/Bug-899.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-899.h rename to tests/test-cpp/Classes/BugsTest/Bug-899.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp b/tests/test-cpp/Classes/BugsTest/Bug-914.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.cpp rename to tests/test-cpp/Classes/BugsTest/Bug-914.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.h b/tests/test-cpp/Classes/BugsTest/Bug-914.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/Bug-914.h rename to tests/test-cpp/Classes/BugsTest/Bug-914.h diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp b/tests/test-cpp/Classes/BugsTest/BugsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp rename to tests/test-cpp/Classes/BugsTest/BugsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h b/tests/test-cpp/Classes/BugsTest/BugsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h rename to tests/test-cpp/Classes/BugsTest/BugsTest.h diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/test-cpp/Classes/ChipmunkTest/ChipmunkTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp rename to tests/test-cpp/Classes/ChipmunkTest/ChipmunkTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h b/tests/test-cpp/Classes/ChipmunkTest/ChipmunkTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h rename to tests/test-cpp/Classes/ChipmunkTest/ChipmunkTest.h diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/test-cpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp rename to tests/test-cpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h b/tests/test-cpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h rename to tests/test-cpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/test-cpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp rename to tests/test-cpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h b/tests/test-cpp/Classes/ClippingNodeTest/ClippingNodeTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h rename to tests/test-cpp/Classes/ClippingNodeTest/ClippingNodeTest.h diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/tests/test-cpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp rename to tests/test-cpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.h b/tests/test-cpp/Classes/CocosDenshionTest/CocosDenshionTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.h rename to tests/test-cpp/Classes/CocosDenshionTest/CocosDenshionTest.h diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp b/tests/test-cpp/Classes/ConfigurationTest/ConfigurationTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp rename to tests/test-cpp/Classes/ConfigurationTest/ConfigurationTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h b/tests/test-cpp/Classes/ConfigurationTest/ConfigurationTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h rename to tests/test-cpp/Classes/ConfigurationTest/ConfigurationTest.h diff --git a/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp b/tests/test-cpp/Classes/ConsoleTest/ConsoleTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.cpp rename to tests/test-cpp/Classes/ConsoleTest/ConsoleTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.h b/tests/test-cpp/Classes/ConsoleTest/ConsoleTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ConsoleTest/ConsoleTest.h rename to tests/test-cpp/Classes/ConsoleTest/ConsoleTest.h diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp b/tests/test-cpp/Classes/CurlTest/CurlTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp rename to tests/test-cpp/Classes/CurlTest/CurlTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h b/tests/test-cpp/Classes/CurlTest/CurlTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h rename to tests/test-cpp/Classes/CurlTest/CurlTest.h diff --git a/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/tests/test-cpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp rename to tests/test-cpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.h b/tests/test-cpp/Classes/CurrentLanguageTest/CurrentLanguageTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.h rename to tests/test-cpp/Classes/CurrentLanguageTest/CurrentLanguageTest.h diff --git a/samples/Cpp/TestCpp/Classes/DataVisitorTest/DataVisitorTest.cpp b/tests/test-cpp/Classes/DataVisitorTest/DataVisitorTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/DataVisitorTest/DataVisitorTest.cpp rename to tests/test-cpp/Classes/DataVisitorTest/DataVisitorTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/DataVisitorTest/DataVisitorTest.h b/tests/test-cpp/Classes/DataVisitorTest/DataVisitorTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/DataVisitorTest/DataVisitorTest.h rename to tests/test-cpp/Classes/DataVisitorTest/DataVisitorTest.h diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/test-cpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp rename to tests/test-cpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h b/tests/test-cpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h rename to tests/test-cpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/tests/test-cpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp rename to tests/test-cpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h b/tests/test-cpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h rename to tests/test-cpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp b/tests/test-cpp/Classes/EffectsTest/EffectsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp rename to tests/test-cpp/Classes/EffectsTest/EffectsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h b/tests/test-cpp/Classes/EffectsTest/EffectsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h rename to tests/test-cpp/Classes/EffectsTest/EffectsTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/EventDef.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/EventDef.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/EventDef.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/EventDef.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h b/tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h rename to tests/test-cpp/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h rename to tests/test-cpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h b/tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp similarity index 96% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index 961f9f8e2d..eb788bb2b2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/tests/test-cpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -15,8 +15,9 @@ USING_NS_CC_EXT; EditBoxTest::EditBoxTest() { - auto visibleOrigin = EGLView::getInstance()->getVisibleOrigin(); - auto visibleSize = EGLView::getInstance()->getVisibleSize(); + auto glview = Director::getInstance()->getOpenGLView(); + auto visibleOrigin = glview->getVisibleOrigin(); + auto visibleSize = glview->getVisibleSize(); auto pBg = Sprite::create("Images/HelloWorld.png"); pBg->setPosition(Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/tests/test-cpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h rename to tests/test-cpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/ExtensionsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/ExtensionsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h b/tests/test-cpp/Classes/ExtensionsTest/ExtensionsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h rename to tests/test-cpp/Classes/ExtensionsTest/ExtensionsTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/tests/test-cpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h rename to tests/test-cpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h b/tests/test-cpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h rename to tests/test-cpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/tests/test-cpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp rename to tests/test-cpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h b/tests/test-cpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h rename to tests/test-cpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp b/tests/test-cpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp rename to tests/test-cpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/tests/test-cpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h rename to tests/test-cpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/test-cpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp rename to tests/test-cpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h b/tests/test-cpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h rename to tests/test-cpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/test-cpp/Classes/FileUtilsTest/FileUtilsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp rename to tests/test-cpp/Classes/FileUtilsTest/FileUtilsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h b/tests/test-cpp/Classes/FileUtilsTest/FileUtilsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h rename to tests/test-cpp/Classes/FileUtilsTest/FileUtilsTest.h diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp b/tests/test-cpp/Classes/FontTest/FontTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp rename to tests/test-cpp/Classes/FontTest/FontTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h b/tests/test-cpp/Classes/FontTest/FontTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/FontTest/FontTest.h rename to tests/test-cpp/Classes/FontTest/FontTest.h diff --git a/samples/Cpp/TestCpp/Classes/InputTest/MouseTest.cpp b/tests/test-cpp/Classes/InputTest/MouseTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/InputTest/MouseTest.cpp rename to tests/test-cpp/Classes/InputTest/MouseTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/InputTest/MouseTest.h b/tests/test-cpp/Classes/InputTest/MouseTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/InputTest/MouseTest.h rename to tests/test-cpp/Classes/InputTest/MouseTest.h diff --git a/samples/Cpp/TestCpp/Classes/IntervalTest/IntervalTest.cpp b/tests/test-cpp/Classes/IntervalTest/IntervalTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/IntervalTest/IntervalTest.cpp rename to tests/test-cpp/Classes/IntervalTest/IntervalTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/IntervalTest/IntervalTest.h b/tests/test-cpp/Classes/IntervalTest/IntervalTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/IntervalTest/IntervalTest.h rename to tests/test-cpp/Classes/IntervalTest/IntervalTest.h diff --git a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp b/tests/test-cpp/Classes/KeyboardTest/KeyboardTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp rename to tests/test-cpp/Classes/KeyboardTest/KeyboardTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h b/tests/test-cpp/Classes/KeyboardTest/KeyboardTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h rename to tests/test-cpp/Classes/KeyboardTest/KeyboardTest.h diff --git a/samples/Cpp/TestCpp/Classes/KeypadTest/KeypadTest.cpp b/tests/test-cpp/Classes/KeypadTest/KeypadTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/KeypadTest/KeypadTest.cpp rename to tests/test-cpp/Classes/KeypadTest/KeypadTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/KeypadTest/KeypadTest.h b/tests/test-cpp/Classes/KeypadTest/KeypadTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/KeypadTest/KeypadTest.h rename to tests/test-cpp/Classes/KeypadTest/KeypadTest.h diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp b/tests/test-cpp/Classes/LabelTest/LabelTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp rename to tests/test-cpp/Classes/LabelTest/LabelTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h b/tests/test-cpp/Classes/LabelTest/LabelTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h rename to tests/test-cpp/Classes/LabelTest/LabelTest.h diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTestNew.cpp b/tests/test-cpp/Classes/LabelTest/LabelTestNew.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/LabelTest/LabelTestNew.cpp rename to tests/test-cpp/Classes/LabelTest/LabelTestNew.cpp diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTestNew.h b/tests/test-cpp/Classes/LabelTest/LabelTestNew.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/LabelTest/LabelTestNew.h rename to tests/test-cpp/Classes/LabelTest/LabelTestNew.h diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/tests/test-cpp/Classes/LayerTest/LayerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp rename to tests/test-cpp/Classes/LayerTest/LayerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/tests/test-cpp/Classes/LayerTest/LayerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h rename to tests/test-cpp/Classes/LayerTest/LayerTest.h diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp b/tests/test-cpp/Classes/MenuTest/MenuTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp rename to tests/test-cpp/Classes/MenuTest/MenuTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h b/tests/test-cpp/Classes/MenuTest/MenuTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h rename to tests/test-cpp/Classes/MenuTest/MenuTest.h diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/tests/test-cpp/Classes/MotionStreakTest/MotionStreakTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp rename to tests/test-cpp/Classes/MotionStreakTest/MotionStreakTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h b/tests/test-cpp/Classes/MotionStreakTest/MotionStreakTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h rename to tests/test-cpp/Classes/MotionStreakTest/MotionStreakTest.h diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp b/tests/test-cpp/Classes/MutiTouchTest/MutiTouchTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp rename to tests/test-cpp/Classes/MutiTouchTest/MutiTouchTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h b/tests/test-cpp/Classes/MutiTouchTest/MutiTouchTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h rename to tests/test-cpp/Classes/MutiTouchTest/MutiTouchTest.h diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp similarity index 82% rename from samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp rename to tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 59ed1fb06f..1495970cec 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -23,6 +23,7 @@ std::function createFunctions[] = CL(RemoveListenerAfterAddingTest), CL(DirectorEventTest), CL(GlobalZTouchTest), + CL(StopPropagationTest), }; unsigned int TEST_CASE_COUNT = sizeof(createFunctions) / sizeof(createFunctions[0]); @@ -866,10 +867,10 @@ GlobalZTouchTest::GlobalZTouchTest() , _accum(0) { - auto listener1 = EventListenerTouchOneByOne::create(); - listener1->setSwallowTouches(true); + auto listener = EventListenerTouchOneByOne::create(); + listener->setSwallowTouches(true); - listener1->onTouchBegan = [](Touch* touch, Event* event){ + listener->onTouchBegan = [](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); Point locationInNode = target->convertToNodeSpace(touch->getLocation()); @@ -885,12 +886,12 @@ GlobalZTouchTest::GlobalZTouchTest() return false; }; - listener1->onTouchMoved = [](Touch* touch, Event* event){ + listener->onTouchMoved = [](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); target->setPosition(target->getPosition() + touch->getDelta()); }; - listener1->onTouchEnded = [=](Touch* touch, Event* event){ + listener->onTouchEnded = [=](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); log("sprite onTouchesEnded.. "); target->setOpacity(255); @@ -901,7 +902,6 @@ GlobalZTouchTest::GlobalZTouchTest() for (int i = 0; i < SPRITE_COUNT; i++) { Sprite *sprite; - auto parent = Node::create(); if(i==4) { sprite = Sprite::create("Images/CyanSquare.png"); @@ -913,10 +913,9 @@ GlobalZTouchTest::GlobalZTouchTest() sprite = Sprite::create("Images/YellowSquare.png"); } - _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1->clone(), sprite); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener->clone(), sprite); - parent->addChild(sprite); - this->addChild(parent); + this->addChild(sprite); Size visibleSize = Director::getInstance()->getVisibleSize(); sprite->setPosition(VisibleRect::left().x + visibleSize.width / (SPRITE_COUNT - 1) * i, VisibleRect::center().y); @@ -945,3 +944,147 @@ std::string GlobalZTouchTest::subtitle() const return "Blue Sprite should change go from foreground to background"; } +StopPropagationTest::StopPropagationTest() +{ + static const int TAG_BLUE_SPRITE = 101; + static const int TAG_BLUE_SPRITE2 = 102; + + auto touchOneByOneListener = EventListenerTouchOneByOne::create(); + touchOneByOneListener->setSwallowTouches(true); + + touchOneByOneListener->onTouchBegan = [=](Touch* touch, Event* event){ + // Skip if don't touch top half screen. + if (!this->isPointInTopHalfAreaOfScreen(touch->getLocation())) + return false; + + auto target = static_cast(event->getCurrentTarget()); + CCASSERT(target->getTag() == TAG_BLUE_SPRITE, "Yellow blocks shouldn't response event."); + + if (this->isPointInNode(touch->getLocation(), target)) + { + target->setOpacity(180); + return true; + } + + // Stop propagation, so yellow blocks will not be able to receive event. + event->stopPropagation(); + return false; + }; + + touchOneByOneListener->onTouchEnded = [=](Touch* touch, Event* event){ + auto target = static_cast(event->getCurrentTarget()); + target->setOpacity(255); + }; + + auto touchAllAtOnceListener = EventListenerTouchAllAtOnce::create(); + touchAllAtOnceListener->onTouchesBegan = [=](const std::vector& touches, Event* event){ + // Skip if don't touch top half screen. + if (this->isPointInTopHalfAreaOfScreen(touches[0]->getLocation())) + return; + + auto target = static_cast(event->getCurrentTarget()); + CCASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); + + if (this->isPointInNode(touches[0]->getLocation(), target)) + { + target->setOpacity(180); + } + // Stop propagation, so yellow blocks will not be able to receive event. + event->stopPropagation(); + }; + + touchAllAtOnceListener->onTouchesEnded = [=](const std::vector& touches, Event* event){ + // Skip if don't touch top half screen. + if (this->isPointInTopHalfAreaOfScreen(touches[0]->getLocation())) + return; + + auto target = static_cast(event->getCurrentTarget()); + CCASSERT(target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); + + if (this->isPointInNode(touches[0]->getLocation(), target)) + { + target->setOpacity(255); + } + // Stop propagation, so yellow blocks will not be able to receive event. + event->stopPropagation(); + }; + + auto keyboardEventListener = EventListenerKeyboard::create(); + keyboardEventListener->onKeyPressed = [](EventKeyboard::KeyCode key, Event* event){ + auto target = static_cast(event->getCurrentTarget()); + CCASSERT(target->getTag() == TAG_BLUE_SPRITE || target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event."); + // Stop propagation, so yellow blocks will not be able to receive event. + event->stopPropagation(); + }; + + const int SPRITE_COUNT = 8; + + for (int i = 0; i < SPRITE_COUNT; i++) + { + Sprite* sprite; + Sprite* sprite2; + + if(i==4) + { + sprite = Sprite::create("Images/CyanSquare.png"); + sprite->setTag(TAG_BLUE_SPRITE); + addChild(sprite, 100); + + sprite2 = Sprite::create("Images/CyanSquare.png"); + sprite2->setTag(TAG_BLUE_SPRITE2); + addChild(sprite2, 100); + } + else + { + sprite = Sprite::create("Images/YellowSquare.png"); + addChild(sprite, 0); + sprite2 = Sprite::create("Images/YellowSquare.png"); + addChild(sprite2, 0); + } + + _eventDispatcher->addEventListenerWithSceneGraphPriority(touchOneByOneListener->clone(), sprite); + _eventDispatcher->addEventListenerWithSceneGraphPriority(keyboardEventListener->clone(), sprite); + + _eventDispatcher->addEventListenerWithSceneGraphPriority(touchAllAtOnceListener->clone(), sprite2); + _eventDispatcher->addEventListenerWithSceneGraphPriority(keyboardEventListener->clone(), sprite2); + + + Size visibleSize = Director::getInstance()->getVisibleSize(); + sprite->setPosition(VisibleRect::left().x + visibleSize.width / (SPRITE_COUNT - 1) * i, VisibleRect::center().y + sprite2->getContentSize().height/2 +10); + sprite2->setPosition(VisibleRect::left().x + visibleSize.width / (SPRITE_COUNT - 1) * i, VisibleRect::center().y - sprite2->getContentSize().height/2-10); + } +} + +bool StopPropagationTest::isPointInNode(Point pt, Node* node) +{ + Point locationInNode = node->convertToNodeSpace(pt); + Size s = node->getContentSize(); + Rect rect = Rect(0, 0, s.width, s.height); + + if (rect.containsPoint(locationInNode)) + { + return true; + } + return false; +} + +bool StopPropagationTest::isPointInTopHalfAreaOfScreen(Point pt) +{ + Size winSize = Director::getInstance()->getWinSize(); + + if (pt.y >= winSize.height/2) { + return true; + } + + return false; +} + +std::string StopPropagationTest::title() const +{ + return "Stop Propagation Test"; +} + +std::string StopPropagationTest::subtitle() const +{ + return "Shouldn't crash and only blue block could be clicked"; +} diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h b/tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h similarity index 90% rename from samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h rename to tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h index aa8d4c4c85..bb5b33b502 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h +++ b/tests/test-cpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h @@ -22,7 +22,7 @@ public: class EventDispatcherTestDemo : public BaseTest { public: - virtual void onEnter(); + virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; void backCallback(Object* sender); @@ -151,4 +151,18 @@ protected: float _accum; }; +class StopPropagationTest : public EventDispatcherTestDemo +{ +public: + CREATE_FUNC(StopPropagationTest); + StopPropagationTest(); + + virtual std::string title() const override; + virtual std::string subtitle() const override; + +protected: + bool isPointInNode(Point pt, Node* node); + bool isPointInTopHalfAreaOfScreen(Point pt); +}; + #endif /* defined(__samples__NewEventDispatcherTest__) */ diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp b/tests/test-cpp/Classes/NewRendererTest/NewRendererTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp rename to tests/test-cpp/Classes/NewRendererTest/NewRendererTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h b/tests/test-cpp/Classes/NewRendererTest/NewRendererTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h rename to tests/test-cpp/Classes/NewRendererTest/NewRendererTest.h diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/tests/test-cpp/Classes/NodeTest/NodeTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp rename to tests/test-cpp/Classes/NodeTest/NodeTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/tests/test-cpp/Classes/NodeTest/NodeTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h rename to tests/test-cpp/Classes/NodeTest/NodeTest.h diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp b/tests/test-cpp/Classes/ParallaxTest/ParallaxTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp rename to tests/test-cpp/Classes/ParallaxTest/ParallaxTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h b/tests/test-cpp/Classes/ParallaxTest/ParallaxTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h rename to tests/test-cpp/Classes/ParallaxTest/ParallaxTest.h diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp rename to tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h b/tests/test-cpp/Classes/ParticleTest/ParticleTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h rename to tests/test-cpp/Classes/ParticleTest/ParticleTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceAllocTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceAllocTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceAllocTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceAllocTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceContainerTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceContainerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceContainerTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceContainerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceContainerTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceContainerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceContainerTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceContainerTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceEventDispatcherTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceLabelTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceLabelTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceLabelTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceLabelTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceLabelTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceParticleTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceParticleTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceParticleTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceParticleTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceRendererTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceRendererTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceRendererTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceRendererTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceRendererTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceRendererTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceRendererTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceRendererTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceSpriteTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceSpriteTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceTextureTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTextureTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceTextureTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTextureTest.h diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTouchesTest.cpp b/tests/test-cpp/Classes/PerformanceTest/PerformanceTouchesTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTouchesTest.cpp rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTouchesTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTouchesTest.h b/tests/test-cpp/Classes/PerformanceTest/PerformanceTouchesTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTouchesTest.h rename to tests/test-cpp/Classes/PerformanceTest/PerformanceTouchesTest.h diff --git a/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.cpp b/tests/test-cpp/Classes/PhysicsTest/PhysicsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.cpp rename to tests/test-cpp/Classes/PhysicsTest/PhysicsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h b/tests/test-cpp/Classes/PhysicsTest/PhysicsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/PhysicsTest/PhysicsTest.h rename to tests/test-cpp/Classes/PhysicsTest/PhysicsTest.h diff --git a/samples/Cpp/TestCpp/Classes/ReleasePoolTest/ReleasePoolTest.cpp b/tests/test-cpp/Classes/ReleasePoolTest/ReleasePoolTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ReleasePoolTest/ReleasePoolTest.cpp rename to tests/test-cpp/Classes/ReleasePoolTest/ReleasePoolTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ReleasePoolTest/ReleasePoolTest.h b/tests/test-cpp/Classes/ReleasePoolTest/ReleasePoolTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ReleasePoolTest/ReleasePoolTest.h rename to tests/test-cpp/Classes/ReleasePoolTest/ReleasePoolTest.h diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/test-cpp/Classes/RenderTextureTest/RenderTextureTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp rename to tests/test-cpp/Classes/RenderTextureTest/RenderTextureTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/tests/test-cpp/Classes/RenderTextureTest/RenderTextureTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h rename to tests/test-cpp/Classes/RenderTextureTest/RenderTextureTest.h diff --git a/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp b/tests/test-cpp/Classes/RotateWorldTest/RotateWorldTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp rename to tests/test-cpp/Classes/RotateWorldTest/RotateWorldTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.h b/tests/test-cpp/Classes/RotateWorldTest/RotateWorldTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/RotateWorldTest/RotateWorldTest.h rename to tests/test-cpp/Classes/RotateWorldTest/RotateWorldTest.h diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp b/tests/test-cpp/Classes/SceneTest/SceneTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp rename to tests/test-cpp/Classes/SceneTest/SceneTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h b/tests/test-cpp/Classes/SceneTest/SceneTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h rename to tests/test-cpp/Classes/SceneTest/SceneTest.h diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp b/tests/test-cpp/Classes/SchedulerTest/SchedulerTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp rename to tests/test-cpp/Classes/SchedulerTest/SchedulerTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/tests/test-cpp/Classes/SchedulerTest/SchedulerTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h rename to tests/test-cpp/Classes/SchedulerTest/SchedulerTest.h diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/tests/test-cpp/Classes/ShaderTest/ShaderTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp rename to tests/test-cpp/Classes/ShaderTest/ShaderTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/tests/test-cpp/Classes/ShaderTest/ShaderTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h rename to tests/test-cpp/Classes/ShaderTest/ShaderTest.h diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp b/tests/test-cpp/Classes/ShaderTest/ShaderTest2.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.cpp rename to tests/test-cpp/Classes/ShaderTest/ShaderTest2.cpp diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h b/tests/test-cpp/Classes/ShaderTest/ShaderTest2.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h rename to tests/test-cpp/Classes/ShaderTest/ShaderTest2.h diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp b/tests/test-cpp/Classes/SpineTest/SpineTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp rename to tests/test-cpp/Classes/SpineTest/SpineTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h b/tests/test-cpp/Classes/SpineTest/SpineTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h rename to tests/test-cpp/Classes/SpineTest/SpineTest.h diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/tests/test-cpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id rename to tests/test-cpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h b/tests/test-cpp/Classes/SpriteTest/SpriteTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h rename to tests/test-cpp/Classes/SpriteTest/SpriteTest.h diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp b/tests/test-cpp/Classes/TextInputTest/TextInputTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp rename to tests/test-cpp/Classes/TextInputTest/TextInputTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h b/tests/test-cpp/Classes/TextInputTest/TextInputTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h rename to tests/test-cpp/Classes/TextInputTest/TextInputTest.h diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/tests/test-cpp/Classes/Texture2dTest/Texture2dTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp rename to tests/test-cpp/Classes/Texture2dTest/Texture2dTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/tests/test-cpp/Classes/Texture2dTest/Texture2dTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h rename to tests/test-cpp/Classes/Texture2dTest/Texture2dTest.h diff --git a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/test-cpp/Classes/TextureCacheTest/TextureCacheTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp rename to tests/test-cpp/Classes/TextureCacheTest/TextureCacheTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h b/tests/test-cpp/Classes/TextureCacheTest/TextureCacheTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TextureCacheTest/TextureCacheTest.h rename to tests/test-cpp/Classes/TextureCacheTest/TextureCacheTest.h diff --git a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/tests/test-cpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp rename to tests/test-cpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h b/tests/test-cpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h rename to tests/test-cpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/tests/test-cpp/Classes/TileMapTest/TileMapTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp rename to tests/test-cpp/Classes/TileMapTest/TileMapTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h b/tests/test-cpp/Classes/TileMapTest/TileMapTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h rename to tests/test-cpp/Classes/TileMapTest/TileMapTest.h diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/Ball.cpp b/tests/test-cpp/Classes/TouchesTest/Ball.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/Ball.cpp rename to tests/test-cpp/Classes/TouchesTest/Ball.cpp diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/Ball.h b/tests/test-cpp/Classes/TouchesTest/Ball.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/Ball.h rename to tests/test-cpp/Classes/TouchesTest/Ball.h diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/Paddle.cpp b/tests/test-cpp/Classes/TouchesTest/Paddle.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/Paddle.cpp rename to tests/test-cpp/Classes/TouchesTest/Paddle.cpp diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/Paddle.h b/tests/test-cpp/Classes/TouchesTest/Paddle.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/Paddle.h rename to tests/test-cpp/Classes/TouchesTest/Paddle.h diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp b/tests/test-cpp/Classes/TouchesTest/TouchesTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.cpp rename to tests/test-cpp/Classes/TouchesTest/TouchesTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.h b/tests/test-cpp/Classes/TouchesTest/TouchesTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TouchesTest/TouchesTest.h rename to tests/test-cpp/Classes/TouchesTest/TouchesTest.h diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/tests/test-cpp/Classes/TransitionsTest/TransitionsTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp rename to tests/test-cpp/Classes/TransitionsTest/TransitionsTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h b/tests/test-cpp/Classes/TransitionsTest/TransitionsTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h rename to tests/test-cpp/Classes/TransitionsTest/TransitionsTest.h diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp b/tests/test-cpp/Classes/UnitTest/UnitTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.cpp rename to tests/test-cpp/Classes/UnitTest/UnitTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h b/tests/test-cpp/Classes/UnitTest/UnitTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/UnitTest/UnitTest.h rename to tests/test-cpp/Classes/UnitTest/UnitTest.h diff --git a/samples/Cpp/TestCpp/Classes/UserDefaultTest/UserDefaultTest.cpp b/tests/test-cpp/Classes/UserDefaultTest/UserDefaultTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/UserDefaultTest/UserDefaultTest.cpp rename to tests/test-cpp/Classes/UserDefaultTest/UserDefaultTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/UserDefaultTest/UserDefaultTest.h b/tests/test-cpp/Classes/UserDefaultTest/UserDefaultTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/UserDefaultTest/UserDefaultTest.h rename to tests/test-cpp/Classes/UserDefaultTest/UserDefaultTest.h diff --git a/samples/Cpp/TestCpp/Classes/VisibleRect.cpp b/tests/test-cpp/Classes/VisibleRect.cpp similarity index 96% rename from samples/Cpp/TestCpp/Classes/VisibleRect.cpp rename to tests/test-cpp/Classes/VisibleRect.cpp index 2686a1b821..94a494a02e 100644 --- a/samples/Cpp/TestCpp/Classes/VisibleRect.cpp +++ b/tests/test-cpp/Classes/VisibleRect.cpp @@ -6,7 +6,7 @@ void VisibleRect::lazyInit() { if (s_visibleRect.size.width == 0.0f && s_visibleRect.size.height == 0.0f) { - auto glView = EGLView::getInstance(); + auto glView = Director::getInstance()->getOpenGLView(); s_visibleRect.origin = glView->getVisibleOrigin(); s_visibleRect.size = glView->getVisibleSize(); } diff --git a/samples/Cpp/TestCpp/Classes/VisibleRect.h b/tests/test-cpp/Classes/VisibleRect.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/VisibleRect.h rename to tests/test-cpp/Classes/VisibleRect.h diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/test-cpp/Classes/ZwoptexTest/ZwoptexTest.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp rename to tests/test-cpp/Classes/ZwoptexTest/ZwoptexTest.cpp diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h b/tests/test-cpp/Classes/ZwoptexTest/ZwoptexTest.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h rename to tests/test-cpp/Classes/ZwoptexTest/ZwoptexTest.h diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/tests/test-cpp/Classes/controller.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/controller.cpp rename to tests/test-cpp/Classes/controller.cpp diff --git a/samples/Cpp/TestCpp/Classes/controller.h b/tests/test-cpp/Classes/controller.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/controller.h rename to tests/test-cpp/Classes/controller.h diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/tests/test-cpp/Classes/testBasic.cpp similarity index 100% rename from samples/Cpp/TestCpp/Classes/testBasic.cpp rename to tests/test-cpp/Classes/testBasic.cpp diff --git a/samples/Cpp/TestCpp/Classes/testBasic.h b/tests/test-cpp/Classes/testBasic.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/testBasic.h rename to tests/test-cpp/Classes/testBasic.h diff --git a/samples/Cpp/TestCpp/Classes/testResource.h b/tests/test-cpp/Classes/testResource.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/testResource.h rename to tests/test-cpp/Classes/testResource.h diff --git a/samples/Cpp/TestCpp/Classes/tests.h b/tests/test-cpp/Classes/tests.h similarity index 100% rename from samples/Cpp/TestCpp/Classes/tests.h rename to tests/test-cpp/Classes/tests.h diff --git a/samples/Cpp/HelloCpp/Resources/.gitignore b/tests/test-cpp/Resources/.gitignore similarity index 100% rename from samples/Cpp/HelloCpp/Resources/.gitignore rename to tests/test-cpp/Resources/.gitignore diff --git a/samples/Cpp/TestCpp/Resources/Hello.png.REMOVED.git-id b/tests/test-cpp/Resources/Hello.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Hello.png.REMOVED.git-id rename to tests/test-cpp/Resources/Hello.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/HelloWorld.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/HelloWorld.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/HelloWorld.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/HelloWorld.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/PlanetCute-1024x1024.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/PlanetCute-1024x1024.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/PlanetCute-1024x1024.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/PlanetCute-1024x1024.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/atlastest.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/atlastest.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/atlastest.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/atlastest.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/background1.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/background1.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/background1.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/background1.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/background2.jpg.REMOVED.git-id b/tests/test-cpp/Resources/Images/background2.jpg.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/background2.jpg.REMOVED.git-id rename to tests/test-cpp/Resources/Images/background2.jpg.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/background2.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/background2.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/background2.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/background2.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/bugs/bug886.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/bugs/bug886.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/bugs/bug886.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/bugs/bug886.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/grossini_dance_atlas-mono.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/grossini_dance_atlas-mono.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/grossini_dance_atlas-mono.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/grossini_dance_atlas-mono.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/landscape-1024x1024.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/landscape-1024x1024.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/landscape-1024x1024.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/landscape-1024x1024.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/noise.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/noise.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/noise.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/noise.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/spritesheet1.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/spritesheet1.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/spritesheet1.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/spritesheet1.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/stone.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/stone.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/stone.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/stone.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024.png.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024.png.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_a8.pvr.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_a8.pvr.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_a8.pvr.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_a8.pvr.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgb888.pvr.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgb888.pvr.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgb888.pvr.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgb888.pvr.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgb888.pvr.gz.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgb888.pvr.gz.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgb888.pvr.gz.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgb888.pvr.gz.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba4444.pvr.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgba4444.pvr.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba4444.pvr.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgba4444.pvr.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba4444.pvr.gz.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgba4444.pvr.gz.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba4444.pvr.gz.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgba4444.pvr.gz.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba8888.pvr.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgba8888.pvr.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba8888.pvr.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgba8888.pvr.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba8888.pvr.gz.REMOVED.git-id b/tests/test-cpp/Resources/Images/test_1021x1024_rgba8888.pvr.gz.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/Images/test_1021x1024_rgba8888.pvr.gz.REMOVED.git-id rename to tests/test-cpp/Resources/Images/test_1021x1024_rgba8888.pvr.gz.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-hd/test4.txt b/tests/test-cpp/Resources/Misc/resources-hd/test4.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-hd/test4.txt rename to tests/test-cpp/Resources/Misc/resources-hd/test4.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-ipad/test2.txt b/tests/test-cpp/Resources/Misc/resources-ipad/test2.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-ipad/test2.txt rename to tests/test-cpp/Resources/Misc/resources-ipad/test2.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-ipadhd/test1.txt b/tests/test-cpp/Resources/Misc/resources-ipadhd/test1.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-ipadhd/test1.txt rename to tests/test-cpp/Resources/Misc/resources-ipadhd/test1.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-iphone/test6.txt b/tests/test-cpp/Resources/Misc/resources-iphone/test6.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-iphone/test6.txt rename to tests/test-cpp/Resources/Misc/resources-iphone/test6.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-mac/test2.txt b/tests/test-cpp/Resources/Misc/resources-mac/test2.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-mac/test2.txt rename to tests/test-cpp/Resources/Misc/resources-mac/test2.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-machd/test1.txt b/tests/test-cpp/Resources/Misc/resources-machd/test1.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-machd/test1.txt rename to tests/test-cpp/Resources/Misc/resources-machd/test1.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-wide/test5.txt b/tests/test-cpp/Resources/Misc/resources-wide/test5.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-wide/test5.txt rename to tests/test-cpp/Resources/Misc/resources-wide/test5.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/resources-widehd/test3.txt b/tests/test-cpp/Resources/Misc/resources-widehd/test3.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/resources-widehd/test3.txt rename to tests/test-cpp/Resources/Misc/resources-widehd/test3.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/searchpath1/file1.txt b/tests/test-cpp/Resources/Misc/searchpath1/file1.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/searchpath1/file1.txt rename to tests/test-cpp/Resources/Misc/searchpath1/file1.txt diff --git a/samples/Cpp/TestCpp/Resources/Misc/searchpath2/resources-ipad/file2.txt b/tests/test-cpp/Resources/Misc/searchpath2/resources-ipad/file2.txt similarity index 100% rename from samples/Cpp/TestCpp/Resources/Misc/searchpath2/resources-ipad/file2.txt rename to tests/test-cpp/Resources/Misc/searchpath2/resources-ipad/file2.txt diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_ColorBars.vsh b/tests/test-cpp/Resources/Shaders/example_ColorBars.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_ColorBars.vsh rename to tests/test-cpp/Resources/Shaders/example_ColorBars.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Flower.vsh b/tests/test-cpp/Resources/Shaders/example_Flower.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Flower.vsh rename to tests/test-cpp/Resources/Shaders/example_Flower.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Heart.vsh b/tests/test-cpp/Resources/Shaders/example_Heart.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Heart.vsh rename to tests/test-cpp/Resources/Shaders/example_Heart.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Julia.vsh b/tests/test-cpp/Resources/Shaders/example_Julia.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Julia.vsh rename to tests/test-cpp/Resources/Shaders/example_Julia.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Mandelbrot.vsh b/tests/test-cpp/Resources/Shaders/example_Mandelbrot.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Mandelbrot.vsh rename to tests/test-cpp/Resources/Shaders/example_Mandelbrot.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Monjori.vsh b/tests/test-cpp/Resources/Shaders/example_Monjori.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Monjori.vsh rename to tests/test-cpp/Resources/Shaders/example_Monjori.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Plasma.vsh b/tests/test-cpp/Resources/Shaders/example_Plasma.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Plasma.vsh rename to tests/test-cpp/Resources/Shaders/example_Plasma.vsh diff --git a/samples/Cpp/TestCpp/Resources/Shaders/example_Twist.vsh b/tests/test-cpp/Resources/Shaders/example_Twist.vsh similarity index 100% rename from samples/Cpp/TestCpp/Resources/Shaders/example_Twist.vsh rename to tests/test-cpp/Resources/Shaders/example_Twist.vsh diff --git a/samples/Cpp/TestCpp/Resources/TileMaps/hexa-tiles.png.REMOVED.git-id b/tests/test-cpp/Resources/TileMaps/hexa-tiles.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/TileMaps/hexa-tiles.png.REMOVED.git-id rename to tests/test-cpp/Resources/TileMaps/hexa-tiles.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/TileMaps/map/slcj.png.REMOVED.git-id b/tests/test-cpp/Resources/TileMaps/map/slcj.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/TileMaps/map/slcj.png.REMOVED.git-id rename to tests/test-cpp/Resources/TileMaps/map/slcj.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/TileMaps/ortho-test1.png.REMOVED.git-id b/tests/test-cpp/Resources/TileMaps/ortho-test1.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/TileMaps/ortho-test1.png.REMOVED.git-id rename to tests/test-cpp/Resources/TileMaps/ortho-test1.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/TileMaps/ortho-test1_bw.png.REMOVED.git-id b/tests/test-cpp/Resources/TileMaps/ortho-test1_bw.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/TileMaps/ortho-test1_bw.png.REMOVED.git-id rename to tests/test-cpp/Resources/TileMaps/ortho-test1_bw.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/animations/grossini.plist.xml b/tests/test-cpp/Resources/animations/grossini.plist.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/animations/grossini.plist.xml rename to tests/test-cpp/Resources/animations/grossini.plist.xml diff --git a/samples/Cpp/TestCpp/Resources/armature/Cowboy.ExportJson.REMOVED.git-id b/tests/test-cpp/Resources/armature/Cowboy.ExportJson.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/Cowboy.ExportJson.REMOVED.git-id rename to tests/test-cpp/Resources/armature/Cowboy.ExportJson.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/armature/Cowboy0.png.REMOVED.git-id b/tests/test-cpp/Resources/armature/Cowboy0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/Cowboy0.png.REMOVED.git-id rename to tests/test-cpp/Resources/armature/Cowboy0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/armature/Dragon.xml b/tests/test-cpp/Resources/armature/Dragon.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/Dragon.xml rename to tests/test-cpp/Resources/armature/Dragon.xml diff --git a/samples/Cpp/TestCpp/Resources/armature/HeroAnimation.ExportJson.REMOVED.git-id b/tests/test-cpp/Resources/armature/HeroAnimation.ExportJson.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/HeroAnimation.ExportJson.REMOVED.git-id rename to tests/test-cpp/Resources/armature/HeroAnimation.ExportJson.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/armature/cyborg.xml b/tests/test-cpp/Resources/armature/cyborg.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/cyborg.xml rename to tests/test-cpp/Resources/armature/cyborg.xml diff --git a/samples/Cpp/TestCpp/Resources/armature/knight.xml b/tests/test-cpp/Resources/armature/knight.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/knight.xml rename to tests/test-cpp/Resources/armature/knight.xml diff --git a/samples/Cpp/TestCpp/Resources/armature/robot.xml b/tests/test-cpp/Resources/armature/robot.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/robot.xml rename to tests/test-cpp/Resources/armature/robot.xml diff --git a/samples/Cpp/TestCpp/Resources/armature/weapon.xml b/tests/test-cpp/Resources/armature/weapon.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/armature/weapon.xml rename to tests/test-cpp/Resources/armature/weapon.xml diff --git a/samples/Cpp/SimpleGame/Resources/background-music-aac.wav.REMOVED.git-id b/tests/test-cpp/Resources/background-music-aac.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/SimpleGame/Resources/background-music-aac.wav.REMOVED.git-id rename to tests/test-cpp/Resources/background-music-aac.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/background.mp3.REMOVED.git-id b/tests/test-cpp/Resources/background.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/background.mp3.REMOVED.git-id rename to tests/test-cpp/Resources/background.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ccb/flower.jpg.REMOVED.git-id b/tests/test-cpp/Resources/ccb/flower.jpg.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ccb/flower.jpg.REMOVED.git-id rename to tests/test-cpp/Resources/ccb/flower.jpg.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ccb/gem-0.wav.REMOVED.git-id b/tests/test-cpp/Resources/ccb/gem-0.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ccb/gem-0.wav.REMOVED.git-id rename to tests/test-cpp/Resources/ccb/gem-0.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ccb/gem-1.wav.REMOVED.git-id b/tests/test-cpp/Resources/ccb/gem-1.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ccb/gem-1.wav.REMOVED.git-id rename to tests/test-cpp/Resources/ccb/gem-1.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ccb/markerfelt24shadow.fnt.REMOVED.git-id b/tests/test-cpp/Resources/ccb/markerfelt24shadow.fnt.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ccb/markerfelt24shadow.fnt.REMOVED.git-id rename to tests/test-cpp/Resources/ccb/markerfelt24shadow.fnt.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/Hello.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/Hello.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/b11.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/b11.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id b/tests/test-cpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/extensions/background.png.REMOVED.git-id b/tests/test-cpp/Resources/extensions/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/extensions/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/extensions/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/Courier New.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/Courier New.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/Courier New.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/Courier New.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/Thonburi.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/Thonburi.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/Thonburi.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/Thonburi.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/ThonburiBold.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/ThonburiBold.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/ThonburiBold.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/ThonburiBold.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/arial-26-en-ru_0.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/arial-26-en-ru_0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/arial-26-en-ru_0.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/arial-26-en-ru_0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/arial-unicode-26.GlyphProject b/tests/test-cpp/Resources/fonts/arial-unicode-26.GlyphProject similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/arial-unicode-26.GlyphProject rename to tests/test-cpp/Resources/fonts/arial-unicode-26.GlyphProject diff --git a/samples/Cpp/TestCpp/Resources/fonts/arial-unicode-26.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/arial-unicode-26.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/arial-unicode-26.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/arial-unicode-26.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/arial.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/arial.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/arial.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/arial.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/bitmapFontChinese.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/bitmapFontChinese.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/bitmapFontChinese.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/bitmapFontChinese.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/bitmapFontTest.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/bitmapFontTest.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest2.bmp.REMOVED.git-id b/tests/test-cpp/Resources/fonts/bitmapFontTest2.bmp.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest2.bmp.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/bitmapFontTest2.bmp.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest2.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/bitmapFontTest2.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/bitmapFontTest2.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/bitmapFontTest2.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/boundsTestFont.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/boundsTestFont.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/boundsTestFont.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/boundsTestFont.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/font-issue1343-hd.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/font-issue1343-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/font-issue1343-hd.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/font-issue1343-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/futura-48.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/futura-48.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/futura-48.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/futura-48.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/helvetica-geneva-32.png.REMOVED.git-id b/tests/test-cpp/Resources/fonts/helvetica-geneva-32.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/helvetica-geneva-32.png.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/helvetica-geneva-32.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/markerFelt.fnt.REMOVED.git-id b/tests/test-cpp/Resources/fonts/markerFelt.fnt.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/markerFelt.fnt.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/markerFelt.fnt.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/strings.xml b/tests/test-cpp/Resources/fonts/strings.xml similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/strings.xml rename to tests/test-cpp/Resources/fonts/strings.xml diff --git a/samples/Cpp/TestCpp/Resources/fonts/tahoma.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/tahoma.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/tahoma.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/tahoma.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/fonts/wt021.ttf.REMOVED.git-id b/tests/test-cpp/Resources/fonts/wt021.ttf.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/fonts/wt021.ttf.REMOVED.git-id rename to tests/test-cpp/Resources/fonts/wt021.ttf.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/Images/background1.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/Images/background1.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/Images/background1.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/Images/background1.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/Images/background2.jpg.REMOVED.git-id b/tests/test-cpp/Resources/hd/Images/background2.jpg.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/Images/background2.jpg.REMOVED.git-id rename to tests/test-cpp/Resources/hd/Images/background2.jpg.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/Images/background2.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/Images/background2.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/Images/background2.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/Images/background2.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/armature/Cowboy0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/armature/Cowboy0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/armature/Cowboy0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/armature/Cowboy0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/armature/Dragon.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/armature/Dragon.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/armature/Dragon.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/armature/Dragon.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/armature/HeroAnimation0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/armature/HeroAnimation0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/armature/HeroAnimation0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/armature/HeroAnimation0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/armature/weapon.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/armature/weapon.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/armature/weapon.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/armature/weapon.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/ccb/burst.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/ccb/burst.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/ccb/burst.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/ccb/burst.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/extensions/background.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/extensions/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/extensions/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/extensions/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/fonts/font-issue1343.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/fonts/font-issue1343.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/fonts/font-issue1343.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/fonts/font-issue1343.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/fonts/markerFelt.fnt.REMOVED.git-id b/tests/test-cpp/Resources/hd/fonts/markerFelt.fnt.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/fonts/markerFelt.fnt.REMOVED.git-id rename to tests/test-cpp/Resources/hd/fonts/markerFelt.fnt.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/fonts/markerFelt.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/fonts/markerFelt.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/fonts/markerFelt.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/fonts/markerFelt.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/fonts/tuffy_bold_italic-charmap.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/fonts/tuffy_bold_italic-charmap.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/fonts/tuffy_bold_italic-charmap.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/fonts/tuffy_bold_italic-charmap.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/spine/goblins.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/spine/goblins.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/spine/goblins.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/spine/goblins.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/spine/spineboy.png.REMOVED.git-id b/tests/test-cpp/Resources/hd/spine/spineboy.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/hd/spine/spineboy.png.REMOVED.git-id rename to tests/test-cpp/Resources/hd/spine/spineboy.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ipad/ccb/burst.png.REMOVED.git-id b/tests/test-cpp/Resources/ipad/ccb/burst.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ipad/ccb/burst.png.REMOVED.git-id rename to tests/test-cpp/Resources/ipad/ccb/burst.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/ipad/extensions/background.png.REMOVED.git-id b/tests/test-cpp/Resources/ipad/extensions/background.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/ipad/extensions/background.png.REMOVED.git-id rename to tests/test-cpp/Resources/ipad/extensions/background.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/ArmatureComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/BackgroundComponentTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/EffectComponentTest/CowBoy/Cowboy0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/TriggerTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/UIComponentTest/Images/startMenuBG.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/tests/test-cpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id rename to tests/test-cpp/Resources/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/spine/goblins.png.REMOVED.git-id b/tests/test-cpp/Resources/spine/goblins.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/Resources/spine/goblins.png.REMOVED.git-id rename to tests/test-cpp/Resources/spine/goblins.png.REMOVED.git-id diff --git a/samples/Cpp/HelloCpp/proj.android/.classpath b/tests/test-cpp/proj.android/.classpath similarity index 100% rename from samples/Cpp/HelloCpp/proj.android/.classpath rename to tests/test-cpp/proj.android/.classpath diff --git a/samples/Lua/HelloLua/proj.android/.project b/tests/test-cpp/proj.android/.project similarity index 86% rename from samples/Lua/HelloLua/proj.android/.project rename to tests/test-cpp/proj.android/.project index 2a61577d0c..3993dc62b8 100644 --- a/samples/Lua/HelloLua/proj.android/.project +++ b/tests/test-cpp/proj.android/.project @@ -1,6 +1,6 @@ - HelloLua + TestCpp @@ -40,11 +40,4 @@ org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - Resources - 2 - PARENT-1-PROJECT_LOC/Resources - - diff --git a/samples/Cpp/TestCpp/proj.android/AndroidManifest.xml b/tests/test-cpp/proj.android/AndroidManifest.xml similarity index 100% rename from samples/Cpp/TestCpp/proj.android/AndroidManifest.xml rename to tests/test-cpp/proj.android/AndroidManifest.xml diff --git a/samples/Cpp/AssetsManagerTest/proj.android/README.md b/tests/test-cpp/proj.android/README.md similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.android/README.md rename to tests/test-cpp/proj.android/README.md diff --git a/samples/Cpp/AssetsManagerTest/proj.android/ant.properties b/tests/test-cpp/proj.android/ant.properties similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.android/ant.properties rename to tests/test-cpp/proj.android/ant.properties diff --git a/samples/Cpp/TestCpp/proj.android/build.xml b/tests/test-cpp/proj.android/build.xml similarity index 100% rename from samples/Cpp/TestCpp/proj.android/build.xml rename to tests/test-cpp/proj.android/build.xml diff --git a/samples/Cpp/TestCpp/proj.android/jni/Android.mk b/tests/test-cpp/proj.android/jni/Android.mk similarity index 86% rename from samples/Cpp/TestCpp/proj.android/jni/Android.mk rename to tests/test-cpp/proj.android/jni/Android.mk index 7867f3f1fb..2b8eac6532 100644 --- a/samples/Cpp/TestCpp/proj.android/jni/Android.mk +++ b/tests/test-cpp/proj.android/jni/Android.mk @@ -14,4 +14,4 @@ LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common include $(BUILD_SHARED_LIBRARY) -$(call import-module,samples/Cpp/TestCpp) +$(call import-module,tests/test-cpp) diff --git a/samples/Cpp/TestCpp/proj.android/jni/Application.mk b/tests/test-cpp/proj.android/jni/Application.mk similarity index 100% rename from samples/Cpp/TestCpp/proj.android/jni/Application.mk rename to tests/test-cpp/proj.android/jni/Application.mk diff --git a/samples/Cpp/TestCpp/proj.android/jni/testcpp/main.cpp b/tests/test-cpp/proj.android/jni/testcpp/main.cpp similarity index 100% rename from samples/Cpp/TestCpp/proj.android/jni/testcpp/main.cpp rename to tests/test-cpp/proj.android/jni/testcpp/main.cpp diff --git a/samples/Cpp/TestCpp/proj.android/ndkgdb.sh b/tests/test-cpp/proj.android/ndkgdb.sh similarity index 100% rename from samples/Cpp/TestCpp/proj.android/ndkgdb.sh rename to tests/test-cpp/proj.android/ndkgdb.sh diff --git a/samples/Cpp/AssetsManagerTest/proj.android/proguard-project.txt b/tests/test-cpp/proj.android/proguard-project.txt similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.android/proguard-project.txt rename to tests/test-cpp/proj.android/proguard-project.txt diff --git a/samples/Cpp/HelloCpp/proj.android/project.properties b/tests/test-cpp/proj.android/project.properties similarity index 83% rename from samples/Cpp/HelloCpp/proj.android/project.properties rename to tests/test-cpp/proj.android/project.properties index 0a6dc6664d..16f145cfc9 100644 --- a/samples/Cpp/HelloCpp/proj.android/project.properties +++ b/tests/test-cpp/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../../cocos/2d/platform/android/java +android.library.reference.1=../../../cocos/2d/platform/android/java diff --git a/samples/Cpp/TestCpp/proj.android/res/values/strings.xml b/tests/test-cpp/proj.android/res/values/strings.xml similarity index 100% rename from samples/Cpp/TestCpp/proj.android/res/values/strings.xml rename to tests/test-cpp/proj.android/res/values/strings.xml diff --git a/samples/Cpp/TestCpp/proj.android/src/nojava.txt b/tests/test-cpp/proj.android/src/nojava.txt similarity index 100% rename from samples/Cpp/TestCpp/proj.android/src/nojava.txt rename to tests/test-cpp/proj.android/src/nojava.txt diff --git a/samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java b/tests/test-cpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java similarity index 100% rename from samples/Cpp/TestCpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java rename to tests/test-cpp/proj.android/src/org/cocos2dx/testcpp/Cocos2dxActivity.java diff --git a/samples/Javascript/MoonWarriors/proj.ios/RootViewController.h b/tests/test-cpp/proj.ios/Classes/RootViewController.h similarity index 93% rename from samples/Javascript/MoonWarriors/proj.ios/RootViewController.h rename to tests/test-cpp/proj.ios/Classes/RootViewController.h index 11dfc4bf88..e6b80c0053 100644 --- a/samples/Javascript/MoonWarriors/proj.ios/RootViewController.h +++ b/tests/test-cpp/proj.ios/Classes/RootViewController.h @@ -1,19 +1,19 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 diff --git a/samples/Lua/HelloLua/proj.ios/RootViewController.mm b/tests/test-cpp/proj.ios/Classes/RootViewController.mm similarity index 96% rename from samples/Lua/HelloLua/proj.ios/RootViewController.mm rename to tests/test-cpp/proj.ios/Classes/RootViewController.mm index a00da00584..4f697958b3 100644 --- a/samples/Lua/HelloLua/proj.ios/RootViewController.mm +++ b/tests/test-cpp/proj.ios/Classes/RootViewController.mm @@ -1,19 +1,19 @@ /**************************************************************************** - Copyright (c) 2010-2011 cocos2d-x.org - Copyright (c) 2010 Ricardo Quesada - + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 diff --git a/samples/Cpp/SimpleGame/proj.ios/AppController.h b/tests/test-cpp/proj.ios/Classes/testsAppDelegate.h similarity index 87% rename from samples/Cpp/SimpleGame/proj.ios/AppController.h rename to tests/test-cpp/proj.ios/Classes/testsAppDelegate.h index 3d51064ca0..68c6c38eab 100644 --- a/samples/Cpp/SimpleGame/proj.ios/AppController.h +++ b/tests/test-cpp/proj.ios/Classes/testsAppDelegate.h @@ -1,18 +1,19 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 @@ -22,9 +23,11 @@ THE SOFTWARE. ****************************************************************************/ +#import + @class RootViewController; -@interface AppController : NSObject { +@interface AppController : NSObject { UIWindow *window; RootViewController *viewController; } diff --git a/samples/Cpp/SimpleGame/proj.ios/AppController.mm b/tests/test-cpp/proj.ios/Classes/testsAppDelegate.mm similarity index 79% rename from samples/Cpp/SimpleGame/proj.ios/AppController.mm rename to tests/test-cpp/proj.ios/Classes/testsAppDelegate.mm index 5e2010ba4c..43bedbcabb 100644 --- a/samples/Cpp/SimpleGame/proj.ios/AppController.mm +++ b/tests/test-cpp/proj.ios/Classes/testsAppDelegate.mm @@ -1,18 +1,19 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 @@ -21,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" +#import "testsAppDelegate.h" + +#import "CCEAGLView.h" +#import "cocos2d.h" +#import "AppDelegate.h" #import "RootViewController.h" @implementation AppController @@ -37,24 +38,31 @@ // cocos2d application instance static AppDelegate s_sharedApplication; -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + + cocos2d::Application *app = cocos2d::Application::getInstance(); + // Override point for customization after application launch. // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 - preserveBackbuffer: NO - sharegroup:nil - multiSampling:NO - numberOfSamples:0]; + // Init the CCEAGLView + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH24_STENCIL8_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + [eaglView setMultipleTouchEnabled:YES]; + // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -69,10 +77,15 @@ static AppDelegate s_sharedApplication; } [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden: YES]; - cocos2d::Application::getInstance()->run(); + [[UIApplication sharedApplication] setStatusBarHidden:true]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + + app->run(); + return YES; } @@ -126,9 +139,9 @@ static AppDelegate s_sharedApplication; - (void)dealloc { + [window release]; [super dealloc]; } @end - diff --git a/samples/Cpp/HelloCpp/proj.ios/Default-568h@2x.png.REMOVED.git-id b/tests/test-cpp/proj.ios/Default-568h@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/HelloCpp/proj.ios/Default-568h@2x.png.REMOVED.git-id rename to tests/test-cpp/proj.ios/Default-568h@2x.png.REMOVED.git-id diff --git a/samples/Cpp/HelloCpp/proj.ios/Default@2x.png.REMOVED.git-id b/tests/test-cpp/proj.ios/Default@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/HelloCpp/proj.ios/Default@2x.png.REMOVED.git-id rename to tests/test-cpp/proj.ios/Default@2x.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/proj.ios/iphone_Prefix.pch b/tests/test-cpp/proj.ios/iphone_Prefix.pch similarity index 100% rename from samples/Cpp/TestCpp/proj.ios/iphone_Prefix.pch rename to tests/test-cpp/proj.ios/iphone_Prefix.pch diff --git a/samples/Cpp/TestCpp/proj.ios/main.m b/tests/test-cpp/proj.ios/main.m similarity index 100% rename from samples/Cpp/TestCpp/proj.ios/main.m rename to tests/test-cpp/proj.ios/main.m diff --git a/samples/Lua/HelloLua/proj.linux/main.cpp b/tests/test-cpp/proj.linux/main.cpp similarity index 83% rename from samples/Lua/HelloLua/proj.linux/main.cpp rename to tests/test-cpp/proj.linux/main.cpp index fee36d74ed..e420889600 100644 --- a/samples/Lua/HelloLua/proj.linux/main.cpp +++ b/tests/test-cpp/proj.linux/main.cpp @@ -12,7 +12,5 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("HelloLua",900,640); return Application::getInstance()->run(); } diff --git a/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id b/tests/test-cpp/proj.mac/Icon.icns.REMOVED.git-id similarity index 100% rename from samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id rename to tests/test-cpp/proj.mac/Icon.icns.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/proj.mac/Test_Prefix.pch b/tests/test-cpp/proj.mac/Test_Prefix.pch similarity index 100% rename from samples/Cpp/TestCpp/proj.mac/Test_Prefix.pch rename to tests/test-cpp/proj.mac/Test_Prefix.pch diff --git a/samples/Cpp/HelloCpp/proj.mac/en.lproj/InfoPlist.strings b/tests/test-cpp/proj.mac/en.lproj/InfoPlist.strings similarity index 100% rename from samples/Cpp/HelloCpp/proj.mac/en.lproj/InfoPlist.strings rename to tests/test-cpp/proj.mac/en.lproj/InfoPlist.strings diff --git a/samples/Cpp/TestCpp/proj.mac/en.lproj/MainMenu.xib b/tests/test-cpp/proj.mac/en.lproj/MainMenu.xib similarity index 100% rename from samples/Cpp/TestCpp/proj.mac/en.lproj/MainMenu.xib rename to tests/test-cpp/proj.mac/en.lproj/MainMenu.xib diff --git a/samples/Lua/TestLua/proj.mac/main.cpp b/tests/test-cpp/proj.mac/main.cpp similarity index 96% rename from samples/Lua/TestLua/proj.mac/main.cpp rename to tests/test-cpp/proj.mac/main.cpp index 73a7d5f6ae..1814d16c15 100644 --- a/samples/Lua/TestLua/proj.mac/main.cpp +++ b/tests/test-cpp/proj.mac/main.cpp @@ -29,7 +29,5 @@ USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("TestLua",900,640); return Application::getInstance()->run(); } diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/tests/test-cpp/proj.win32/TestCpp.vcxproj similarity index 96% rename from samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj rename to tests/test-cpp/proj.win32/TestCpp.vcxproj index 620b12b3f1..df8f3b6dc7 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/tests/test-cpp/proj.win32/TestCpp.vcxproj @@ -36,13 +36,13 @@ - - + + - - + + @@ -94,7 +94,7 @@ if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -130,7 +130,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -485,41 +485,41 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} false - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} false - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {b7c2a162-dec9-4418-972e-240ab3cbfcae} - + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {df2638c0-8128-4847-867c-6eafe3dee7b5} - + {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} false - + {929480e7-23c0-4df6-8456-096d71547116} false - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} false diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters b/tests/test-cpp/proj.win32/TestCpp.vcxproj.filters similarity index 100% rename from samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters rename to tests/test-cpp/proj.win32/TestCpp.vcxproj.filters diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.user b/tests/test-cpp/proj.win32/TestCpp.vcxproj.user similarity index 100% rename from samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.user rename to tests/test-cpp/proj.win32/TestCpp.vcxproj.user diff --git a/samples/Cpp/TestCpp/proj.win32/main.cpp b/tests/test-cpp/proj.win32/main.cpp similarity index 84% rename from samples/Cpp/TestCpp/proj.win32/main.cpp rename to tests/test-cpp/proj.win32/main.cpp index 8411246122..46ce5bf290 100644 --- a/samples/Cpp/TestCpp/proj.win32/main.cpp +++ b/tests/test-cpp/proj.win32/main.cpp @@ -1,6 +1,5 @@ #include "main.h" #include "AppDelegate.h" -#include "CCEGLView.h" USING_NS_CC; @@ -14,7 +13,5 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",960,640); return Application::getInstance()->run(); } diff --git a/samples/Cpp/HelloCpp/proj.win32/main.h b/tests/test-cpp/proj.win32/main.h similarity index 100% rename from samples/Cpp/HelloCpp/proj.win32/main.h rename to tests/test-cpp/proj.win32/main.h diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/tests/test-javascript/Classes/AppDelegate.cpp similarity index 91% rename from samples/Javascript/TestJavascript/Classes/AppDelegate.cpp rename to tests/test-javascript/Classes/AppDelegate.cpp index ec3a33e02b..ffe11134d4 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/tests/test-javascript/Classes/AppDelegate.cpp @@ -37,16 +37,20 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::createWithRect("Test JavaScript", Rect(0,0,900,640)); + director->setOpenGLView(glview); + } // JS-Test in Html5 uses 800x450 as design resolution - EGLView::getInstance()->setDesignResolutionSize(800, 450, ResolutionPolicy::FIXED_HEIGHT); + glview->setDesignResolutionSize(800, 450, ResolutionPolicy::FIXED_HEIGHT); // turn on display FPS - pDirector->setDisplayStats(true); + director->setDisplayStats(true); // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); + director->setAnimationInterval(1.0 / 60); auto fileUtils = FileUtils::getInstance(); std::vector searchPaths; diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.h b/tests/test-javascript/Classes/AppDelegate.h similarity index 100% rename from samples/Javascript/CocosDragonJS/Classes/AppDelegate.h rename to tests/test-javascript/Classes/AppDelegate.h diff --git a/samples/Cpp/AssetsManagerTest/proj.android/.classpath b/tests/test-javascript/proj.android/.classpath similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.android/.classpath rename to tests/test-javascript/proj.android/.classpath diff --git a/samples/Cpp/HelloCpp/proj.android/.project b/tests/test-javascript/proj.android/.project similarity index 79% rename from samples/Cpp/HelloCpp/proj.android/.project rename to tests/test-javascript/proj.android/.project index 908b979a53..f7677dbac4 100644 --- a/samples/Cpp/HelloCpp/proj.android/.project +++ b/tests/test-javascript/proj.android/.project @@ -1,10 +1,15 @@ - HelloCpp + TestJavascript + + org.eclipse.wst.jsdt.core.javascriptValidator + + + com.android.ide.eclipse.adt.ResourceManagerBuilder @@ -39,22 +44,13 @@ org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.wst.jsdt.core.jsNature - Classes + scripting 2 - COCOS2DX/samples/Cpp/HelloCpp/Classes - - - cocos2dx - 2 - COCOS2DX/cocos2dx - - - extensions - 2 - COCOS2DX/extensions + COCOS2DX/scripting diff --git a/samples/Javascript/TestJavascript/proj.android/AndroidManifest.xml b/tests/test-javascript/proj.android/AndroidManifest.xml similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/AndroidManifest.xml rename to tests/test-javascript/proj.android/AndroidManifest.xml diff --git a/samples/Cpp/HelloCpp/proj.android/README.md b/tests/test-javascript/proj.android/README.md similarity index 100% rename from samples/Cpp/HelloCpp/proj.android/README.md rename to tests/test-javascript/proj.android/README.md diff --git a/samples/Javascript/CocosDragonJS/proj.android/ant.properties b/tests/test-javascript/proj.android/ant.properties similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.android/ant.properties rename to tests/test-javascript/proj.android/ant.properties diff --git a/samples/Javascript/TestJavascript/proj.android/build.xml b/tests/test-javascript/proj.android/build.xml similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/build.xml rename to tests/test-javascript/proj.android/build.xml diff --git a/samples/Javascript/TestJavascript/proj.android/jni/Android.mk b/tests/test-javascript/proj.android/jni/Android.mk similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/jni/Android.mk rename to tests/test-javascript/proj.android/jni/Android.mk diff --git a/samples/Javascript/MoonWarriors/proj.android/jni/Application.mk b/tests/test-javascript/proj.android/jni/Application.mk similarity index 100% rename from samples/Javascript/MoonWarriors/proj.android/jni/Application.mk rename to tests/test-javascript/proj.android/jni/Application.mk diff --git a/samples/Javascript/CocosDragonJS/proj.android/jni/cocosdragonjs/main.cpp b/tests/test-javascript/proj.android/jni/testjavascript/main.cpp similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.android/jni/cocosdragonjs/main.cpp rename to tests/test-javascript/proj.android/jni/testjavascript/main.cpp diff --git a/samples/Javascript/TestJavascript/proj.android/ndkgdb.sh b/tests/test-javascript/proj.android/ndkgdb.sh similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/ndkgdb.sh rename to tests/test-javascript/proj.android/ndkgdb.sh diff --git a/samples/Cpp/SimpleGame/proj.android/proguard-project.txt b/tests/test-javascript/proj.android/proguard-project.txt similarity index 100% rename from samples/Cpp/SimpleGame/proj.android/proguard-project.txt rename to tests/test-javascript/proj.android/proguard-project.txt diff --git a/samples/Cpp/TestCpp/proj.android/project.properties b/tests/test-javascript/proj.android/project.properties similarity index 83% rename from samples/Cpp/TestCpp/proj.android/project.properties rename to tests/test-javascript/proj.android/project.properties index 0a6dc6664d..16f145cfc9 100644 --- a/samples/Cpp/TestCpp/proj.android/project.properties +++ b/tests/test-javascript/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../../cocos/2d/platform/android/java +android.library.reference.1=../../../cocos/2d/platform/android/java diff --git a/samples/Javascript/TestJavascript/proj.android/res/values/strings.xml b/tests/test-javascript/proj.android/res/values/strings.xml similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/res/values/strings.xml rename to tests/test-javascript/proj.android/res/values/strings.xml diff --git a/samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java b/tests/test-javascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java similarity index 100% rename from samples/Javascript/TestJavascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java rename to tests/test-javascript/proj.android/src/org/cocos2dx/testjavascript/Cocos2dxActivity.java diff --git a/samples/Lua/HelloLua/proj.ios/AppController.h b/tests/test-javascript/proj.ios/AppController.h similarity index 89% rename from samples/Lua/HelloLua/proj.ios/AppController.h rename to tests/test-javascript/proj.ios/AppController.h index 3d51064ca0..2e8186124e 100644 --- a/samples/Lua/HelloLua/proj.ios/AppController.h +++ b/tests/test-javascript/proj.ios/AppController.h @@ -1,18 +1,19 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + http://www.cocos2d-x.org - + 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 @@ -24,7 +25,8 @@ @class RootViewController; -@interface AppController : NSObject { +@interface AppController : NSObject +{ UIWindow *window; RootViewController *viewController; } diff --git a/samples/Lua/TestLua/proj.ios/AppController.mm b/tests/test-javascript/proj.ios/AppController.mm similarity index 90% rename from samples/Lua/TestLua/proj.ios/AppController.mm rename to tests/test-javascript/proj.ios/AppController.mm index b7c9a608f0..6e1d42e9c0 100644 --- a/samples/Lua/TestLua/proj.ios/AppController.mm +++ b/tests/test-javascript/proj.ios/AppController.mm @@ -1,5 +1,6 @@ /**************************************************************************** - Copyright (c) 2010 cocos2d-x.org + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -21,13 +22,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#import -#import "AppController.h" -#import "cocos2d.h" -#import "EAGLView.h" -#import "AppDelegate.h" +#import +#import "cocos2d.h" + +#import "AppController.h" +#import "AppDelegate.h" #import "RootViewController.h" +#import "CCEAGLView.h" @implementation AppController @@ -37,25 +39,27 @@ // cocos2d application instance static AppDelegate s_sharedApplication; -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ // Override point for customization after application launch. // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] pixelFormat: kEAGLColorFormatRGBA8 depthFormat: GL_DEPTH24_STENCIL8_OES preserveBackbuffer: NO sharegroup: nil multiSampling: NO numberOfSamples: 0 ]; - [__glView setMultipleTouchEnabled:YES]; + [eaglView setMultipleTouchEnabled:YES]; + // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -73,6 +77,10 @@ static AppDelegate s_sharedApplication; [[UIApplication sharedApplication] setStatusBarHidden: YES]; + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + cocos2d::Application::getInstance()->run(); return YES; } diff --git a/samples/Cpp/SimpleGame/proj.ios/Default-568h@2x.png.REMOVED.git-id b/tests/test-javascript/proj.ios/Default-568h@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/SimpleGame/proj.ios/Default-568h@2x.png.REMOVED.git-id rename to tests/test-javascript/proj.ios/Default-568h@2x.png.REMOVED.git-id diff --git a/samples/Cpp/SimpleGame/proj.ios/Default@2x.png.REMOVED.git-id b/tests/test-javascript/proj.ios/Default@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/SimpleGame/proj.ios/Default@2x.png.REMOVED.git-id rename to tests/test-javascript/proj.ios/Default@2x.png.REMOVED.git-id diff --git a/samples/Javascript/CocosDragonJS/proj.ios/Prefix.pch b/tests/test-javascript/proj.ios/Prefix.pch similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.ios/Prefix.pch rename to tests/test-javascript/proj.ios/Prefix.pch diff --git a/samples/Cpp/HelloCpp/proj.ios/RootViewController.h b/tests/test-javascript/proj.ios/RootViewController.h similarity index 100% rename from samples/Cpp/HelloCpp/proj.ios/RootViewController.h rename to tests/test-javascript/proj.ios/RootViewController.h diff --git a/samples/Javascript/CocosDragonJS/proj.ios/RootViewController.mm b/tests/test-javascript/proj.ios/RootViewController.mm similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.ios/RootViewController.mm rename to tests/test-javascript/proj.ios/RootViewController.mm diff --git a/samples/Javascript/CocosDragonJS/proj.ios/main.m b/tests/test-javascript/proj.ios/main.m similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.ios/main.m rename to tests/test-javascript/proj.ios/main.m diff --git a/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id b/tests/test-javascript/proj.mac/Icon.icns.REMOVED.git-id similarity index 100% rename from samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id rename to tests/test-javascript/proj.mac/Icon.icns.REMOVED.git-id diff --git a/samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch b/tests/test-javascript/proj.mac/Test_Prefix.pch similarity index 100% rename from samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch rename to tests/test-javascript/proj.mac/Test_Prefix.pch diff --git a/samples/Cpp/SimpleGame/proj.mac/en.lproj/InfoPlist.strings b/tests/test-javascript/proj.mac/en.lproj/InfoPlist.strings similarity index 100% rename from samples/Cpp/SimpleGame/proj.mac/en.lproj/InfoPlist.strings rename to tests/test-javascript/proj.mac/en.lproj/InfoPlist.strings diff --git a/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib b/tests/test-javascript/proj.mac/en.lproj/MainMenu.xib similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib rename to tests/test-javascript/proj.mac/en.lproj/MainMenu.xib diff --git a/samples/Cpp/TestCpp/proj.mac/main.cpp b/tests/test-javascript/proj.mac/main.cpp similarity index 96% rename from samples/Cpp/TestCpp/proj.mac/main.cpp rename to tests/test-javascript/proj.mac/main.cpp index 37600cec7a..4b6a1e9021 100644 --- a/samples/Cpp/TestCpp/proj.mac/main.cpp +++ b/tests/test-javascript/proj.mac/main.cpp @@ -23,13 +23,13 @@ ****************************************************************************/ #include "AppDelegate.h" +#include "cocos2d.h" USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("TestCPP",900,640); return Application::getInstance()->run(); } + diff --git a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj b/tests/test-javascript/proj.win32/TestJavascript.vcxproj similarity index 80% rename from samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj rename to tests/test-javascript/proj.win32/TestJavascript.vcxproj index e3be6f4245..5319580d2a 100644 --- a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj +++ b/tests/test-javascript/proj.win32/TestJavascript.vcxproj @@ -34,13 +34,13 @@ - - + + - - + + @@ -98,8 +98,8 @@ if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -113,8 +113,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ if not exist "$(OutDir)" mkdir "$(OutDir)" if exist "$(OutDir)\TestJavascriptRes" rd /s /q "$(OutDir)\TestJavascriptRes" mkdir "$(OutDir)\TestJavascriptRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\TestJavascriptRes\" /e /Y -xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y +xcopy "$(ProjectDir)..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\TestJavascriptRes\" /e /Y +xcopy "$(ProjectDir)..\tests" "$(OutDir)\TestJavascriptRes\" /e /Y Copy js and resource files. @@ -154,8 +154,8 @@ xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\spidermonkey\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -169,8 +169,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ if not exist "$(OutDir)" mkdir "$(OutDir)" if exist "$(OutDir)\TestJavascriptRes" rd /s /q "$(OutDir)\TestJavascriptRes" mkdir "$(OutDir)\TestJavascriptRes" -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\TestJavascriptRes\" /e /Y -xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y +xcopy "$(ProjectDir)..\..\..\cocos\scripting\javascript\script\*.js" "$(OutDir)\TestJavascriptRes\" /e /Y +xcopy "$(ProjectDir)..\tests" "$(OutDir)\TestJavascriptRes\" /e /Y Copy js and resource files. @@ -190,66 +190,66 @@ xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} false - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} false - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {b7c2a162-dec9-4418-972e-240ab3cbfcae} - + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {df2638c0-8128-4847-867c-6eafe3dee7b5} - + {21070e58-eec6-4e16-8b4f-6d083df55790} - + {f9da0fc1-651b-457b-962e-a4d61cebf5fd} - + {79d34511-e54e-410a-8bba-ef175ad6c695} - + {625f7391-9a91-48a1-8cfc-79508c822637} - + {9a844c88-97e8-4e2d-b09a-e138c67d338b} - + {68f5f371-bd7b-4c30-ae5b-0b08f22e0cde} - + {3bec13f5-e227-4d80-bc77-1c857f83bcfc} - + {39379840-825a-45a0-b363-c09ffef864bd} - + {e78cdc6b-f37d-48d2-ad91-1db549497e32} - + {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {929480e7-23c0-4df6-8456-096d71547116} - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj.filters b/tests/test-javascript/proj.win32/TestJavascript.vcxproj.filters similarity index 100% rename from samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj.filters rename to tests/test-javascript/proj.win32/TestJavascript.vcxproj.filters diff --git a/samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj.user b/tests/test-javascript/proj.win32/TestJavascript.vcxproj.user similarity index 100% rename from samples/Javascript/TestJavascript/proj.win32/TestJavascript.vcxproj.user rename to tests/test-javascript/proj.win32/TestJavascript.vcxproj.user diff --git a/samples/Javascript/MoonWarriors/proj.win32/main.cpp b/tests/test-javascript/proj.win32/main.cpp similarity index 89% rename from samples/Javascript/MoonWarriors/proj.win32/main.cpp rename to tests/test-javascript/proj.win32/main.cpp index 42d84925be..f5ce0656ed 100644 --- a/samples/Javascript/MoonWarriors/proj.win32/main.cpp +++ b/tests/test-javascript/proj.win32/main.cpp @@ -1,6 +1,5 @@ #include "main.h" #include "AppDelegate.h" -#include "CCEGLView.h" USING_NS_CC; @@ -24,8 +23,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("MoonWarriors", 480, 720); int ret = Application::getInstance()->run(); diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/main.h b/tests/test-javascript/proj.win32/main.h similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.win32/main.h rename to tests/test-javascript/proj.win32/main.h diff --git a/samples/Javascript/CocosDragonJS/proj.win32/res/testjs.ico b/tests/test-javascript/proj.win32/res/testjs.ico similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.win32/res/testjs.ico rename to tests/test-javascript/proj.win32/res/testjs.ico diff --git a/samples/Cpp/AssetsManagerTest/proj.win32/resource.h b/tests/test-javascript/proj.win32/resource.h similarity index 100% rename from samples/Cpp/AssetsManagerTest/proj.win32/resource.h rename to tests/test-javascript/proj.win32/resource.h diff --git a/samples/Javascript/CocosDragonJS/proj.win32/testjs.rc b/tests/test-javascript/proj.win32/testjs.rc similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.win32/testjs.rc rename to tests/test-javascript/proj.win32/testjs.rc diff --git a/tests/test-javascript/tests b/tests/test-javascript/tests new file mode 160000 index 0000000000..7a9a69a414 --- /dev/null +++ b/tests/test-javascript/tests @@ -0,0 +1 @@ +Subproject commit 7a9a69a41480127a1572a4983eb9b5f1cbf2e186 diff --git a/samples/Lua/TestLua/.gitignore b/tests/test-lua/.gitignore similarity index 100% rename from samples/Lua/TestLua/.gitignore rename to tests/test-lua/.gitignore diff --git a/samples/Lua/TestLua/CMakeLists.txt b/tests/test-lua/CMakeLists.txt similarity index 84% rename from samples/Lua/TestLua/CMakeLists.txt rename to tests/test-lua/CMakeLists.txt index bc9427168f..b13ff6e4f1 100644 --- a/samples/Lua/TestLua/CMakeLists.txt +++ b/tests/test-lua/CMakeLists.txt @@ -7,9 +7,9 @@ set(SAMPLE_SRC include_directories( Classes - ../../../cocos/scripting/lua/bindings - ../../../external/lua/lua - ../../../external/lua/tolua + ../../cocos/scripting/lua/bindings + ../../external/lua/lua + ../../external/lua/tolua ) # add the executable @@ -37,6 +37,6 @@ pre_build(${APP_NAME} COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/cocos/scripting/lua/script ${APP_BIN_DIR}/Resources - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/samples/Cpp/TestCpp/Resources ${APP_BIN_DIR}/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests/test-cpp/Resources ${APP_BIN_DIR}/Resources ) diff --git a/samples/Lua/TestLua/Classes/AppDelegate.cpp b/tests/test-lua/Classes/AppDelegate.cpp similarity index 81% rename from samples/Lua/TestLua/Classes/AppDelegate.cpp rename to tests/test-lua/Classes/AppDelegate.cpp index fadd0b1c25..259171741c 100644 --- a/samples/Lua/TestLua/Classes/AppDelegate.cpp +++ b/tests/test-lua/Classes/AppDelegate.cpp @@ -19,17 +19,20 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { - // initialize director - auto pDirector = Director::getInstance(); - pDirector->setOpenGLView(EGLView::getInstance()); + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { + glview = GLView::createWithRect("Test Lua", Rect(0,0,900,640)); + director->setOpenGLView(glview); + } // turn on display FPS - pDirector->setDisplayStats(true); + director->setDisplayStats(true); // set FPS. the default value is 1.0/60 if you don't call this - pDirector->setAnimationInterval(1.0 / 60); + director->setAnimationInterval(1.0 / 60); - auto screenSize = EGLView::getInstance()->getFrameSize(); + auto screenSize = glview->getFrameSize(); auto designSize = Size(480, 320); @@ -41,10 +44,10 @@ bool AppDelegate::applicationDidFinishLaunching() std::vector searchPaths; searchPaths.push_back("hd"); pFileUtils->setSearchPaths(searchPaths); - pDirector->setContentScaleFactor(resourceSize.height/designSize.height); + director->setContentScaleFactor(resourceSize.height/designSize.height); } - EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_HEIGHT); + glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_HEIGHT); // register lua engine LuaEngine* pEngine = LuaEngine::getInstance(); diff --git a/samples/Lua/TestLua/Classes/AppDelegate.h b/tests/test-lua/Classes/AppDelegate.h similarity index 100% rename from samples/Lua/TestLua/Classes/AppDelegate.h rename to tests/test-lua/Classes/AppDelegate.h diff --git a/samples/Lua/TestLua/Classes/lua_assetsmanager_test_sample.cpp b/tests/test-lua/Classes/lua_assetsmanager_test_sample.cpp similarity index 100% rename from samples/Lua/TestLua/Classes/lua_assetsmanager_test_sample.cpp rename to tests/test-lua/Classes/lua_assetsmanager_test_sample.cpp diff --git a/samples/Lua/TestLua/Classes/lua_assetsmanager_test_sample.h b/tests/test-lua/Classes/lua_assetsmanager_test_sample.h similarity index 100% rename from samples/Lua/TestLua/Classes/lua_assetsmanager_test_sample.h rename to tests/test-lua/Classes/lua_assetsmanager_test_sample.h diff --git a/samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/flower.jpg.REMOVED.git-id b/tests/test-lua/Resources/cocosbuilderRes/ccb/flower.jpg.REMOVED.git-id similarity index 100% rename from samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/flower.jpg.REMOVED.git-id rename to tests/test-lua/Resources/cocosbuilderRes/ccb/flower.jpg.REMOVED.git-id diff --git a/samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/gem-0.wav.REMOVED.git-id b/tests/test-lua/Resources/cocosbuilderRes/ccb/gem-0.wav.REMOVED.git-id similarity index 100% rename from samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/gem-0.wav.REMOVED.git-id rename to tests/test-lua/Resources/cocosbuilderRes/ccb/gem-0.wav.REMOVED.git-id diff --git a/samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/gem-1.wav.REMOVED.git-id b/tests/test-lua/Resources/cocosbuilderRes/ccb/gem-1.wav.REMOVED.git-id similarity index 100% rename from samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/gem-1.wav.REMOVED.git-id rename to tests/test-lua/Resources/cocosbuilderRes/ccb/gem-1.wav.REMOVED.git-id diff --git a/samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/markerfelt24shadow.fnt.REMOVED.git-id b/tests/test-lua/Resources/cocosbuilderRes/ccb/markerfelt24shadow.fnt.REMOVED.git-id similarity index 100% rename from samples/Lua/TestLua/Resources/cocosbuilderRes/ccb/markerfelt24shadow.fnt.REMOVED.git-id rename to tests/test-lua/Resources/cocosbuilderRes/ccb/markerfelt24shadow.fnt.REMOVED.git-id diff --git a/samples/Lua/TestLua/Resources/luaScript/AccelerometerTest/AccelerometerTest.lua b/tests/test-lua/Resources/luaScript/AccelerometerTest/AccelerometerTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/AccelerometerTest/AccelerometerTest.lua rename to tests/test-lua/Resources/luaScript/AccelerometerTest/AccelerometerTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ActionManagerTest/ActionManagerTest.lua b/tests/test-lua/Resources/luaScript/ActionManagerTest/ActionManagerTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ActionManagerTest/ActionManagerTest.lua rename to tests/test-lua/Resources/luaScript/ActionManagerTest/ActionManagerTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ActionsEaseTest/ActionsEaseTest.lua b/tests/test-lua/Resources/luaScript/ActionsEaseTest/ActionsEaseTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ActionsEaseTest/ActionsEaseTest.lua rename to tests/test-lua/Resources/luaScript/ActionsEaseTest/ActionsEaseTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ActionsProgressTest/ActionsProgressTest.lua b/tests/test-lua/Resources/luaScript/ActionsProgressTest/ActionsProgressTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ActionsProgressTest/ActionsProgressTest.lua rename to tests/test-lua/Resources/luaScript/ActionsProgressTest/ActionsProgressTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua b/tests/test-lua/Resources/luaScript/ActionsTest/ActionsTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ActionsTest/ActionsTest.lua rename to tests/test-lua/Resources/luaScript/ActionsTest/ActionsTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerModule.lua b/tests/test-lua/Resources/luaScript/AssetsManagerTest/AssetsManagerModule.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerModule.lua rename to tests/test-lua/Resources/luaScript/AssetsManagerTest/AssetsManagerModule.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua b/tests/test-lua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua rename to tests/test-lua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua b/tests/test-lua/Resources/luaScript/BugsTest/BugsTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/BugsTest/BugsTest.lua rename to tests/test-lua/Resources/luaScript/BugsTest/BugsTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua b/tests/test-lua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua rename to tests/test-lua/Resources/luaScript/ClickAndMoveTest/ClickAndMoveTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua.REMOVED.git-id diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/acts.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/cons.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/TriggerCode/eventDef.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua b/tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua rename to tests/test-lua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua b/tests/test-lua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua rename to tests/test-lua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/CurrentLanguageTest/CurrentLanguageTest.lua b/tests/test-lua/Resources/luaScript/CurrentLanguageTest/CurrentLanguageTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/CurrentLanguageTest/CurrentLanguageTest.lua rename to tests/test-lua/Resources/luaScript/CurrentLanguageTest/CurrentLanguageTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua b/tests/test-lua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua rename to tests/test-lua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua b/tests/test-lua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua rename to tests/test-lua/Resources/luaScript/EffectsAdvancedTest/EffectsAdvancedTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsName.lua b/tests/test-lua/Resources/luaScript/EffectsTest/EffectsName.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsName.lua rename to tests/test-lua/Resources/luaScript/EffectsTest/EffectsName.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua b/tests/test-lua/Resources/luaScript/EffectsTest/EffectsTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/EffectsTest/EffectsTest.lua rename to tests/test-lua/Resources/luaScript/EffectsTest/EffectsTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua b/tests/test-lua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua rename to tests/test-lua/Resources/luaScript/ExtensionTest/CocosBuilderTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua b/tests/test-lua/Resources/luaScript/ExtensionTest/ExtensionTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ExtensionTest/ExtensionTest.lua rename to tests/test-lua/Resources/luaScript/ExtensionTest/ExtensionTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ExtensionTest/WebProxyTest.lua b/tests/test-lua/Resources/luaScript/ExtensionTest/WebProxyTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ExtensionTest/WebProxyTest.lua rename to tests/test-lua/Resources/luaScript/ExtensionTest/WebProxyTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua b/tests/test-lua/Resources/luaScript/FontTest/FontTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/FontTest/FontTest.lua rename to tests/test-lua/Resources/luaScript/FontTest/FontTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/IntervalTest/IntervalTest.lua b/tests/test-lua/Resources/luaScript/IntervalTest/IntervalTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/IntervalTest/IntervalTest.lua rename to tests/test-lua/Resources/luaScript/IntervalTest/IntervalTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/KeypadTest/KeypadTest.lua b/tests/test-lua/Resources/luaScript/KeypadTest/KeypadTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/KeypadTest/KeypadTest.lua rename to tests/test-lua/Resources/luaScript/KeypadTest/KeypadTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua b/tests/test-lua/Resources/luaScript/LabelTest/LabelTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/LabelTest/LabelTest.lua rename to tests/test-lua/Resources/luaScript/LabelTest/LabelTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/LabelTestNew/LabelTestNew.lua b/tests/test-lua/Resources/luaScript/LabelTestNew/LabelTestNew.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/LabelTestNew/LabelTestNew.lua rename to tests/test-lua/Resources/luaScript/LabelTestNew/LabelTestNew.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua b/tests/test-lua/Resources/luaScript/LayerTest/LayerTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua rename to tests/test-lua/Resources/luaScript/LayerTest/LayerTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/LuaBridgeTest/LuaBridgeTest.lua b/tests/test-lua/Resources/luaScript/LuaBridgeTest/LuaBridgeTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/LuaBridgeTest/LuaBridgeTest.lua rename to tests/test-lua/Resources/luaScript/LuaBridgeTest/LuaBridgeTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua b/tests/test-lua/Resources/luaScript/MenuTest/MenuTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/MenuTest/MenuTest.lua rename to tests/test-lua/Resources/luaScript/MenuTest/MenuTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua b/tests/test-lua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua rename to tests/test-lua/Resources/luaScript/MotionStreakTest/MotionStreakTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/test-lua/Resources/luaScript/NewEventDispatcherTest/NewEventDispatcherTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/NewEventDispatcherTest/NewEventDispatcherTest.lua rename to tests/test-lua/Resources/luaScript/NewEventDispatcherTest/NewEventDispatcherTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua b/tests/test-lua/Resources/luaScript/NodeTest/NodeTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/NodeTest/NodeTest.lua rename to tests/test-lua/Resources/luaScript/NodeTest/NodeTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua b/tests/test-lua/Resources/luaScript/OpenGLTest/OpenGLTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/OpenGLTest/OpenGLTest.lua rename to tests/test-lua/Resources/luaScript/OpenGLTest/OpenGLTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ParallaxTest/ParallaxTest.lua b/tests/test-lua/Resources/luaScript/ParallaxTest/ParallaxTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ParallaxTest/ParallaxTest.lua rename to tests/test-lua/Resources/luaScript/ParallaxTest/ParallaxTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua b/tests/test-lua/Resources/luaScript/ParticleTest/ParticleTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ParticleTest/ParticleTest.lua rename to tests/test-lua/Resources/luaScript/ParticleTest/ParticleTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua b/tests/test-lua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua rename to tests/test-lua/Resources/luaScript/PerformanceTest/PerformanceSpriteTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua b/tests/test-lua/Resources/luaScript/PerformanceTest/PerformanceTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/PerformanceTest/PerformanceTest.lua rename to tests/test-lua/Resources/luaScript/PerformanceTest/PerformanceTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua b/tests/test-lua/Resources/luaScript/PhysicsTest/PhysicsTest.lua similarity index 96% rename from samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua rename to tests/test-lua/Resources/luaScript/PhysicsTest/PhysicsTest.lua index 7bfffa2c24..0cff427b7f 100644 --- a/samples/Lua/TestLua/Resources/luaScript/PhysicsTest/PhysicsTest.lua +++ b/tests/test-lua/Resources/luaScript/PhysicsTest/PhysicsTest.lua @@ -16,6 +16,89 @@ local function range(from, to, step) end, nil, from - step end +-- bit operation + +bit = bit or {} +bit.data32 = {} +for i=1,32 do + bit.data32[i]=2^(32-i) +end + +function bit._b2d(arg) + local nr=0 + for i=1,32 do + if arg[i] ==1 then + nr=nr+bit.data32[i] + end + end + return nr +end + +function bit._d2b(arg) + arg = arg >= 0 and arg or (0xFFFFFFFF + arg + 1) + local tr={} + for i=1,32 do + if arg >= bit.data32[i] then + tr[i]=1 + arg=arg-bit.data32[i] + else + tr[i]=0 + end + end + return tr +end + +function bit._and(a,b) + local op1=bit._d2b(a) + local op2=bit._d2b(b) + local r={} + + for i=1,32 do + if op1[i]==1 and op2[i]==1 then + r[i]=1 + else + r[i]=0 + end + end + return bit._b2d(r) + +end + +function bit._rshift(a,n) + local op1=bit._d2b(a) + n = n <= 32 and n or 32 + n = n >= 0 and n or 0 + + for i=32, n+1, -1 do + op1[i] = op1[i-n] + end + for i=1, n do + op1[i] = 0 + end + + return bit._b2d(op1) +end + +function bit._not(a) + local op1=bit._d2b(a) + local r={} + + for i=1,32 do + if op1[i]==1 then + r[i]=0 + else + r[i]=1 + end + end + return bit._b2d(r) +end + +bit.band = bit.band or bit._and +bit.rshift = bit.rshift or bit._rshift +bit.bnot = bit.bnot or bit._not + +-- bit operation end + local function initWithLayer(layer, callback) curLayer = layer layer.spriteTexture = cc.SpriteBatchNode:create("Images/grossini_dance_atlas.png", 100):getTexture() diff --git a/samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua b/tests/test-lua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua rename to tests/test-lua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua b/tests/test-lua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua rename to tests/test-lua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua b/tests/test-lua/Resources/luaScript/SceneTest/SceneTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/SceneTest/SceneTest.lua rename to tests/test-lua/Resources/luaScript/SceneTest/SceneTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/SpineTest/SpineTest.lua b/tests/test-lua/Resources/luaScript/SpineTest/SpineTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/SpineTest/SpineTest.lua rename to tests/test-lua/Resources/luaScript/SpineTest/SpineTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/SpriteTest/SpriteTest.lua b/tests/test-lua/Resources/luaScript/SpriteTest/SpriteTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/SpriteTest/SpriteTest.lua rename to tests/test-lua/Resources/luaScript/SpriteTest/SpriteTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua b/tests/test-lua/Resources/luaScript/Texture2dTest/Texture2dTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/Texture2dTest/Texture2dTest.lua rename to tests/test-lua/Resources/luaScript/Texture2dTest/Texture2dTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua b/tests/test-lua/Resources/luaScript/TileMapTest/TileMapTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TileMapTest/TileMapTest.lua rename to tests/test-lua/Resources/luaScript/TileMapTest/TileMapTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua b/tests/test-lua/Resources/luaScript/TouchesTest/Ball.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TouchesTest/Ball.lua rename to tests/test-lua/Resources/luaScript/TouchesTest/Ball.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua b/tests/test-lua/Resources/luaScript/TouchesTest/Paddle.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TouchesTest/Paddle.lua rename to tests/test-lua/Resources/luaScript/TouchesTest/Paddle.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TouchesTest/TouchesTest.lua b/tests/test-lua/Resources/luaScript/TouchesTest/TouchesTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TouchesTest/TouchesTest.lua rename to tests/test-lua/Resources/luaScript/TouchesTest/TouchesTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsName.lua b/tests/test-lua/Resources/luaScript/TransitionsTest/TransitionsName.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsName.lua rename to tests/test-lua/Resources/luaScript/TransitionsTest/TransitionsName.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua b/tests/test-lua/Resources/luaScript/TransitionsTest/TransitionsTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/TransitionsTest/TransitionsTest.lua rename to tests/test-lua/Resources/luaScript/TransitionsTest/TransitionsTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/UserDefaultTest/UserDefaultTest.lua b/tests/test-lua/Resources/luaScript/UserDefaultTest/UserDefaultTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/UserDefaultTest/UserDefaultTest.lua rename to tests/test-lua/Resources/luaScript/UserDefaultTest/UserDefaultTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua b/tests/test-lua/Resources/luaScript/VisibleRect.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/VisibleRect.lua rename to tests/test-lua/Resources/luaScript/VisibleRect.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/XMLHttpRequestTest/XMLHttpRequestTest.lua b/tests/test-lua/Resources/luaScript/XMLHttpRequestTest/XMLHttpRequestTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/XMLHttpRequestTest/XMLHttpRequestTest.lua rename to tests/test-lua/Resources/luaScript/XMLHttpRequestTest/XMLHttpRequestTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua b/tests/test-lua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua rename to tests/test-lua/Resources/luaScript/ZwoptexTest/ZwoptexTest.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/controller.lua b/tests/test-lua/Resources/luaScript/controller.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/controller.lua rename to tests/test-lua/Resources/luaScript/controller.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/helper.lua b/tests/test-lua/Resources/luaScript/helper.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/helper.lua rename to tests/test-lua/Resources/luaScript/helper.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/mainMenu.lua b/tests/test-lua/Resources/luaScript/mainMenu.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/mainMenu.lua rename to tests/test-lua/Resources/luaScript/mainMenu.lua diff --git a/samples/Lua/TestLua/Resources/luaScript/testResource.lua b/tests/test-lua/Resources/luaScript/testResource.lua similarity index 100% rename from samples/Lua/TestLua/Resources/luaScript/testResource.lua rename to tests/test-lua/Resources/luaScript/testResource.lua diff --git a/samples/Javascript/CocosDragonJS/proj.android/.classpath b/tests/test-lua/proj.android/.classpath similarity index 100% rename from samples/Javascript/CocosDragonJS/proj.android/.classpath rename to tests/test-lua/proj.android/.classpath diff --git a/samples/Lua/TestLua/proj.android/.project b/tests/test-lua/proj.android/.project similarity index 100% rename from samples/Lua/TestLua/proj.android/.project rename to tests/test-lua/proj.android/.project diff --git a/samples/Lua/TestLua/proj.android/AndroidManifest.xml b/tests/test-lua/proj.android/AndroidManifest.xml similarity index 100% rename from samples/Lua/TestLua/proj.android/AndroidManifest.xml rename to tests/test-lua/proj.android/AndroidManifest.xml diff --git a/samples/Cpp/SimpleGame/proj.android/ant.properties b/tests/test-lua/proj.android/ant.properties similarity index 100% rename from samples/Cpp/SimpleGame/proj.android/ant.properties rename to tests/test-lua/proj.android/ant.properties diff --git a/samples/Lua/TestLua/proj.android/build.xml b/tests/test-lua/proj.android/build.xml similarity index 100% rename from samples/Lua/TestLua/proj.android/build.xml rename to tests/test-lua/proj.android/build.xml diff --git a/samples/Lua/TestLua/proj.android/jni/Android.mk b/tests/test-lua/proj.android/jni/Android.mk similarity index 70% rename from samples/Lua/TestLua/proj.android/jni/Android.mk rename to tests/test-lua/proj.android/jni/Android.mk index 4bc4ceafb3..e75e0de694 100644 --- a/samples/Lua/TestLua/proj.android/jni/Android.mk +++ b/tests/test-lua/proj.android/jni/Android.mk @@ -12,9 +12,9 @@ LOCAL_SRC_FILES += testlua/main.cpp \ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes \ - $(LOCAL_PATH)/../../../../../external/lua/tolua \ - $(LOCAL_PATH)/../../../../../extensions \ - $(LOCAL_PATH)/../../../../../cocos/scripting/lua/bindings + $(LOCAL_PATH)/../../../../external/lua/tolua \ + $(LOCAL_PATH)/../../../../extensions \ + $(LOCAL_PATH)/../../../../cocos/scripting/lua/bindings LOCAL_STATIC_LIBRARIES := curl_static_prebuilt diff --git a/samples/Lua/TestLua/proj.android/jni/Application.mk b/tests/test-lua/proj.android/jni/Application.mk similarity index 100% rename from samples/Lua/TestLua/proj.android/jni/Application.mk rename to tests/test-lua/proj.android/jni/Application.mk diff --git a/samples/Lua/TestLua/proj.android/jni/testlua/main.cpp b/tests/test-lua/proj.android/jni/testlua/main.cpp similarity index 100% rename from samples/Lua/TestLua/proj.android/jni/testlua/main.cpp rename to tests/test-lua/proj.android/jni/testlua/main.cpp diff --git a/samples/Cpp/TestCpp/proj.android/proguard-project.txt b/tests/test-lua/proj.android/proguard-project.txt similarity index 100% rename from samples/Cpp/TestCpp/proj.android/proguard-project.txt rename to tests/test-lua/proj.android/proguard-project.txt diff --git a/samples/Javascript/CocosDragonJS/proj.android/project.properties b/tests/test-lua/proj.android/project.properties similarity index 83% rename from samples/Javascript/CocosDragonJS/proj.android/project.properties rename to tests/test-lua/proj.android/project.properties index 0a6dc6664d..16f145cfc9 100644 --- a/samples/Javascript/CocosDragonJS/proj.android/project.properties +++ b/tests/test-lua/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../../cocos/2d/platform/android/java +android.library.reference.1=../../../cocos/2d/platform/android/java diff --git a/samples/Lua/TestLua/proj.android/res/values/strings.xml b/tests/test-lua/proj.android/res/values/strings.xml similarity index 100% rename from samples/Lua/TestLua/proj.android/res/values/strings.xml rename to tests/test-lua/proj.android/res/values/strings.xml diff --git a/samples/Lua/TestLua/proj.android/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java b/tests/test-lua/proj.android/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java similarity index 100% rename from samples/Lua/TestLua/proj.android/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java rename to tests/test-lua/proj.android/src/com/cocos2dx/sample/LuaJavaBridgeTest/LuaJavaBridgeTest.java diff --git a/samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java b/tests/test-lua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java similarity index 100% rename from samples/Lua/TestLua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java rename to tests/test-lua/proj.android/src/org/cocos2dx/testlua/Cocos2dxActivity.java diff --git a/samples/Cpp/HelloCpp/proj.ios/AppController.h b/tests/test-lua/proj.ios/AppController.h similarity index 100% rename from samples/Cpp/HelloCpp/proj.ios/AppController.h rename to tests/test-lua/proj.ios/AppController.h diff --git a/samples/Lua/HelloLua/proj.ios/AppController.mm b/tests/test-lua/proj.ios/AppController.mm similarity index 82% rename from samples/Lua/HelloLua/proj.ios/AppController.mm rename to tests/test-lua/proj.ios/AppController.mm index e87a13dbc9..c7d5d8312f 100644 --- a/samples/Lua/HelloLua/proj.ios/AppController.mm +++ b/tests/test-lua/proj.ios/AppController.mm @@ -1,18 +1,18 @@ /**************************************************************************** Copyright (c) 2010 cocos2d-x.org - + http://www.cocos2d-x.org - + 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 @@ -24,7 +24,7 @@ #import #import "AppController.h" #import "cocos2d.h" -#import "EAGLView.h" +#import "CCEAGLView.h" #import "AppDelegate.h" #import "RootViewController.h" @@ -37,24 +37,26 @@ // cocos2d application instance static AppDelegate s_sharedApplication; -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. // Add the view controller's view to the window and display. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; - CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGBA8 - depthFormat: GL_DEPTH_COMPONENT16 - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Use RootViewController manage CCEAGLView + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH24_STENCIL8_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + [eaglView setMultipleTouchEnabled:YES]; + + // Use RootViewController manage CCEAGLView viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; - viewController.view = __glView; + viewController.view = eaglView; // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -71,7 +73,12 @@ static AppDelegate s_sharedApplication; [window makeKeyAndVisible]; [[UIApplication sharedApplication] setStatusBarHidden: YES]; - + + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + cocos2d::Application::getInstance()->run(); return YES; } @@ -94,7 +101,7 @@ static AppDelegate s_sharedApplication; - (void)applicationDidEnterBackground:(UIApplication *)application { /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ cocos2d::Application::getInstance()->applicationDidEnterBackground(); @@ -122,6 +129,7 @@ static AppDelegate s_sharedApplication; /* Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. */ + cocos2d::Director::getInstance()->purgeCachedData(); } diff --git a/samples/Cpp/TestCpp/proj.ios/Default-568h@2x.png.REMOVED.git-id b/tests/test-lua/proj.ios/Default-568h@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/proj.ios/Default-568h@2x.png.REMOVED.git-id rename to tests/test-lua/proj.ios/Default-568h@2x.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/proj.ios/Default@2x.png.REMOVED.git-id b/tests/test-lua/proj.ios/Default@2x.png.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/proj.ios/Default@2x.png.REMOVED.git-id rename to tests/test-lua/proj.ios/Default@2x.png.REMOVED.git-id diff --git a/samples/Lua/TestLua/proj.ios/LuaObjectCBridgeTest.h b/tests/test-lua/proj.ios/LuaObjectCBridgeTest.h similarity index 100% rename from samples/Lua/TestLua/proj.ios/LuaObjectCBridgeTest.h rename to tests/test-lua/proj.ios/LuaObjectCBridgeTest.h diff --git a/samples/Lua/TestLua/proj.ios/LuaObjectCBridgeTest.mm b/tests/test-lua/proj.ios/LuaObjectCBridgeTest.mm similarity index 100% rename from samples/Lua/TestLua/proj.ios/LuaObjectCBridgeTest.mm rename to tests/test-lua/proj.ios/LuaObjectCBridgeTest.mm diff --git a/samples/Cpp/SimpleGame/proj.ios/RootViewController.h b/tests/test-lua/proj.ios/RootViewController.h similarity index 100% rename from samples/Cpp/SimpleGame/proj.ios/RootViewController.h rename to tests/test-lua/proj.ios/RootViewController.h diff --git a/samples/Cpp/SimpleGame/proj.ios/RootViewController.mm b/tests/test-lua/proj.ios/RootViewController.mm similarity index 100% rename from samples/Cpp/SimpleGame/proj.ios/RootViewController.mm rename to tests/test-lua/proj.ios/RootViewController.mm diff --git a/samples/Lua/TestLua/proj.ios/TestLua_Prefix.pch b/tests/test-lua/proj.ios/TestLua_Prefix.pch similarity index 100% rename from samples/Lua/TestLua/proj.ios/TestLua_Prefix.pch rename to tests/test-lua/proj.ios/TestLua_Prefix.pch diff --git a/samples/Lua/TestLua/proj.ios/main.m b/tests/test-lua/proj.ios/main.m similarity index 100% rename from samples/Lua/TestLua/proj.ios/main.m rename to tests/test-lua/proj.ios/main.m diff --git a/samples/Cpp/HelloCpp/proj.linux/main.cpp b/tests/test-lua/proj.linux/main.cpp similarity index 83% rename from samples/Cpp/HelloCpp/proj.linux/main.cpp rename to tests/test-lua/proj.linux/main.cpp index eaac21e713..e420889600 100644 --- a/samples/Cpp/HelloCpp/proj.linux/main.cpp +++ b/tests/test-lua/proj.linux/main.cpp @@ -12,7 +12,5 @@ int main(int argc, char **argv) { // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("HelloCpp",900,640); return Application::getInstance()->run(); } diff --git a/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id b/tests/test-lua/proj.mac/Icon.icns.REMOVED.git-id similarity index 100% rename from samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id rename to tests/test-lua/proj.mac/Icon.icns.REMOVED.git-id diff --git a/samples/Lua/TestLua/proj.mac/LuaObjectCBridgeTest.h b/tests/test-lua/proj.mac/LuaObjectCBridgeTest.h similarity index 100% rename from samples/Lua/TestLua/proj.mac/LuaObjectCBridgeTest.h rename to tests/test-lua/proj.mac/LuaObjectCBridgeTest.h diff --git a/samples/Lua/TestLua/proj.mac/LuaObjectCBridgeTest.mm b/tests/test-lua/proj.mac/LuaObjectCBridgeTest.mm similarity index 100% rename from samples/Lua/TestLua/proj.mac/LuaObjectCBridgeTest.mm rename to tests/test-lua/proj.mac/LuaObjectCBridgeTest.mm diff --git a/samples/Lua/TestLua/proj.mac/TestLua_Prefix.pch b/tests/test-lua/proj.mac/TestLua_Prefix.pch similarity index 100% rename from samples/Lua/TestLua/proj.mac/TestLua_Prefix.pch rename to tests/test-lua/proj.mac/TestLua_Prefix.pch diff --git a/samples/Cpp/TestCpp/proj.mac/en.lproj/InfoPlist.strings b/tests/test-lua/proj.mac/en.lproj/InfoPlist.strings similarity index 100% rename from samples/Cpp/TestCpp/proj.mac/en.lproj/InfoPlist.strings rename to tests/test-lua/proj.mac/en.lproj/InfoPlist.strings diff --git a/samples/Cpp/HelloCpp/proj.mac/en.lproj/MainMenu.xib b/tests/test-lua/proj.mac/en.lproj/MainMenu.xib similarity index 100% rename from samples/Cpp/HelloCpp/proj.mac/en.lproj/MainMenu.xib rename to tests/test-lua/proj.mac/en.lproj/MainMenu.xib diff --git a/samples/Cpp/HelloCpp/proj.mac/main.cpp b/tests/test-lua/proj.mac/main.cpp similarity index 95% rename from samples/Cpp/HelloCpp/proj.mac/main.cpp rename to tests/test-lua/proj.mac/main.cpp index 4bba4a37b3..1814d16c15 100644 --- a/samples/Cpp/HelloCpp/proj.mac/main.cpp +++ b/tests/test-lua/proj.mac/main.cpp @@ -29,8 +29,5 @@ USING_NS_CC; int main(int argc, char *argv[]) { AppDelegate app; - EGLView eglView; - eglView.init("HelloCpp",900,640); return Application::getInstance()->run(); } - diff --git a/samples/Lua/TestLua/proj.win32/TestLua.rc b/tests/test-lua/proj.win32/TestLua.rc similarity index 100% rename from samples/Lua/TestLua/proj.win32/TestLua.rc rename to tests/test-lua/proj.win32/TestLua.rc diff --git a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj b/tests/test-lua/proj.win32/TestLua.win32.vcxproj similarity index 85% rename from samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj rename to tests/test-lua/proj.win32/TestLua.win32.vcxproj index 7d04e0f16c..799ae15647 100644 --- a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj +++ b/tests/test-lua/proj.win32/TestLua.win32.vcxproj @@ -36,13 +36,13 @@ - - + + - - + + @@ -104,8 +104,8 @@ - xcopy "$(ProjectDir)..\..\..\Cpp\TestCpp\Resources" "$(ProjectDir)..\..\TestLua\Resources" /e /Y -xcopy "$(EngineRoot)cocos\scripting\lua\script" "$(ProjectDir)..\..\TestLua\Resources" /e /Y + xcopy "$(ProjectDir)..\..\test-cpp\Resources" "$(ProjectDir)..\Resources" /e /Y +xcopy "$(EngineRoot)cocos\scripting\lua\script" "$(ProjectDir)..\Resources" /e /Y copy files from TestCpp to TestLua @@ -152,13 +152,13 @@ xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\\win32\*.*" "$(OutDir)" - xcopy "$(ProjectDir)..\..\..\Cpp\TestCpp\Resources" "$(ProjectDir)..\..\TestLua\Resources" /e /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua\script" "$(ProjectDir)..\..\TestLua\Resources" /e /Y + xcopy "$(ProjectDir)..\..\test-cpp\Resources" "$(ProjectDir)..\Resources" /e /Y +xcopy "$(EngineRoot)cocos\scripting\lua\script" "$(ProjectDir)..\Resources" /e /Y copy files from TestCpp to TestLua if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" @@ -172,37 +172,37 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ - + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} - + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} - + {811c0dab-7b96-4bd3-a154-b7572b58e4ab} - + {b57cf53f-2e49-4031-9822-047cc0e6bde2} - + {b7c2a162-dec9-4418-972e-240ab3cbfcae} - + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} - + {df2638c0-8128-4847-867c-6eafe3dee7b5} - + {ddc3e27f-004d-4dd4-9dd3-931a013d2159} - + {632a8f38-d0f0-4d22-86b3-d69f5e6bf63a} - + {21b2c324-891f-48ea-ad1a-5ae13de12e28} - + {207bc7a9-ccf1-4f2f-a04d-45f72242ae25} diff --git a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj.filters b/tests/test-lua/proj.win32/TestLua.win32.vcxproj.filters similarity index 100% rename from samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj.filters rename to tests/test-lua/proj.win32/TestLua.win32.vcxproj.filters diff --git a/samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj.user b/tests/test-lua/proj.win32/TestLua.win32.vcxproj.user similarity index 100% rename from samples/Lua/TestLua/proj.win32/TestLua.win32.vcxproj.user rename to tests/test-lua/proj.win32/TestLua.win32.vcxproj.user diff --git a/samples/Lua/TestLua/proj.win32/main.cpp b/tests/test-lua/proj.win32/main.cpp similarity index 92% rename from samples/Lua/TestLua/proj.win32/main.cpp rename to tests/test-lua/proj.win32/main.cpp index 2554f5981a..eb96bb538f 100644 --- a/samples/Lua/TestLua/proj.win32/main.cpp +++ b/tests/test-lua/proj.win32/main.cpp @@ -24,8 +24,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - EGLView eglView; - eglView.init("TestLua",900,640); int ret = Application::getInstance()->run(); diff --git a/samples/Lua/TestLua/proj.win32/main.h b/tests/test-lua/proj.win32/main.h similarity index 100% rename from samples/Lua/TestLua/proj.win32/main.h rename to tests/test-lua/proj.win32/main.h diff --git a/samples/Lua/TestLua/proj.win32/res/TestLua.ico b/tests/test-lua/proj.win32/res/TestLua.ico similarity index 100% rename from samples/Lua/TestLua/proj.win32/res/TestLua.ico rename to tests/test-lua/proj.win32/res/TestLua.ico diff --git a/samples/Lua/TestLua/proj.win32/resource.h b/tests/test-lua/proj.win32/resource.h similarity index 100% rename from samples/Lua/TestLua/proj.win32/resource.h rename to tests/test-lua/proj.win32/resource.h diff --git a/tools/jenkins-scripts/create-template-project.py b/tools/jenkins-scripts/create-template-project.py new file mode 100644 index 0000000000..e82af72c95 --- /dev/null +++ b/tools/jenkins-scripts/create-template-project.py @@ -0,0 +1,19 @@ +import os + +languages = ['cpp','lua','javascript'] +base_path = 'tools/project-creator/' +create_project = base_path + 'create_project.py' +template_root = base_path + 'templateTest' + +# create project +for item in languages: + ret = os.system('python ' + create_project + + ' -n ' + 'template' + item + + ' -k ' + 'com.test.template.' + item + + ' -l ' + item + + ' -p ' + template_root) + if(ret > 0): + ret = 1 + exit(ret) + +exit(0) diff --git a/tools/project-creator/README.md b/tools/project-creator/README.md index 7417a3ecdb..81122b9337 100644 --- a/tools/project-creator/README.md +++ b/tools/project-creator/README.md @@ -13,7 +13,7 @@ Notice: The best project path is an English path without spaces. To use this, open the terminal and type: ``` $ cd cocos2d-x/tools/project-creator - $ ./project-creator.py --help - $ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame + $ ./create_project.py --help + $ ./create_project.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame $ cd /home/mygame ``` diff --git a/tools/project-creator/module/cocos_files.json.REMOVED.git-id b/tools/project-creator/module/cocos_files.json.REMOVED.git-id index 439dd92f78..1409708766 100644 --- a/tools/project-creator/module/cocos_files.json.REMOVED.git-id +++ b/tools/project-creator/module/cocos_files.json.REMOVED.git-id @@ -1 +1 @@ -44ac62648cf47a69716600ec684d653c4705f990 \ No newline at end of file +817cdd5c111dd3430b51a20442c3586ed3a900cd \ No newline at end of file diff --git a/tools/project-creator/module/core.py b/tools/project-creator/module/core.py index f12ce71553..d5fab0da83 100644 --- a/tools/project-creator/module/core.py +++ b/tools/project-creator/module/core.py @@ -179,8 +179,7 @@ class CocosProject: self.step = 0 #begin copy engine - print("###begin copy engine") - print("waitting copy cocos2d ...") + print("> Copying cocos2d files...") dstPath = os.path.join(self.context["dst_project_path"],"cocos2d") for index in range(len(fileList)): srcfile = os.path.join(self.cocos_root,fileList[index]) @@ -201,14 +200,19 @@ class CocosProject: self.step = self.step + 1 if self.callbackfun and self.step%int(self.totalStep/50) == 0: self.callbackfun(self.step,self.totalStep,fileList[index]) - print("cocos2d\t\t: Done!") + print("< done") # call process_proj from each platform's script folder + + print ("") + print("> Creating project files...") for platform in self.platforms_list: self.__processPlatformProjects(platform) + print("< done") - print ("###New project has been created in this path: ") + print ("") + print ("A new project was created in:") print (self.context["dst_project_path"].replace("\\", "/")) - print ("Have Fun!") + return True def __processPlatformProjects(self, platform): @@ -262,7 +266,7 @@ class CocosProject: replaceString(os.path.join(proj_path, dst), self.context["src_project_name"], self.context["dst_project_name"]) # done! - showMsg = "proj.%s\t\t: Done!" % platform + showMsg = ">> Creating proj.%s... OK" % platform self.step += 1 if self.callbackfun: self.callbackfun(self.step,self.totalStep,showMsg) diff --git a/tools/project-creator/module/ui.py b/tools/project-creator/module/ui.py index 98d261cbf0..63209fe3e4 100644 --- a/tools/project-creator/module/ui.py +++ b/tools/project-creator/module/ui.py @@ -86,9 +86,9 @@ class ThreadedTask(threading.Thread): self.newProjectCallBack ) if breturn: - putMsg = "end@%d@%d@%s" %(100, 100, "create successful") + putMsg = "end@%d@%d@%s" %(100, 100, "Projected created successfully") else: - putMsg = "end@%d@%d@%s" %(100, 100, "create failure") + putMsg = "end@%d@%d@%s" %(100, 100, "Failed to create project") self.queue.put(putMsg) def newProjectCallBack(self, step, totalStep, showMsg): @@ -176,7 +176,7 @@ class TkCocosDialog(Frame): scnHeight = self.parent.winfo_screenheight() tmpcnf = '%dx%d+%d+%d'%(curWidth, curHeight, int((scnWidth-curWidth)/2), int((scnHeight-curHeight)/2)) self.parent.geometry(tmpcnf) - self.parent.title("Cocos Project Creator") + self.parent.title("Cocos2d Project Creator") #fix size #self.parent.maxsize(curWidth, curHeight) @@ -280,4 +280,4 @@ def createTkCocosDialog(): sys.stdout = old_stdout if __name__ =='__main__': - createTkCocosDialog() \ No newline at end of file + createTkCocosDialog() diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index dc35321993..c3f448b595 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/Simpl # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image Event(?!.*(Physics).*).* +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image Event(?!.*(Physics).*).* Component # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -143,7 +143,7 @@ base_classes_to_skip = Clonable # classes that create no constructor # Set is special and we will use a hand-written constructor -abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView EventAcceleration DisplayLinkDirector +abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView EventAcceleration DisplayLinkDirector Component # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index aa9c47f5c6..d7c938d702 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -42,9 +42,9 @@ elif [ "$PLATFORM"x = "android"x ]; then # Create a directory for temporary objects mkdir android_build_objs - PROJECTS=("Cpp/HelloCpp" "Cpp/TestCpp" "Cpp/SimpleGame" "Cpp/AssetsManagerTest" "Javascript/TestJavascript" "Javascript/CocosDragonJS" "Javascript/CrystalCraze" "Javascript/MoonWarriors" "Javascript/WatermelonWithMe" "Lua/HelloLua" "Lua/TestLua") + PROJECTS=("test-cpp" "test-javascript" "test-lua") for i in ${PROJECTS[*]}; do - ln -s $COCOS2DX_ROOT/android_build_objs $COCOS2DX_ROOT/samples/$i/proj.android/obj + ln -s $COCOS2DX_ROOT/android_build_objs $COCOS2DX_ROOT/tests/$i/proj.android/obj done # Build all samples