diff --git a/.gitignore b/.gitignore index 0f469c24b0b0..8ab2dcda3246 100644 --- a/.gitignore +++ b/.gitignore @@ -168,3 +168,17 @@ tests/lua-tests/project/proj.tizen/res/ cmake-build-*/ .vs cmake_build* + +# tmp android build files +cocos/platform/android/libcocos2dx/.project +tests/lua-tests/project/proj.android/.project +tests/lua-tests/project/proj.android/app/.project +tests/*/proj.android/.settings/org.eclipse.buildship.core.prefs +tests/*/project/proj.android/.settings/org.eclipse.buildship.core.prefs + +# tmp folder for temp usage +tmp/ +temp/ + +# external libs zip +*.zip diff --git a/.travis.yml b/.travis.yml index 434feab6f0fe..a24f88911744 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ matrix: include: # linux - os: linux + dist: xenial env: - BUILD_TARGET=linux - GEN_BINDING_AND_COCOSFILE=true @@ -24,7 +25,7 @@ matrix: sudo: required # android ndk-build - os: linux - env: BUILD_TARGET=android_ndk-build + env: BUILD_TARGET=android_cpp_ndk-build language: android sudo: required # android_lua ndk-build @@ -34,7 +35,7 @@ matrix: sudo: required # android cmake - os: linux - env: BUILD_TARGET=android_cmake + env: BUILD_TARGET=android_cpp_cmake language: android sudo: required # android_lua cmake @@ -60,11 +61,12 @@ matrix: osx_image: xcode9.3 sudo: required - os: linux - env: BUILD_TARGET=android_cocos_new_test - language: cpp + env: BUILD_TARGET=android_cocos_new_cpp_test + language: android sudo: required - os: linux - env: BUILD_TARGET=linux_cocos_new_test + dist: xenial + env: BUILD_TARGET=linux_cocos_new_lua_test language: cpp sudo: required diff --git a/CHANGELOG b/CHANGELOG index a9b5d62fdd2a..81211847fd39 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,86 @@ +cocos2d-x-3.17.1 Nov.19 2018 + +[REFINE] Renderer: properly reduce clear buffer times to save energy +[REFINE] Engine: improve the reuse logic of sprite frames cache +[REFINE] Engine: add `GLView::setCursor` for desktop platforms +[REFINE] Engine: add methods to change icons for desktop platforms +[REFINE] UI: improve iPhone X home indicator handling behavior +[REFINE] UI: add line spacing support for system font on iOS and Android +[REFINE] UI: add support for pressed and disabled image in EditBox +[REFINE] UI: shrink extra label text if too long, prevent label too long crash +[REFINE] LUA: add binding code for cocos2d::Downloader +[REFINE] Android: add supporting SafeArea for most edge screens devices +[REFINE] Android: change default value of PROP_BUILD_TYPE from ndk-build to CMake +[REFINE] Android: update project config to gradle 4.6, sdk 28, android gradle plugin 3.1.0 +[REFINE] Android: add ability to not stop music on game start in android +[REFINE] Windows: refine CCDevice-win32 BitmapDC +[REFINE] Windows: improve binary folder structure, copy resources to "Resources/" folder +[REFINE] Action: add ui::LoadingBar support to Progress actions +[REFINE] Network: support multiple parameters in SocketIO emit/send method +[REFINE] FileUtils: improve thread safety (use single recursive_mutex) +[REFINE] FileUtils: add getFileSize impl for Windows +[REFINE] FileUtils: add listFiles impl for Android and Windows platform +[REFINE] FileUtils: exact fullPathForDirectory from fullPathForFilename, fullPathForFilename should not accept directory +[REFINE] CMake: improve libraries link, compile options config +[REFINE] CMake: remove un-elegant prebuilt feature at internal cmake build scripts +[REFINE] 3rd: upgrade libwebsockets to 2.4.2 with libuv enabled +[REFINE] 3rd: improve cmake build scripts for external libs +[REFINE] 3rd: upgrade luajit to 2.1.0-beta3, fix random crash in Android release mode +[REFINE] 3rd: external/lua/lua is not referenced in cmake and it will be removed in the near future +[REFINE] Tests: add websocket latency test +[REFINE] Tests: add download multi task test case +[REFINE] Tests: improve part test cases UI shows +[REFINE] cocos console: disable "gen-libs" command +[REFINE] Others: add another xbox 360 configuration +[REFINE] Others: remove ANT_ROOT env check on setup.py +[REFINE] Others: improve cmake tests in travis CI scripts + +[FIX] Renderer: handle opengl recreate event for CameraBackgroundDepthBrush +[FIX] Renderer: fix some EVENT_RENDERER_RECREATED problem +[FIX] Engine: fix the last update time was not corrected if next delta time was zeroed +[FIX] Engine: be safe to handle operator= in CCData +[FIX] Engine: aviod reading outside of the buffer when print log +[FIX] Engine: avoid duplicate find action when already found +[FIX] Engine: prevent free _bytes when src and dest are identical in CCData +[FIX] Engine: fix Console::loop() consumes 100% of CPU usage +[FIX] Engine: fix Action doesn't work when follow Node added PhysicsBody +[FIX] UI: fix locate image path relative to tsx file error in TiledMap +[FIX] UI: fix several bugs with button's title, include memory leak +[FIX] UI: fix LabelLetter::isVisible always return false +[FIX] UI: fix not support sprite frame when ignoreContentAdaptWithSize is false +[FIX] UI: fix out of range access in Label +[FIX] UI: fix Widget::getAncestorWidget error +[FIX] UI: fix iOS editbox EndAction wrong when single line mode (UITextField) +[FIX] UI: Fix for Label and UIRichEdit text trailing space trimming +[FXI] JavaScript: fix crash if garbage collection runs between TouchStart and TouchEnd event +[FIX] Audio: fix AudioEngine rotateBufferThread crash on iOS +[FIX] Audio: add extra init checks in pcm audio service, avoid crash in PcmAudioService +[FIX] Audio: fix AVAudioSessionErrorCodeCannotStartPlaying error may occur on Apple +[FIX] Audio: fix background music may resumes even the application is on the background on Android +[FIX] Audio: fix AudioCache* holding invalid pointer value +[FIX] Network: fix memory leaks in WebSocket +[FIX] Network: fix websocket memory zereoing size error +[FIX] Network: fix https downloader timeout on win/mac +[FIX] Network: fix "cc.loader.load" convert url error +[FIX] iOS: fix project build warnings in Xcode +[FIX] iOS: fix crash when saving gray colorspace image +[FIX] iOS: `js/lua tests` fix double free issue on app exits. +[FIX] Android: shorten C++ build path, reduce long path error on Windows +[FIX] Android: keep cocos2dx activity at task root by mark "singleTask" in manifest +[FIX] Android: fix crash caused by JNIEnv null pointer in getStringUTFCharsJNI function +[FIX] Android: use 'Binary names' style on JNI for ClassLoader.loadClass +[FIX] Android: allow cleartext HTTP traffic by default for all tests project +[FIX] Windows: Support VS2017 in release mode +[FIX] Action: fix repeat CallFunc for some times, may never stop +[FIX] Physics: fix PhysicsJointMotor setRate and getRate Bad Access Crash +[FIX] FileUtils: fix removeDirectory() failure on win32 +[FIX] FileUtils: let getContents return an error code when the filename is a directory +[FIX] FileUtils: let isFileExistInternal return false when folder as parameter on Linux +[FIX] LUA: performance drop bug introduced in 3.17 +[FIX] CMake: fix project name always be "TemplateCpp" when create a new project +[FIX] Tests: fix auto test stop in cpp-tests project +[FIX] cocos console: do uninstall only when that app is installed for android + cocos2d-x-3.17 May.21 2018 [HIGHLIGHT] Android: support Android Studio 3.0, NDK 16 @@ -1164,7 +1247,7 @@ cocos2d-x-3.7rc0 July.1 2015 [NEW] C++: Added ActionFloat [NEW] C++: Supported physical keyboard on WinRT [NEW] FileUtils: checked filename case characters on windows - [NEW] FileUitls: added supporting loading files that which file path include utf-8 characters + [NEW] FileUtils: added supporting loading files that which file path include utf-8 characters [NEW] PhysicsShape: added sensor property [NEW] Sprite: used triangle command [NEW] 3d: Added `getFarPlane` and `getNearPlane` in `Camera` class diff --git a/CMakeLists.txt b/CMakeLists.txt index f379e71ece8b..f429b7548a72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,15 +34,29 @@ project(Cocos2d-x) set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) +# prevent in-source-build +include(PreventInSourceBuilds) +AssureOutOfSourceBuilds() + # works before build libcocos2d include(CocosBuildSet) +# build options +option(BUILD_TESTS "Build tests" ON) + # default tests include lua, js test project, so we set those option on to build libs set(BUILD_LUA_LIBS ON) set(BUILD_JS_LIBS ON) -if(NOT USE_COCOS_PREBUILT) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) +add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) + +# prevent tests project to build "cocos2d-x/cocos" again +set(BUILD_ENGINE_DONE ON) +# add engine all tests project +if (BUILD_TESTS) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/js-tests/project ${ENGINE_BINARY_PATH}/tests/js-tests) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test) endif() -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests ${ENGINE_BINARY_PATH}/tests) - diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 5e77ca9c4506..9919fa92423e 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -2048,6 +2048,7 @@ 507B3B4B1C31BDD30067B53E /* CCBillBoard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B60C5BD219AC68B10056FBDE /* CCBillBoard.cpp */; }; 507B3B4C1C31BDD30067B53E /* Particle3DReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18956BB01A9DFBFD006E9155 /* Particle3DReader.cpp */; }; 507B3B4D1C31BDD30067B53E /* CCSprite3DMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15AE180319AAD2F700C27E9E /* CCSprite3DMaterial.cpp */; }; + 507B3B4E1C31BDD30067B53E /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */; }; 507B3B501C31BDD30067B53E /* CCPUDoEnableComponentEventHandlerTranslator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B665E1021AA80A6500DDB1C5 /* CCPUDoEnableComponentEventHandlerTranslator.cpp */; }; 507B3B511C31BDD30067B53E /* CCTransition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D8180BCB8C0088DEC7 /* CCTransition.cpp */; }; 507B3B531C31BDD30067B53E /* CCEventAssetsManagerEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15B3707019EE414C00ABE682 /* CCEventAssetsManagerEx.cpp */; }; @@ -2532,6 +2533,7 @@ 507B3DEB1C31BDD30067B53E /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005A180BC5A10088DEC7 /* CCActionPageTurn3D.h */; }; 507B3DEC1C31BDD30067B53E /* UIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9F518CF08D000240AA3 /* UIHelper.h */; }; 507B3DED1C31BDD30067B53E /* CCNavMeshUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B677B0C81B18492D006762CB /* CCNavMeshUtils.h */; }; + 507B3DEE1C31BDD30067B53E /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */; }; 507B3DEF1C31BDD30067B53E /* CCPUBaseForceAffector.h in Headers */ = {isa = PBXBuildFile; fileRef = B665E0DB1AA80A6500DDB1C5 /* CCPUBaseForceAffector.h */; }; 507B3DF01C31BDD30067B53E /* CCPUNoise.h in Headers */ = {isa = PBXBuildFile; fileRef = B665E1591AA80A6500DDB1C5 /* CCPUNoise.h */; }; 507B3DF11C31BDD30067B53E /* CocosGUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905F9EA18CF08D000240AA3 /* CocosGUI.h */; }; @@ -3220,6 +3222,10 @@ 50ABBD981925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */; }; 50ABBD991925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */; }; 50ABBD9A1925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */; }; + 50ABBD9B1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */; }; + 50ABBD9C1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */; }; + 50ABBD9D1925AB4100A911A9 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */; }; + 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */; }; 50ABBD9F1925AB4100A911A9 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */; }; 50ABBDA01925AB4100A911A9 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */; }; 50ABBDA11925AB4100A911A9 /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */; }; @@ -5394,6 +5400,8 @@ 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramState.h; sourceTree = ""; }; 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramStateCache.cpp; sourceTree = ""; }; 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramStateCache.h; sourceTree = ""; }; + 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccGLStateCache.cpp; sourceTree = ""; }; + 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = ""; }; 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGroupCommand.cpp; sourceTree = ""; }; 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGroupCommand.h; sourceTree = ""; }; 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCQuadCommand.cpp; sourceTree = ""; }; @@ -7988,6 +7996,8 @@ 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */, 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */, 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */, + 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */, + 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */, 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */, 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */, B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */, @@ -9782,6 +9792,7 @@ B665E2641AA80A6500DDB1C5 /* CCPUDoExpireEventHandler.h in Headers */, 1A40D1091E8E56C6002E363A /* allocators.h in Headers */, 50864CE21C7BC1B100B3BAB1 /* cpVect.h in Headers */, + 50ABBD9D1925AB4100A911A9 /* ccGLStateCache.h in Headers */, B665E3241AA80A6500DDB1C5 /* CCPUOnCollisionObserver.h in Headers */, 50ABBEB91925AB6F00A911A9 /* ccUTF8.h in Headers */, 15AE191A19AAD35000C27E9E /* CCSSceneReader.h in Headers */, @@ -10058,6 +10069,7 @@ 5020A1D91D49912500E80C72 /* RegionAttachment.h in Headers */, 507B3DEC1C31BDD30067B53E /* UIHelper.h in Headers */, 507B3DED1C31BDD30067B53E /* CCNavMeshUtils.h in Headers */, + 507B3DEE1C31BDD30067B53E /* ccGLStateCache.h in Headers */, 507B3DEF1C31BDD30067B53E /* CCPUBaseForceAffector.h in Headers */, 507B3DF01C31BDD30067B53E /* CCPUNoise.h in Headers */, 507B3DF11C31BDD30067B53E /* CocosGUI.h in Headers */, @@ -10870,6 +10882,7 @@ 1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */, 15AE1B9319AADA9A00C27E9E /* UIHelper.h in Headers */, B677B0DC1B18492D006762CB /* CCNavMeshUtils.h in Headers */, + 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */, B665E2111AA80A6500DDB1C5 /* CCPUBaseForceAffector.h in Headers */, B665E30D1AA80A6500DDB1C5 /* CCPUNoise.h in Headers */, 15AE1B9619AADA9A00C27E9E /* CocosGUI.h in Headers */, @@ -12150,6 +12163,7 @@ D0FD03531A3B51AA00825BB5 /* CCAllocatorGlobalNewDelete.cpp in Sources */, B6DD2FE51B04825B00E47F5F /* DetourPathQueue.cpp in Sources */, B665E39A1AA80A6500DDB1C5 /* CCPUPointEmitterTranslator.cpp in Sources */, + 50ABBD9B1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */, 15AE188119AAD33D00C27E9E /* CCBReader.cpp in Sources */, 501216A01AC473AD009A4BEA /* CCMaterial.cpp in Sources */, 50ABBDB91925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, @@ -12560,6 +12574,7 @@ 507B3B4B1C31BDD30067B53E /* CCBillBoard.cpp in Sources */, 507B3B4C1C31BDD30067B53E /* Particle3DReader.cpp in Sources */, 507B3B4D1C31BDD30067B53E /* CCSprite3DMaterial.cpp in Sources */, + 507B3B4E1C31BDD30067B53E /* ccGLStateCache.cpp in Sources */, 507B3B501C31BDD30067B53E /* CCPUDoEnableComponentEventHandlerTranslator.cpp in Sources */, 507B3B511C31BDD30067B53E /* CCTransition.cpp in Sources */, 507B3B531C31BDD30067B53E /* CCEventAssetsManagerEx.cpp in Sources */, @@ -13228,6 +13243,7 @@ B60C5BD519AC68B10056FBDE /* CCBillBoard.cpp in Sources */, 18956BB31A9DFBFD006E9155 /* Particle3DReader.cpp in Sources */, 15AE184519AAD2F700C27E9E /* CCSprite3DMaterial.cpp in Sources */, + 50ABBD9C1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */, B665E25F1AA80A6500DDB1C5 /* CCPUDoEnableComponentEventHandlerTranslator.cpp in Sources */, 1A5701E7180BCB8C0088DEC7 /* CCTransition.cpp in Sources */, 15B3707D19EE414C00ABE682 /* CCEventAssetsManagerEx.cpp in Sources */, @@ -13702,7 +13718,7 @@ 1551A34D158F2AB200E66CFE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_EXTENSION = a; @@ -13743,7 +13759,7 @@ 1551A34E158F2AB200E66CFE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_EXTENSION = a; @@ -13856,7 +13872,7 @@ A07A4D621783777C0073F6A7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; ENABLE_BITCODE = NO; EXECUTABLE_PREFIX = ""; @@ -13893,7 +13909,7 @@ A07A4D631783777C0073F6A7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; ENABLE_BITCODE = NO; EXECUTABLE_PREFIX = ""; diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index c3fb3dd9da83..badb74cb318f 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -1129,6 +1129,9 @@ 52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; }; 52B47A351A53A43A004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; }; 53367D561DC22891005862DE /* WindowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53367D541DC22891005862DE /* WindowTest.cpp */; }; + 53E6A008218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; }; + 53E6A009218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; }; + 53E6A00A218FA06E002BE515 /* InputTest in Resources */ = {isa = PBXBuildFile; fileRef = 53E6A007218FA06D002BE515 /* InputTest */; }; 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; 59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; 59E170151AB42EB10007F2BF /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 826294421AAF071500CB7CF7 /* Security.framework */; }; @@ -2302,6 +2305,7 @@ 52B47A331A534B2B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; 53367D541DC22891005862DE /* WindowTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowTest.cpp; sourceTree = ""; }; 53367D551DC22891005862DE /* WindowTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowTest.h; sourceTree = ""; }; + 53E6A007218FA06D002BE515 /* InputTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = InputTest; path = "../tests/cpp-tests/Resources/InputTest"; sourceTree = ""; }; 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-Child.cpp"; sourceTree = ""; }; 59620E8E1921E5CF002021B6 /* Bug-Child.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-Child.h"; sourceTree = ""; }; 5EBEECAE1995247000429821 /* DrawNode3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawNode3D.cpp; path = Sprite3DTest/DrawNode3D.cpp; sourceTree = ""; }; @@ -3976,6 +3980,7 @@ 1AC35CBC18CED84500F37B72 /* hd */, 1AC35CBD18CED84500F37B72 /* Hello.png */, 1AC35CBE18CED84500F37B72 /* Images */, + 53E6A007218FA06D002BE515 /* InputTest */, 15B3709219EE5D1000ABE682 /* Manifests */, 5046AB5A1AF2C4180060550B /* Materials */, 1AC35CC118CED84500F37B72 /* Misc */, @@ -5699,6 +5704,7 @@ 5046AB5B1AF2C4180060550B /* Materials in Resources */, B63993311A49359F00B07923 /* Particle3D in Resources */, 1AC35CEC18CED84500F37B72 /* fonts in Resources */, + 53E6A008218FA06E002BE515 /* InputTest in Resources */, 460629781CDB4DBA00B44058 /* ccs-res in Resources */, 1AC35CCA18CED84500F37B72 /* animations in Resources */, 1AC35CEA18CED84500F37B72 /* fileLookup.plist in Resources */, @@ -5776,6 +5782,7 @@ 507B41211C31BEA60067B53E /* animations in Resources */, 507B41221C31BEA60067B53E /* cocosvideo.mp4 in Resources */, 507B41231C31BEA60067B53E /* Sprite3DTest in Resources */, + 53E6A00A218FA06E002BE515 /* InputTest in Resources */, 507B41251C31BEA60067B53E /* hd in Resources */, 507B41271C31BEA60067B53E /* Misc in Resources */, 507B41281C31BEA60067B53E /* Hello.png in Resources */, @@ -5949,6 +5956,7 @@ 1AC35CE918CED84500F37B72 /* extensions in Resources */, 3E2BDAD219BEA3E20055CDCD /* audio in Resources */, 5046AB5C1AF2C4180060550B /* Materials in Resources */, + 53E6A009218FA06E002BE515 /* InputTest in Resources */, C08689C318D370C90093E810 /* background.caf in Resources */, 15B3709419EE5D1000ABE682 /* Manifests in Resources */, 1AC35D0B18CED84500F37B72 /* zwoptex in Resources */, @@ -7336,7 +7344,7 @@ ); PRODUCT_NAME = "js-tests Mac"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../tests/js-tests/project/Classes"; }; name = Debug; }; @@ -7368,7 +7376,7 @@ ); PRODUCT_NAME = "js-tests Mac"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../tests/js-tests/project/Classes"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -7401,7 +7409,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../tests/js-tests/project/Classes"; VALID_ARCHS = "arm64 armv7"; }; name = Debug; @@ -7435,7 +7443,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../tests/js-tests/project/Classes"; VALIDATE_PRODUCT = YES; VALID_ARCHS = "arm64 armv7"; }; @@ -7485,7 +7493,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-empty-test/project/Classes"; }; name = Debug; }; @@ -7504,7 +7512,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-empty-test/project/Classes"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -7512,6 +7520,7 @@ 1A0EE41118CDF775004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-cpp-empty-test"; CODE_SIGN_IDENTITY = "iPhone Developer"; ENABLE_BITCODE = NO; @@ -7532,6 +7541,7 @@ 1A0EE41218CDF775004CD58F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-cpp-empty-test"; CODE_SIGN_IDENTITY = "iPhone Developer"; ENABLE_BITCODE = NO; @@ -7560,6 +7570,7 @@ "$(inherited)", CC_TARGET_OS_IPHONE, ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-empty-test/project/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LIBRARY_SEARCH_PATHS = ( @@ -7575,7 +7586,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-empty-test/project/Classes"; VALID_ARCHS = "arm64 armv7"; }; name = Debug; @@ -7590,6 +7601,7 @@ "$(inherited)", CC_TARGET_OS_IPHONE, ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-empty-test/project/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LIBRARY_SEARCH_PATHS = ( @@ -7605,7 +7617,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-empty-test/project/Classes"; VALIDATE_PRODUCT = YES; VALID_ARCHS = "arm64 armv7"; }; @@ -7626,7 +7638,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-tests/project/Classes"; }; name = Debug; }; @@ -7645,7 +7657,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../tests/lua-tests/project/Classes"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -7675,7 +7687,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../tests/lua-tests/project/Classes"; VALID_ARCHS = "arm64 armv7"; }; name = Debug; @@ -7705,7 +7717,7 @@ SDKROOT = iphoneos; STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../tests/lua-tests/project/Classes"; VALIDATE_PRODUCT = YES; VALID_ARCHS = "arm64 armv7"; }; @@ -8240,7 +8252,7 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; @@ -8255,7 +8267,7 @@ "CC_ENABLE_CHIPMUNK_INTEGRATION=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -8271,7 +8283,7 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; @@ -8283,7 +8295,7 @@ "CC_ENABLE_CHIPMUNK_INTEGRATION=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/build/install-deps-linux.sh b/build/install-deps-linux.sh index 031e5c9b55b8..cf6bab4dae32 100755 --- a/build/install-deps-linux.sh +++ b/build/install-deps-linux.sh @@ -1,8 +1,6 @@ #!/bin/bash -# Change directory to the location of this script echo "This Shell Script will install dependencies for cocos2d-x" -echo "if you execute this shell more than once it will get errors when building libGLFW.so" echo -n "Are you continue? (y/n) " read answer if echo "$answer" | grep -iq "^y" ;then @@ -11,15 +9,6 @@ else exit fi -cd $(dirname ${BASH_SOURCE[0]}) - -if [ ! $(command -v apt-get) ]; then - echo "Not a .deb package system. Please install dependencies manually" - exit 0 -fi - -#install g++-4.9 -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y > /dev/null sudo apt-get update DEPENDS='libx11-dev' @@ -27,8 +16,6 @@ DEPENDS+=' libxmu-dev' DEPENDS+=' libglu1-mesa-dev' DEPENDS+=' libgl2ps-dev' DEPENDS+=' libxi-dev' -DEPENDS+=' gcc-4.9' -DEPENDS+=' g++-4.9' DEPENDS+=' libzip-dev' DEPENDS+=' libpng12-dev' DEPENDS+=' libcurl4-gnutls-dev' @@ -39,38 +26,4 @@ DEPENDS+=' libssl-dev' DEPENDS+=' libgtk-3-dev' DEPENDS+=' binutils' -MISSING= -echo "Checking for missing packages ..." -for i in $DEPENDS; do - if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then - MISSING+="$i " - fi -done - -if [ -n "$MISSING" ]; then - TXTCOLOR_DEFAULT="\033[0;m" - TXTCOLOR_GREEN="\033[0;32m" - echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT - CUR_APT_VERSION="$(apt --version | grep -o '[0-9].[0-9]')" - REQ_APT_VERSION="1.1" - if [ 1 -ge "$(echo "${CUR_APT_VERSION} >= ${REQ_APT_VERSION}" | bc)" ] - then - sudo apt-get install --allow-change-held-packages $MISSING -y > /dev/null - else - sudo apt-get install --force-yes --yes $MISSING > /dev/null - fi -fi - - - -sudo update-alternatives --remove-all gcc -sudo update-alternatives --remove-all g++ - -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 60 - -echo "Cocos uses GCC Version: `gcc --version`" -echo "Cocos uses G++ Version: `g++ --version`" -echo "Cocos uses ld Version: `ld --version`" -echo "Cocos uses /usr/bin/ld Version: `/usr/bin/ld --version`" - +sudo apt-get install --force-yes --yes $DEPENDS > /dev/null diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index ad3428a43f88..3758b49f1ff6 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -1,14 +1,17 @@ include(CMakeParseArguments) -# copy resource `FILES` and `FOLDERS` to `COPY_TO` folder -function(cocos_copy_res) +# copy resource `FILES` and `FOLDERS` to TARGET_FILE_DIR/Resources +function(cocos_copy_target_res cocos_target) set(oneValueArgs COPY_TO) set(multiValueArgs FILES FOLDERS) cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # copy files foreach(cc_file ${opt_FILES}) get_filename_component(file_name ${cc_file} NAME) - configure_file(${cc_file} "${opt_COPY_TO}/${file_name}" COPYONLY) + add_custom_command(TARGET ${cocos_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E echo "copy file into Resources: ${file_name} ..." + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${cc_file} "${opt_COPY_TO}/${file_name}" + ) endforeach() # copy folders files foreach(cc_folder ${opt_FOLDERS}) @@ -17,7 +20,10 @@ function(cocos_copy_res) foreach(res_file ${folder_files}) get_filename_component(res_file_abs_path ${res_file} ABSOLUTE) file(RELATIVE_PATH res_file_relat_path ${folder_abs_path} ${res_file_abs_path}) - configure_file(${res_file} "${opt_COPY_TO}/${res_file_relat_path}" COPYONLY) + add_custom_command(TARGET ${cocos_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E echo "copy file into Resources: ${res_file_relat_path} ..." + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${res_file} "${opt_COPY_TO}/${res_file_relat_path}" + ) endforeach() endforeach() endfunction() @@ -45,25 +51,18 @@ function(cocos_mark_multi_resources res_out) set(${res_out} ${tmp_file_list} PARENT_SCOPE) endfunction() -# get `cocos_target` depend all dlls, save the result in `all_depend_dlls_out` -function(get_target_depends_ext_dlls cocos_target all_depend_dlls_out) - set(all_depend_ext_dlls) +# get all linked libraries including transitive ones, recursive +function(search_depend_libs_recursive cocos_target all_depends_out) + set(all_depends_inner) set(targets_prepare_search ${cocos_target}) - # targets_prepare_search, target need find ext libs - set(have_searched_targets) - set(need_search_targets) while(true) foreach(tmp_target ${targets_prepare_search}) get_target_property(tmp_depend_libs ${tmp_target} LINK_LIBRARIES) list(REMOVE_ITEM targets_prepare_search ${tmp_target}) - # target itself use_cocos_pkg list(APPEND tmp_depend_libs ${tmp_target}) foreach(depend_lib ${tmp_depend_libs}) if(TARGET ${depend_lib}) - get_target_property(tmp_dlls ${depend_lib} CC_DEPEND_DLLS) - if(tmp_dlls) - list(APPEND all_depend_ext_dlls ${tmp_dlls}) - endif() + list(APPEND all_depends_inner ${depend_lib}) if(NOT (depend_lib STREQUAL tmp_target)) list(APPEND targets_prepare_search ${depend_lib}) endif() @@ -75,24 +74,41 @@ function(get_target_depends_ext_dlls cocos_target all_depend_dlls_out) break() endif() endwhile(true) + set(${all_depends_out} ${all_depends_inner} PARENT_SCOPE) +endfunction() + +# get `cocos_target` depend all dlls, save the result in `all_depend_dlls_out` +function(get_target_depends_ext_dlls cocos_target all_depend_dlls_out) + + set(depend_libs) + set(all_depend_ext_dlls) + search_depend_libs_recursive(${cocos_target} depend_libs) + foreach(depend_lib ${depend_libs}) + if(TARGET ${depend_lib}) + get_target_property(found_shared_lib ${depend_lib} IMPORTED_IMPLIB) + if(found_shared_lib) + get_target_property(tmp_dlls ${depend_lib} IMPORTED_LOCATION) + list(APPEND all_depend_ext_dlls ${tmp_dlls}) + endif() + endif() + endforeach() set(${all_depend_dlls_out} ${all_depend_ext_dlls} PARENT_SCOPE) endfunction() -# copy the `cocos_target` needed dlls into `COPY_TO` folder +# copy the `cocos_target` needed dlls into TARGET_FILE_DIR function(cocos_copy_target_dll cocos_target) - set(oneValueArgs COPY_TO) - cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) get_target_depends_ext_dlls(${cocos_target} all_depend_dlls) # remove repeat items if(all_depend_dlls) list(REMOVE_DUPLICATES all_depend_dlls) endif() - # todo, add a option to enable/disable debug print - message(STATUS "prepare to copy external dlls for ${cocos_target}:${all_depend_dlls}") foreach(cc_dll_file ${all_depend_dlls}) get_filename_component(cc_dll_name ${cc_dll_file} NAME) - configure_file(${cc_dll_file} "${opt_COPY_TO}/${cc_dll_name}" COPYONLY) + add_custom_command(TARGET ${cocos_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E echo "copy dll into target file dir: ${cc_dll_name} ..." + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${cc_dll_file} "$/${cc_dll_name}" + ) endforeach() endfunction() @@ -158,32 +174,21 @@ function(source_group_single_file single_file) source_group("${ide_file_group}" FILES ${single_file}) endfunction() -# setup a cocos application, include "APP_BIN_DIR", "APP_RES_DIR" config +# setup a cocos application function(setup_cocos_app_config app_name) - # set target PROPERTIES, depend different platforms + # put all output app into bin/${app_name} + set_target_properties(${app_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/${app_name}") if(APPLE) - set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") - set_target_properties(${app_name} PROPERTIES MACOSX_BUNDLE 1 - ) + # output macOS/iOS .app + set_target_properties(${app_name} PROPERTIES MACOSX_BUNDLE 1) elseif(MSVC) - # only Debug and Release mode was supported when using MSVC. - set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}/$") - set(APP_RES_DIR "${CMAKE_BINARY_DIR}/bin/${APP_NAME}/${CMAKE_BUILD_TYPE}") - #Visual Studio Defaults to wrong type - set_target_properties(${app_name} PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS") - else(LINUX) - set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/${APP_NAME}") - set(APP_RES_DIR "${APP_BIN_DIR}/Resources") + # visual studio default is Console app, but we need Windows app + set_property(TARGET ${app_name} APPEND PROPERTY LINK_FLAGS "/SUBSYSTEM:WINDOWS") endif() - set_target_properties(${app_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") - # auto mark code files for IDE when mark app if(XCODE OR VS) - cocos_mark_code_files(${APP_NAME}) + cocos_mark_code_files(${app_name}) endif() - - set(APP_BIN_DIR ${APP_BIN_DIR} PARENT_SCOPE) - set(APP_RES_DIR ${APP_RES_DIR} PARENT_SCOPE) endfunction() # if cc_variable not set, then set it cc_value @@ -232,26 +237,18 @@ macro(cocos_pak_xcode cocos_target) set(MACOSX_BUNDLE_LONG_VERSION_STRING ${COCOS_APP_LONG_VERSION_STRING}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${COCOS_APP_SHORT_VERSION_STRING}) - message("cocos package: ${cocos_target}, plist file: ${COCOS_APP_INFO_PLIST}") + message(STATUS "cocos package: ${cocos_target}, plist file: ${COCOS_APP_INFO_PLIST}") cocos_config_app_xcode_property(${cocos_target}) endmacro() # set Xcode property for application, include all depend target macro(cocos_config_app_xcode_property cocos_app) - cocos_config_target_xcode_property(${cocos_app}) - # for example, cocos_target: cpp-tests link engine_lib: cocos2d - get_target_property(engine_libs ${cocos_app} LINK_LIBRARIES) - foreach(engine_lib ${engine_libs}) - if(TARGET ${engine_lib}) - cocos_config_target_xcode_property(${engine_lib}) - # for example, engine_lib: cocos2d link external_lib: flatbuffers - get_target_property(external_libs ${engine_lib} LINK_LIBRARIES) - foreach(external_lib ${external_libs}) - if(TARGET ${external_lib}) - cocos_config_target_xcode_property(${external_lib}) - endif() - endforeach() + set(depend_libs) + search_depend_libs_recursive(${cocos_app} depend_libs) + foreach(depend_lib ${depend_libs}) + if(TARGET ${depend_lib}) + cocos_config_target_xcode_property(${depend_lib}) endif() endforeach() endmacro() diff --git a/cmake/Modules/CocosBuildSet.cmake b/cmake/Modules/CocosBuildSet.cmake index 31caf1d93d81..f93621238af9 100644 --- a/cmake/Modules/CocosBuildSet.cmake +++ b/cmake/Modules/CocosBuildSet.cmake @@ -1,53 +1,39 @@ -# Disable in-source builds to prevent source tree corruption. -if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}") - message(FATAL_ERROR " - FATAL: In-source builds are not allowed. - You should create a separate directory for build files. - ") -endif() - # print cmake debug info set(CMAKE_DEBUG_TARGET_PROPERTIES # INCLUDE_DIRECTORIES # COMPILE_DEFINITIONS + # COMPILE_OPTIONS + # AUTOUIC_OPTIONS # POSITION_INDEPENDENT_CODE - # CONTAINER_SIZE_REQUIRED - # LIB_VERSION ) -# It ensures that when Find*.cmake files included from cmake's Modules dir -# include another *.cmake file with relative path, that file will be included -# also from cmake's Modules dir, to not clash with per-project files. -cmake_policy(SET CMP0017 NEW) - -# Use new behaviour with cmake >= 3.1: -# Only interpret if() arguments as variables or keywords when unquoted. -cmake_policy(SET CMP0054 NEW) - -# print the info of CMAKE_TOOLCHAIN_FILE, if defined it -if(DEFINED CMAKE_TOOLCHAIN_FILE) - message(STATUS "using toolchain file: ${CMAKE_TOOLCHAIN_FILE}") -endif() # some useful variables for every one cocos project -set(COCOS_EXTERNAL_DIR ${COCOS2DX_ROOT_PATH}/external) set(ENGINE_BINARY_PATH ${PROJECT_BINARY_DIR}/engine) +if(CMAKE_TOOLCHAIN_FILE) + message(STATUS "using toolchain file:" ${CMAKE_TOOLCHAIN_FILE}) +endif() + message(STATUS "PROJECT_NAME:" ${PROJECT_NAME}) message(STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR}) message(STATUS "COCOS2DX_ROOT_PATH:" ${COCOS2DX_ROOT_PATH}) message(STATUS "CMAKE_MODULE_PATH:" ${CMAKE_MODULE_PATH}) -message(STATUS "COCOS_EXTERNAL_DIR:" ${COCOS_EXTERNAL_DIR}) # delete binary dir if you hope a full clean re-build message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR}) message(STATUS "ENGINE_BINARY_PATH:" ${ENGINE_BINARY_PATH}) -# include helper functions for cmake build -include(CocosBuildHelpers) +# the default behavior of build module +option(DEBUG_MODE "Debug or Release?" ON) +option(BUILD_LUA_LIBS "Build lua libraries" OFF) +option(BUILD_JS_LIBS "Build js libraries" OFF) -# select building modules -include(CocosSelectModule) +# include helper functions +include(CocosBuildHelpers) # set common compiler options -include(CocosCompileOptions) +# add target compile define function +# add target compile options function +include(CocosConfigDefine) +# config libraries dependence include(CocosConfigDepend) diff --git a/cmake/Modules/CocosCompileOptions.cmake b/cmake/Modules/CocosCompileOptions.cmake deleted file mode 100644 index aba389de920c..000000000000 --- a/cmake/Modules/CocosCompileOptions.cmake +++ /dev/null @@ -1,191 +0,0 @@ - #cmake has some strange defaults, this should help us a lot - #Please use them everywhere - #WINDOWS = Windows Desktop - #ANDROID = Android - #IOS = iOS - #MACOSX = MacOS X - #LINUX = Linux - if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(WINDOWS TRUE) - set(SYSTEM_STRING "Windows Desktop") - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android") - set(SYSTEM_STRING "Android") - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - if(ANDROID) - set(SYSTEM_STRING "Android") - else() - set(LINUX TRUE) - set(SYSTEM_STRING "Linux") - endif() - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if(IOS) - set(APPLE TRUE) - set(SYSTEM_STRING "IOS") - else() - set(APPLE TRUE) - set(MACOSX TRUE) - set(SYSTEM_STRING "Mac OSX") - endif() - endif() - - if(CMAKE_GENERATOR STREQUAL Xcode) - set(XCODE TRUE) - elseif(CMAKE_GENERATOR MATCHES Visual) - set(VS TRUE) - endif() - #Debug is default value - if(NOT CMAKE_BUILD_TYPE) - if(DEBUG_MODE) - set(CMAKE_BUILD_TYPE Debug) - else() - set(CMAKE_BUILD_TYPE Release) - endif() - endif() - # make configurations type keep same to cmake build type. prevent use generate debug project but switch release mode in IDE - if(CMAKE_GENERATOR) - set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" CACHE STRING "Reset the configurations to what we need" FORCE) - endif() - message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - - # check and print compiler infos - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(COMPILER_STRING ${CMAKE_CXX_COMPILER_ID}) - set(CLANG TRUE) - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if(MINGW) - set(COMPILER_STRING "Mingw GCC") - else() - set(COMPILER_STRING "GCC") - endif() - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") - set(COMPILER_STRING "${CMAKE_CXX_COMPILER_ID} C++") - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - set(COMPILER_STRING "Visual Studio C++") - else() - set(COMPILER_STRING "${CMAKE_CXX_COMPILER_ID}") - endif() - if(CMAKE_CROSSCOMPILING) - set(BUILDING_STRING "It appears you are cross compiling for ${SYSTEM_STRING} with ${COMPILER_STRING}") - else() - set(BUILDING_STRING "It appears you are building natively for ${SYSTEM_STRING} with ${COMPILER_STRING}") - endif() - message(STATUS ${BUILDING_STRING}) - - # Set compiler options - if(MSVC) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcmt") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmt") - - add_definitions(-DUNICODE -D_UNICODE) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS - -wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710 - -wd4514 -wd4056 -wd4996 -wd4099) - # multi thread compile option - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") - # Use inline Debug info (/Z7) format. Or internal error may occur. - # Errors looks like: "xmemory0(592): error C3130: Internal Compiler Error: failed to write injected code block to PDB" - foreach(lang C CXX) - string(REGEX REPLACE "/Z[iI7]" "" CMAKE_${lang}_FLAGS_DEBUG "${CMAKE_${lang}_FLAGS_DEBUG}") - set(CMAKE_${lang}_FLAGS_DEBUG "${CMAKE_${lang}_FLAGS_DEBUG} /Z7") - endforeach() - else() - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -Wall") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -fPIC") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder -Wno-invalid-offsetof -fPIC") - if(CLANG AND NOT ANDROID) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - if(LINUX) - add_definitions(-D_GNU_SOURCE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -lrt") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -lrt") - endif() - # specail options for android - if(ANDROID) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char -fexceptions") - set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} -latomic") - if(CLANG AND ANDROID_ARM_MODE STREQUAL thumb AND ANDROID_ABI STREQUAL armeabi) - string(REPLACE "-mthumb" "-marm" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) - string(REPLACE "-mthumb" "-marm" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - endif() - endif() - endif(MSVC) - - # Set common macro definitions - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - add_definitions(-DCOCOS2D_DEBUG=1) - endif() - # Set macro definitions for special platforms - if(WINDOWS) - if(BUILD_SHARED_LIBS) - add_definitions(-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL) - else() - add_definitions(-DCC_STATIC) - endif() - add_definitions(-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32) - set(PLATFORM_FOLDER win32) - elseif(APPLE) - add_definitions(-DUSE_FILE32API) - if(MACOSX) - add_definitions(-DTARGET_OS_MAC) - set(PLATFORM_FOLDER mac) - elseif(IOS) - add_definitions(-DTARGET_OS_IPHONE) - add_definitions(-DTARGET_OS_IOS) - set(PLATFORM_FOLDER ios) - endif(MACOSX) - elseif(LINUX) - add_definitions(-DLINUX) - set(PLATFORM_FOLDER linux) - elseif(ANDROID) - add_definitions(-DUSE_FILE32API) - set(PLATFORM_FOLDER android) - else() - message(FATAL_ERROR "Unsupported platform, CMake will exit") - return() - endif() - - if(CMAKE_FIND_ROOT_PATH) - # Adds cocos2d-x external folder to the list of valid include/library paths when cross-compiling and using prebuilds - set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${COCOS_EXTERNAL_DIR}) - endif() - - # extra config for windows - if(WINDOWS) - # folder much targets - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - # not support other compile tools except MSVC for now - if(MSVC) - # Visual Studio 2015, MSVC_VERSION 1900 (v140 toolset) - # Visual Studio 2017, MSVC_VERSION 1910-1919 (v141 toolset) - if(${MSVC_VERSION} EQUAL 1900 OR ${MSVC_VERSION} GREATER 1900) - message(STATUS "using Windows MSVC generate cocos2d-x project, MSVC_VERSION:${MSVC_VERSION}") - else() - message(FATAL_ERROR "using Windows MSVC generate cocos2d-x project, MSVC_VERSION:${MSVC_VERSION} lower than needed") - endif() - else() - message(FATAL_ERROR "please using Windows MSVC compile cocos2d-x project, support other compile tools not yet") - endif() - endif() - -# custom target property for dll collect -define_property(TARGET - PROPERTY CC_DEPEND_DLLS - BRIEF_DOCS "depend dlls of a target" - FULL_DOCS "use to save depend dlls of a target" -) -# custom target property for lua/js link -define_property(TARGET - PROPERTY CC_JS_DEPEND - BRIEF_DOCS "cocos2d js depend libs" - FULL_DOCS "use to save depend libs of cocos2d js project" -) -define_property(TARGET - PROPERTY CC_LUA_DEPEND - BRIEF_DOCS "cocos2d lua depend libs" - FULL_DOCS "use to save depend libs of cocos2d lua project" -) \ No newline at end of file diff --git a/cmake/Modules/CocosConfigDefine.cmake b/cmake/Modules/CocosConfigDefine.cmake new file mode 100644 index 000000000000..45250835d27f --- /dev/null +++ b/cmake/Modules/CocosConfigDefine.cmake @@ -0,0 +1,135 @@ + #Please use them everywhere + #WINDOWS = Windows Desktop + #ANDROID = Android + #IOS = iOS + #MACOSX = MacOS X + #LINUX = Linux + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(WINDOWS TRUE) + set(PLATFORM_FOLDER win32) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android") + set(PLATFORM_FOLDER android) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + if(ANDROID) + set(PLATFORM_FOLDER android) + else() + set(LINUX TRUE) + set(PLATFORM_FOLDER linux) + endif() + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if(IOS) + set(APPLE TRUE) + set(PLATFORM_FOLDER ios) + else() + set(APPLE TRUE) + set(MACOSX TRUE) + set(PLATFORM_FOLDER mac) + endif() + else() + message(FATAL_ERROR "Unsupported platform, CMake will exit") + return() + endif() + +# generators that are capable of organizing into a hierarchy of folders +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +# simplify generator condition, please use them everywhere +if(CMAKE_GENERATOR STREQUAL Xcode) + set(XCODE TRUE) +elseif(CMAKE_GENERATOR MATCHES Visual) + set(VS TRUE) +endif() +message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Reset the configurations to what we need" FORCE) + message(STATUS "CMAKE_CONFIGURATION_TYPES: ${CMAKE_CONFIGURATION_TYPES}") +else() + if(NOT CMAKE_BUILD_TYPE) + if(DEBUG_MODE) # build mode, Debug is default value + set(CMAKE_BUILD_TYPE Debug) + else() + set(CMAKE_BUILD_TYPE Release) + endif() + endif() + message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +endif() + +# custom target property for lua/js link +define_property(TARGET + PROPERTY CC_JS_DEPEND + BRIEF_DOCS "cocos2d js depend libs" + FULL_DOCS "use to save depend libs of cocos2d js project" +) +define_property(TARGET + PROPERTY CC_LUA_DEPEND + BRIEF_DOCS "cocos2d lua depend libs" + FULL_DOCS "use to save depend libs of cocos2d lua project" +) + +# check c++ standard +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# check visual studio version + if(WINDOWS) + # not support other compile tools except MSVC for now + if(MSVC) + # Visual Studio 2015, MSVC_VERSION 1900 (v140 toolset) + # Visual Studio 2017, MSVC_VERSION 1910-1919 (v141 toolset) + if(${MSVC_VERSION} EQUAL 1900 OR ${MSVC_VERSION} GREATER 1900) + message(STATUS "using Windows MSVC generate cocos2d-x project, MSVC_VERSION:${MSVC_VERSION}") + else() + message(FATAL_ERROR "using Windows MSVC generate cocos2d-x project, MSVC_VERSION:${MSVC_VERSION} lower than needed") + endif() + else() + message(FATAL_ERROR "please using Windows MSVC compile cocos2d-x project, support other compile tools not yet") + endif() +endif() + + # Set macro definitions for special platforms + function(use_cocos2dx_compile_define target) + target_compile_definitions(${target} PUBLIC $<$:COCOS2D_DEBUG=1>) + if(APPLE) + target_compile_definitions(${target} PUBLIC __APPLE__) + target_compile_definitions(${target} PUBLIC USE_FILE32API) + elseif(LINUX) + target_compile_definitions(${target} PUBLIC LINUX) + target_compile_definitions(${target} PUBLIC _GNU_SOURCE) + elseif(ANDROID) + target_compile_definitions(${target} PUBLIC ANDROID) + target_compile_definitions(${target} PUBLIC USE_FILE32API) + elseif(WINDOWS) + target_compile_definitions(${target} + PUBLIC WIN32 + PUBLIC _WIN32 + PUBLIC _WINDOWS + PUBLIC UNICODE + PUBLIC _UNICODE + PUBLIC _CRT_SECURE_NO_WARNINGS + PUBLIC _SCL_SECURE_NO_WARNINGS + ) + if(BUILD_SHARED_LIBS) + target_compile_definitions(${target} + PUBLIC _USRDLL + PUBLIC _EXPORT_DLL_ + PUBLIC _USEGUIDLL + PUBLIC _USREXDLL + PUBLIC _USRSTUDIODLL + PUBLIC _USE3DDLL + ) + else() + target_compile_definitions(${target} PUBLIC CC_STATIC) + endif() + endif() +endfunction() + + # Set compiler options + function(use_cocos2dx_compile_options target) + if(MSVC) + target_compile_options(${target} + PUBLIC /MP + ) + endif() + endfunction() diff --git a/cmake/Modules/CocosConfigDepend.cmake b/cmake/Modules/CocosConfigDepend.cmake index 5602a0dd6d2f..2850686849d8 100644 --- a/cmake/Modules/CocosConfigDepend.cmake +++ b/cmake/Modules/CocosConfigDepend.cmake @@ -87,62 +87,8 @@ macro(cocos2dx_depend) endif() endmacro() -macro(cocos2dx_define) - - if(USE_JPEG) - add_definitions(-DCC_USE_JPEG=1) - else() - add_definitions(-DCC_USE_JPEG=0) - endif() - - if(USE_WEBP) - add_definitions(-DCC_USE_WEBP=1) - else() - add_definitions(-DCC_USE_WEBP=0) - endif() - - if(USE_TIFF) - add_definitions(-DCC_USE_TIFF=1) - else() - add_definitions(-DCC_USE_TIFF=0) - endif() - - if(USE_PNG) - add_definitions(-DCC_USE_PNG=1) - else() - add_definitions(-DCC_USE_PNG=0) - endif() - - if(USE_CHIPMUNK) - add_definitions(-DCC_USE_PHYSICS=1) - add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=1) - else() - add_definitions(-DCC_USE_PHYSICS=0) - add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=0) - endif() - - if(USE_BOX2D) - add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1) - else() - add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=0) - endif(USE_BOX2D) - - if(USE_BULLET) - add_definitions(-DCC_USE_3D_PHYSICS=1) - add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=1) - else(USE_BULLET) - add_definitions(-DCC_USE_3D_PHYSICS=0) - add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=0) - endif(USE_BULLET) - - # tocheck, libuv option - add_definitions(-DLWS_WITH_LIBUV) -endmacro() - - -macro(target_use_cocos2dx_depend target) +macro(use_cocos2dx_libs_depend target) cocos2dx_depend() - cocos2dx_define() foreach(platform_lib ${PLATFORM_SPECIFIC_LIBS}) target_link_libraries(${target} ${platform_lib}) endforeach() diff --git a/cmake/Modules/CocosSelectModule.cmake b/cmake/Modules/CocosSelectModule.cmake deleted file mode 100644 index bd3918c1ea58..000000000000 --- a/cmake/Modules/CocosSelectModule.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# the default behavior of build module -set(BUILD_LUA_LIBS_DEFAULT OFF) -set(BUILD_JS_LIBS_DEFAULT OFF) - -option(USE_CHIPMUNK "Use chipmunk for physics library" ON) -option(USE_BOX2D "Use box2d for physics library" OFF) -option(USE_BULLET "Use bullet for physics3d library" ON) -option(USE_RECAST "Use Recast for navigation mesh" ON) -option(USE_WEBP "Use WebP codec" ON) -option(USE_PNG "Use PNG codec" ON) -option(USE_TIFF "Use TIFF codec" ON) -option(USE_JPEG "Use JPEG codec" ON) -option(BUILD_SHARED_LIBS "Build shared libraries" OFF) -option(DEBUG_MODE "Debug or Release?" ON) -option(BUILD_EXTENSIONS "Build extension library" ON) -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_LUA_LIBS "Build lua libraries" ${BUILD_LUA_LIBS_DEFAULT}) -option(BUILD_JS_LIBS "Build js libraries" ${BUILD_JS_LIBS_DEFAULT}) - diff --git a/cmake/Modules/PreventInSourceBuilds.cmake b/cmake/Modules/PreventInSourceBuilds.cmake new file mode 100644 index 000000000000..12e03009ba60 --- /dev/null +++ b/cmake/Modules/PreventInSourceBuilds.cmake @@ -0,0 +1,47 @@ +# Adapated from ITKv4/CMake/PreventInSourceBuilds.cmake +# +# This function will prevent in-source builds +function(AssureOutOfSourceBuilds) + # make sure the user doesn't play dirty with symlinks + get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) + get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) + + # disallow in-source builds + if("${srcdir}" STREQUAL "${bindir}") + message("######################################################") + message("# Cocos2d-x should not be configured & built in the Cocos2d-x source directory") + message("# You must run cmake in a build directory.") + message("# For example:") + message("# mkdir Cocos ; cd Cocos") + message("# download & unpack the Cocos2d-x tarball") + message("# mkdir Cocos2d-x-Build") + message("# this will create the following directory structure") + message("#") + message("# Cocos") + message("# +--Cocos2d-x") + message("# +--Cocos2d-x-Build") + message("#") + message("# Then you can proceed to configure and build") + message("# by using the following commands") + message("#") + message("# cd Cocos2d-x-Build") + message("# cmake ../Cocos2d-x # or ccmake, or cmake-gui ") + message("# make") + message("#") + message("# NOTE: Given that you already tried to make an in-source build") + message("# CMake have already created several files & directories") + message("# in your source tree. run 'git status' to find them and") + message("# remove them by doing:") + message("#") + message("# cd Cocos/Cocos2d-x") + message("# git clean -n -d") + message("# git clean -f -d") + message("# git checkout --") + message("#") + message("######################################################") + message(FATAL_ERROR "Quitting configuration") + endif() +endfunction() + +AssureOutOfSourceBuilds() + diff --git a/cmake/Modules/iOSBundleInfo.plist.in b/cmake/Modules/iOSBundleInfo.plist.in index f6b35ef1da01..fa2a779a2d05 100644 --- a/cmake/Modules/iOSBundleInfo.plist.in +++ b/cmake/Modules/iOSBundleInfo.plist.in @@ -38,8 +38,8 @@ LaunchScreen UISupportedInterfaceOrientations - UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationLandscapeLeft NSHumanReadableCopyright ${MACOSX_BUNDLE_COPYRIGHT} diff --git a/cmake/README.md b/cmake/README.md index c5c1c33b1883..8bf6e8c2d80f 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -8,7 +8,7 @@ CMake is an open-source, cross-platform family of tools designed to build, test ```sh cmake --version ``` -if the CMake version is lower than 3.1, please upgrade. +if the CMake version is lower than 3.6, please upgrade. 2. You should use __out-of-source__ builds, this means you need to create a different directory than __cocos2d-x__ to execute the `cmake` command. @@ -33,7 +33,14 @@ mkdir win32-build && cd win32-build cmake .. -G"Visual Studio 15 2017" -Tv141 ``` -Execute `cmake --build .` to compile, or open __Cocos2d-x.sln__ in Explorer to use the generated project. +Execute `cmake --build .` to compile, +``` +cmake --build . --config Debug +cmake --build . --config Release +``` +or open __Cocos2d-x.sln__ in Explorer to use the generated project. + +If can't found `MSVCR110.dll` issue occurs to you, please install this [Visual C++ Runtime Libraries](https://www.microsoft.com/en-us/download/details.aspx?id=30679), when runing the cpp-tests project ### Generate macOS Project @@ -53,7 +60,9 @@ cmake .. -GXcode -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake open Cocos2d-x.xcodeproj ``` -The default build is for running on actual iOS hardware, if you want to run in the simulator, please add `-DIOS_PLATFORM=SIMULATOR` for architecture i386 or `-DIOS_PLATFORM=SIMULATOR64` for x86_64. +The default build is for running on iOS device, if you want to run in the simulator, please add `-DIOS_PLATFORM=SIMULATOR` for architecture i386 or `-DIOS_PLATFORM=SIMULATOR64` for x86_64, but remember you can't run metal-support app in simulator because Apple limitation. + +if you want to sign iOS app in CMake, you will need to fill development team ID into `set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")`, or select to sign in Xcode after project files generated. ### Android Studio @@ -91,6 +100,11 @@ If you want to add cmake build arguments, please add it at [external Native Buil * `cmake --build ./msvc_build`, cmake will sellect corresponding build tools. +## Tips + +1. Use `cmake ..` to refersh resources and code files, after you modify `Resources` or `CMakeLists.txt`. +1. Don't need `CMAKE_BUILD_TYPE` options when `-G` Xcode or Visual Studio, CMake scripts will generate both configurations, so you can switch `Debug` and `Release` in IDE. + ## Useful Links * CMake Official website: [cmake.org](https://cmake.org/) diff --git a/cmake/ios.toolchain.cmake b/cmake/ios.toolchain.cmake index 3d4490c2c8c9..3d9bd3050c47 100644 --- a/cmake/ios.toolchain.cmake +++ b/cmake/ios.toolchain.cmake @@ -35,8 +35,9 @@ set(UNIX True) set(APPLE True) set(IOS True) -# Required as of cmake 2.8.10 -set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE) +# support iOS on cmake 3.11+ +# cmake 3.11 milestone feature, https://gitlab.kitware.com/cmake/cmake/issues/17431 +set(CMAKE_OSX_DEPLOYMENT_TARGET "8.0" CACHE STRING "set of the deployment target for iOS" FORCE) # Determine the cmake host system version so we know where to find the iOS SDKs find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) @@ -203,4 +204,13 @@ macro(find_host_package) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endmacro(find_host_package) \ No newline at end of file +endmacro(find_host_package) + +# This macro lets you find library on the host system +macro(find_host_library) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + + find_library(${ARGN}) + + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +endmacro(find_host_library) diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index bbc54a655461..b18388915886 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -88,8 +88,8 @@ void ExtraAction::step(float /*dt*/) bool ActionInterval::initWithDuration(float d) { - _duration = d; + _duration = std::abs(d) <= MATH_EPSILON ? MATH_EPSILON : d; _elapsed = 0; _firstTick = true; _done = false; @@ -119,7 +119,7 @@ void ActionInterval::step(float dt) if (_firstTick) { _firstTick = false; - _elapsed = 0; + _elapsed = MATH_EPSILON; } else { @@ -481,7 +481,7 @@ Repeat::~Repeat() void Repeat::startWithTarget(Node *target) { _total = 0; - _nextDt = _innerAction->getDuration()/_duration; + _nextDt = _innerAction->getDuration() / _duration; ActionInterval::startWithTarget(target); _innerAction->startWithTarget(target); } diff --git a/cocos/2d/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp index d51a1b7811a9..92595a8c5cc1 100644 --- a/cocos/2d/CCActionProgressTimer.cpp +++ b/cocos/2d/CCActionProgressTimer.cpp @@ -26,13 +26,13 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCActionProgressTimer.h" #include "2d/CCProgressTimer.h" +#include "ui/UILoadingBar.h" NS_CC_BEGIN #define kProgressTimerCast ProgressTimer* // implementation of ProgressTo - ProgressTo* ProgressTo::create(float duration, float percent) { ProgressTo *progressTo = new (std::nothrow) ProgressTo(); @@ -41,7 +41,6 @@ ProgressTo* ProgressTo::create(float duration, float percent) progressTo->autorelease(); return progressTo; } - delete progressTo; return nullptr; } @@ -73,12 +72,23 @@ ProgressTo* ProgressTo::reverse() const void ProgressTo::startWithTarget(Node *target) { ActionInterval::startWithTarget(target); - _from = ((kProgressTimerCast)(target))->getPercentage(); + + ui::LoadingBar* loading_bar = dynamic_cast(target); + if (loading_bar){ + _from = loading_bar->getPercent(); + } else { + _from = static_cast(target)->getPercentage(); + }; } void ProgressTo::update(float time) { - ((kProgressTimerCast)(_target))->setPercentage(_from + (_to - _from) * time); + ui::LoadingBar* loading_bar = dynamic_cast(_target); + if (loading_bar){ + loading_bar->setPercent(_from + (_to - _from) * time); + } else { + static_cast(_target)->setPercentage(_from + (_to - _from) * time); + }; } // implementation of ProgressFromTo @@ -90,14 +100,14 @@ ProgressFromTo* ProgressFromTo::create(float duration, float fromPercentage, flo progressFromTo->autorelease(); return progressFromTo; } - + delete progressFromTo; return nullptr; } bool ProgressFromTo::initWithDuration(float duration, float fromPercentage, float toPercentage) { - if (ActionInterval::initWithDuration(duration)) + if (ActionInterval::initWithDuration(duration)) { _to = toPercentage; _from = fromPercentage; @@ -127,7 +137,12 @@ void ProgressFromTo::startWithTarget(Node *target) void ProgressFromTo::update(float time) { - ((kProgressTimerCast)(_target))->setPercentage(_from + (_to - _from) * time); + ui::LoadingBar* loading_bar = dynamic_cast(_target); + if (loading_bar){ + loading_bar->setPercent(_from + (_to - _from) * time); + } else { + static_cast(_target)->setPercentage(_from + (_to - _from) * time); + }; } NS_CC_END diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index e1e42ef2c1e8..186e59783f2b 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -33,6 +33,7 @@ #include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCFrameBuffer.h" #include "renderer/CCRenderState.h" diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 5c8bdf347815..330c2c357cb7 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -26,9 +26,9 @@ #include "2d/CCCameraBackgroundBrush.h" #include "2d/CCCamera.h" #include "base/ccMacros.h" -#include "base/ccUtils.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgramState.h" @@ -115,7 +115,7 @@ CameraBackgroundDepthBrush::~CameraBackgroundDepthBrush() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -168,7 +168,7 @@ void CameraBackgroundDepthBrush::initBuffer() if (supportVAO) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } glGenBuffers(1, &_vertexBuffer); @@ -196,7 +196,7 @@ void CameraBackgroundDepthBrush::initBuffer() } if (supportVAO) - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); @@ -227,13 +227,11 @@ void CameraBackgroundDepthBrush::drawBackground(Camera* /*camera*/) auto supportVAO = Configuration::getInstance()->supportsShareableVAO(); if (supportVAO) - glBindVertexArray(_vao); + GL::bindVAO(_vao); else { glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); // vertices glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_T2F, vertices)); @@ -250,7 +248,7 @@ void CameraBackgroundDepthBrush::drawBackground(Camera* /*camera*/) glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr); if (supportVAO) - glBindVertexArray(0); + GL::bindVAO(0); else { glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -305,7 +303,7 @@ bool CameraBackgroundColorBrush::init() void CameraBackgroundColorBrush::drawBackground(Camera* camera) { - utils::setBlending(BlendFunc::ALPHA_NON_PREMULTIPLIED.src, BlendFunc::ALPHA_NON_PREMULTIPLIED.dst); + GL::blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED.src, BlendFunc::ALPHA_NON_PREMULTIPLIED.dst); CameraBackgroundDepthBrush::drawBackground(camera); } @@ -379,7 +377,7 @@ CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -482,11 +480,11 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POSITION); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vec3), nullptr); @@ -498,7 +496,7 @@ void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } else { @@ -533,14 +531,14 @@ void CameraBackgroundSkyBoxBrush::initBuffer() if (Configuration::getInstance()->supportsShareableVAO() && _vao) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } // init vertex buffer object @@ -572,7 +570,7 @@ void CameraBackgroundSkyBoxBrush::initBuffer() glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); _glProgramState->applyAttributes(false); - glBindVertexArray(0); + GL::bindVAO(0); } } diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index ed3563cde980..69fbfbb70b1b 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -29,6 +29,7 @@ #include "2d/CCClippingNode.h" #include "2d/CCDrawingPrimitives.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" #include "base/CCDirector.h" diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 53a9f6df6bfa..d7420bde17fc 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -26,6 +26,7 @@ #include "base/CCEventType.h" #include "base/CCConfiguration.h" #include "renderer/CCRenderer.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgramCache.h" #include "base/CCDirector.h" @@ -33,7 +34,6 @@ #include "base/CCEventDispatcher.h" #include "2d/CCActionCatmullRom.h" #include "platform/CCGL.h" -#include "base/ccUtils.h" NS_CC_BEGIN @@ -134,7 +134,7 @@ DrawNode::~DrawNode() if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); glDeleteVertexArrays(1, &_vao); glDeleteVertexArrays(1, &_vaoGLLine); glDeleteVertexArrays(1, &_vaoGLPoint); @@ -195,7 +195,7 @@ void DrawNode::setupBuffer() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); glGenBuffers(1, &_vbo); glBindBuffer(GL_ARRAY_BUFFER, _vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW); @@ -210,7 +210,7 @@ void DrawNode::setupBuffer() glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); glGenVertexArrays(1, &_vaoGLLine); - glBindVertexArray(_vaoGLLine); + GL::bindVAO(_vaoGLLine); glGenBuffers(1, &_vboGLLine); glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine); glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLLine, _bufferGLLine, GL_STREAM_DRAW); @@ -225,7 +225,7 @@ void DrawNode::setupBuffer() glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); glGenVertexArrays(1, &_vaoGLPoint); - glBindVertexArray(_vaoGLPoint); + GL::bindVAO(_vaoGLPoint); glGenBuffers(1, &_vboGLPoint); glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint); glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW); @@ -239,7 +239,7 @@ void DrawNode::setupBuffer() glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, 0); } @@ -310,7 +310,7 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t /*flags*/) getGLProgramState()->apply(transform); auto glProgram = this->getGLProgram(); glProgram->setUniformLocationWith1f(glProgram->getUniformLocation("u_alpha"), _displayedOpacity / 255.0); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirty) { @@ -321,13 +321,11 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t /*flags*/) } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex @@ -343,7 +341,7 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferCount); @@ -357,7 +355,7 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t /*flags*/) glProgram->setUniformsForBuiltins(transform); glProgram->setUniformLocationWith1f(glProgram->getUniformLocation("u_alpha"), _displayedOpacity / 255.0); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirtyGLLine) { @@ -367,14 +365,12 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t /*flags*/) } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vaoGLLine); + GL::bindVAO(_vaoGLLine); } else { glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); // vertex glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); // color @@ -388,7 +384,7 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -404,7 +400,7 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t /*flags*/) glProgram->setUniformsForBuiltins(transform); glProgram->setUniformLocationWith1f(glProgram->getUniformLocation("u_alpha"), _displayedOpacity / 255.0); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirtyGLPoint) { @@ -416,14 +412,12 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vaoGLPoint); + GL::bindVAO(_vaoGLPoint); } else { glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); @@ -433,7 +427,7 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/cocos/2d/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp index fd445afd0f49..aa1bd06c9976 100644 --- a/cocos/2d/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -44,6 +44,7 @@ THE SOFTWARE. #include "2d/CCActionCatmullRom.h" #include "base/CCDirector.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCRenderer.h" #include "platform/CCGL.h" @@ -110,7 +111,7 @@ void drawPoint(const Vec2& point) p.x = point.x; p.y = point.y; - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); s_shader->use(); s_shader->setUniformsForBuiltins(); @@ -128,7 +129,7 @@ void drawPoints( const Vec2 *points, unsigned int numberOfPoints ) { lazy_init(); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); s_shader->use(); s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); @@ -154,7 +155,7 @@ void drawLine(const Vec2& origin, const Vec2& destination) s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_LINES, 0, 2); @@ -189,7 +190,8 @@ void drawPoly(const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon) s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, poli); if( closePolygon ) @@ -208,7 +210,8 @@ void drawSolidPoly(const Vec2 *poli, unsigned int numberOfPoints, Color4F color) s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, poli); glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) numberOfPoints); @@ -244,7 +247,8 @@ void drawCircle( const Vec2& center, float radius, float angle, unsigned int seg s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments+additionalSegment); @@ -283,7 +287,8 @@ void drawSolidCircle( const Vec2& center, float radius, float angle, unsigned in s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) segments+1); @@ -318,7 +323,8 @@ void drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destina s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1); CC_SAFE_DELETE_ARRAY(vertices); @@ -369,7 +375,8 @@ void drawCardinalSpline( PointArray *config, float tension, unsigned int segmen s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*)&s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1); @@ -397,7 +404,8 @@ void drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& contr s_shader->setUniformsForBuiltins(); s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1); CC_SAFE_DELETE_ARRAY(vertices); diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 5f7d0b6cae96..54b09d2227cb 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -41,6 +41,7 @@ THE SOFTWARE. #include "2d/CCCamera.h" #include "renderer/CCTextureCache.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCVertexIndexBuffer.h" #include "base/CCDirector.h" @@ -186,11 +187,10 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags) void TMXLayer::onDraw(Primitive *primitive) { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); + GL::bindTexture2D(_texture->getName()); getGLProgramState()->apply(_modelViewTransform); - glBindVertexArray(0); + GL::bindVAO(0); primitive->draw(); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); @@ -292,7 +292,7 @@ void TMXLayer::updateTiles(const Rect& culledRect) void TMXLayer::updateVertexBuffer() { - glBindVertexArray(0); + GL::bindVAO(0); if(nullptr == _vData) { _vertexBuffer = VertexBuffer::create(sizeof(V3F_C4B_T2F), (int)_totalQuads.size() * 4); diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index b03bd37e8534..7253947e5488 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -71,8 +71,6 @@ FontAtlas::FontAtlas(Font &theFont) { _letterPadding += 2 * FontFreeType::DistanceMapSpread; } - - reinit(); #if CC_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -343,7 +341,10 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) { return false; } - + + if (!_currentPageData) + reinit(); + std::unordered_map codeMapOfNewChar; findNewCharacters(utf32Text, codeMapOfNewChar); if (codeMapOfNewChar.empty()) @@ -486,9 +487,9 @@ std::string FontAtlas::getFontName() const { std::string fontName = _fontFreeType ? _fontFreeType->getFontName() : ""; if(fontName.empty()) return fontName; - auto idx = fontName.rfind("/"); + auto idx = fontName.rfind('/'); if (idx != std::string::npos) { return fontName.substr(idx + 1); } - idx = fontName.rfind("\\"); + idx = fontName.rfind('\\'); if (idx != std::string::npos) { return fontName.substr(idx + 1); } return fontName; } diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 8913ec734b05..1c7128d01c76 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -36,7 +36,7 @@ NS_CC_BEGIN std::unordered_map FontAtlasCache::_atlasMap; -#define ATLAS_MAP_KEY_BUFFER 255 +#define ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE 255 void FontAtlasCache::purgeCachedData() { @@ -60,15 +60,11 @@ FontAtlas* FontAtlasCache::getFontAtlasTTF(const _ttfConfig* config) useDistanceField = false; } - char tmp[ATLAS_MAP_KEY_BUFFER]; - if (useDistanceField) { - snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "df %.2f %d %s", config->fontSize, config->outlineSize, - realFontFilename.c_str()); - } else { - snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %d %s", config->fontSize, config->outlineSize, - realFontFilename.c_str()); - } - std::string atlasName = tmp; + std::string key; + char keyPrefix[ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE]; + snprintf(keyPrefix, ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE, useDistanceField ? "df %.2f %d " : "%.2f %d ", config->fontSize, config->outlineSize); + std::string atlasName(keyPrefix); + atlasName += realFontFilename; auto it = _atlasMap.find(atlasName); @@ -95,9 +91,10 @@ FontAtlas* FontAtlasCache::getFontAtlasTTF(const _ttfConfig* config) FontAtlas* FontAtlasCache::getFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset /* = Vec2::ZERO */) { auto realFontFilename = FileUtils::getInstance()->getNewFilename(fontFileName); // resolves real file path, to prevent storing multiple atlases for the same file. - char tmp[ATLAS_MAP_KEY_BUFFER]; - snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %s", imageOffset.x, imageOffset.y, realFontFilename.c_str()); - std::string atlasName = tmp; + char keyPrefix[ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE]; + snprintf(keyPrefix, ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE, "%.2f %.2f ", imageOffset.x, imageOffset.y); + std::string atlasName(keyPrefix); + atlasName += realFontFilename; auto it = _atlasMap.find(atlasName); if ( it == _atlasMap.end() ) @@ -147,9 +144,9 @@ FontAtlas* FontAtlasCache::getFontAtlasCharMap(const std::string& plistFile) FontAtlas* FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap) { - char tmp[30]; - sprintf(tmp,"name:%u_%d_%d_%d",texture->getName(),itemWidth,itemHeight,startCharMap); - std::string atlasName = tmp; + char key[ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE]; + sprintf(key,"name:%u_%d_%d_%d",texture->getName(),itemWidth,itemHeight,startCharMap); + std::string atlasName = key; auto it = _atlasMap.find(atlasName); if ( it == _atlasMap.end() ) @@ -174,9 +171,10 @@ FontAtlas* FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidth FontAtlas* FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap) { - char tmp[ATLAS_MAP_KEY_BUFFER]; - snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%d %d %d %s", itemWidth, itemHeight, startCharMap, charMapFile.c_str()); - std::string atlasName = tmp; + char keyPrefix[ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE]; + snprintf(keyPrefix, ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE, "%d %d %d ", itemWidth, itemHeight, startCharMap); + std::string atlasName(keyPrefix); + atlasName += charMapFile; auto it = _atlasMap.find(atlasName); if ( it == _atlasMap.end() ) @@ -224,9 +222,10 @@ bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) void FontAtlasCache::reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset/* = Vec2::ZERO*/) { - char tmp[ATLAS_MAP_KEY_BUFFER]; - snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %s", imageOffset.x, imageOffset.y, fontFileName.c_str()); - std::string atlasName = tmp; + char keyPrefix[ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE]; + snprintf(keyPrefix, ATLAS_MAP_KEY_PREFIX_BUFFER_SIZE, "%.2f %.2f ", imageOffset.x, imageOffset.y); + std::string atlasName(keyPrefix); + atlasName += fontFileName; auto it = _atlasMap.find(atlasName); if (it != _atlasMap.end()) diff --git a/cocos/2d/CCFontCharMap.cpp b/cocos/2d/CCFontCharMap.cpp index 0b08dc238e2c..ab958166aba4 100644 --- a/cocos/2d/CCFontCharMap.cpp +++ b/cocos/2d/CCFontCharMap.cpp @@ -35,7 +35,7 @@ NS_CC_BEGIN FontCharMap * FontCharMap::create(const std::string& plistFile) { std::string pathStr = FileUtils::getInstance()->fullPathForFilename(plistFile); - std::string relPathStr = pathStr.substr(0, pathStr.find_last_of("/"))+"/"; + std::string relPathStr = pathStr.substr(0, pathStr.find_last_of('/'))+"/"; ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr); diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 1ba97a585493..970051468c43 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -32,7 +32,7 @@ #include "2d/CCFont.h" #include -#include +#include "ft2build.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #define generic GenericFromFreeTypeLibrary diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index bc6f20487935..e7d00ed88f06 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -32,6 +32,7 @@ THE SOFTWARE. #include "2d/CCGrabber.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" #include "renderer/CCTexture2D.h" @@ -208,6 +209,8 @@ void GridBase::set2DProjection() director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + + GL::setProjectionMatrixDirty(); } void GridBase::setGridRect(const cocos2d::Rect &rect) @@ -253,8 +256,7 @@ void GridBase::afterDraw(cocos2d::Node * /*target*/) // kmGLTranslatef(-offset.x, -offset.y, 0); // } - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); + GL::bindTexture2D(_texture->getName()); // restore projection for default FBO .fixed bug #543 #544 //TODO: Director::getInstance()->setProjection(Director::getInstance()->getProjection()); @@ -417,8 +419,7 @@ void Grid3D::blit(void) { int n = _gridSize.width * _gridSize.height; - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORD ); _shaderProgram->use(); _shaderProgram->setUniformsForBuiltins(); @@ -664,8 +665,7 @@ void TiledGrid3D::blit(void) // // Attributes // - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORD ); // position glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _vertices); diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 468f175eea8c..a327885d3945 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -38,11 +38,11 @@ #include "base/ccUTF8.h" #include "platform/CCFileUtils.h" #include "renderer/CCRenderer.h" +#include "renderer/ccGLStateCache.h" #include "base/CCDirector.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" #include "base/CCEventCustom.h" -#include "base/ccUtils.h" #include "2d/CCFontFNT.h" NS_CC_BEGIN @@ -677,6 +677,13 @@ void Label::setString(const std::string& text) { _utf32Text = utf32String; } + + CCASSERT(_utf32Text.length() <= CC_LABEL_MAX_LENGTH, "Length of text should be less then 16384"); + if (_utf32Text.length() > CC_LABEL_MAX_LENGTH) + { + cocos2d::log("Error: Label text is too long %d > %d and it will be truncated!", _utf32Text.length(), CC_LABEL_MAX_LENGTH); + _utf32Text = _utf32Text.substr(0, CC_LABEL_MAX_LENGTH); + } } } @@ -1539,7 +1546,7 @@ void Label::onDraw(const Mat4& transform, bool /*transformUpdated*/) { auto glprogram = getGLProgram(); glprogram->use(); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_shadowEnabled) { @@ -2092,6 +2099,7 @@ FontDefinition Label::_getFontDefinition() const systemFontDef._fontSize = _systemFontSize; systemFontDef._alignment = _hAlignment; systemFontDef._vertAlignment = _vAlignment; + systemFontDef._lineSpacing = _lineSpacing; systemFontDef._dimensions.width = _labelWidth; systemFontDef._dimensions.height = _labelHeight; systemFontDef._fontFillColor.r = _textColor.r; diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index bf451b04e169..95a88c34a4e9 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -559,7 +559,7 @@ class CC_DLL Label : public Node, public LabelProtocol, public BlendProtocol @warning Not support system font. @return the type of label - @since v3.18.0 + @since v3.17.1 */ LabelType getLabelType() const { return _currentLabelType; } diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 70eaed844771..091d2a4ea149 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -105,7 +105,7 @@ LabelAtlas* LabelAtlas::create(const std::string& string, const std::string& fnt bool LabelAtlas::initWithString(const std::string& theString, const std::string& fntFile) { std::string pathStr = FileUtils::getInstance()->fullPathForFilename(fntFile); - std::string relPathStr = pathStr.substr(0, pathStr.find_last_of("/"))+"/"; + std::string relPathStr = pathStr.substr(0, pathStr.find_last_of('/'))+"/"; ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr); diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 697b69c6653b..e860ced5cab9 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -29,9 +29,9 @@ THE SOFTWARE. #include #include "2d/CCLayer.h" #include "base/CCScriptSupport.h" -#include "base/ccUtils.h" #include "platform/CCDevice.h" #include "renderer/CCRenderer.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramState.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" @@ -620,8 +620,7 @@ void LayerColor::onDraw(const Mat4& transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR ); // // Attributes @@ -630,7 +629,7 @@ void LayerColor::onDraw(const Mat4& transform, uint32_t /*flags*/) glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc( _blendFunc.src, _blendFunc.dst ); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); @@ -951,7 +950,7 @@ void LayerRadialGradient::onDraw(const Mat4& transform, uint32_t /*flags*/) program->setUniformLocationWith1f(_uniformLocationExpand, _expand); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION); // // Attributes @@ -959,7 +958,7 @@ void LayerRadialGradient::onDraw(const Mat4& transform, uint32_t /*flags*/) glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, _vertices); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index 308102a81966..b0f87dc8ba9b 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -28,8 +28,8 @@ THE SOFTWARE. #include "2d/CCMotionStreak.h" #include "math/CCVertex.h" #include "base/CCDirector.h" -#include "base/ccUtils.h" #include "renderer/CCTextureCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCTexture2D.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramState.h" @@ -383,13 +383,10 @@ void MotionStreak::onDraw(const Mat4 &transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); + GL::blendFunc( _blendFunc.src, _blendFunc.dst ); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); + GL::bindTexture2D( _texture ); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, _vertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, _texCoords); diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index a14e4540d97f..1721ccd604a0 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -35,6 +35,7 @@ THE SOFTWARE. #include "2d/CCSpriteFrame.h" #include "2d/CCParticleBatchNode.h" #include "renderer/CCTextureAtlas.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "base/CCDirector.h" #include "base/CCEventType.h" @@ -63,7 +64,7 @@ ParticleSystemQuad::~ParticleSystemQuad() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_VAOname); - glBindVertexArray(0); + GL::bindVAO(0); } } } @@ -547,10 +548,10 @@ void ParticleSystemQuad::setupVBOandVAO() // clean VAO glDeleteBuffers(2, &_buffersVBO[0]); glDeleteVertexArrays(1, &_VAOname); - glBindVertexArray(0); + GL::bindVAO(0); glGenVertexArrays(1, &_VAOname); - glBindVertexArray(_VAOname); + GL::bindVAO(_VAOname); #define kQuadSize sizeof(_quads[0].bl) @@ -575,7 +576,7 @@ void ParticleSystemQuad::setupVBOandVAO() glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _totalParticles * 6, _indices, GL_STATIC_DRAW); // Must unbind the VAO before changing the element buffer. - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -679,7 +680,7 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode * batchNode) if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_VAOname); - glBindVertexArray(0); + GL::bindVAO(0); _VAOname = 0; } } diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index 66cddbcf049f..047fc8c8c82e 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -31,8 +31,8 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" #include "2d/CCSprite.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" -#include "base/ccUtils.h" NS_CC_BEGIN @@ -509,14 +509,11 @@ void ProgressTimer::onDraw(const Mat4 &transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - utils::setBlending(_sprite->getBlendFunc().src, _sprite->getBlendFunc().dst); + GL::blendFunc( _sprite->getBlendFunc().src, _sprite->getBlendFunc().dst ); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _sprite->getTexture()->getName()); + GL::bindTexture2D( _sprite->getTexture() ); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]) , &_vertexData[0].vertices); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]), &_vertexData[0].texCoords); diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 9eac614a751d..9d454cc9954e 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -79,23 +79,20 @@ SpriteFrameCache::~SpriteFrameCache() void SpriteFrameCache::parseIntegerList(const std::string &string, std::vector &res) { - std::string delim(" "); - size_t n = std::count(string.begin(), string.end(), ' '); - res.resize(n+1); - - size_t start = 0U; - size_t end = string.find(delim); - - int i=0; - while (end != std::string::npos) - { - res[i++] = atoi(string.substr(start, end - start).c_str()); - start = end + delim.length(); - end = string.find(delim, start); - } - - res[i] = atoi(string.substr(start, end).c_str()); + res.resize(n + 1); + + const char *cStr = string.c_str(); + char *endptr; + + int i = 0; + do { + long int val = strtol(cStr, &endptr, 10); + if (endptr == cStr) + return; + res[i++] = static_cast(val); + cStr = endptr; + } while (*endptr != '\0'); } void SpriteFrameCache::initializePolygonInfo(const Size &textureSize, @@ -293,6 +290,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu // add sprite frame _spriteFramesCache.insertFrame(plist, spriteFrameName, spriteFrame); } + _spriteFramesCache.markPlistFull(plist, true); CC_SAFE_DELETE(image); } @@ -350,11 +348,6 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dict, const std:: void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture2D *texture) { - if (_spriteFramesCache.hasPlist(plist)) - { - return; // We already added it - } - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); @@ -370,10 +363,6 @@ void SpriteFrameCache::addSpriteFramesWithFileContent(const std::string& plist_c void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) { CCASSERT(textureFileName.size()>0, "texture name should not be null"); - if (_spriteFramesCache.hasPlist(plist)) - { - return; // We already added it - } const std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); addSpriteFramesWithDictionary(dict, textureFileName, plist); @@ -383,6 +372,11 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist) { CCASSERT(!plist.empty(), "plist filename should not be nullptr"); + if (_spriteFramesCache.isPlistFull(plist)) + { + return; + } + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); if (fullPath.empty()) { @@ -391,45 +385,42 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist) return; } - if (!_spriteFramesCache.hasPlist(plist)) - { - ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); + ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); - string texturePath(""); + string texturePath(""); - if (dict.find("metadata") != dict.end()) - { - ValueMap& metadataDict = dict["metadata"].asValueMap(); - // try to read texture file name from meta data - texturePath = metadataDict["textureFileName"].asString(); - } + if (dict.find("metadata") != dict.end()) + { + ValueMap& metadataDict = dict["metadata"].asValueMap(); + // try to read texture file name from meta data + texturePath = metadataDict["textureFileName"].asString(); + } - if (!texturePath.empty()) - { - // build texture path relative to plist file - texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath, plist); - } - else - { - // build texture path by replacing file extension - texturePath = plist; + if (!texturePath.empty()) + { + // build texture path relative to plist file + texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath, plist); + } + else + { + // build texture path by replacing file extension + texturePath = plist; - // remove .xxx - size_t startPos = texturePath.find_last_of("."); - texturePath = texturePath.erase(startPos); + // remove .xxx + size_t startPos = texturePath.find_last_of('.'); + texturePath = texturePath.erase(startPos); - // append .png - texturePath = texturePath.append(".png"); + // append .png + texturePath = texturePath.append(".png"); - CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str()); - } - addSpriteFramesWithDictionary(dict, texturePath, plist); + CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str()); } + addSpriteFramesWithDictionary(dict, texturePath, plist); } bool SpriteFrameCache::isSpriteFramesWithFileLoaded(const std::string& plist) const { - return _spriteFramesCache.hasPlist(plist); + return _spriteFramesCache.isPlistUsed(plist) && _spriteFramesCache.isPlistFull(plist); } void SpriteFrameCache::addSpriteFrame(SpriteFrame* frame, const std::string& frameName) @@ -686,7 +677,7 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) { CCASSERT(plist.size()>0, "plist filename should not be nullptr"); - if (_spriteFramesCache.hasPlist(plist)) { + if (_spriteFramesCache.isPlistUsed(plist)) { _spriteFramesCache.erasePlistIndex(plist); } else @@ -718,7 +709,7 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) texturePath = plist; // remove .xxx - size_t startPos = texturePath.find_last_of("."); + size_t startPos = texturePath.find_last_of('.'); texturePath = texturePath.erase(startPos); // append .png @@ -749,21 +740,21 @@ void SpriteFrameCache::PlistFramesCache::insertFrame(const std::string &plist, c _indexFrame2plist[frame] = plist; //insert index frameName->plist } -bool SpriteFrameCache::PlistFramesCache::isPlistUsed(const std::string &plist) const -{ - //plist loaded && not empty - auto it = _indexPlist2Frames.find(plist); - return it != _indexPlist2Frames.end() && !it->second.empty(); -} - bool SpriteFrameCache::PlistFramesCache::eraseFrame(const std::string &frame) { _spriteFrames.erase(frame); //drop SpriteFrame auto itFrame = _indexFrame2plist.find(frame); if (itFrame != _indexFrame2plist.end()) { - _indexPlist2Frames[itFrame->second].erase(frame); //update index plist->[frameNames] + auto plist = itFrame->second; + markPlistFull(plist, false); + _indexPlist2Frames[plist].erase(frame); //update index plist->[frameNames] _indexFrame2plist.erase(itFrame); //update index frame->plist + // erase plist index if all frames was erased + if (_indexFrame2plist.empty()) + { + _indexPlist2Frames.erase(plist); + } return true; } return false; @@ -792,6 +783,7 @@ bool SpriteFrameCache::PlistFramesCache::erasePlistIndex(const std::string &plis _indexFrame2plist.erase(f); //erase plist frame frameName->plist } _indexPlist2Frames.erase(plist); //update index plist->[frameNames] + _isPlistFull.erase(plist); //erase full status return true; } @@ -800,6 +792,7 @@ void SpriteFrameCache::PlistFramesCache::clear() _indexPlist2Frames.clear(); _indexFrame2plist.clear(); _spriteFrames.clear(); + _isPlistFull.clear(); } bool SpriteFrameCache::PlistFramesCache::hasFrame(const std::string &frame) const @@ -807,10 +800,11 @@ bool SpriteFrameCache::PlistFramesCache::hasFrame(const std::string &frame) cons return _indexFrame2plist.find(frame) != _indexFrame2plist.end(); } -bool SpriteFrameCache::PlistFramesCache::hasPlist(const std::string &plist) const +bool SpriteFrameCache::PlistFramesCache::isPlistUsed(const std::string &plist) const { - return _indexPlist2Frames.find(plist) != _indexPlist2Frames.end(); -} + auto frames = _indexPlist2Frames.find(plist); + return frames != _indexPlist2Frames.end() && frames->second.size() > 0; +} SpriteFrame * SpriteFrameCache::PlistFramesCache::at(const std::string &frame) { diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index ca8e48ab1255..0f5e689a8b34 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -116,17 +116,22 @@ class CC_DLL SpriteFrameCache : public Ref void clear(); inline bool hasFrame(const std::string &frame) const; - inline bool hasPlist(const std::string &plist) const; + inline bool isPlistUsed(const std::string &plist) const; inline SpriteFrame *at(const std::string &frame); inline Map& getSpriteFrames(); - inline bool isPlistUsed(const std::string &plist) const; - + void markPlistFull(const std::string &plist, bool full) { _isPlistFull[plist] = full; } + bool isPlistFull(const std::string &plist) const + { + auto it = _isPlistFull.find(plist); + return it == _isPlistFull.end() ? false : it->second; + } private: Map _spriteFrames; std::unordered_map> _indexPlist2Frames; std::unordered_map _indexFrame2plist; + std::unordered_map _isPlistFull; }; public: diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 0ab60cea728b..06a38fc271a5 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -211,8 +211,9 @@ bool TMXMapInfo::parseXMLFile(const std::string& xmlFilename) } parser.setDelegator(this); - - return parser.parse(FileUtils::getInstance()->fullPathForFilename(xmlFilename)); + auto fullPath = FileUtils::getInstance()->fullPathForFilename(xmlFilename); + CCASSERT(FileUtils::getInstance()->isFileExist(fullPath), "TMXMapInfo::parseXMLFile xml file not exists"); + return parser.parse(fullPath); } // the XML parser calls here with all the elements @@ -297,9 +298,9 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char *name, const char **atts _externalTilesetFilename = externalTilesetFilename; // Tileset file will be relative to the map file. So we need to convert it to an absolute path - if (_TMXFileName.find_last_of("/") != string::npos) + if (_TMXFileName.find_last_of('/') != string::npos) { - string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of("/") + 1); + string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of('/') + 1); externalTilesetFilename = dir + externalTilesetFilename; } else @@ -314,7 +315,7 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char *name, const char **atts _currentFirstGID = 0; } _recordFirstGID = false; - + _externalTilesetFullPath = externalTilesetFilename; tmxMapInfo->parseXMLFile(externalTilesetFilename); } else @@ -431,9 +432,14 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char *name, const char **atts std::string imagename = attributeDict["source"].asString(); tileset->_originSourceImage = imagename; - if (_TMXFileName.find_last_of("/") != string::npos) + if (!_externalTilesetFullPath.empty()) + { + string dir = _externalTilesetFullPath.substr(0, _externalTilesetFullPath.find_last_of('/') + 1); + tileset->_sourceImage = dir + imagename; + } + else if (_TMXFileName.find_last_of('/') != string::npos) { - string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of("/") + 1); + string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of('/') + 1); tileset->_sourceImage = dir + imagename; } else diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 4f9824dac0c9..b7ff1536b029 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -343,6 +343,7 @@ class CC_DLL TMXMapInfo : public Ref, public SAXDelegator int _currentFirstGID; bool _recordFirstGID; std::string _externalTilesetFilename; + std::string _externalTilesetFullPath; }; // end of tilemap_parallax_nodes group diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index ed870d00fd5f..f6c7823aa49f 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -387,7 +387,7 @@ void TextFieldTTF::setCursorFromPoint(const Vec2 &point, const Camera* camera) auto sprite = getLetter(latterPosition); if (sprite) { - rect.size = sprite->getContentSize(); + rect.size = Size(sprite->getContentSize().width, _lineHeight); if (isScreenPointInRect(point, camera, sprite->getWorldToNodeTransform(), rect, nullptr)) { setCursorPosition(latterPosition); diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index b92c7cada5ef..de4daaa5f1fa 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -15,6 +15,7 @@ {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} cocos2d-x.win32 Win32Proj + 10.0.17134.0 @@ -112,7 +113,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\OpenalSoft\prebuilt\*.*" xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\MP3Decoder\prebuilt\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\OggDecoder\prebuilt\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\sqlite3\libraries\win32\*.*" "$(OutDir)" -xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\debug-lib\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\bullet\prebuilt\win32\debug\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\Box2D\prebuilt\win32\debug\*.*" "$(OutDir)" xcopy /Y /Q "$(ProjectDir)..\..\external\openssl\prebuilt\win32\*.*" "$(OutDir)" @@ -646,6 +647,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\uv\prebuilt\win32\*.*" "$(OutDir)" + @@ -1286,6 +1288,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\uv\prebuilt\win32\*.*" "$(OutDir)" + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index 3441f613000a..adcbd4a8658b 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -670,6 +670,9 @@ renderer + + renderer + renderer @@ -2415,6 +2418,9 @@ renderer + + renderer + renderer diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj index 07188708b904..1aee25122917 100644 --- a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj @@ -643,6 +643,7 @@ + @@ -1329,6 +1330,7 @@ + @@ -1505,9 +1507,6 @@ - - {0c32d479-46d5-46c3-9aa9-0a8ff8320516} - {f551524d-8a70-4b2f-a7c2-28ae61150022} diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters index 9b2610df4d8c..cd4f8e646761 100644 --- a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters @@ -1581,6 +1581,9 @@ renderer + + renderer + renderer @@ -3479,6 +3482,9 @@ renderer + + renderer + renderer diff --git a/cocos/3d/CCBundle3D.cpp b/cocos/3d/CCBundle3D.cpp index 4686e7fe6d54..baf381f88038 100644 --- a/cocos/3d/CCBundle3D.cpp +++ b/cocos/3d/CCBundle3D.cpp @@ -225,7 +225,7 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, MaterialDatas& materialdatas, NodeD int i = 0; char str[20]; std::string dir = ""; - auto last = fullPath.rfind("/"); + auto last = fullPath.rfind('/'); if (last != std::string::npos) dir = fullPath.substr(0, last + 1); for (auto& material : materials) { diff --git a/cocos/3d/CCMeshVertexIndexData.cpp b/cocos/3d/CCMeshVertexIndexData.cpp index 9c683184e924..61e07471af82 100644 --- a/cocos/3d/CCMeshVertexIndexData.cpp +++ b/cocos/3d/CCMeshVertexIndexData.cpp @@ -40,6 +40,7 @@ #include "base/CCEventDispatcher.h" #include "base/CCEventType.h" #include "base/CCDirector.h" +#include "renderer/ccGLStateCache.h" using namespace std; diff --git a/cocos/3d/CCMotionStreak3D.cpp b/cocos/3d/CCMotionStreak3D.cpp index 1fabab46a0bc..3ff4602a31a9 100644 --- a/cocos/3d/CCMotionStreak3D.cpp +++ b/cocos/3d/CCMotionStreak3D.cpp @@ -28,8 +28,8 @@ THE SOFTWARE. #include "3d/CCMotionStreak3D.h" #include "math/CCVertex.h" #include "base/CCDirector.h" -#include "base/ccUtils.h" #include "renderer/CCTextureCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCTexture2D.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramState.h" @@ -387,13 +387,10 @@ void MotionStreak3D::onDraw(const Mat4 &transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); + GL::blendFunc( _blendFunc.src, _blendFunc.dst ); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); + GL::bindTexture2D( _texture->getName() ); glDisable(GL_CULL_FACE); RenderState::StateBlock::_defaultState->setCullFace(false); diff --git a/cocos/3d/CCSkybox.cpp b/cocos/3d/CCSkybox.cpp index 84aafd4a6af7..64eda3132c2e 100644 --- a/cocos/3d/CCSkybox.cpp +++ b/cocos/3d/CCSkybox.cpp @@ -26,6 +26,7 @@ #include "base/ccMacros.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgramState.h" @@ -56,7 +57,7 @@ Skybox::~Skybox() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } @@ -107,7 +108,7 @@ void Skybox::initBuffers() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } // The skybox is rendered using a purpose-built shader which makes use of // the shader language's inherent support for cubemaps. Hence there is no @@ -152,7 +153,7 @@ void Skybox::initBuffers() glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); getGLProgramState()->applyAttributes(false); - glBindVertexArray(0); + GL::bindVAO(0); } } @@ -200,11 +201,11 @@ void Skybox::onDraw(const Mat4& transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POSITION); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(Vec3), nullptr); @@ -216,7 +217,7 @@ void Skybox::onDraw(const Mat4& transform, uint32_t /*flags*/) if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } else { diff --git a/cocos/3d/CCTerrain.cpp b/cocos/3d/CCTerrain.cpp index 634a914b8397..20c35b58b35d 100644 --- a/cocos/3d/CCTerrain.cpp +++ b/cocos/3d/CCTerrain.cpp @@ -34,6 +34,8 @@ USING_NS_CC; #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramStateCache.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCRenderState.h" #include "base/CCDirector.h" #include "base/CCEventType.h" #include "2d/CCCamera.h" @@ -148,26 +150,21 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t /*flags*/) _stateBlock->bind(); - glEnableVertexAttribArray(_positionLocation); - glEnableVertexAttribArray(_texcoordLocation); - glEnableVertexAttribArray(_normalLocation); + GL::enableVertexAttribs(1<<_positionLocation | 1 << _texcoordLocation | 1<<_normalLocation); glProgram->setUniformsForBuiltins(transform); _glProgramState->applyUniforms(); glUniform3f(_lightDirLocation,_lightDir.x,_lightDir.y,_lightDir.z); if(!_alphaMap) { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _detailMapTextures[0]->getName()); + GL::bindTexture2D(_detailMapTextures[0]->getName()); //getGLProgramState()->setUniformTexture("") glUniform1i(_detailMapLocation[0],0); glUniform1i(_alphaIsHasAlphaMapLocation,0); - } - else + }else { for(int i =0;i<_maxDetailMapValue;++i) { - glActiveTexture(GL_TEXTURE0 + i); - glBindTexture(GL_TEXTURE_2D, _detailMapTextures[i]->getName()); + GL::bindTexture2DN(i,_detailMapTextures[i]->getName()); glUniform1i(_detailMapLocation[i],i); glUniform1f(_detailMapSizeLocation[i],_terrainData._detailMaps[i]._detailMapSize); @@ -175,15 +172,13 @@ void Terrain::onDraw(const Mat4 &transform, uint32_t /*flags*/) glUniform1i(_alphaIsHasAlphaMapLocation,1); - glActiveTexture(GL_TEXTURE0 + 4); - glBindTexture(GL_TEXTURE_2D, _alphaMap->getName()); + GL::bindTexture2DN(4, _alphaMap->getName()); glUniform1i(_alphaMapLocation,4); } if (_lightMap) { glUniform1i(_lightMapCheckLocation, 1); - glActiveTexture(GL_TEXTURE0 + 5); - glBindTexture(GL_TEXTURE_2D, _lightMap->getName()); + GL::bindTexture2DN(5, _lightMap->getName()); glUniform1i(_lightMapLocation, 5); }else { diff --git a/cocos/3d/CMakeLists.txt b/cocos/3d/CMakeLists.txt index fadfdcccfdaf..92ddd5fb3760 100644 --- a/cocos/3d/CMakeLists.txt +++ b/cocos/3d/CMakeLists.txt @@ -1,8 +1,3 @@ - -if(WINDOWS AND BUILD_SHARED_LIBS) - add_definitions(-D_USE3DDLL) -endif() - set(COCOS_3D_HEADER 3d/CCBillBoard.h diff --git a/cocos/Android.mk b/cocos/Android.mk index d21c4e910d0a..29cd06ec9bef 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -185,6 +185,7 @@ renderer/CCTrianglesCommand.cpp \ renderer/CCVertexAttribBinding.cpp \ renderer/CCVertexIndexBuffer.cpp \ renderer/CCVertexIndexData.cpp \ +renderer/ccGLStateCache.cpp \ renderer/CCFrameBuffer.cpp \ renderer/ccShaders.cpp \ vr/CCVRDistortion.cpp \ diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 871e17d7585a..d4970132bbad 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -30,14 +30,10 @@ # build jscocos2d if BUILD_JS_LIBS=ON # The version number -set(COCOS2D_X_VERSION 3.18) +set(COCOS2D_X_VERSION 3.17.1) set(COCOS_CORE_LIB cocos2d) -if(WINDOWS) - add_definitions(-DUNICODE -D_UNICODE) -endif() - include(2d/CMakeLists.txt) include(3d/CMakeLists.txt) include(platform/CMakeLists.txt) @@ -54,6 +50,12 @@ include(network/CMakeLists.txt) include(audio/CMakeLists.txt) include(storage/CMakeLists.txt) +# default value for cocos2dx extensions modules build +option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON) +option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) +option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) +option(BUILD_EXTENSIONS "Build extension library" ON) + if(BUILD_EDITOR_COCOSBUILDER) include(editor-support/cocosbuilder/CMakeLists.txt) set(COCOS_EDITOR_SUPPORT_SRC ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_CCB_SRC} ${COCOS_CCB_HEADER}) @@ -121,8 +123,12 @@ add_library(cocos2d ${COCOS_SRC}) add_subdirectory(${COCOS2DX_ROOT_PATH}/external ${ENGINE_BINARY_PATH}/external) target_link_libraries(cocos2d external) +# add base macro define and compile options +use_cocos2dx_compile_define(cocos2d) +use_cocos2dx_compile_options(cocos2d) + # use all platform related system libs -target_use_cocos2dx_depend(cocos2d) +use_cocos2dx_libs_depend(cocos2d) target_include_directories(cocos2d PUBLIC ${COCOS2DX_ROOT_PATH} @@ -155,3 +161,12 @@ endif() if(XCODE OR VS) cocos_mark_code_files("cocos2d") endif() + +if(WINDOWS) + # precompiled header. Compilation time speedup ~4x. + target_sources(cocos2d PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp") + set_target_properties(cocos2d PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") + set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") + # compile c as c++. needed for precompiled header + set_source_files_properties(${COCOS_SPINE_SRC} base/ccFPSImages.c PROPERTIES LANGUAGE CXX) +endif() diff --git a/cocos/audio/apple/AudioCache.mm b/cocos/audio/apple/AudioCache.mm index 67df4a2481e9..901c9a1b0f0d 100644 --- a/cocos/audio/apple/AudioCache.mm +++ b/cocos/audio/apple/AudioCache.mm @@ -51,22 +51,6 @@ of this software and associated documentation files (the "Software"), to deal #define INVALID_AL_BUFFER_ID 0xFFFFFFFF #define PCMDATA_CACHEMAXSIZE 1048576 -typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq); -static ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq) -{ - static alBufferDataStaticProcPtr proc = nullptr; - - if (proc == nullptr) { - proc = (alBufferDataStaticProcPtr) alcGetProcAddress(nullptr, (const ALCchar*) "alBufferDataStatic"); - } - - if (proc){ - proc(bid, format, data, size, freq); - } - - return; -} - @interface NSTimerWrapper : NSObject { std::function _timeoutCallback; @@ -104,11 +88,6 @@ -(void) dealloc @end -static void setTimeout(double seconds, const std::function& cb) -{ - [[[NSTimerWrapper alloc] initWithTimeInterval:seconds callback:cb] autorelease]; -} - using namespace cocos2d; using namespace cocos2d::experimental; @@ -150,35 +129,19 @@ static void setTimeout(double seconds, const std::function& cb) } //wait for the 'readDataTask' task to exit _readDataTaskMutex.lock(); - _readDataTaskMutex.unlock(); - if (_pcmData) + if (_state == State::READY) { - if (_state == State::READY) - { - if (_alBufferId != INVALID_AL_BUFFER_ID && alIsBuffer(_alBufferId)) - { - ALOGV("~AudioCache(id=%u), delete buffer: %u", _id, _alBufferId); - alDeleteBuffers(1, &_alBufferId); - _alBufferId = INVALID_AL_BUFFER_ID; - } - } - else + if (_alBufferId != INVALID_AL_BUFFER_ID && alIsBuffer(_alBufferId)) { - ALOGW("AudioCache (%p), id=%u, buffer isn't ready, state=%d", this, _id, _state); + ALOGV("~AudioCache(id=%u), delete buffer: %u", _id, _alBufferId); + alDeleteBuffers(1, &_alBufferId); + _alBufferId = INVALID_AL_BUFFER_ID; } - - // fixed #17494: CrashIfClientProvidedBogusAudioBufferList - // We're using 'alBufferDataStaticProc' for speeding up - // the performance of playing audio without preload, but we need to manage the memory by ourself carefully. - // It's probably that '_pcmData' is freed before OpenAL finishes the audio render task, - // then 'CrashIfClientProvidedBogusAudioBufferList' may be triggered. - // 'cpp-tests/NewAudioEngineTest/AudioSwitchStateTest' can reproduce this issue without the following fix. - // The workaround is delaying 200ms to free pcm data. - char* data = _pcmData; - setTimeout(0.2, [data](){ - free(data); - }); + } + else + { + ALOGW("AudioCache (%p), id=%u, buffer isn't ready, state=%d", this, _id, _state); } if (_queBufferFrames > 0) @@ -189,6 +152,7 @@ static void setTimeout(double seconds, const std::function& cb) } } ALOGVV("~AudioCache() %p, id=%u, end", this, _id); + _readDataTaskMutex.unlock(); } void AudioCache::readDataTask(unsigned int selfId) @@ -261,24 +225,16 @@ static void setTimeout(double seconds, const std::function& cb) _pcmData = (char*)malloc(dataSize); memset(_pcmData, 0x00, dataSize); + ALOGV(" id=%u _pcmData alloc: %p", selfId, _pcmData); if (adjustFrames > 0) { memcpy(_pcmData + (dataSize - adjustFrameBuf.size()), adjustFrameBuf.data(), adjustFrameBuf.size()); } - alGenBuffers(1, &_alBufferId); - auto alError = alGetError(); - if (alError != AL_NO_ERROR) { - ALOGE("%s: attaching audio to buffer fail: %x", __PRETTY_FUNCTION__, alError); - break; - } - if (*_isDestroyed) break; - alBufferDataStaticProc(_alBufferId, _format, _pcmData, (ALsizei)dataSize, (ALsizei)sampleRate); - framesRead = decoder.readFixedFrames(std::min(framesToReadOnce, remainingFrames), _pcmData + _framesRead * bytesPerFrame); _framesRead += framesRead; remainingFrames -= framesRead; @@ -286,10 +242,6 @@ static void setTimeout(double seconds, const std::function& cb) if (*_isDestroyed) break; - _state = State::READY; - - invokingPlayCallbacks(); - uint32_t frames = 0; while (!*_isDestroyed && _framesRead < originalTotalFrames) { @@ -309,9 +261,22 @@ static void setTimeout(double seconds, const std::function& cb) { memset(_pcmData + _framesRead * bytesPerFrame, 0x00, (totalFrames - _framesRead) * bytesPerFrame); } - ALOGV("pcm buffer was loaded successfully, total frames: %u, total read frames: %u, adjust frames: %u, remainingFrames: %u", totalFrames, _framesRead, adjustFrames, remainingFrames); + ALOGV("pcm buffer was loaded successfully, total frames: %u, total read frames: %u, adjust frames: %u, remainingFrames: %u", totalFrames, _framesRead, adjustFrames, remainingFrames); _framesRead += adjustFrames; + + alGenBuffers(1, &_alBufferId); + auto alError = alGetError(); + if (alError != AL_NO_ERROR) { + ALOGE("%s: attaching audio to buffer fail: %x", __PRETTY_FUNCTION__, alError); + break; + } + ALOGV(" id=%u generated alGenBuffers: %u for _pcmData: %p", selfId, _alBufferId, _pcmData); + ALOGV(" id=%u _pcmData alBufferData: %p", selfId, _pcmData); + alBufferData(_alBufferId, _format, _pcmData, (ALsizei)dataSize, (ALsizei)sampleRate); + _state = State::READY; + invokingPlayCallbacks(); + } else { @@ -333,6 +298,10 @@ static void setTimeout(double seconds, const std::function& cb) } while (false); + if (_pcmData != nullptr){ + CC_SAFE_FREE(_pcmData); + } + decoder.close(); //FIXME: Why to invoke play callback first? Should it be after 'load' callback? @@ -345,7 +314,7 @@ static void setTimeout(double seconds, const std::function& cb) _state = State::FAILED; if (_alBufferId != INVALID_AL_BUFFER_ID && alIsBuffer(_alBufferId)) { - ALOGV("readDataTask failed, delete buffer: %u", _alBufferId); + ALOGV(" id=%u readDataTask failed, delete buffer: %u", selfId, _alBufferId); alDeleteBuffers(1, &_alBufferId); _alBufferId = INVALID_AL_BUFFER_ID; } diff --git a/cocos/audio/apple/AudioEngine-inl.mm b/cocos/audio/apple/AudioEngine-inl.mm index 81b8b86a8973..4c53db0e6ca4 100644 --- a/cocos/audio/apple/AudioEngine-inl.mm +++ b/cocos/audio/apple/AudioEngine-inl.mm @@ -677,6 +677,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *bids) if (player->_finishCallbak) { auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; filePath = *audioInfo.filePath; + player->setCache(nullptr); // it's safe for player didn't free audio cache } AudioEngine::remove(audioID); @@ -710,6 +711,11 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *bids) void AudioEngineImpl::uncacheAll() { _audioCaches.clear(); + for(auto&& player : _audioPlayers) + { + // prevent player hold invalid AudioCache* pointer, since all audio caches purged + player.second->setCache(nullptr); + } } #endif diff --git a/cocos/audio/win32/AudioEngine-win32.cpp b/cocos/audio/win32/AudioEngine-win32.cpp index f779f4276e4b..3fb0ffc8734c 100644 --- a/cocos/audio/win32/AudioEngine-win32.cpp +++ b/cocos/audio/win32/AudioEngine-win32.cpp @@ -482,6 +482,7 @@ void AudioEngineImpl::update(float dt) if (player->_finishCallbak) { auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; filePath = *audioInfo.filePath; + player->setCache(nullptr); // it's safe for player didn't free audio cache } AudioEngine::remove(audioID); @@ -515,6 +516,11 @@ void AudioEngineImpl::uncache(const std::string &filePath) void AudioEngineImpl::uncacheAll() { _audioCaches.clear(); + for(auto&& player : _audioPlayers) + { + // prevent player hold invalid AudioCache* pointer, since all audio caches purged + player.second->setCache(nullptr); + } } #endif diff --git a/cocos/base/CCConfiguration.h b/cocos/base/CCConfiguration.h index 91bce875ca3f..0b7637a5ccd0 100644 --- a/cocos/base/CCConfiguration.h +++ b/cocos/base/CCConfiguration.h @@ -229,6 +229,15 @@ class CC_DLL Configuration : public Ref * @return The Configuration info. */ std::string getInfo() const; + + /** + Returns the configuration as value map + @return the configuration map + @since 3.18 + @js NA + @lua NA + */ + const ValueMap& getInfoAsMap()const { return _valueDict; } /** Gathers OpenGL / GPU information. */ diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 133d62cb15a9..d26f02be8b90 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -114,7 +114,7 @@ namespace { if (Director::getInstance()->getOpenGLView()) { HWND hwnd = Director::getInstance()->getOpenGLView()->getWin32Window(); - SendMessage(hwnd, + PostMessage(hwnd, WM_COPYDATA, (WPARAM)(HWND)hwnd, (LPARAM)(LPVOID)&myCDS); @@ -181,16 +181,17 @@ void log(const char * format, ...) do { - std::copy(buf + pos, buf + pos + MAX_LOG_LENGTH, tempBuf); + int dataSize = std::min(MAX_LOG_LENGTH, len - pos); + std::copy(buf + pos, buf + pos + dataSize, tempBuf); - tempBuf[MAX_LOG_LENGTH] = 0; + tempBuf[dataSize] = 0; MultiByteToWideChar(CP_UTF8, 0, tempBuf, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, tempBuf, sizeof(tempBuf), nullptr, FALSE); printf("%s", tempBuf); - pos += MAX_LOG_LENGTH; + pos += dataSize; } while (pos < len); SendLogToWindow(buf); @@ -453,7 +454,7 @@ void Console::Command::commandGeneric(int fd, const std::string& args) { // The first argument (including the empty) std::string key(args); - auto pos = args.find(" "); + auto pos = args.find(' '); if ((pos != std::string::npos) && (0 < pos)) { key = args.substr(0, pos); } diff --git a/cocos/base/CCData.cpp b/cocos/base/CCData.cpp index 27e11a3c9745..1fe7ece35556 100644 --- a/cocos/base/CCData.cpp +++ b/cocos/base/CCData.cpp @@ -108,8 +108,8 @@ ssize_t Data::getSize() const ssize_t Data::copy(const unsigned char* bytes, const ssize_t size) { - CCASSERT(size >= 0, "copy size should be non-negative"); - CCASSERT(bytes, "bytes should not be nullptr"); + //CCASSERT(size >= 0, "copy size should be non-negative"); + //CCASSERT(bytes, "bytes should not be nullptr"); if (size <= 0) return 0; diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 496e89e7f5d6..b682b43326d1 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -46,12 +46,12 @@ THE SOFTWARE. #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgramStateCache.h" #include "renderer/CCTextureCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" #include "renderer/CCFrameBuffer.h" #include "2d/CCCamera.h" #include "base/CCUserDefault.h" -#include "base/ccUtils.h" #include "base/ccFPSImages.h" #include "base/CCScheduler.h" #include "base/ccMacros.h" @@ -68,10 +68,6 @@ THE SOFTWARE. #include "base/CCScriptSupport.h" #endif -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h" -#endif - /** Position of the FPS @@ -118,7 +114,7 @@ Director::Director() { } -bool Director::init(void) +bool Director::init() { setDefaultValues(); @@ -161,13 +157,10 @@ bool Director::init(void) _renderer = new (std::nothrow) Renderer; RenderState::initialize(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID - EngineDataManager::init(); -#endif return true; } -Director::~Director(void) +Director::~Director() { CCLOGINFO("deallocing Director: %p", this); @@ -199,6 +192,14 @@ Director::~Director(void) ObjectFactory::destroyInstance(); s_SharedDirector = nullptr; + +#if CC_ENABLE_SCRIPT_BINDING + ScriptEngineManager::destroyInstance(); +#endif + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + exit(0); +#endif } void Director::setDefaultValues(void) @@ -683,6 +684,7 @@ void Director::setProjection(Projection projection) } _projection = projection; + GL::setProjectionMatrixDirty(); _eventDispatcher->dispatchEvent(_eventProjectionChanged); } @@ -713,11 +715,11 @@ void Director::setAlphaBlending(bool on) { if (on) { - utils::setBlending(CC_BLEND_SRC, CC_BLEND_DST); + GL::blendFunc(CC_BLEND_SRC, CC_BLEND_DST); } else { - utils::setBlending(GL_ONE, GL_ZERO); + GL::blendFunc(GL_ONE, GL_ZERO); } CHECK_GL_ERROR_DEBUG(); @@ -733,6 +735,11 @@ void Director::setClearColor(const Color4F& clearColor) _renderer->setClearColor(clearColor); } +const Color4F& Director::getClearColor() const +{ + return _renderer->getClearColor(); +} + static void GLToClipTransform(Mat4 *transformOut) { if(nullptr == transformOut) return; @@ -775,17 +782,17 @@ Vec2 Director::convertToUI(const Vec2& glPoint) Vec4 glCoord(glPoint.x, glPoint.y, 0.0, 1); transform.transformVector(glCoord, &clipCoord); - /* - BUG-FIX #5506 + /* + BUG-FIX #5506 - a = (Vx, Vy, Vz, 1) - b = (a×M)T - Out = 1 ⁄ bw(bx, by, bz) - */ + a = (Vx, Vy, Vz, 1) + b = (a×M)T + Out = 1 ⁄ bw(bx, by, bz) + */ - clipCoord.x = clipCoord.x / clipCoord.w; - clipCoord.y = clipCoord.y / clipCoord.w; - clipCoord.z = clipCoord.z / clipCoord.w; + clipCoord.x = clipCoord.x / clipCoord.w; + clipCoord.y = clipCoord.y / clipCoord.w; + clipCoord.z = clipCoord.z / clipCoord.w; Size glSize = _openGLView->getDesignResolutionSize(); float factor = 1.0f / glCoord.w; @@ -1099,7 +1106,9 @@ void Director::reset() // cocos2d-x specific data structures UserDefault::destroyInstance(); - resetMatrixStack(); + + GL::invalidateStateCache(); + RenderState::finalize(); destroyTextureCache(); @@ -1117,10 +1126,7 @@ void Director::purgeDirector() _openGLView->end(); _openGLView = nullptr; } - -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID - EngineDataManager::destroy(); -#endif + // delete Director release(); } @@ -1202,7 +1208,7 @@ void Director::pause() _oldAnimationInterval = _animationInterval; // when paused, don't consume CPU - setAnimationInterval(1 / 4.0, SetIntervalReason::BY_DIRECTOR_PAUSE); + setAnimationInterval(1 / 4.0); _paused = true; } @@ -1213,7 +1219,7 @@ void Director::resume() return; } - setAnimationInterval(_oldAnimationInterval, SetIntervalReason::BY_ENGINE); + setAnimationInterval(_oldAnimationInterval); _paused = false; _deltaTime = 0; @@ -1392,18 +1398,19 @@ void Director::setContentScaleFactor(float scaleFactor) void Director::setNotificationNode(Node *node) { - if (_notificationNode != nullptr){ - _notificationNode->onExitTransitionDidStart(); - _notificationNode->onExit(); - _notificationNode->cleanup(); - } - CC_SAFE_RELEASE(_notificationNode); - - _notificationNode = node; - if (node == nullptr) - return; - _notificationNode->onEnter(); - _notificationNode->onEnterTransitionDidFinish(); + if (_notificationNode != nullptr) + { + _notificationNode->onExitTransitionDidStart(); + _notificationNode->onExit(); + _notificationNode->cleanup(); + } + CC_SAFE_RELEASE(_notificationNode); + + _notificationNode = node; + if (node == nullptr) + return; + _notificationNode->onEnter(); + _notificationNode->onEnterTransitionDidFinish(); CC_SAFE_RETAIN(_notificationNode); } @@ -1438,11 +1445,6 @@ void Director::setEventDispatcher(EventDispatcher* dispatcher) } void Director::startAnimation() -{ - startAnimation(SetIntervalReason::BY_ENGINE); -} - -void Director::startAnimation(SetIntervalReason reason) { _lastUpdate = std::chrono::steady_clock::now(); @@ -1450,7 +1452,7 @@ void Director::startAnimation(SetIntervalReason reason) _cocos2d_thread_id = std::this_thread::get_id(); - Application::getInstance()->setAnimationInterval(_animationInterval, reason); + Application::getInstance()->setAnimationInterval(_animationInterval); // fix issue #3509, skip one fps to avoid incorrect time calculation. setNextDeltaTimeZero(true); @@ -1490,17 +1492,12 @@ void Director::stopAnimation() } void Director::setAnimationInterval(float interval) -{ - setAnimationInterval(interval, SetIntervalReason::BY_GAME); -} - -void Director::setAnimationInterval(float interval, SetIntervalReason reason) { _animationInterval = interval; if (! _invalid) { stopAnimation(); - startAnimation(reason); + startAnimation(); } } diff --git a/cocos/base/CCDirector.h b/cocos/base/CCDirector.h index 6aaef8341e1b..48fd373dd754 100644 --- a/cocos/base/CCDirector.h +++ b/cocos/base/CCDirector.h @@ -320,7 +320,7 @@ class CC_DLL Director : public Ref If level is 1, it will pop all scenes until it reaches to root scene. If level is <= than the current stack level, it won't do anything. */ - void popToSceneStackLevel(int level); + void popToSceneStackLevel(int level); /** Replaces the running scene with a new one. The running scene is terminated. * ONLY call it if there is a running scene. @@ -375,7 +375,7 @@ class CC_DLL Director : public Ref */ void purgeCachedData(); - /** Sets the default values based on the Configuration info. */ + /** Sets the default values based on the Configuration info. */ void setDefaultValues(); // OpenGL Helper @@ -395,6 +395,11 @@ class CC_DLL Director : public Ref */ void setClearColor(const Color4F& clearColor); + /** Gets clear values for the color buffers. + * @js NA + */ + const Color4F& getClearColor() const; + /** Enables/disables OpenGL depth test. */ void setDepthTest(bool on); @@ -585,10 +590,6 @@ class CC_DLL Director : public Ref protected: void reset(); - - - virtual void startAnimation(SetIntervalReason reason); - virtual void setAnimationInterval(float interval, SetIntervalReason reason); void purgeDirector(); bool _purgeDirectorInNextLoop = false; // this flag will be set to true in end() diff --git a/cocos/base/CCIMEDispatcher.cpp b/cocos/base/CCIMEDispatcher.cpp index a0f674dc3b8b..85cafb1a3cef 100644 --- a/cocos/base/CCIMEDispatcher.cpp +++ b/cocos/base/CCIMEDispatcher.cpp @@ -266,6 +266,13 @@ const std::string& IMEDispatcher::getContentText() return STD_STRING_EMPTY; } +bool IMEDispatcher::isAnyDelegateAttachedWithIME() const +{ + if (!_impl) + return false; + return _impl->_delegateWithIme != nullptr; +} + ////////////////////////////////////////////////////////////////////////// // dispatch keyboard message ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/base/CCIMEDispatcher.h b/cocos/base/CCIMEDispatcher.h index d56bb920b009..6b48ea9d31d2 100644 --- a/cocos/base/CCIMEDispatcher.h +++ b/cocos/base/CCIMEDispatcher.h @@ -78,6 +78,11 @@ class CC_DLL IMEDispatcher * @lua NA */ const std::string& getContentText(); + + /** + *@brief Returns if any delegate is attached with IME. + */ + bool isAnyDelegateAttachedWithIME() const; ////////////////////////////////////////////////////////////////////////// // dispatch keyboard notification diff --git a/cocos/base/CCProperties.cpp b/cocos/base/CCProperties.cpp index a2babc24a561..47c4e2d0149a 100644 --- a/cocos/base/CCProperties.cpp +++ b/cocos/base/CCProperties.cpp @@ -1117,12 +1117,12 @@ void calculateNamespacePath(const std::string& urlString, std::string& fileStrin { // If the url references a specific namespace within the file, // calculate the full namespace path to the final namespace. - size_t loc = urlString.rfind("#"); + size_t loc = urlString.rfind('#'); if (loc != std::string::npos) { fileString = urlString.substr(0, loc); std::string namespacePathString = urlString.substr(loc + 1); - while ((loc = namespacePathString.find("/")) != std::string::npos) + while ((loc = namespacePathString.find('/')) != std::string::npos) { namespacePath.push_back(namespacePathString.substr(0, loc)); namespacePathString = namespacePathString.substr(loc + 1); diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index d64b2181cc25..342582913ffc 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -64,15 +64,15 @@ Ref::Ref() Ref::~Ref() { #if CC_ENABLE_SCRIPT_BINDING - // if the object is referenced by Lua engine, remove it - if (_luaID) + ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); + if (pEngine != nullptr && _luaID) { - ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptObjectByObject(this); + // if the object is referenced by Lua engine, remove it + pEngine->removeScriptObjectByObject(this); } #if !CC_ENABLE_GC_FOR_NATIVE_OBJECTS else { - ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (pEngine != nullptr && pEngine->getScriptType() == kScriptTypeJavascript) { pEngine->removeScriptObjectByObject(this); diff --git a/cocos/base/CCStencilStateManager.cpp b/cocos/base/CCStencilStateManager.cpp index c5742fa0a0f2..2747fed9c0b8 100644 --- a/cocos/base/CCStencilStateManager.cpp +++ b/cocos/base/CCStencilStateManager.cpp @@ -27,6 +27,7 @@ #include "base/CCStencilStateManager.h" #include "base/CCDirector.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) @@ -88,7 +89,7 @@ void StencilStateManager::drawFullScreenQuadClearStencil() glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1); glBindBuffer(GL_ARRAY_BUFFER, 0); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 4187875d5423..26ce44668d55 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -10,7 +10,7 @@ elseif(ANDROID) base/CCUserDefault-android.cpp base/CCController-android.cpp ) -elseif(LINUX) +elseif(LINUX OR WINDOWS) set(COCOS_BASE_SPECIFIC_SRC base/CCController-linux-win32.cpp ) diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index 8f9fa583cc17..7ee1d647d7eb 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -627,7 +627,7 @@ std::vector ZipFile::listFiles(const std::string &pathname) const if(filename.substr(0, dirname.length()) == dirname) { std::string suffix = filename.substr(dirname.length()); - auto pos = suffix.find("/"); + auto pos = suffix.find('/'); if (pos == std::string::npos) { fileSet.insert(suffix); diff --git a/cocos/base/ccConfig.h b/cocos/base/ccConfig.h index cd21a413c24b..767ee4904429 100644 --- a/cocos/base/ccConfig.h +++ b/cocos/base/ccConfig.h @@ -257,6 +257,18 @@ THE SOFTWARE. #define CC_USE_PHYSICS 1 #endif +#if (CC_USE_PHYSICS) +/** Use chipmunk physics 2d engine. */ +#ifndef CC_ENABLE_CHIPMUNK_INTEGRATION +#define CC_ENABLE_CHIPMUNK_INTEGRATION 1 +#endif + +/** or use box2d physics 2d engine. */ +#ifndef CC_ENABLE_BOX2D_INTEGRATION +#define CC_ENABLE_BOX2D_INTEGRATION 0 +#endif +#endif // CC_USE_PHYSICS + /** Use 3d physics integration API. */ #ifndef CC_USE_3D_PHYSICS #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX /*|| CC_TARGET_PLATFORM == CC_PLATFORM_WINRT*/) @@ -405,4 +417,6 @@ THE SOFTWARE. #define CC_STRIP_FPS 0 #endif +#define CC_LABEL_MAX_LENGTH ((1<<16)/4) + #endif // __CCCONFIG_H__ diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index ae30d7939be5..cde02353c859 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -561,6 +561,7 @@ struct CC_DLL FontDefinition : _fontSize(0) , _alignment(TextHAlignment::CENTER) , _vertAlignment(TextVAlignment::TOP) + , _lineSpacing(0.0f) , _dimensions(Size::ZERO) , _fontFillColor(Color3B::WHITE) , _fontAlpha(255) @@ -575,7 +576,9 @@ struct CC_DLL FontDefinition /// horizontal alignment TextHAlignment _alignment; /// vertical alignment - TextVAlignment _vertAlignment; + TextVAlignment _vertAlignment; + /// line spacing + float _lineSpacing; /// rendering box Size _dimensions; /// font color @@ -631,15 +634,6 @@ class CC_DLL Acceleration extern const std::string CC_DLL STD_STRING_EMPTY; extern const ssize_t CC_DLL CC_INVALID_INDEX; -enum class SetIntervalReason : char -{ - BY_GAME = 0, - BY_ENGINE, - BY_SYSTEM, - BY_SCENE_CHANGE, - BY_DIRECTOR_PAUSE -}; - NS_CC_END // end group /// @} diff --git a/cocos/base/ccUtils.cpp b/cocos/base/ccUtils.cpp index 7d35ab5b7f1f..54cc4387de92 100644 --- a/cocos/base/ccUtils.cpp +++ b/cocos/base/ccUtils.cpp @@ -37,7 +37,6 @@ THE SOFTWARE. #include "renderer/CCCustomCommand.h" #include "renderer/CCRenderer.h" #include "renderer/CCTextureCache.h" -#include "renderer/CCRenderState.h" #include "platform/CCImage.h" #include "platform/CCFileUtils.h" @@ -125,7 +124,7 @@ void onCaptureScreen(const std::function& afterC } else { - CCASSERT(filename.find("/") == std::string::npos, "The existence of a relative path is not guaranteed!"); + CCASSERT(filename.find('/') == std::string::npos, "The existence of a relative path is not guaranteed!"); outputFile = FileUtils::getInstance()->getWritablePath() + filename; } @@ -527,24 +526,6 @@ LanguageType getLanguageTypeByISO2(const char* code) return ret; } -void setBlending(GLenum sfactor, GLenum dfactor) -{ - if (sfactor == GL_ONE && dfactor == GL_ZERO) - { - glDisable(GL_BLEND); - RenderState::StateBlock::_defaultState->setBlend(false); - } - else - { - glEnable(GL_BLEND); - glBlendFunc(sfactor, dfactor); - - RenderState::StateBlock::_defaultState->setBlend(true); - RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)sfactor); - RenderState::StateBlock::_defaultState->setBlendDst((RenderState::Blend)dfactor); - } -} - } NS_CC_END diff --git a/cocos/base/ccUtils.h b/cocos/base/ccUtils.h index a3d11a4872f1..53545d46bbbf 100644 --- a/cocos/base/ccUtils.h +++ b/cocos/base/ccUtils.h @@ -188,8 +188,6 @@ namespace utils * @lua NA */ CC_DLL LanguageType getLanguageTypeByISO2(const char* code); - - CC_DLL void setBlending(GLenum sfactor, GLenum dfactor); } NS_CC_END diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index 9e3de492d2cc..b89ac9785922 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -32,7 +32,7 @@ NS_CC_BEGIN CC_DLL const char* cocos2dVersion() { - return "cocos2d-x-3.17"; + return "cocos2d-x-3.17.1"; } NS_CC_END diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 185c4a4d46d1..84bca472f29f 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -31,7 +31,7 @@ THE SOFTWARE. // 0x00 HI ME LO // 00 03 08 00 -#define COCOS2D_VERSION 0x00031700 +#define COCOS2D_VERSION 0x00031701 // // all cocos2d include files @@ -175,6 +175,7 @@ THE SOFTWARE. #include "renderer/CCVertexIndexBuffer.h" #include "renderer/CCVertexIndexData.h" #include "renderer/CCFrameBuffer.h" +#include "renderer/ccGLStateCache.h" #include "renderer/ccShaders.h" // physics @@ -211,13 +212,6 @@ THE SOFTWARE. //Enhance modification end #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) - #include "platform/blackberry/CCApplication.h" - #include "platform/blackberry/CCGLViewImpl.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-win32.h" #include "platform/desktop/CCGLViewImpl-desktop.h" @@ -239,20 +233,6 @@ THE SOFTWARE. #include "platform/linux/CCStdC-linux.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - #include "platform/winrt/CCApplication.h" - #include "platform/winrt/CCGLViewImpl-winrt.h" - #include "platform/winrt/CCGL.h" - #include "platform/winrt/CCStdC.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) - #include "platform/tizen/CCApplication-tizen.h" - #include "platform/tizen/CCGLViewImpl-tizen.h" - #include "platform/tizen/CCGL-tizen.h" - #include "platform/tizen/CCStdC-tizen.h" -#endif - // script_support #include "base/CCScriptSupport.h" diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index 8eaa72fb3f15..229c7fe14fde 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -92,6 +92,7 @@ #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCTextureAtlas.h" +#include "renderer/ccGLStateCache.h" NS_CC_BEGIN @@ -904,6 +905,12 @@ CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNameColor; CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNamePosition; CC_DEPRECATED_ATTRIBUTE extern const char* kCCAttributeNameTexCoord; +CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_None = GL::VERTEX_ATTRIB_FLAG_NONE; +CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Position = GL::VERTEX_ATTRIB_FLAG_POSITION; +CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Color = GL::VERTEX_ATTRIB_FLAG_COLOR; +CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORD; +CC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX; + CC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeRadial = ProgressTimer::Type::RADIAL; CC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeBar = ProgressTimer::Type::BAR; CC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type ProgressTimerType; @@ -1064,6 +1071,18 @@ CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawColor4F( GLfloat r, GLfloat g, GLfloat CC_DEPRECATED_ATTRIBUTE void CC_DLL ccPointSize( GLfloat pointSize ); +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLInvalidateStateCache() { GL::invalidateStateCache(); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLUseProgram(GLuint program) { GL::useProgram(program); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteProgram(GLuint program){ GL::deleteProgram(program); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBlendFunc(GLenum sfactor, GLenum dfactor) { GL::blendFunc(sfactor, dfactor); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBlendResetToCache() { GL::blendResetToCache(); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccSetProjectionMatrixDirty() { GL::setProjectionMatrixDirty(); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnableVertexAttribs(unsigned int flags) { GL::enableVertexAttribs(flags); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2D(GLuint textureId) { GL::bindTexture2D(textureId); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2DN(GLuint textureUnit, GLuint textureId) { GL::bindTexture2DN(textureUnit, textureId); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTexture(GLuint textureId) { GL::deleteTexture(textureId); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTexture(textureId); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindVAO(GLuint vaoId) { GL::bindVAO(vaoId); } CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnable( int flags ) { /* ignore */ }; CC_DEPRECATED_ATTRIBUTE typedef int ccGLServerState; diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index 2a2cc68f5611..393a52951cc2 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -951,7 +951,7 @@ bool CCBReader::readSequences() std::string CCBReader::lastPathComponent(const char* pPath) { std::string path(pPath); - size_t slashPos = path.find_last_of("/"); + size_t slashPos = path.find_last_of('/'); if(slashPos != std::string::npos) { return path.substr(slashPos + 1, path.length() - slashPos); } @@ -960,7 +960,7 @@ std::string CCBReader::lastPathComponent(const char* pPath) { std::string CCBReader::deletePathExtension(const char* pPath) { std::string path(pPath); - size_t dotPos = path.find_last_of("."); + size_t dotPos = path.find_last_of('.'); if(dotPos != std::string::npos) { return path.substr(0, dotPos); } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp index 4cbf29f59289..a9af7a53868d 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ #include "base/CCDirector.h" -#include "base/ccUtils.h" #include "renderer/CCRenderer.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" @@ -485,14 +485,13 @@ void BoneNode::onDraw(const cocos2d::Mat4 &transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR); + cocos2d::GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION | cocos2d::GL::VERTEX_ATTRIB_FLAG_COLOR); glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); - cocos2d::utils::setBlending(_blendFunc.src, _blendFunc.dst); + cocos2d::GL::blendFunc(_blendFunc.src, _blendFunc.dst); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp index 2e3ad5599885..26563959318a 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp @@ -27,10 +27,12 @@ THE SOFTWARE. #include "base/CCDirector.h" #include "math/TransformUtils.h" #include "renderer/CCRenderer.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramState.h" -#include "base/ccUtils.h" #include +using namespace cocos2d::GL; + NS_TIMELINE_BEGIN SkeletonNode* SkeletonNode::create() @@ -234,14 +236,13 @@ void SkeletonNode::batchDrawAllSubBones(const cocos2d::Mat4 &transform) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR); + cocos2d::GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION | cocos2d::GL::VERTEX_ATTRIB_FLAG_COLOR); glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, vetices); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, veticesColor); - cocos2d::utils::setBlending(_blendFunc.src, _blendFunc.dst); + cocos2d::GL::blendFunc(_blendFunc.src, _blendFunc.dst); #ifdef CC_STUDIO_ENABLED_VIEW glLineWidth(1); @@ -268,14 +269,13 @@ void SkeletonNode::onDraw(const cocos2d::Mat4 &transform, uint32_t /*flags*/) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR); + cocos2d::GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION | cocos2d::GL::VERTEX_ATTRIB_FLAG_COLOR); glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices); glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors); - cocos2d::utils::setBlending(_blendFunc.src, _blendFunc.dst); + cocos2d::GL::blendFunc(_blendFunc.src, _blendFunc.dst); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index 8898ae7aaf56..2c0e71524306 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -63,7 +63,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V { std::string path = jsonName; this->_studioVersionNumber = version; - ssize_t pos = path.find_last_of("/"); + ssize_t pos = path.find_last_of('/'); std::string fileName = path.substr(pos+1,path.length()); cocos2d::Vector actionList; int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist"); @@ -83,7 +83,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V stExpCocoNode* pCocoNode) { std::string path = file; - ssize_t pos = path.find_last_of("/"); + ssize_t pos = path.find_last_of('/'); std::string fileName = path.substr(pos+1,path.length()); cocos2d::Vector actionList; @@ -116,7 +116,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName) { std::string path = jsonName; - ssize_t pos = path.find_last_of("/"); + ssize_t pos = path.find_last_of('/'); std::string fileName = path.substr(pos+1,path.length()); auto iterator = _actionDic.find(fileName); if (iterator == _actionDic.end()) diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 11b6c928a763..f3e7f8932636 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -717,7 +717,7 @@ void Armature::setBody(cpBody *body) { detector->setBody(body); } - }); + } } } } diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 87d90b8652ce..04ee436b4500 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -296,7 +296,7 @@ void DataReaderHelper::addDataFromFile(const std::string& filePath) //! find the base file path std::string basefilePath = filePath; - size_t pos = basefilePath.find_last_of("/"); + size_t pos = basefilePath.find_last_of('/'); if (pos != std::string::npos) { @@ -362,7 +362,7 @@ void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const //! find the base file path std::string basefilePath = filePath; - size_t pos = basefilePath.find_last_of("/"); + size_t pos = basefilePath.find_last_of('/'); if (pos != std::string::npos) { @@ -1305,7 +1305,7 @@ void DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, Data } std::string filePath = path; - filePath = filePath.erase(filePath.find_last_of(".")); + filePath = filePath.erase(filePath.find_last_of('.')); if (dataInfo->asyncStruct) { @@ -1844,7 +1844,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json, } std::string filePath = path; - filePath = filePath.erase(filePath.find_last_of(".")); + filePath = filePath.erase(filePath.find_last_of('.')); if (dataInfo->asyncStruct) { diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index b3572e2db3d9..13598ba0218c 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -147,7 +147,7 @@ std::string DisplayData::changeDisplayToTexture(const std::string& displayName) { // remove .xxx std::string textureName = displayName; - size_t startPos = textureName.find_last_of("."); + size_t startPos = textureName.find_last_of('.'); if(startPos != std::string::npos) { diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp index c9156b9ca10d..42b429d8b7b5 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -144,7 +144,7 @@ void DisplayFactory::createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisp SpriteDisplayData *displayData = (SpriteDisplayData *)decoDisplay->getDisplayData(); std::string textureName = displayData->displayName; - size_t startPos = textureName.find_last_of("."); + size_t startPos = textureName.find_last_of('.'); if(startPos != std::string::npos) { @@ -191,7 +191,7 @@ void DisplayFactory::initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDispla { //! remove .xxx std::string textureName = displayName; - size_t startPos = textureName.find_last_of("."); + size_t startPos = textureName.find_last_of('.'); if(startPos != std::string::npos) { diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index df70a788a7f6..b98b66bdd14d 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -117,19 +117,19 @@ int GUIReader::getVersionInteger(const char *str) { return 0; } - size_t pos = strVersion.find_first_of("."); + size_t pos = strVersion.find_first_of('.'); std::string t = strVersion.substr(0,pos); strVersion = strVersion.substr(pos+1,strVersion.length()-1); - pos = strVersion.find_first_of("."); + pos = strVersion.find_first_of('.'); std::string h = strVersion.substr(0,pos); strVersion = strVersion.substr(pos+1,strVersion.length()-1); - pos = strVersion.find_first_of("."); + pos = strVersion.find_first_of('.'); std::string te = strVersion.substr(0,pos); strVersion = strVersion.substr(pos+1,strVersion.length()-1); - pos = strVersion.find_first_of("."); + pos = strVersion.find_first_of('.'); std::string s = strVersion.substr(0,pos); int it = atoi(t.c_str()); diff --git a/cocos/editor-support/cocostudio/CMakeLists.txt b/cocos/editor-support/cocostudio/CMakeLists.txt index da192aaa51b1..30d7ee7163d7 100644 --- a/cocos/editor-support/cocostudio/CMakeLists.txt +++ b/cocos/editor-support/cocostudio/CMakeLists.txt @@ -1,10 +1,3 @@ - -if(WINDOWS AND BUILD_SHARED_LIBS) - add_definitions(-D_USRSTUDIODLL) -endif() - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ") - set(COCOS_CS_HEADER editor-support/cocostudio/CCProcessBase.h diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 75f01a4e2b78..c2bd3cb0b605 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -160,7 +160,7 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node, std::string fullpath = FileUtils::getInstance()->fullPathForFilename(filepath); - std::string dirpath = fullpath.substr(0, fullpath.find_last_of("/")); + std::string dirpath = fullpath.substr(0, fullpath.find_last_of('/')); FileUtils::getInstance()->addSearchPath(dirpath); ArmatureDataManager::getInstance()->addArmatureFileInfo(fullpath); @@ -201,9 +201,9 @@ cocos2d::Node* ArmatureNodeReader::createNodeWithFlatBuffers(const flatbuffers: std::string ArmatureNodeReader::getArmatureName(const std::string& exporJsonPath) { //FileUtils.getFileData(exporJsonPath, "r", size) // need read armature name in exportJsonPath - size_t end = exporJsonPath.find_last_of("."); - size_t start = exporJsonPath.find_last_of("\\") + 1; - size_t start1 = exporJsonPath.find_last_of("/") + 1; + size_t end = exporJsonPath.find_last_of('.'); + size_t start = exporJsonPath.find_last_of('\\') + 1; + size_t start1 = exporJsonPath.find_last_of('/') + 1; if (start < start1) start = start1; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 88430fe280be..d8460fd85dbf 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -878,9 +878,7 @@ namespace cocostudio Color3B titleColor(textColor->r(), textColor->g(), textColor->b()); button->setTitleColor(titleColor); - int titleFontSize = options->fontSize(); - button->setTitleFontSize(titleFontSize); - + std::string titleFontName = options->fontName()->c_str(); button->setTitleFontName(titleFontName); @@ -905,6 +903,9 @@ namespace cocostudio } } + int titleFontSize = options->fontSize(); + button->setTitleFontSize(titleFontSize); + bool displaystate = options->displaystate() != 0; button->setBright(displaystate); button->setEnabled(displaystate); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index b37a4563af73..877bb3b9a46a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -324,7 +324,7 @@ namespace cocostudio { ILocalizationManager* lm = LocalizationHelper::getCurrentManager(); std::string localizedTxt = lm->getLocalizationString(text); - std::string::size_type newlineIndex = localizedTxt.find("\n"); + std::string::size_type newlineIndex = localizedTxt.find('\n'); if (newlineIndex != std::string::npos) localizedTxt = localizedTxt.substr(0, newlineIndex); textField->setString(localizedTxt); diff --git a/cocos/editor-support/spine/Animation.c b/cocos/editor-support/spine/Animation.c index 6c3fea6f2b19..35a2f39ae1ba 100644 --- a/cocos/editor-support/spine/Animation.c +++ b/cocos/editor-support/spine/Animation.c @@ -28,10 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Animation.h" +#include "spine/IkConstraint.h" #include -#include +#include "spine/extension.h" spAnimation* spAnimation_create (const char* name, int timelinesCount) { spAnimation* self = NEW(spAnimation); diff --git a/cocos/editor-support/spine/Animation.h b/cocos/editor-support/spine/Animation.h index 296f8e26ea90..d9ea6d860ffe 100644 --- a/cocos/editor-support/spine/Animation.h +++ b/cocos/editor-support/spine/Animation.h @@ -31,9 +31,9 @@ #ifndef SPINE_ANIMATION_H_ #define SPINE_ANIMATION_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/Event.h" +#include "spine/Attachment.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/AnimationState.c b/cocos/editor-support/spine/AnimationState.c index 14ad9dd1510b..3b01a89677cc 100644 --- a/cocos/editor-support/spine/AnimationState.c +++ b/cocos/editor-support/spine/AnimationState.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/AnimationState.h" +#include "spine/extension.h" #include #define SUBSEQUENT 0 diff --git a/cocos/editor-support/spine/AnimationState.h b/cocos/editor-support/spine/AnimationState.h index a8b54e73253f..0963bb81ec92 100644 --- a/cocos/editor-support/spine/AnimationState.h +++ b/cocos/editor-support/spine/AnimationState.h @@ -31,11 +31,11 @@ #ifndef SPINE_ANIMATIONSTATE_H_ #define SPINE_ANIMATIONSTATE_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Animation.h" +#include "spine/AnimationStateData.h" +#include "spine/Event.h" +#include "spine/Array.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/AnimationStateData.c b/cocos/editor-support/spine/AnimationStateData.c index 40279a8e194e..ed7d097bb00a 100644 --- a/cocos/editor-support/spine/AnimationStateData.c +++ b/cocos/editor-support/spine/AnimationStateData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/AnimationStateData.h" +#include "spine/extension.h" typedef struct _ToEntry _ToEntry; struct _ToEntry { diff --git a/cocos/editor-support/spine/AnimationStateData.h b/cocos/editor-support/spine/AnimationStateData.h index 87bdba5c1892..25f691ee6bcd 100644 --- a/cocos/editor-support/spine/AnimationStateData.h +++ b/cocos/editor-support/spine/AnimationStateData.h @@ -31,9 +31,9 @@ #ifndef SPINE_ANIMATIONSTATEDATA_H_ #define SPINE_ANIMATIONSTATEDATA_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/Animation.h" +#include "spine/SkeletonData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Array.c b/cocos/editor-support/spine/Array.c index 03a32bc78b31..346f5a4c0461 100644 --- a/cocos/editor-support/spine/Array.c +++ b/cocos/editor-support/spine/Array.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Array.h" +#include "spine/extension.h" _SP_ARRAY_IMPLEMENT_TYPE(spFloatArray, float) _SP_ARRAY_IMPLEMENT_TYPE(spIntArray, int) diff --git a/cocos/editor-support/spine/Array.h b/cocos/editor-support/spine/Array.h index 3beb083253fe..1362050da0a5 100644 --- a/cocos/editor-support/spine/Array.h +++ b/cocos/editor-support/spine/Array.h @@ -31,7 +31,7 @@ #ifndef SPINE_ARRAY_H #define SPINE_ARRAY_H -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Atlas.c b/cocos/editor-support/spine/Atlas.c index 00b5364176f3..6977e5e0d6b9 100644 --- a/cocos/editor-support/spine/Atlas.c +++ b/cocos/editor-support/spine/Atlas.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/Atlas.h" #include -#include +#include "spine/extension.h" spAtlasPage* spAtlasPage_create(spAtlas* atlas, const char* name) { spAtlasPage* self = NEW(spAtlasPage); diff --git a/cocos/editor-support/spine/Atlas.h b/cocos/editor-support/spine/Atlas.h index 61637f17909f..15e236827809 100644 --- a/cocos/editor-support/spine/Atlas.h +++ b/cocos/editor-support/spine/Atlas.h @@ -31,7 +31,7 @@ #ifndef SPINE_ATLAS_H_ #define SPINE_ATLAS_H_ -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.c b/cocos/editor-support/spine/AtlasAttachmentLoader.c index ea686ada0480..aa6866fc4e57 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.c +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/AtlasAttachmentLoader.h" +#include "spine/extension.h" spAttachment* _spAtlasAttachmentLoader_createAttachment (spAttachmentLoader* loader, spSkin* skin, spAttachmentType type, const char* name, const char* path) { diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.h b/cocos/editor-support/spine/AtlasAttachmentLoader.h index a62b14e5b6e3..0ad0ef7122b7 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.h +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.h @@ -31,9 +31,9 @@ #ifndef SPINE_ATLASATTACHMENTLOADER_H_ #define SPINE_ATLASATTACHMENTLOADER_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/AttachmentLoader.h" +#include "spine/Atlas.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Attachment.c b/cocos/editor-support/spine/Attachment.c index 69d547a57b04..5dbaefd16162 100644 --- a/cocos/editor-support/spine/Attachment.c +++ b/cocos/editor-support/spine/Attachment.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/Attachment.h" +#include "spine/extension.h" +#include "spine/Slot.h" typedef struct _spAttachmentVtable { void (*dispose) (spAttachment* self); diff --git a/cocos/editor-support/spine/Attachment.h b/cocos/editor-support/spine/Attachment.h index 39d2cf3a0872..5181777f9f06 100644 --- a/cocos/editor-support/spine/Attachment.h +++ b/cocos/editor-support/spine/Attachment.h @@ -31,7 +31,7 @@ #ifndef SPINE_ATTACHMENT_H_ #define SPINE_ATTACHMENT_H_ -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/AttachmentLoader.c b/cocos/editor-support/spine/AttachmentLoader.c index 6a1e04eaaf69..6287364f4473 100644 --- a/cocos/editor-support/spine/AttachmentLoader.c +++ b/cocos/editor-support/spine/AttachmentLoader.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/AttachmentLoader.h" #include -#include +#include "spine/extension.h" typedef struct _spAttachmentLoaderVtable { spAttachment* (*createAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, diff --git a/cocos/editor-support/spine/AttachmentLoader.h b/cocos/editor-support/spine/AttachmentLoader.h index 774ff8ecdfce..cb43cf56e666 100644 --- a/cocos/editor-support/spine/AttachmentLoader.h +++ b/cocos/editor-support/spine/AttachmentLoader.h @@ -31,9 +31,9 @@ #ifndef SPINE_ATTACHMENTLOADER_H_ #define SPINE_ATTACHMENTLOADER_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/Skin.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/AttachmentVertices.cpp b/cocos/editor-support/spine/AttachmentVertices.cpp index ce614ec74688..814c11457a7a 100644 --- a/cocos/editor-support/spine/AttachmentVertices.cpp +++ b/cocos/editor-support/spine/AttachmentVertices.cpp @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/AttachmentVertices.h" USING_NS_CC; diff --git a/cocos/editor-support/spine/Bone.c b/cocos/editor-support/spine/Bone.c index 66571ab13333..471cf3217052 100644 --- a/cocos/editor-support/spine/Bone.c +++ b/cocos/editor-support/spine/Bone.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Bone.h" +#include "spine/extension.h" #include static int yDown; diff --git a/cocos/editor-support/spine/Bone.h b/cocos/editor-support/spine/Bone.h index 725152a62748..4f7ca102756e 100644 --- a/cocos/editor-support/spine/Bone.h +++ b/cocos/editor-support/spine/Bone.h @@ -31,8 +31,8 @@ #ifndef SPINE_BONE_H_ #define SPINE_BONE_H_ -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/BoneData.c b/cocos/editor-support/spine/BoneData.c index 6338e7f14345..01ff134f8f2a 100644 --- a/cocos/editor-support/spine/BoneData.c +++ b/cocos/editor-support/spine/BoneData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/BoneData.h" +#include "spine/extension.h" spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent) { spBoneData* self = NEW(spBoneData); diff --git a/cocos/editor-support/spine/BoneData.h b/cocos/editor-support/spine/BoneData.h index 1f4730b1b3b7..59dd2e86c01e 100644 --- a/cocos/editor-support/spine/BoneData.h +++ b/cocos/editor-support/spine/BoneData.h @@ -31,7 +31,7 @@ #ifndef SPINE_BONEDATA_H_ #define SPINE_BONEDATA_H_ -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/BoundingBoxAttachment.c b/cocos/editor-support/spine/BoundingBoxAttachment.c index 2cbea77d8b05..38d3761c4d67 100644 --- a/cocos/editor-support/spine/BoundingBoxAttachment.c +++ b/cocos/editor-support/spine/BoundingBoxAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/BoundingBoxAttachment.h" +#include "spine/extension.h" void _spBoundingBoxAttachment_dispose (spAttachment* attachment) { spBoundingBoxAttachment* self = SUB_CAST(spBoundingBoxAttachment, attachment); diff --git a/cocos/editor-support/spine/BoundingBoxAttachment.h b/cocos/editor-support/spine/BoundingBoxAttachment.h index 71d4876d30be..8c2d675c3458 100644 --- a/cocos/editor-support/spine/BoundingBoxAttachment.h +++ b/cocos/editor-support/spine/BoundingBoxAttachment.h @@ -31,11 +31,11 @@ #ifndef SPINE_BOUNDINGBOXATTACHMENT_H_ #define SPINE_BOUNDINGBOXATTACHMENT_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/VertexAttachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/ClippingAttachment.c b/cocos/editor-support/spine/ClippingAttachment.c index 0c2d4ab5f7ed..33638f144367 100644 --- a/cocos/editor-support/spine/ClippingAttachment.c +++ b/cocos/editor-support/spine/ClippingAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/ClippingAttachment.h" +#include "spine/extension.h" void _spClippingAttachment_dispose (spAttachment* attachment) { spClippingAttachment* self = SUB_CAST(spClippingAttachment, attachment); diff --git a/cocos/editor-support/spine/ClippingAttachment.h b/cocos/editor-support/spine/ClippingAttachment.h index 134334d6d727..c66c2fe49cbc 100644 --- a/cocos/editor-support/spine/ClippingAttachment.h +++ b/cocos/editor-support/spine/ClippingAttachment.h @@ -31,11 +31,11 @@ #ifndef SPINE_CLIPPINGATTACHMENT_H_ #define SPINE_CLIPPINGATTACHMENT_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/VertexAttachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Cocos2dAttachmentLoader.cpp b/cocos/editor-support/spine/Cocos2dAttachmentLoader.cpp index bb91555231b0..1fe8a22628ee 100644 --- a/cocos/editor-support/spine/Cocos2dAttachmentLoader.cpp +++ b/cocos/editor-support/spine/Cocos2dAttachmentLoader.cpp @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/Cocos2dAttachmentLoader.h" +#include "spine/extension.h" +#include "spine/AttachmentVertices.h" USING_NS_CC; using namespace spine; diff --git a/cocos/editor-support/spine/Cocos2dAttachmentLoader.h b/cocos/editor-support/spine/Cocos2dAttachmentLoader.h index 35f95e9104fa..8bb634ceaed2 100644 --- a/cocos/editor-support/spine/Cocos2dAttachmentLoader.h +++ b/cocos/editor-support/spine/Cocos2dAttachmentLoader.h @@ -31,7 +31,7 @@ #ifndef SPINE_COCOS2DATTACHMENTLOADER_H_ #define SPINE_COCOS2DATTACHMENTLOADER_H_ -#include +#include "spine/AtlasAttachmentLoader.h" extern "C" { diff --git a/cocos/editor-support/spine/Color.c b/cocos/editor-support/spine/Color.c index 02168ee3cce0..365fcb6ab3b3 100644 --- a/cocos/editor-support/spine/Color.c +++ b/cocos/editor-support/spine/Color.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Color.h" +#include "spine/extension.h" spColor* spColor_create() { return MALLOC(spColor, 1); diff --git a/cocos/editor-support/spine/Color.h b/cocos/editor-support/spine/Color.h index 272ba95524b6..941188398ec9 100644 --- a/cocos/editor-support/spine/Color.h +++ b/cocos/editor-support/spine/Color.h @@ -31,7 +31,7 @@ #ifndef SPINE_COLOR_H_ #define SPINE_COLOR_H_ -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Event.c b/cocos/editor-support/spine/Event.c index 04b2f67de39b..caa661b087cd 100644 --- a/cocos/editor-support/spine/Event.c +++ b/cocos/editor-support/spine/Event.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Event.h" +#include "spine/extension.h" spEvent* spEvent_create (float time, spEventData* data) { spEvent* self = NEW(spEvent); diff --git a/cocos/editor-support/spine/Event.h b/cocos/editor-support/spine/Event.h index 308fd3953000..d08052852eca 100644 --- a/cocos/editor-support/spine/Event.h +++ b/cocos/editor-support/spine/Event.h @@ -31,8 +31,8 @@ #ifndef SPINE_EVENT_H_ #define SPINE_EVENT_H_ -#include -#include +#include "spine/dll.h" +#include "spine/EventData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/EventData.c b/cocos/editor-support/spine/EventData.c index b53fe152f6be..cdbc6461a412 100644 --- a/cocos/editor-support/spine/EventData.c +++ b/cocos/editor-support/spine/EventData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/EventData.h" +#include "spine/extension.h" spEventData* spEventData_create (const char* name) { spEventData* self = NEW(spEventData); diff --git a/cocos/editor-support/spine/EventData.h b/cocos/editor-support/spine/EventData.h index 459d161c9ee0..628c4486724e 100644 --- a/cocos/editor-support/spine/EventData.h +++ b/cocos/editor-support/spine/EventData.h @@ -31,7 +31,7 @@ #ifndef SPINE_EVENTDATA_H_ #define SPINE_EVENTDATA_H_ -#include +#include "spine/dll.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/IkConstraint.c b/cocos/editor-support/spine/IkConstraint.c index 509bc25d5da7..3b59e4a6c5d8 100644 --- a/cocos/editor-support/spine/IkConstraint.c +++ b/cocos/editor-support/spine/IkConstraint.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/IkConstraint.h" +#include "spine/Skeleton.h" +#include "spine/extension.h" #include spIkConstraint *spIkConstraint_create(spIkConstraintData *data, const spSkeleton *skeleton) { diff --git a/cocos/editor-support/spine/IkConstraint.h b/cocos/editor-support/spine/IkConstraint.h index e9f27ba2e7dd..2ba8157f0721 100644 --- a/cocos/editor-support/spine/IkConstraint.h +++ b/cocos/editor-support/spine/IkConstraint.h @@ -31,9 +31,9 @@ #ifndef SPINE_IKCONSTRAINT_H_ #define SPINE_IKCONSTRAINT_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/IkConstraintData.h" +#include "spine/Bone.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/IkConstraintData.c b/cocos/editor-support/spine/IkConstraintData.c index c4d99faecd90..f74de615a9f7 100644 --- a/cocos/editor-support/spine/IkConstraintData.c +++ b/cocos/editor-support/spine/IkConstraintData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/IkConstraintData.h" +#include "spine/extension.h" spIkConstraintData* spIkConstraintData_create (const char* name) { spIkConstraintData* self = NEW(spIkConstraintData); diff --git a/cocos/editor-support/spine/IkConstraintData.h b/cocos/editor-support/spine/IkConstraintData.h index de8f899c1d26..dd93405e9b05 100644 --- a/cocos/editor-support/spine/IkConstraintData.h +++ b/cocos/editor-support/spine/IkConstraintData.h @@ -31,8 +31,8 @@ #ifndef SPINE_IKCONSTRAINTDATA_H_ #define SPINE_IKCONSTRAINTDATA_H_ -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Json.c b/cocos/editor-support/spine/Json.c index 6225ff00cc82..17cf10b17025 100644 --- a/cocos/editor-support/spine/Json.c +++ b/cocos/editor-support/spine/Json.c @@ -39,7 +39,7 @@ #include #include /* strtod (C89), strtof (C99) */ #include /* strcasecmp (4.4BSD - compatibility), _stricmp (_WIN32) */ -#include +#include "spine/extension.h" #ifndef SPINE_JSON_DEBUG /* Define this to do extra NULL and expected-character checking */ diff --git a/cocos/editor-support/spine/MeshAttachment.c b/cocos/editor-support/spine/MeshAttachment.c index bd1ab94bd056..6bc8d23c604f 100644 --- a/cocos/editor-support/spine/MeshAttachment.c +++ b/cocos/editor-support/spine/MeshAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/MeshAttachment.h" +#include "spine/extension.h" void _spMeshAttachment_dispose (spAttachment* attachment) { spMeshAttachment* self = SUB_CAST(spMeshAttachment, attachment); diff --git a/cocos/editor-support/spine/MeshAttachment.h b/cocos/editor-support/spine/MeshAttachment.h index 20a7e75ac44c..03b1491512d3 100644 --- a/cocos/editor-support/spine/MeshAttachment.h +++ b/cocos/editor-support/spine/MeshAttachment.h @@ -31,11 +31,11 @@ #ifndef SPINE_MESHATTACHMENT_H_ #define SPINE_MESHATTACHMENT_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/VertexAttachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/PathAttachment.c b/cocos/editor-support/spine/PathAttachment.c index 92305f1b7678..06ef9b508992 100644 --- a/cocos/editor-support/spine/PathAttachment.c +++ b/cocos/editor-support/spine/PathAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/PathAttachment.h" +#include "spine/extension.h" void _spPathAttachment_dispose (spAttachment* attachment) { spPathAttachment* self = SUB_CAST(spPathAttachment, attachment); diff --git a/cocos/editor-support/spine/PathAttachment.h b/cocos/editor-support/spine/PathAttachment.h index 6584733bd3a1..f6809bbe4e08 100644 --- a/cocos/editor-support/spine/PathAttachment.h +++ b/cocos/editor-support/spine/PathAttachment.h @@ -31,11 +31,11 @@ #ifndef SPINE_PATHATTACHMENT_H_ #define SPINE_PATHATTACHMENT_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/VertexAttachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/PathConstraint.c b/cocos/editor-support/spine/PathConstraint.c index 988d0d1154b0..67be24cbbf50 100644 --- a/cocos/editor-support/spine/PathConstraint.c +++ b/cocos/editor-support/spine/PathConstraint.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/PathConstraint.h" +#include "spine/Skeleton.h" +#include "spine/extension.h" #define PATHCONSTRAINT_NONE -1 #define PATHCONSTRAINT_BEFORE -2 diff --git a/cocos/editor-support/spine/PathConstraint.h b/cocos/editor-support/spine/PathConstraint.h index d6c761eb3a05..73b7e9c89122 100644 --- a/cocos/editor-support/spine/PathConstraint.h +++ b/cocos/editor-support/spine/PathConstraint.h @@ -31,10 +31,10 @@ #ifndef SPINE_PATHCONSTRAINT_H_ #define SPINE_PATHCONSTRAINT_H_ -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/PathConstraintData.h" +#include "spine/Bone.h" +#include "spine/Slot.h" #include "PathAttachment.h" #ifdef __cplusplus diff --git a/cocos/editor-support/spine/PathConstraintData.c b/cocos/editor-support/spine/PathConstraintData.c index a02f8c3576e6..a1cdfcdc9a80 100644 --- a/cocos/editor-support/spine/PathConstraintData.c +++ b/cocos/editor-support/spine/PathConstraintData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/PathConstraintData.h" +#include "spine/extension.h" spPathConstraintData* spPathConstraintData_create (const char* name) { spPathConstraintData* self = NEW(spPathConstraintData); diff --git a/cocos/editor-support/spine/PathConstraintData.h b/cocos/editor-support/spine/PathConstraintData.h index 0c515dbea202..41103cf228fc 100644 --- a/cocos/editor-support/spine/PathConstraintData.h +++ b/cocos/editor-support/spine/PathConstraintData.h @@ -31,9 +31,9 @@ #ifndef SPINE_PATHCONSTRAINTDATA_H_ #define SPINE_PATHCONSTRAINTDATA_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" +#include "spine/SlotData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/PointAttachment.c b/cocos/editor-support/spine/PointAttachment.c index 9a013966352b..bcbe3ea20353 100644 --- a/cocos/editor-support/spine/PointAttachment.c +++ b/cocos/editor-support/spine/PointAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/PointAttachment.h" +#include "spine/extension.h" void _spPointAttachment_dispose (spAttachment* attachment) { spPathAttachment* self = SUB_CAST(spPathAttachment, attachment); diff --git a/cocos/editor-support/spine/PointAttachment.h b/cocos/editor-support/spine/PointAttachment.h index da8df6cbbdfd..768fa994a6e1 100644 --- a/cocos/editor-support/spine/PointAttachment.h +++ b/cocos/editor-support/spine/PointAttachment.h @@ -31,11 +31,11 @@ #ifndef SPINE_POINTATTACHMENT_H_ #define SPINE_POINTATTACHMENT_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/VertexAttachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/RegionAttachment.c b/cocos/editor-support/spine/RegionAttachment.c index ee905f1d9084..1ba5a5712cc4 100644 --- a/cocos/editor-support/spine/RegionAttachment.c +++ b/cocos/editor-support/spine/RegionAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/RegionAttachment.h" +#include "spine/extension.h" typedef enum { BLX = 0, BLY, ULX, ULY, URX, URY, BRX, BRY diff --git a/cocos/editor-support/spine/RegionAttachment.h b/cocos/editor-support/spine/RegionAttachment.h index 59249c218aa1..30663f632641 100644 --- a/cocos/editor-support/spine/RegionAttachment.h +++ b/cocos/editor-support/spine/RegionAttachment.h @@ -31,10 +31,10 @@ #ifndef SPINE_REGIONATTACHMENT_H_ #define SPINE_REGIONATTACHMENT_H_ -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/Atlas.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Skeleton.c b/cocos/editor-support/spine/Skeleton.c index 125e28b15da4..7c9a3d8b5266 100644 --- a/cocos/editor-support/spine/Skeleton.c +++ b/cocos/editor-support/spine/Skeleton.c @@ -28,10 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/Skeleton.h" #include #include -#include +#include "spine/extension.h" typedef enum { SP_UPDATE_BONE, SP_UPDATE_IK_CONSTRAINT, SP_UPDATE_PATH_CONSTRAINT, SP_UPDATE_TRANSFORM_CONSTRAINT diff --git a/cocos/editor-support/spine/Skeleton.h b/cocos/editor-support/spine/Skeleton.h index 74bc528d19db..60494cdeead1 100644 --- a/cocos/editor-support/spine/Skeleton.h +++ b/cocos/editor-support/spine/Skeleton.h @@ -31,13 +31,13 @@ #ifndef SPINE_SKELETON_H_ #define SPINE_SKELETON_H_ -#include -#include -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/SkeletonData.h" +#include "spine/Slot.h" +#include "spine/Skin.h" +#include "spine/IkConstraint.h" +#include "spine/TransformConstraint.h" +#include "spine/PathConstraint.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonAnimation.cpp b/cocos/editor-support/spine/SkeletonAnimation.cpp index acf53fea8b57..ef1d0d5364dd 100644 --- a/cocos/editor-support/spine/SkeletonAnimation.cpp +++ b/cocos/editor-support/spine/SkeletonAnimation.cpp @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/SkeletonAnimation.h" +#include "spine/spine-cocos2dx.h" +#include "spine/extension.h" #include USING_NS_CC; diff --git a/cocos/editor-support/spine/SkeletonAnimation.h b/cocos/editor-support/spine/SkeletonAnimation.h index fc7f163cae23..5108909dd51b 100644 --- a/cocos/editor-support/spine/SkeletonAnimation.h +++ b/cocos/editor-support/spine/SkeletonAnimation.h @@ -31,8 +31,8 @@ #ifndef SPINE_SKELETONANIMATION_H_ #define SPINE_SKELETONANIMATION_H_ -#include -#include +#include "spine/spine.h" +#include "spine/SkeletonRenderer.h" #include "cocos2d.h" namespace spine { diff --git a/cocos/editor-support/spine/SkeletonBatch.cpp b/cocos/editor-support/spine/SkeletonBatch.cpp index 7ac3ce419c10..b9361e74e976 100644 --- a/cocos/editor-support/spine/SkeletonBatch.cpp +++ b/cocos/editor-support/spine/SkeletonBatch.cpp @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/SkeletonBatch.h" +#include "spine/extension.h" #include USING_NS_CC; diff --git a/cocos/editor-support/spine/SkeletonBatch.h b/cocos/editor-support/spine/SkeletonBatch.h index eea569739f1a..c3cdb7dd5515 100644 --- a/cocos/editor-support/spine/SkeletonBatch.h +++ b/cocos/editor-support/spine/SkeletonBatch.h @@ -31,7 +31,7 @@ #ifndef SPINE_SKELETONBATCH_H_ #define SPINE_SKELETONBATCH_H_ -#include +#include "spine/spine.h" #include "cocos2d.h" #include diff --git a/cocos/editor-support/spine/SkeletonBinary.c b/cocos/editor-support/spine/SkeletonBinary.c index 97168a5bb0e2..6ad508c2baca 100644 --- a/cocos/editor-support/spine/SkeletonBinary.c +++ b/cocos/editor-support/spine/SkeletonBinary.c @@ -28,11 +28,11 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/SkeletonBinary.h" #include -#include -#include -#include +#include "spine/extension.h" +#include "spine/AtlasAttachmentLoader.h" +#include "spine/Animation.h" #include "kvec.h" typedef struct { diff --git a/cocos/editor-support/spine/SkeletonBinary.h b/cocos/editor-support/spine/SkeletonBinary.h index 41f50d3171f9..9985cfa4bbf6 100644 --- a/cocos/editor-support/spine/SkeletonBinary.h +++ b/cocos/editor-support/spine/SkeletonBinary.h @@ -31,11 +31,11 @@ #ifndef SPINE_SKELETONBINARY_H_ #define SPINE_SKELETONBINARY_H_ -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/AttachmentLoader.h" +#include "spine/SkeletonData.h" +#include "spine/Atlas.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonBounds.c b/cocos/editor-support/spine/SkeletonBounds.c index 5caa6dc8ee14..10ac96765ac2 100644 --- a/cocos/editor-support/spine/SkeletonBounds.c +++ b/cocos/editor-support/spine/SkeletonBounds.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/SkeletonBounds.h" #include -#include +#include "spine/extension.h" spPolygon* spPolygon_create (int capacity) { spPolygon* self = NEW(spPolygon); diff --git a/cocos/editor-support/spine/SkeletonBounds.h b/cocos/editor-support/spine/SkeletonBounds.h index 077dca5c8971..98ca9c58515b 100644 --- a/cocos/editor-support/spine/SkeletonBounds.h +++ b/cocos/editor-support/spine/SkeletonBounds.h @@ -31,9 +31,9 @@ #ifndef SPINE_SKELETONBOUNDS_H_ #define SPINE_SKELETONBOUNDS_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/BoundingBoxAttachment.h" +#include "spine/Skeleton.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonClipping.c b/cocos/editor-support/spine/SkeletonClipping.c index 8d2c7803c56f..4da622bdb37a 100644 --- a/cocos/editor-support/spine/SkeletonClipping.c +++ b/cocos/editor-support/spine/SkeletonClipping.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/SkeletonClipping.h" +#include "spine/extension.h" spSkeletonClipping* spSkeletonClipping_create() { spSkeletonClipping* clipping = CALLOC(spSkeletonClipping, 1); diff --git a/cocos/editor-support/spine/SkeletonClipping.h b/cocos/editor-support/spine/SkeletonClipping.h index 74f21fccb796..ae7d9f373584 100644 --- a/cocos/editor-support/spine/SkeletonClipping.h +++ b/cocos/editor-support/spine/SkeletonClipping.h @@ -31,11 +31,11 @@ #ifndef SPINE_SKELETONCLIPPING_H #define SPINE_SKELETONCLIPPING_H -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Array.h" +#include "spine/ClippingAttachment.h" +#include "spine/Slot.h" +#include "spine/Triangulator.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonData.c b/cocos/editor-support/spine/SkeletonData.c index 78a724e45234..a6879c1409b0 100644 --- a/cocos/editor-support/spine/SkeletonData.c +++ b/cocos/editor-support/spine/SkeletonData.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/SkeletonData.h" #include -#include +#include "spine/extension.h" spSkeletonData* spSkeletonData_create () { return NEW(spSkeletonData); diff --git a/cocos/editor-support/spine/SkeletonData.h b/cocos/editor-support/spine/SkeletonData.h index 5383d7d144f7..b608c92fb386 100644 --- a/cocos/editor-support/spine/SkeletonData.h +++ b/cocos/editor-support/spine/SkeletonData.h @@ -31,15 +31,15 @@ #ifndef SPINE_SKELETONDATA_H_ #define SPINE_SKELETONDATA_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" +#include "spine/SlotData.h" +#include "spine/Skin.h" +#include "spine/EventData.h" +#include "spine/Animation.h" +#include "spine/IkConstraintData.h" +#include "spine/TransformConstraintData.h" +#include "spine/PathConstraintData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonJson.c b/cocos/editor-support/spine/SkeletonJson.c index 842258dee1a1..c21e062442bb 100644 --- a/cocos/editor-support/spine/SkeletonJson.c +++ b/cocos/editor-support/spine/SkeletonJson.c @@ -28,13 +28,13 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/SkeletonJson.h" #include #include #include "Json.h" -#include -#include -#include +#include "spine/extension.h" +#include "spine/AtlasAttachmentLoader.h" +#include "spine/Array.h" #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #define strdup _strdup diff --git a/cocos/editor-support/spine/SkeletonJson.h b/cocos/editor-support/spine/SkeletonJson.h index 58eacdd8b2b1..88a64ba5fc94 100644 --- a/cocos/editor-support/spine/SkeletonJson.h +++ b/cocos/editor-support/spine/SkeletonJson.h @@ -31,12 +31,12 @@ #ifndef SPINE_SKELETONJSON_H_ #define SPINE_SKELETONJSON_H_ -#include -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/AttachmentLoader.h" +#include "spine/SkeletonData.h" +#include "spine/Atlas.h" +#include "spine/Animation.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SkeletonRenderer.cpp b/cocos/editor-support/spine/SkeletonRenderer.cpp index 860ce3501101..b8668e73355c 100644 --- a/cocos/editor-support/spine/SkeletonRenderer.cpp +++ b/cocos/editor-support/spine/SkeletonRenderer.cpp @@ -28,12 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include -#include -#include -#include +#include "spine/SkeletonRenderer.h" +#include "spine/extension.h" +#include "spine/SkeletonBatch.h" +#include "spine/SkeletonTwoColorBatch.h" +#include "spine/AttachmentVertices.h" +#include "spine/Cocos2dAttachmentLoader.h" #include USING_NS_CC; diff --git a/cocos/editor-support/spine/SkeletonRenderer.h b/cocos/editor-support/spine/SkeletonRenderer.h index adf34bd70bfe..7cae9b8a663b 100644 --- a/cocos/editor-support/spine/SkeletonRenderer.h +++ b/cocos/editor-support/spine/SkeletonRenderer.h @@ -31,7 +31,7 @@ #ifndef SPINE_SKELETONRENDERER_H_ #define SPINE_SKELETONRENDERER_H_ -#include +#include "spine/spine.h" #include "cocos2d.h" namespace spine { diff --git a/cocos/editor-support/spine/SkeletonTwoColorBatch.cpp b/cocos/editor-support/spine/SkeletonTwoColorBatch.cpp index fac3fc971af8..2c191b9e901a 100644 --- a/cocos/editor-support/spine/SkeletonTwoColorBatch.cpp +++ b/cocos/editor-support/spine/SkeletonTwoColorBatch.cpp @@ -27,12 +27,10 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/SkeletonTwoColorBatch.h" +#include "spine/extension.h" #include -#include "base/ccUtils.h" - USING_NS_CC; #define EVENT_AFTER_DRAW_RESET_POSITION "director_after_draw" using std::max; @@ -92,17 +90,14 @@ void TwoColorTrianglesCommand::generateMaterialID() { void TwoColorTrianglesCommand::useMaterial() const { //Set texture - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _textureID); + GL::bindTexture2D(_textureID); - if (_alphaTextureID > 0) - { + if (_alphaTextureID > 0) { // ANDROID ETC1 ALPHA supports. - glActiveTexture(GL_TEXTURE0 + 1); - glBindTexture(GL_TEXTURE_2D, _alphaTextureID); + GL::bindTexture2DN(1, _alphaTextureID); } //set blend mode - cocos2d::utils::setBlending(_blendType.src, _blendType.dst); + GL::blendFunc(_blendType.src, _blendType.dst); _glProgramState->apply(_mv); } diff --git a/cocos/editor-support/spine/SkeletonTwoColorBatch.h b/cocos/editor-support/spine/SkeletonTwoColorBatch.h index 8035fad47d2c..d69aee5a6870 100644 --- a/cocos/editor-support/spine/SkeletonTwoColorBatch.h +++ b/cocos/editor-support/spine/SkeletonTwoColorBatch.h @@ -31,7 +31,7 @@ #ifndef SPINE_SKELETONTWOCOLORBATCH_H_ #define SPINE_SKELETONTWOCOLORBATCH_H_ -#include +#include "spine/spine.h" #include "cocos2d.h" #include diff --git a/cocos/editor-support/spine/Skin.c b/cocos/editor-support/spine/Skin.c index 66fbd1af0130..6822d456c917 100644 --- a/cocos/editor-support/spine/Skin.c +++ b/cocos/editor-support/spine/Skin.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Skin.h" +#include "spine/extension.h" _Entry* _Entry_create (int slotIndex, const char* name, spAttachment* attachment) { _Entry* self = NEW(_Entry); diff --git a/cocos/editor-support/spine/Skin.h b/cocos/editor-support/spine/Skin.h index 488ad1450543..a18b37dbc1e7 100644 --- a/cocos/editor-support/spine/Skin.h +++ b/cocos/editor-support/spine/Skin.h @@ -31,8 +31,8 @@ #ifndef SPINE_SKIN_H_ #define SPINE_SKIN_H_ -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Slot.c b/cocos/editor-support/spine/Slot.c index 49888bb5cb85..7d46c9c18966 100644 --- a/cocos/editor-support/spine/Slot.c +++ b/cocos/editor-support/spine/Slot.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Slot.h" +#include "spine/extension.h" typedef struct { spSlot super; diff --git a/cocos/editor-support/spine/Slot.h b/cocos/editor-support/spine/Slot.h index 16db951b6d9e..54354d4e70ec 100644 --- a/cocos/editor-support/spine/Slot.h +++ b/cocos/editor-support/spine/Slot.h @@ -31,10 +31,10 @@ #ifndef SPINE_SLOT_H_ #define SPINE_SLOT_H_ -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Bone.h" +#include "spine/Attachment.h" +#include "spine/SlotData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/SlotData.c b/cocos/editor-support/spine/SlotData.c index 7ef171e85500..957b828f18ec 100644 --- a/cocos/editor-support/spine/SlotData.c +++ b/cocos/editor-support/spine/SlotData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/SlotData.h" +#include "spine/extension.h" spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData) { spSlotData* self = NEW(spSlotData); diff --git a/cocos/editor-support/spine/SlotData.h b/cocos/editor-support/spine/SlotData.h index 669d01f50cb1..e802461bd131 100644 --- a/cocos/editor-support/spine/SlotData.h +++ b/cocos/editor-support/spine/SlotData.h @@ -31,9 +31,9 @@ #ifndef SPINE_SLOTDATA_H_ #define SPINE_SLOTDATA_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" +#include "spine/Color.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/TransformConstraint.c b/cocos/editor-support/spine/TransformConstraint.c index 233dfa2d6f98..43b5b5c49212 100644 --- a/cocos/editor-support/spine/TransformConstraint.c +++ b/cocos/editor-support/spine/TransformConstraint.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include -#include +#include "spine/TransformConstraint.h" +#include "spine/Skeleton.h" +#include "spine/extension.h" spTransformConstraint* spTransformConstraint_create (spTransformConstraintData* data, const spSkeleton* skeleton) { int i; diff --git a/cocos/editor-support/spine/TransformConstraint.h b/cocos/editor-support/spine/TransformConstraint.h index 0af1d8d5d3de..84dcc6a9d1a4 100644 --- a/cocos/editor-support/spine/TransformConstraint.h +++ b/cocos/editor-support/spine/TransformConstraint.h @@ -31,9 +31,9 @@ #ifndef SPINE_TRANSFORMCONSTRAINT_H_ #define SPINE_TRANSFORMCONSTRAINT_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/TransformConstraintData.h" +#include "spine/Bone.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/TransformConstraintData.c b/cocos/editor-support/spine/TransformConstraintData.c index c9b3d06e3ef2..62ebf1371f50 100644 --- a/cocos/editor-support/spine/TransformConstraintData.c +++ b/cocos/editor-support/spine/TransformConstraintData.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/TransformConstraintData.h" +#include "spine/extension.h" spTransformConstraintData* spTransformConstraintData_create (const char* name) { spTransformConstraintData* self = NEW(spTransformConstraintData); diff --git a/cocos/editor-support/spine/TransformConstraintData.h b/cocos/editor-support/spine/TransformConstraintData.h index 34920b877dbc..63b1fb3f3d24 100644 --- a/cocos/editor-support/spine/TransformConstraintData.h +++ b/cocos/editor-support/spine/TransformConstraintData.h @@ -31,8 +31,8 @@ #ifndef SPINE_TRANSFORMCONSTRAINTDATA_H_ #define SPINE_TRANSFORMCONSTRAINTDATA_H_ -#include -#include +#include "spine/dll.h" +#include "spine/BoneData.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/Triangulator.c b/cocos/editor-support/spine/Triangulator.c index bc473825850a..0deba5da247a 100644 --- a/cocos/editor-support/spine/Triangulator.c +++ b/cocos/editor-support/spine/Triangulator.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/Triangulator.h" +#include "spine/extension.h" #include spTriangulator* spTriangulator_create() { diff --git a/cocos/editor-support/spine/Triangulator.h b/cocos/editor-support/spine/Triangulator.h index 69863b2f78c7..5a6ace56d6f2 100644 --- a/cocos/editor-support/spine/Triangulator.h +++ b/cocos/editor-support/spine/Triangulator.h @@ -31,8 +31,8 @@ #ifndef SPINE_TRIANGULATOR_H #define SPINE_TRIANGULATOR_H -#include -#include +#include "spine/dll.h" +#include "spine/Array.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/VertexAttachment.c b/cocos/editor-support/spine/VertexAttachment.c index dde19ba5354e..c05525d0169d 100644 --- a/cocos/editor-support/spine/VertexAttachment.c +++ b/cocos/editor-support/spine/VertexAttachment.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/VertexAttachment.h" +#include "spine/extension.h" /* FIXME this is not thread-safe */ static int nextID = 0; diff --git a/cocos/editor-support/spine/VertexAttachment.h b/cocos/editor-support/spine/VertexAttachment.h index 3bb766ade69f..0a0640d8b857 100644 --- a/cocos/editor-support/spine/VertexAttachment.h +++ b/cocos/editor-support/spine/VertexAttachment.h @@ -31,9 +31,9 @@ #ifndef SPINE_VERTEXATTACHMENT_H_ #define SPINE_VERTEXATTACHMENT_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/Attachment.h" +#include "spine/Slot.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/VertexEffect.c b/cocos/editor-support/spine/VertexEffect.c index 68d4d1f68043..24ae8c11b9a4 100644 --- a/cocos/editor-support/spine/VertexEffect.c +++ b/cocos/editor-support/spine/VertexEffect.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/VertexEffect.h" +#include "spine/extension.h" void _spJitterVertexEffect_begin(spVertexEffect* self, spSkeleton* skeleton) { } diff --git a/cocos/editor-support/spine/VertexEffect.h b/cocos/editor-support/spine/VertexEffect.h index 4f670119b3cd..994ffa01e406 100644 --- a/cocos/editor-support/spine/VertexEffect.h +++ b/cocos/editor-support/spine/VertexEffect.h @@ -31,9 +31,9 @@ #ifndef SPINE_VERTEXEFFECT_H_ #define SPINE_VERTEXEFFECT_H_ -#include -#include -#include +#include "spine/dll.h" +#include "spine/Skeleton.h" +#include "spine/Color.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/extension.c b/cocos/editor-support/spine/extension.c index de1074865afd..64e07b4f1c2e 100644 --- a/cocos/editor-support/spine/extension.c +++ b/cocos/editor-support/spine/extension.c @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include "spine/extension.h" #include float _spInternalRandom () { diff --git a/cocos/editor-support/spine/extension.h b/cocos/editor-support/spine/extension.h index 0823b5667cb4..a75040674657 100644 --- a/cocos/editor-support/spine/extension.h +++ b/cocos/editor-support/spine/extension.h @@ -126,21 +126,21 @@ #define UNUSED(x) (void)(x) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "stdlib.h" +#include "string.h" +#include "math.h" +#include "spine/Skeleton.h" +#include "spine/Animation.h" +#include "spine/Atlas.h" +#include "spine/AttachmentLoader.h" +#include "spine/VertexAttachment.h" +#include "spine/RegionAttachment.h" +#include "spine/MeshAttachment.h" +#include "spine/BoundingBoxAttachment.h" +#include "spine/ClippingAttachment.h" +#include "spine/PathAttachment.h" +#include "spine/PointAttachment.h" +#include "spine/AnimationState.h" #ifdef __cplusplus extern "C" { diff --git a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj index bf508ff83c81..ade6722e9676 100644 --- a/cocos/editor-support/spine/proj.win32/libSpine.vcxproj +++ b/cocos/editor-support/spine/proj.win32/libSpine.vcxproj @@ -112,6 +112,7 @@ {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} libSpine + 10.0.17134.0 diff --git a/cocos/editor-support/spine/spine-cocos2dx.cpp b/cocos/editor-support/spine/spine-cocos2dx.cpp index 6e75b4eed841..c9af6e2544a3 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.cpp +++ b/cocos/editor-support/spine/spine-cocos2dx.cpp @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include -#include +#include "spine/spine-cocos2dx.h" +#include "spine/extension.h" USING_NS_CC; diff --git a/cocos/editor-support/spine/spine-cocos2dx.h b/cocos/editor-support/spine/spine-cocos2dx.h index 7f09e359ff16..4fd49752eb04 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.h +++ b/cocos/editor-support/spine/spine-cocos2dx.h @@ -31,11 +31,11 @@ #ifndef SPINE_COCOS2DX_H_ #define SPINE_COCOS2DX_H_ -#include +#include "spine/spine.h" #include "cocos2d.h" -#include -#include -#include -#include +#include "spine/Cocos2dAttachmentLoader.h" +#include "spine/SkeletonRenderer.h" +#include "spine/SkeletonAnimation.h" +#include "spine/SkeletonBatch.h" #endif /* SPINE_COCOS2DX_H_ */ diff --git a/cocos/editor-support/spine/spine.h b/cocos/editor-support/spine/spine.h index 6c85d7cb995d..b90f6d16aa9f 100644 --- a/cocos/editor-support/spine/spine.h +++ b/cocos/editor-support/spine/spine.h @@ -31,33 +31,33 @@ #ifndef SPINE_SPINE_H_ #define SPINE_SPINE_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "spine/dll.h" +#include "spine/Animation.h" +#include "spine/AnimationState.h" +#include "spine/AnimationStateData.h" +#include "spine/Atlas.h" +#include "spine/AtlasAttachmentLoader.h" +#include "spine/Attachment.h" +#include "spine/AttachmentLoader.h" +#include "spine/Bone.h" +#include "spine/BoneData.h" +#include "spine/RegionAttachment.h" +#include "spine/VertexAttachment.h" +#include "spine/MeshAttachment.h" +#include "spine/BoundingBoxAttachment.h" +#include "spine/ClippingAttachment.h" +#include "spine/PointAttachment.h" +#include "spine/Skeleton.h" +#include "spine/SkeletonBounds.h" +#include "spine/SkeletonData.h" +#include "spine/SkeletonBinary.h" +#include "spine/SkeletonJson.h" +#include "spine/Skin.h" +#include "spine/Slot.h" +#include "spine/SlotData.h" +#include "spine/SkeletonClipping.h" +#include "spine/Event.h" +#include "spine/EventData.h" +#include "spine/VertexEffect.h" #endif /* SPINE_SPINE_H_ */ diff --git a/cocos/math/CCGeometry.cpp b/cocos/math/CCGeometry.cpp index ffe00e5163dd..cf2bc6f88533 100644 --- a/cocos/math/CCGeometry.cpp +++ b/cocos/math/CCGeometry.cpp @@ -175,15 +175,10 @@ float Rect::getMinY() const bool Rect::containsPoint(const Vec2& point) const { - bool bRet = false; - - if (point.x >= getMinX() && point.x <= getMaxX() - && point.y >= getMinY() && point.y <= getMaxY()) - { - bRet = true; - } - - return bRet; + return (point.x >= getMinX() && + point.x <= getMaxX() && + point.y >= getMinY() && + point.y <= getMaxY()); } bool Rect::intersectsRect(const Rect& rect) const diff --git a/cocos/math/CCGeometry.h b/cocos/math/CCGeometry.h index f343a7dc46df..2ef9d247c1b6 100644 --- a/cocos/math/CCGeometry.h +++ b/cocos/math/CCGeometry.h @@ -190,7 +190,7 @@ class CC_DLL Rect */ bool equals(const Rect& rect) const; /** - Check if the points is contained in the rect. + Check if the points is contained inclusively in the rect. * @js NA */ bool containsPoint(const Vec2& point) const; diff --git a/cocos/math/MathUtilNeon.inl b/cocos/math/MathUtilNeon.inl index bf41e6c70427..78d2ba7c2991 100644 --- a/cocos/math/MathUtilNeon.inl +++ b/cocos/math/MathUtilNeon.inl @@ -43,7 +43,7 @@ public: inline static void crossVec3(const float* v1, const float* v2, float* dst); }; -inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst) +inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {q0, q1}, [%1]! \n\t" // M[m0-m7] @@ -66,7 +66,7 @@ inline void MathUtilNeon::addMatrix(const float* m, float scalar, float* dst) ); } -inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7] @@ -87,7 +87,7 @@ inline void MathUtilNeon::addMatrix(const float* m1, const float* m2, float* dst ); } -inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {q0, q1}, [%1]! \n\t" // M1[m0-m7] @@ -108,7 +108,7 @@ inline void MathUtilNeon::subtractMatrix(const float* m1, const float* m2, float ); } -inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* dst) +inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {d0[0]}, [%2] \n\t" // M[m0-m7] @@ -128,7 +128,7 @@ inline void MathUtilNeon::multiplyMatrix(const float* m, float scalar, float* ds ); } -inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {d16 - d19}, [%1]! \n\t" // M1[m0-m7] @@ -165,7 +165,7 @@ inline void MathUtilNeon::multiplyMatrix(const float* m1, const float* m2, float ); } -inline void MathUtilNeon::negateMatrix(const float* m, float* dst) +inline void MathUtilNeon::negateMatrix(const float* m, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {q0-q1}, [%1]! \n\t" // load m0-m7 @@ -184,7 +184,7 @@ inline void MathUtilNeon::negateMatrix(const float* m, float* dst) ); } -inline void MathUtilNeon::transposeMatrix(const float* m, float* dst) +inline void MathUtilNeon::transposeMatrix(const float* m, float* dst) __attribute__((optnone)) { asm volatile( "vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]! \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3] @@ -200,7 +200,7 @@ inline void MathUtilNeon::transposeMatrix(const float* m, float* dst) ); } -inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float z, float w, float* dst) +inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float z, float w, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {d0[0]}, [%1] \n\t" // V[x] @@ -223,7 +223,7 @@ inline void MathUtilNeon::transformVec4(const float* m, float x, float y, float ); } -inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* dst) +inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* dst) __attribute__((optnone)) { asm volatile ( @@ -243,7 +243,7 @@ inline void MathUtilNeon::transformVec4(const float* m, const float* v, float* d ); } -inline void MathUtilNeon::crossVec3(const float* v1, const float* v2, float* dst) +inline void MathUtilNeon::crossVec3(const float* v1, const float* v2, float* dst) __attribute__((optnone)) { asm volatile( "vld1.32 {d1[1]}, [%1] \n\t" // diff --git a/cocos/math/MathUtilNeon64.inl b/cocos/math/MathUtilNeon64.inl index 9832669907fd..08b0ff7b5c28 100644 --- a/cocos/math/MathUtilNeon64.inl +++ b/cocos/math/MathUtilNeon64.inl @@ -44,7 +44,7 @@ public: inline static void crossVec3(const float* v1, const float* v2, float* dst); }; -inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst) +inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst) __attribute__((optnone)) { asm volatile( "ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M[m0-m7] M[m8-m15] @@ -62,7 +62,7 @@ inline void MathUtilNeon64::addMatrix(const float* m, float scalar, float* dst) ); } -inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15] @@ -80,7 +80,7 @@ inline void MathUtilNeon64::addMatrix(const float* m1, const float* m2, float* d ); } -inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15] @@ -98,7 +98,7 @@ inline void MathUtilNeon64::subtractMatrix(const float* m1, const float* m2, flo ); } -inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* dst) +inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* dst) __attribute__((optnone)) { asm volatile( "ld1 {v0.s}[0], [%2] \n\t" //s @@ -116,7 +116,7 @@ inline void MathUtilNeon64::multiplyMatrix(const float* m, float scalar, float* ); } -inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, float* dst) +inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, float* dst) __attribute__((optnone)) { asm volatile( "ld1 {v8.4s, v9.4s, v10.4s, v11.4s}, [%1] \n\t" // M1[m0-m7] M1[m8-m15] M2[m0-m7] M2[m8-m15] @@ -151,7 +151,7 @@ inline void MathUtilNeon64::multiplyMatrix(const float* m1, const float* m2, flo ); } -inline void MathUtilNeon64::negateMatrix(const float* m, float* dst) +inline void MathUtilNeon64::negateMatrix(const float* m, float* dst) __attribute__((optnone)) { asm volatile( "ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // load m0-m7 load m8-m15 @@ -168,7 +168,7 @@ inline void MathUtilNeon64::negateMatrix(const float* m, float* dst) ); } -inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst) +inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst) __attribute__((optnone)) { asm volatile( "ld4 {v0.4s, v1.4s, v2.4s, v3.4s}, [%1] \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3] @@ -180,7 +180,7 @@ inline void MathUtilNeon64::transposeMatrix(const float* m, float* dst) ); } -inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, float z, float w, float* dst) +inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, float z, float w, float* dst) __attribute__((optnone)) { asm volatile( "ld1 {v0.s}[0], [%1] \n\t" // V[x] @@ -204,7 +204,7 @@ inline void MathUtilNeon64::transformVec4(const float* m, float x, float y, floa ); } -inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* dst) +inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* dst) __attribute__((optnone)) { asm volatile ( @@ -223,7 +223,7 @@ inline void MathUtilNeon64::transformVec4(const float* m, const float* v, float* ); } -inline void MathUtilNeon64::crossVec3(const float* v1, const float* v2, float* dst) +inline void MathUtilNeon64::crossVec3(const float* v1, const float* v2, float* dst) __attribute__((optnone)) { asm volatile( "ld1 {v0.2s}, [%2] \n\t" diff --git a/cocos/navmesh/CCNavMeshDebugDraw.cpp b/cocos/navmesh/CCNavMeshDebugDraw.cpp index b353d81c277b..f2f06e1606cf 100644 --- a/cocos/navmesh/CCNavMeshDebugDraw.cpp +++ b/cocos/navmesh/CCNavMeshDebugDraw.cpp @@ -26,6 +26,7 @@ #if CC_USE_NAVMESH #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" #include "base/CCDirector.h" @@ -140,8 +141,7 @@ void NavMeshDebugDraw::drawImplement(const cocos2d::Mat4& transform, uint32_t /* _program->setUniformsForBuiltins(transform); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4F), (GLvoid *)offsetof(V3F_C4F, position)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, sizeof(V3F_C4F), (GLvoid *)offsetof(V3F_C4F, color)); if (_dirtyBuffer){ diff --git a/cocos/network/HttpClient-android.cpp b/cocos/network/HttpClient-android.cpp index 2f39ee422771..f423de79bc55 100644 --- a/cocos/network/HttpClient-android.cpp +++ b/cocos/network/HttpClient-android.cpp @@ -885,6 +885,8 @@ HttpClient::HttpClient() , _threadCount(0) , _cookie(nullptr) , _requestSentinel(new HttpRequest()) +, _clearRequestPredicate(nullptr) +, _clearResponsePredicate(nullptr) { CCLOG("In the constructor of HttpClient!"); increaseThreadCount(); @@ -991,6 +993,39 @@ void HttpClient::dispatchResponseCallbacks() } } +void HttpClient::clearResponseAndRequestQueue() +{ + _requestQueueMutex.lock(); + if (_requestQueue.size()) + { + for (auto it = _requestQueue.begin(); it != _requestQueue.end();) + { + if(!_clearRequestPredicate || + _clearRequestPredicate((*it))) + { + (*it)->release(); + it =_requestQueue.erase(it); + } + else + { + it++; + } + } + } + _requestQueueMutex.unlock(); + + _responseQueueMutex.lock(); + if (_clearResponsePredicate) + { + _responseQueue.erase(std::remove_if(_responseQueue.begin(), _responseQueue.end(), _clearResponsePredicate), _responseQueue.end()); + } + else + { + _responseQueue.clear(); + } + _responseQueueMutex.unlock(); +} + void HttpClient::increaseThreadCount() { _threadCountMutex.lock(); diff --git a/cocos/network/HttpClient-apple.mm b/cocos/network/HttpClient-apple.mm index 049f386a7b93..6e3e4f418c49 100644 --- a/cocos/network/HttpClient-apple.mm +++ b/cocos/network/HttpClient-apple.mm @@ -371,6 +371,8 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque , _threadCount(0) , _cookie(nullptr) , _requestSentinel(new HttpRequest()) +, _clearRequestPredicate(nullptr) +, _clearResponsePredicate(nullptr) { CCLOG("In the constructor of HttpClient!"); memset(_responseMessage, 0, sizeof(char) * RESPONSE_BUFFER_SIZE); @@ -534,7 +536,39 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque response->setErrorBuffer(responseMessage); } } - + +void HttpClient::clearResponseAndRequestQueue() +{ + _requestQueueMutex.lock(); + if (_requestQueue.size()) + { + for (auto it = _requestQueue.begin(); it != _requestQueue.end();) + { + if(!_clearRequestPredicate || + _clearRequestPredicate((*it))) + { + (*it)->release(); + it =_requestQueue.erase(it); + } + else + { + it++; + } + } + } + _requestQueueMutex.unlock(); + + _responseQueueMutex.lock(); + if (_clearResponsePredicate) + { + _responseQueue.erase(std::remove_if(_responseQueue.begin(), _responseQueue.end(), _clearResponsePredicate), _responseQueue.end()); + } + else + { + _responseQueue.clear(); + } + _responseQueueMutex.unlock(); +} void HttpClient::increaseThreadCount() { diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index a01cd7911337..e18009942379 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -403,6 +403,8 @@ HttpClient::HttpClient() , _threadCount(0) , _cookie(nullptr) , _requestSentinel(new HttpRequest()) +, _clearRequestPredicate(nullptr) +, _clearResponsePredicate(nullptr) { CCLOG("In the constructor of HttpClient!"); memset(_responseMessage, 0, RESPONSE_BUFFER_SIZE * sizeof(char)); @@ -575,6 +577,39 @@ void HttpClient::processResponse(HttpResponse* response, char* responseMessage) response->setSucceed(true); } } + +void HttpClient::clearResponseAndRequestQueue() +{ + _requestQueueMutex.lock(); + if (_requestQueue.size()) + { + for (auto it = _requestQueue.begin(); it != _requestQueue.end();) + { + if(!_clearRequestPredicate || + _clearRequestPredicate((*it))) + { + (*it)->release(); + it =_requestQueue.erase(it); + } + else + { + it++; + } + } + } + _requestQueueMutex.unlock(); + + _responseQueueMutex.lock(); + if (_clearResponsePredicate) + { + _responseQueue.erase(std::remove_if(_responseQueue.begin(), _responseQueue.end(), _clearResponsePredicate), _responseQueue.end()); + } + else + { + _responseQueue.clear(); + } + _responseQueueMutex.unlock(); +} void HttpClient::increaseThreadCount() { diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index 2e31b4202dcd..16ed49c55358 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -150,6 +150,34 @@ class CC_DLL HttpClient std::mutex& getCookieFileMutex() {return _cookieFileMutex;} std::mutex& getSSLCaFileMutex() {return _sslCaFileMutex;} + + typedef std::function ClearRequestPredicate; + typedef std::function ClearResponsePredicate; + + /** + * Clears the pending http responses and http requests + * If defined, the method uses the ClearRequestPredicate and ClearResponsePredicate + * to check for each request/response which to delete + */ + void clearResponseAndRequestQueue(); + + /** + * Sets a predicate function that is going to be called to determine if we proceed + * each of the pending requests + * + * @param predicate function that will be called + */ + void setClearRequestPredicate(ClearRequestPredicate predicate) { _clearRequestPredicate = predicate; } + + /** + Sets a predicate function that is going to be called to determine if we proceed + * each of the pending requests + * + * @param cb predicate function that will be called + */ + void setClearResponsePredicate(ClearResponsePredicate predicate) { _clearResponsePredicate = predicate; } + + private: HttpClient(); virtual ~HttpClient(); @@ -203,6 +231,9 @@ class CC_DLL HttpClient char _responseMessage[RESPONSE_BUFFER_SIZE]; HttpRequest* _requestSentinel; + + ClearRequestPredicate _clearRequestPredicate; + ClearResponsePredicate _clearResponsePredicate; }; } // namespace network diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index fab86d3889f0..266e508a08bd 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -489,7 +489,7 @@ void SIOClientImpl::handshakeResponse(HttpClient* /*sender*/, HttpResponse *resp std::string sid = ""; int heartbeat = 0, timeout = 0; - if (res.find("}") != std::string::npos) { + if (res.find('}') != std::string::npos) { CCLOGINFO("SIOClientImpl::handshake() Socket.IO 1.x detected"); _version = SocketIOPacket::SocketIOVersion::V10x; @@ -500,29 +500,29 @@ void SIOClientImpl::handshakeResponse(HttpClient* /*sender*/, HttpResponse *resp std::string temp = res.substr(a, res.size() - a); // find the sid - a = temp.find(":"); - b = temp.find(","); + a = temp.find(':'); + b = temp.find(','); sid = temp.substr(a + 2, b - (a + 3)); temp = temp.erase(0, b + 1); // chomp past the upgrades - b = temp.find(","); + b = temp.find(','); temp = temp.erase(0, b + 1); // get the pingInterval / heartbeat - a = temp.find(":"); - b = temp.find(","); + a = temp.find(':'); + b = temp.find(','); std::string heartbeat_str = temp.substr(a + 1, b - a); heartbeat = atoi(heartbeat_str.c_str()) / 1000; temp = temp.erase(0, b + 1); // get the timeout - a = temp.find(":"); - b = temp.find("}"); + a = temp.find(':'); + b = temp.find('}'); std::string timeout_str = temp.substr(a + 1, b - a); timeout = atoi(timeout_str.c_str()) / 1000; @@ -536,20 +536,20 @@ void SIOClientImpl::handshakeResponse(HttpClient* /*sender*/, HttpResponse *resp // sample: 3GYzE9md2Ig-lm3cf8Rv:60:60:websocket,htmlfile,xhr-polling,jsonp-polling size_t pos = 0; - pos = res.find(":"); + pos = res.find(':'); if (pos != std::string::npos) { sid = res.substr(0, pos); res.erase(0, pos + 1); } - pos = res.find(":"); + pos = res.find(':'); if (pos != std::string::npos) { heartbeat = atoi(res.substr(pos + 1, res.size()).c_str()); } - pos = res.find(":"); + pos = res.find(':'); if (pos != std::string::npos) { timeout = atoi(res.substr(pos + 1, res.size()).c_str()); @@ -795,20 +795,20 @@ void SIOClientImpl::onMessage(WebSocket* /*ws*/, const WebSocket::Data& data) std::string::size_type pos, pos2; - pos = payload.find(":"); + pos = payload.find(':'); if (pos != std::string::npos) { payload.erase(0, pos + 1); } - pos = payload.find(":"); + pos = payload.find(':'); if (pos != std::string::npos) { msgid = atoi(payload.substr(0, pos + 1).c_str()); } payload.erase(0, pos + 1); - pos = payload.find(":"); + pos = payload.find(':'); if (pos != std::string::npos) { endpoint = payload.substr(0, pos); @@ -860,8 +860,8 @@ void SIOClientImpl::onMessage(WebSocket* /*ws*/, const WebSocket::Data& data) if (c) { eventname = ""; - pos = s_data.find(":"); - pos2 = s_data.find(","); + pos = s_data.find(':'); + pos2 = s_data.find(','); if (pos2 > pos) { eventname = s_data.substr(pos + 2, pos2 - (pos + 3)); @@ -917,8 +917,8 @@ void SIOClientImpl::onMessage(WebSocket* /*ws*/, const WebSocket::Data& data) std::string endpoint = ""; - std::string::size_type a = payload.find("/"); - std::string::size_type b = payload.find("["); + std::string::size_type a = payload.find('/'); + std::string::size_type b = payload.find('['); if (b != std::string::npos) { @@ -961,8 +961,8 @@ void SIOClientImpl::onMessage(WebSocket* /*ws*/, const WebSocket::Data& data) { CCLOGINFO("Event Received (%s)", payload.c_str()); - std::string::size_type payloadFirstSlashPos = payload.find("\""); - std::string::size_type payloadSecondSlashPos = payload.substr(payloadFirstSlashPos + 1).find("\""); + std::string::size_type payloadFirstSlashPos = payload.find('\"'); + std::string::size_type payloadSecondSlashPos = payload.substr(payloadFirstSlashPos + 1).find('\"'); std::string eventname = payload.substr(payloadFirstSlashPos + 1, payloadSecondSlashPos - payloadFirstSlashPos + 1); @@ -1039,7 +1039,7 @@ SIOClient::SIOClient(const std::string& path, SIOClientImpl* impl, SocketIO::SIO , _socket(impl) , _delegate(&delegate) { - + CC_SAFE_RETAIN(_socket); } SIOClient::~SIOClient() @@ -1048,6 +1048,7 @@ SIOClient::~SIOClient() { _socket->disconnectFromEndpoint(_path); } + CC_SAFE_RELEASE(_socket); } void SIOClient::onOpen() @@ -1129,7 +1130,7 @@ void SIOClient::socketClosed() bool SIOClient::isConnected() const { - return _socket && _socket->_connected && _connected; + return _connected && _socket && _socket->_connected ; } void SIOClient::setConnected(bool connected) diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index c9c45a7fe212..f1eddfbe6a69 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -51,9 +51,10 @@ #define WS_RX_BUFFER_SIZE (65536) #define WS_RESERVE_RECEIVE_BUFFER_SIZE (4096) +//#define WEBSOCKETS_LOGGING #define LOG_TAG "WebSocket.cpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) && defined(WEBSOCKETS_LOGGING) // log, CCLOG aren't threadsafe, since we uses sub threads for parsing pcm data, threadsafe log output // is needed. Define the following macros (ALOGV, ALOGD, ALOGI, ALOGW, ALOGE) for threadsafe log output. @@ -122,7 +123,7 @@ static void wsLog(const char * format, ...) // Since CCLOG isn't thread safe, we uses LOGD for multi-thread logging. #ifdef ANDROID - #if COCOS2D_DEBUG > 0 + #ifdef WEBSOCKETS_LOGGING #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG,__VA_ARGS__) #else #define LOGD(...) @@ -130,7 +131,7 @@ static void wsLog(const char * format, ...) #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG,__VA_ARGS__) #else - #if COCOS2D_DEBUG > 0 + #ifdef WEBSOCKETS_LOGGING #define LOGD(fmt, ...) wsLog("D/" LOG_TAG " (" QUOTEME(__LINE__) "): " fmt "", ##__VA_ARGS__) #else #define LOGD(fmt, ...) @@ -139,9 +140,9 @@ static void wsLog(const char * format, ...) #define LOGE(fmt, ...) wsLog("E/" LOG_TAG " (" QUOTEME(__LINE__) "): " fmt "", ##__VA_ARGS__) #endif +#ifdef WEBSOCKETS_LOGGING static void printWebSocketLog(int level, const char *line) { -#if COCOS2D_DEBUG > 0 static const char * const log_level_names[] = { "ERR", "WARN", @@ -155,20 +156,18 @@ static void printWebSocketLog(int level, const char *line) "LATENCY", }; - char buf[30] = {0}; - int n; + const char* level_name = ""; - for (n = 0; n < LLL_COUNT; n++) { + for (int n = 0; n < LLL_COUNT; n++) { if (level != (1 << n)) continue; - sprintf(buf, "%s: ", log_level_names[n]); + level_name = log_level_names[n]; break; } - LOGD("%s%s\n", buf, line); - -#endif // #if COCOS2D_DEBUG > 0 + LOGD("%s: %s", level_name, line); } +#endif // #ifdef WEBSOCKETS_LOGGING NS_NETWORK_BEGIN @@ -389,8 +388,10 @@ void WsThreadHelper::onSubThreadLoop() void WsThreadHelper::onSubThreadStarted() { +#ifdef WEBSOCKETS_LOGGING int log_level = LLL_ERR | LLL_WARN | LLL_NOTICE | LLL_INFO/* | LLL_DEBUG | LLL_PARSER | LLL_HEADER*/ | LLL_EXT | LLL_CLIENT | LLL_LATENCY; lws_set_log_level(log_level, printWebSocketLog); +#endif memset(__defaultProtocols, 0, 2 * sizeof(struct lws_protocols)); @@ -922,7 +923,7 @@ void WebSocket::onClientOpenConnectionRequest() if (nullptr == _wsInstance) { - onConnectionError(); + onConnectionError(nullptr, 0); return; } } @@ -1197,11 +1198,19 @@ int WebSocket::onConnectionOpened() return 0; } -int WebSocket::onConnectionError() +int WebSocket::onConnectionError(void* in, ssize_t len) { + std::string error; + { std::lock_guard lk(_readyStateMutex); - LOGD("WebSocket (%p) onConnectionError, state: %d ...\n", this, (int)_readyState); + if (len > 0) + { + error.assign((char*)in, (char*)in + len); + } + + LOGD("WebSocket (%p) onConnectionError, state: %d, error: %s\n", this, (int)_readyState, error.c_str()); + if (_readyState == State::CLOSED) { return 0; @@ -1210,13 +1219,14 @@ int WebSocket::onConnectionError() } std::shared_ptr> isDestroyed = _isDestroyed; - __wsHelper->sendMessageToCocosThread([this, isDestroyed](){ + __wsHelper->sendMessageToCocosThread([this, isDestroyed, error](){ if (*isDestroyed) { LOGD("WebSocket instance was destroyed!\n"); } else { + CCLOGERROR("WebSocket connection error: %s", error.c_str()); _delegate->onError(this, ErrorCode::CONNECTION_FAILURE); } }); @@ -1301,7 +1311,7 @@ int WebSocket::onSocketCallback(struct lws *wsi, break; case LWS_CALLBACK_CLIENT_CONNECTION_ERROR: - ret = onConnectionError(); + ret = onConnectionError(in, len); break; case LWS_CALLBACK_WSI_DESTROY: @@ -1318,10 +1328,18 @@ int WebSocket::onSocketCallback(struct lws *wsi, case LWS_CALLBACK_CHANGE_MODE_POLL_FD: case LWS_CALLBACK_LOCK_POLL: case LWS_CALLBACK_UNLOCK_POLL: + case LWS_CALLBACK_ADD_POLL_FD: + case LWS_CALLBACK_DEL_POLL_FD: + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + case LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: + case LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: break; case LWS_CALLBACK_PROTOCOL_INIT: LOGD("protocol init..."); break; + case LWS_CALLBACK_WSI_CREATE: + LOGD("protocol create..."); + break; case LWS_CALLBACK_PROTOCOL_DESTROY: LOGD("protocol destroy..."); break; diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index f939944d00dd..265974d2589d 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -231,7 +231,7 @@ class CC_DLL WebSocket int onClientWritable(); int onClientReceivedData(void* in, ssize_t len); int onConnectionOpened(); - int onConnectionError(); + int onConnectionError(void* in, ssize_t len); int onConnectionClosed(); struct lws_vhost* createVhost(struct lws_protocols* protocols, int& sslConnection); diff --git a/cocos/physics3d/CCPhysics3DDebugDrawer.cpp b/cocos/physics3d/CCPhysics3DDebugDrawer.cpp index ac8105ac8d48..4e68e7377694 100644 --- a/cocos/physics3d/CCPhysics3DDebugDrawer.cpp +++ b/cocos/physics3d/CCPhysics3DDebugDrawer.cpp @@ -27,10 +27,10 @@ #include "base/CCConfiguration.h" #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "base/ccUtils.h" #include "renderer/CCGLProgram.h" #include "renderer/CCRenderer.h" #include "renderer/CCRenderState.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramCache.h" #if CC_USE_3D_PHYSICS @@ -134,7 +134,7 @@ void Physics3DDebugDrawer::drawImplementation( const Mat4 &transform, uint32_t / _program->setUniformsForBuiltins(transform); glEnable(GL_DEPTH_TEST); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirty) { @@ -144,12 +144,11 @@ void Physics3DDebugDrawer::drawImplementation( const Mat4 &transform, uint32_t / } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex @@ -176,7 +175,7 @@ void Physics3DDebugDrawer::init() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } glGenBuffers(1, &_vbo); @@ -193,7 +192,7 @@ void Physics3DDebugDrawer::init() if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } } diff --git a/cocos/platform/CCApplication.h b/cocos/platform/CCApplication.h index 00950cc9e694..ad86810b2e65 100644 --- a/cocos/platform/CCApplication.h +++ b/cocos/platform/CCApplication.h @@ -42,8 +42,6 @@ THE SOFTWARE. #include "platform/winrt/CCApplication.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCApplication-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "platform/tizen/CCApplication-tizen.h" #endif /// @endcond diff --git a/cocos/platform/CCApplicationProtocol.h b/cocos/platform/CCApplicationProtocol.h index 09d5f39309ee..8cc7bf0863c0 100644 --- a/cocos/platform/CCApplicationProtocol.h +++ b/cocos/platform/CCApplicationProtocol.h @@ -28,7 +28,6 @@ THE SOFTWARE. #define __CC_APPLICATION_PROTOCOL_H__ #include "platform/CCPlatformMacros.h" -#include "base/CCScriptSupport.h" #include "base/CCAutoreleasePool.h" #include "base/ccTypes.h" @@ -67,9 +66,6 @@ class CC_DLL ApplicationProtocol * @lua NA */ virtual ~ApplicationProtocol(){ -#if CC_ENABLE_SCRIPT_BINDING - ScriptEngineManager::destroyInstance(); -#endif /** clean auto release pool. */ PoolManager::destroyInstance(); } @@ -104,7 +100,6 @@ class CC_DLL ApplicationProtocol * @lua NA */ virtual void setAnimationInterval(float interval) = 0; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) = 0; /** Subclass override the function to set OpenGL context attribution instead of use default value. * And now can only set six attributions:redBits,greenBits,blueBits,alphaBits,depthBits,stencilBits. diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index 50e604f626b1..3106bcfce2b2 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -624,6 +624,7 @@ void FileUtils::purgeCachedEntries() { DECLARE_GUARD; _fullPathCache.clear(); + _fullPathCacheDir.clear(); } std::string FileUtils::getStringFromFile(const std::string& filename) const @@ -669,20 +670,21 @@ FileUtils::Status FileUtils::getContents(const std::string& filename, ResizableB if (fullPath.empty()) return Status::NotExists; - FILE *fp = fopen(fs->getSuitableFOpen(fullPath).c_str(), "rb"); - if (!fp) - return Status::OpenFailed; + std::string suitableFullPath = fs->getSuitableFOpen(fullPath); -#if defined(_MSC_VER) - auto descriptor = _fileno(fp); -#else - auto descriptor = fileno(fp); -#endif struct stat statBuf; - if (fstat(descriptor, &statBuf) == -1) { - fclose(fp); + if (stat(suitableFullPath.c_str(), &statBuf) == -1) { return Status::ReadFailed; } + + if (!(statBuf.st_mode & S_IFREG)) { + return Status::NotRegularFileType; + } + + FILE *fp = fopen(suitableFullPath.c_str(), "rb"); + if (!fp) + return Status::OpenFailed; + size_t size = statBuf.st_size; buffer->resize(size); @@ -795,7 +797,7 @@ std::string FileUtils::getPathForFilename(const std::string& filename, const std { std::string file = filename; std::string file_path = ""; - size_t pos = filename.find_last_of("/"); + size_t pos = filename.find_last_of('/'); if (pos != std::string::npos) { file_path = filename.substr(0, pos+1); @@ -807,7 +809,7 @@ std::string FileUtils::getPathForFilename(const std::string& filename, const std path += file_path; path += resolutionDirectory; - path = getFullPathForDirectoryAndFilename(path, file); + path = getFullPathForFilenameWithinDirectory(path, file); return path; } @@ -863,6 +865,60 @@ std::string FileUtils::fullPathForFilename(const std::string &filename) const return ""; } + +std::string FileUtils::fullPathForDirectory(const std::string &dir) const +{ + DECLARE_GUARD; + + if (dir.empty()) + { + return ""; + } + + if (isAbsolutePath(dir)) + { + return dir; + } + + // Already Cached ? + auto cacheIter = _fullPathCacheDir.find(dir); + if(cacheIter != _fullPathCacheDir.end()) + { + return cacheIter->second; + } + std::string longdir = dir; + std::string fullpath; + + if(longdir[longdir.length() - 1] != '/') + { + longdir +="/"; + } + + for (const auto& searchIt : _searchPathArray) + { + for (const auto& resolutionIt : _searchResolutionsOrderArray) + { + fullpath = searchIt + longdir + resolutionIt; + auto exists = isDirectoryExistInternal(fullpath); + + if (exists && !fullpath.empty()) + { + // Using the filename passed in as key. + _fullPathCacheDir.emplace(dir, fullpath); + return fullpath; + } + + } + } + + if(isPopupNotify()){ + CCLOG("cocos2d: fullPathForDirectory: No directory found at %s. Possible missing directory.", dir.c_str()); + } + + // The file wasn't found, return empty string. + return ""; +} + std::string FileUtils::fullPathFromRelativeFile(const std::string &filename, const std::string &relativeFile) const { return relativeFile.substr(0, relativeFile.rfind('/')+1) + getNewFilename(filename); @@ -880,6 +936,7 @@ void FileUtils::setSearchResolutionsOrder(const std::vector& search bool existDefault = false; _fullPathCache.clear(); + _fullPathCacheDir.clear(); _searchResolutionsOrderArray.clear(); for(const auto& iter : searchResolutionsOrder) { @@ -955,6 +1012,7 @@ void FileUtils::setDefaultResourceRootPath(const std::string& path) if (_defaultResRootPath != path) { _fullPathCache.clear(); + _fullPathCacheDir.clear(); _defaultResRootPath = path; if (!_defaultResRootPath.empty() && _defaultResRootPath[_defaultResRootPath.length()-1] != '/') { @@ -973,6 +1031,7 @@ void FileUtils::setSearchPaths(const std::vector& searchPaths) _originalSearchPaths = searchPaths; _fullPathCache.clear(); + _fullPathCacheDir.clear(); _searchPathArray.clear(); for (const auto& path : _originalSearchPaths) @@ -1029,6 +1088,7 @@ void FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict) { DECLARE_GUARD; _fullPathCache.clear(); + _fullPathCacheDir.clear(); _filenameLookupDict = filenameLookupDict; } @@ -1052,7 +1112,7 @@ void FileUtils::loadFilenameLookupDictionaryFromFile(const std::string &filename } } -std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const +std::string FileUtils::getFullPathForFilenameWithinDirectory(const std::string& directory, const std::string& filename) const { // get directory+filename, safely adding '/' as necessary std::string ret = directory; @@ -1060,9 +1120,8 @@ std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& dir ret += '/'; } ret += filename; - // if the file doesn't exist, return an empty string - if (!isFileExistInternal(ret) && !isDirectoryExistInternal(ret)) { + if (!isFileExistInternal(ret)) { ret = ""; } return ret; @@ -1109,8 +1168,8 @@ bool FileUtils::isDirectoryExist(const std::string& dirPath) const } // Already Cached ? - auto cacheIter = _fullPathCache.find(dirPath); - if( cacheIter != _fullPathCache.end() ) + auto cacheIter = _fullPathCacheDir.find(dirPath); + if( cacheIter != _fullPathCacheDir.end() ) { return isDirectoryExistInternal(cacheIter->second); } @@ -1121,10 +1180,10 @@ bool FileUtils::isDirectoryExist(const std::string& dirPath) const for (const auto& resolutionIt : _searchResolutionsOrderArray) { // searchPath + file_path + resourceDirectory - fullpath = fullPathForFilename(searchIt + dirPath + resolutionIt); + fullpath = fullPathForDirectory(searchIt + dirPath + resolutionIt); if (isDirectoryExistInternal(fullpath)) { - _fullPathCache.emplace(dirPath, fullpath); + _fullPathCacheDir.emplace(dirPath, fullpath); return true; } } @@ -1187,7 +1246,7 @@ void FileUtils::getFileSize(const std::string &filepath, std::function)> callback) const { - auto fullPath = fullPathForFilename(dirPath); + auto fullPath = fullPathForDirectory(dirPath); performOperationOffthread([fullPath]() { return FileUtils::getInstance()->listFiles(fullPath); }, std::move(callback)); @@ -1195,7 +1254,7 @@ void FileUtils::listFilesAsync(const std::string& dirPath, std::function)> callback) const { - auto fullPath = fullPathForFilename(dirPath); + auto fullPath = fullPathForDirectory(dirPath); performOperationOffthread([fullPath]() { std::vector retval; FileUtils::getInstance()->listFilesRecursively(fullPath, &retval); @@ -1458,7 +1517,7 @@ long FileUtils::getFileSize(const std::string &filepath) const std::vector FileUtils::listFiles(const std::string& dirPath) const { std::vector files; - std::string fullpath = fullPathForFilename(dirPath); + std::string fullpath = fullPathForDirectory(dirPath); if (isDirectoryExist(fullpath)) { tinydir_dir dir; @@ -1496,7 +1555,7 @@ std::vector FileUtils::listFiles(const std::string& dirPath) const void FileUtils::listFilesRecursively(const std::string& dirPath, std::vector *files) const { - std::string fullpath = fullPathForFilename(dirPath); + std::string fullpath = fullPathForDirectory(dirPath); if (isDirectoryExist(fullpath)) { tinydir_dir dir; diff --git a/cocos/platform/CCFileUtils.h b/cocos/platform/CCFileUtils.h index b21e58818f32..db20f0124366 100644 --- a/cocos/platform/CCFileUtils.h +++ b/cocos/platform/CCFileUtils.h @@ -203,7 +203,8 @@ class CC_DLL FileUtils ReadFailed = 3, // Read failed NotInitialized = 4, // FileUtils is not initializes TooLarge = 5, // The file is too large (great than 2^32-1) - ObtainSizeFailed = 6 // Failed to obtain the file size. + ObtainSizeFailed = 6, // Failed to obtain the file size. + NotRegularFileType = 7 // File type is not S_IFREG }; /** @@ -342,6 +343,7 @@ class CC_DLL FileUtils */ virtual std::string fullPathForFilename(const std::string &filename) const; + /** * Loads the filenameLookup dictionary from the contents of a filename. * @@ -904,8 +906,14 @@ class CC_DLL FileUtils * @param filename The name of the file. * @return The full path of the file, if the file can't be found, it will return an empty string. */ - virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const; + virtual std::string getFullPathForFilenameWithinDirectory(const std::string& directory, const std::string& filename) const; + + /** + * Returns the fullpath for a given dirname. + * @since 3.17.1 + */ + virtual std::string fullPathForDirectory(const std::string &dirname) const; /** * mutex used to protect fields. @@ -949,11 +957,17 @@ class CC_DLL FileUtils std::string _defaultResRootPath; /** - * The full path cache. When a file is found, it will be added into this cache. + * The full path cache for normal files. When a file is found, it will be added into this cache. * This variable is used for improving the performance of file search. */ mutable std::unordered_map _fullPathCache; + /** + * The full path cache for directories. When a diretory is found, it will be added into this cache. + * This variable is used for improving the performance of file search. + */ + mutable std::unordered_map _fullPathCacheDir; + /** * Writable path. */ diff --git a/cocos/platform/CCGLView.h b/cocos/platform/CCGLView.h index 5752ad4ba3ff..36f2fdf57b87 100644 --- a/cocos/platform/CCGLView.h +++ b/cocos/platform/CCGLView.h @@ -195,6 +195,19 @@ class CC_DLL GLView : public Ref */ virtual float getFrameZoomFactor() const { return 1.0; } + /** + * Sets the cursor for the window with custom image. + * + * @param filename A path to image file, e.g., "cursors/custom.png". + * @param hotspot Cursor hotspot, as a anchor point, default is top left (0, 1) + */ + virtual void setCursor(const std::string& filename, Vec2 hotspot = Vec2::ANCHOR_TOP_LEFT) {} + + /** + * Sets the cursor for the window back to default. + */ + virtual void setDefaultCursor() {} + /** * Hide or Show the mouse cursor if there is one. * @@ -363,7 +376,7 @@ class CC_DLL GLView : public Ref /** Set window icon (implemented for windows and linux). * - * @param filename A path to image file, e.g., "icons/cusom.png". + * @param filename A path to image file, e.g., "icons/custom.png". */ virtual void setIcon(const std::string& filename) const {}; @@ -420,6 +433,7 @@ class CC_DLL GLView : public Ref #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) virtual id getCocoaWindow() = 0; + virtual id getNSGLContext() = 0; // stevetranby: added #endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) */ /** diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 8e5c225a2db5..bf00d0092083 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -1145,9 +1145,18 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) png_read_end(png_ptr, nullptr); // premultiplied alpha for RGBA8888 - if (PNG_PREMULTIPLIED_ALPHA_ENABLED && color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - premultipliedAlpha(); + if (PNG_PREMULTIPLIED_ALPHA_ENABLED) + { + premultipliedAlpha(); + } + else + { +#if CC_ENABLE_PREMULTIPLIED_ALPHA != 0 + _hasPremultipliedAlpha = true; +#endif + } } if (row_pointers != nullptr) diff --git a/cocos/platform/CCPlatformDefine.h b/cocos/platform/CCPlatformDefine.h index 18f87a133046..d82438eabb35 100644 --- a/cocos/platform/CCPlatformDefine.h +++ b/cocos/platform/CCPlatformDefine.h @@ -38,12 +38,8 @@ THE SOFTWARE. #include "platform/android/CCPlatformDefine-android.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "platform/win32/CCPlatformDefine-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT -#include "platform/winrt/CCPlatformDefine-winrt.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCPlatformDefine-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "platform/tizen/CCPlatformDefine-tizen.h" #endif /// @endcond diff --git a/cocos/platform/CCStdC.h b/cocos/platform/CCStdC.h index 52ec32087627..a90f921cb089 100644 --- a/cocos/platform/CCStdC.h +++ b/cocos/platform/CCStdC.h @@ -41,8 +41,6 @@ THE SOFTWARE. #include "platform/winrt/CCStdC.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCStdC-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "platform/tizen/CCStdC-tizen.h" #endif #endif /* __PLATFORM_CCSTDC_H__*/ diff --git a/cocos/platform/android/Android.mk b/cocos/platform/android/Android.mk index 4adfd98351ca..7a307ba53119 100644 --- a/cocos/platform/android/Android.mk +++ b/cocos/platform/android/Android.mk @@ -18,7 +18,6 @@ jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp \ jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp \ jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp \ jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp \ -jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp \ jni/JniHelper.cpp \ jni/TouchesJni.cpp diff --git a/cocos/platform/android/CCApplication-android.cpp b/cocos/platform/android/CCApplication-android.cpp index cd1e1f1de93e..da71a1ba542f 100644 --- a/cocos/platform/android/CCApplication-android.cpp +++ b/cocos/platform/android/CCApplication-android.cpp @@ -27,7 +27,6 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h" #include "platform/android/jni/JniHelper.h" #include "platform/CCApplication.h" #include "base/CCDirector.h" @@ -79,12 +78,7 @@ int Application::run() void Application::setAnimationInterval(float interval) { - setAnimationInterval(interval, SetIntervalReason::BY_ENGINE); -} - -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - EngineDataManager::setAnimationInterval(interval, reason); + JniHelper::callStaticVoidMethod("org/cocos2dx/lib/Cocos2dxRenderer", "setAnimationInterval", interval); } ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/platform/android/CCApplication-android.h b/cocos/platform/android/CCApplication-android.h index 3f7ee8b96dd0..c2278ce95825 100644 --- a/cocos/platform/android/CCApplication-android.h +++ b/cocos/platform/android/CCApplication-android.h @@ -53,7 +53,6 @@ class CC_DLL Application : public ApplicationProtocol @param interval The time, expressed in seconds, between current frame and next. */ virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; /** @brief Run the message loop. diff --git a/cocos/platform/android/CCDevice-android.cpp b/cocos/platform/android/CCDevice-android.cpp index 002888effdc6..c72ab7d8d3bf 100644 --- a/cocos/platform/android/CCDevice-android.cpp +++ b/cocos/platform/android/CCDevice-android.cpp @@ -89,7 +89,7 @@ class BitmapDC { JniMethodInfo methodInfo; if (! JniHelper::getStaticMethodInfo(methodInfo, "org.cocos2dx.lib.Cocos2dxBitmap", "createTextBitmapShadowStroke", - "([BLjava/lang/String;IIIIIIIIZFFFFZIIIIFZI)Z")) + "([BLjava/lang/String;IIIIIIIIFZFFFFZIIIIFZI)Z")) { CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__); return false; @@ -122,7 +122,7 @@ class BitmapDC if(!methodInfo.env->CallStaticBooleanMethod(methodInfo.classID, methodInfo.methodID, strArray, jstrFont, textDefinition._fontSize, textDefinition._fontFillColor.r, textDefinition._fontFillColor.g, textDefinition._fontFillColor.b, textDefinition._fontAlpha, - eAlignMask, nWidth, nHeight, + eAlignMask, nWidth, nHeight, textDefinition._lineSpacing, textDefinition._shadow._shadowEnabled, textDefinition._shadow._shadowOffset.width, -textDefinition._shadow._shadowOffset.height, textDefinition._shadow._shadowBlur, textDefinition._shadow._shadowOpacity, textDefinition._stroke._strokeEnabled, textDefinition._stroke._strokeColor.r, textDefinition._stroke._strokeColor.g, diff --git a/cocos/platform/android/CCFileUtils-android.cpp b/cocos/platform/android/CCFileUtils-android.cpp index cf27566406ae..5c7da21a7c91 100644 --- a/cocos/platform/android/CCFileUtils-android.cpp +++ b/cocos/platform/android/CCFileUtils-android.cpp @@ -31,7 +31,6 @@ THE SOFTWARE. #include "platform/CCCommon.h" #include "platform/android/jni/JniHelper.h" #include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" -#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h" #include "android/asset_manager.h" #include "android/asset_manager_jni.h" #include "base/ZipUtils.h" @@ -213,12 +212,18 @@ bool FileUtilsAndroid::isDirectoryExistInternal(const std::string& dirPath) cons return false; } - const char* s = dirPath.c_str(); + std::string dirPathCopy = dirPath; + if(dirPathCopy[dirPathCopy.length() - 1] == '/') + { + dirPathCopy.erase(dirPathCopy.length() - 1); + } + + const char* s = dirPathCopy.c_str(); // find absolute path in flash memory if (s[0] == '/') { - CCLOG("find in flash memory dirPath(%s)", s); + //CCLOG("find in flash memory dirPath(%s)", s); struct stat st; if (stat(s, &st) == 0) { @@ -227,13 +232,16 @@ bool FileUtilsAndroid::isDirectoryExistInternal(const std::string& dirPath) cons } else { + + // find it in apk's assets dir // Found "assets/" at the beginning of the path and we don't want it - CCLOG("find in apk dirPath(%s)", s); + //CCLOG("find in apk dirPath(%s)", s); if (dirPath.find(ASSETS_FOLDER_NAME) == 0) { s += ASSETS_FOLDER_NAME_LENGTH; } + if (FileUtilsAndroid::assetmanager) { AAssetDir* aa = AAssetManager_openDir(FileUtilsAndroid::assetmanager, s); @@ -292,10 +300,10 @@ long FileUtilsAndroid::getFileSize(const std::string& filepath) const std::vector FileUtilsAndroid::listFiles(const std::string& dirPath) const { - if(isAbsolutePath(dirPath)) return FileUtils::listFiles(dirPath); + if(!dirPath.empty() && dirPath[0] == '/') return FileUtils::listFiles(dirPath); std::vector fileList; - string fullPath = fullPathForFilename(dirPath); + string fullPath = fullPathForDirectory(dirPath); static const std::string apkprefix("assets/"); string relativePath = ""; @@ -314,6 +322,11 @@ std::vector FileUtilsAndroid::listFiles(const std::string& dirPath) return fileList; } + if(relativePath[relativePath.length() - 1] == '/') + { + relativePath.erase(relativePath.length() - 1); + } + auto *dir = AAssetManager_openDir(assetmanager, relativePath.c_str()); if(nullptr == dir) { LOGD("... FileUtilsAndroid::failed to open dir %s", relativePath.c_str()); @@ -333,8 +346,6 @@ std::vector FileUtilsAndroid::listFiles(const std::string& dirPath) FileUtils::Status FileUtilsAndroid::getContents(const std::string& filename, ResizableBuffer* buffer) const { - EngineDataManager::onBeforeReadFile(); - static const std::string apkprefix("assets/"); if (filename.empty()) return FileUtils::Status::NotExists; diff --git a/cocos/platform/android/CCFileUtils-android.h b/cocos/platform/android/CCFileUtils-android.h index a20107548784..2153199b18ef 100644 --- a/cocos/platform/android/CCFileUtils-android.h +++ b/cocos/platform/android/CCFileUtils-android.h @@ -34,6 +34,8 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. #include "base/ccTypes.h" #include #include +#include +#include #include "jni.h" #include "android/asset_manager.h" diff --git a/cocos/platform/android/CCGLViewImpl-android.cpp b/cocos/platform/android/CCGLViewImpl-android.cpp index c16927973bb2..519584f383fe 100644 --- a/cocos/platform/android/CCGLViewImpl-android.cpp +++ b/cocos/platform/android/CCGLViewImpl-android.cpp @@ -144,6 +144,8 @@ Rect GLViewImpl::getSafeAreaRect() const { bool isScreenRound = JniHelper::callStaticBooleanMethod("org/cocos2dx/lib/Cocos2dxHelper", "isScreenRound"); bool hasSoftKeys = JniHelper::callStaticBooleanMethod("org/cocos2dx/lib/Cocos2dxHelper", "hasSoftKeys"); + bool isCutoutEnabled = JniHelper::callStaticBooleanMethod("org/cocos2dx/lib/Cocos2dxHelper", "isCutoutEnabled"); + if(isScreenRound) { // edge screen (ex. Samsung Galaxy s7, s9, s9+, Note 9, Nokia 8 Sirocco, Sony Xperia XZ3, Oppo Find X...) if(safeAreaRect.size.width < safeAreaRect.size.height) { @@ -184,6 +186,33 @@ Rect GLViewImpl::getSafeAreaRect() const { } } + if (isCutoutEnabled) { + // screen with enabled cutout area (ex. Google Pixel 3 XL, Huawei P20, Asus ZenFone 5, etc) + static int* safeInsets = JniHelper::callStaticIntArrayMethod("org/cocos2dx/lib/Cocos2dxHelper", "getSafeInsets"); + if (safeInsets != nullptr) { + float safeInsetBottom = safeInsets[0] / _scaleY; + float safeInsetLeft = safeInsets[1] / _scaleX; + float safeInsetRight = safeInsets[2] / _scaleX; + float safeInsetTop = safeInsets[3] / _scaleY; + + // fit safe area rect with safe insets + if (safeInsetBottom > 0) { + safeAreaRect.origin.y += safeInsetBottom; + safeAreaRect.size.height -= safeInsetBottom; + } + if (safeInsetLeft > 0) { + safeAreaRect.origin.x += safeInsetLeft; + safeAreaRect.size.width -= safeInsetLeft; + } + if (safeInsetRight > 0) { + safeAreaRect.size.width -= safeInsetRight; + } + if (safeInsetTop > 0) { + safeAreaRect.size.height -= safeInsetTop; + } + } + } + return safeAreaRect; } diff --git a/cocos/platform/android/CMakeLists.txt b/cocos/platform/android/CMakeLists.txt index 17cbd0d94b1d..609317806d08 100644 --- a/cocos/platform/android/CMakeLists.txt +++ b/cocos/platform/android/CMakeLists.txt @@ -14,7 +14,6 @@ set(${target_name}_src jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp - jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp ) add_library(${target_name} STATIC diff --git a/cocos/platform/android/java/libs/EngineDataManager.jar b/cocos/platform/android/java/libs/EngineDataManager.jar deleted file mode 100644 index 74f326d937f2..000000000000 Binary files a/cocos/platform/android/java/libs/EngineDataManager.jar and /dev/null differ diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index 77c29fcceb18..499b7d5e6f9d 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -166,8 +166,6 @@ protected void onCreate(final Bundle savedInstanceState) { // Audio configuration this.setVolumeControlStream(AudioManager.STREAM_MUSIC); - - Cocos2dxEngineDataManager.init(this, mGLSurfaceView); } //native method,call GLViewImpl::getGLContextAttrs() to get the OpenGL ES context attributions @@ -190,8 +188,6 @@ protected void onResume() { Cocos2dxAudioFocusManager.registerAudioFocusListener(this); this.hideVirtualButton(); resumeIfHasFocus(); - - Cocos2dxEngineDataManager.resume(); } @Override @@ -224,7 +220,6 @@ protected void onPause() { Cocos2dxAudioFocusManager.unregisterAudioFocusListener(this); Cocos2dxHelper.onPause(); mGLSurfaceView.onPause(); - Cocos2dxEngineDataManager.pause(); } @Override @@ -232,8 +227,6 @@ protected void onDestroy() { if(gainAudioFocus) Cocos2dxAudioFocusManager.unregisterAudioFocusListener(this); super.onDestroy(); - - Cocos2dxEngineDataManager.destroy(); } @Override @@ -287,6 +280,7 @@ public void init() { // Cocos2dxGLSurfaceView this.mGLSurfaceView = this.onCreateView(); + this.mGLSurfaceView.setPreserveEGLContextOnPause(true); // ...add to FrameLayout mFrameLayout.addView(this.mGLSurfaceView); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java index 6aec602b92d3..07fd695a3fab 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -151,7 +151,7 @@ public static Typeface calculateShrinkTypeFace(String text, int width, int heigh public static boolean createTextBitmapShadowStroke(byte[] bytes, final String fontName, int fontSize, int fontTintR, int fontTintG, int fontTintB, int fontTintA, - int alignment, int width, int height, + int alignment, int width, int height, float lineSpacing, boolean shadow, float shadowDX, float shadowDY, float shadowBlur, float shadowOpacity, boolean stroke, int strokeR, int strokeG, int strokeB, int strokeA, float strokeSize, boolean enableWrap, int overflow) { String string; @@ -196,12 +196,12 @@ public static boolean createTextBitmapShadowStroke(byte[] bytes, final String f if (overflow == 1 && !enableWrap){ int widthBoundary = (int)Math.ceil( StaticLayout.getDesiredWidth(string, paint)); - layout = new StaticLayout(string, paint, widthBoundary , hAlignment,1.0f,0.0f,false); + layout = new StaticLayout(string, paint, widthBoundary, hAlignment, 1.0f, lineSpacing, false); }else { if (overflow == 2) { calculateShrinkTypeFace(string, width, height, hAlignment, fontSize, paint, enableWrap); } - layout = new StaticLayout(string, paint, maxWidth , hAlignment,1.0f,0.0f,false); + layout = new StaticLayout(string, paint, maxWidth, hAlignment, 1.0f, lineSpacing, false); } layoutWidth = layout.getWidth(); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEngineDataManager.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEngineDataManager.java deleted file mode 100644 index 8d09a7ca9ba0..000000000000 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEngineDataManager.java +++ /dev/null @@ -1,263 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2016 Chukong Technologies Inc. - *

- * http://www.cocos2d-x.org - *

- * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * 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. - ****************************************************************************/ - -package org.cocos2dx.lib; - -import android.content.Context; -import android.opengl.GLSurfaceView; -import android.os.Handler; -import android.util.Log; - -import org.cocos2dx.enginedata.EngineDataManager; -import org.cocos2dx.enginedata.IEngineDataManager; - -public class Cocos2dxEngineDataManager { - private static final String TAG = "CCEngineDataManager"; - private static EngineDataManager sManager = new EngineDataManager(); - private static boolean sIsEnabled = true; - private static boolean sIsInited = false; - - private Cocos2dxEngineDataManager() { - - } - - // Whether to disable Cocos2dxEngineDataManager, invoke it if you don't wanna - // this optimization. You could invoke `Cocos2dxEngineDataManager.disable` before - // `super.onCreate` in game's Activity. The following code snippet demonstrates how to disable it. - /* - public class AppActivity extends Cocos2dxActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - Cocos2dxEngineDataManager.disable(); // disable before `super.onCreate` - super.onCreate(savedInstanceState); - ... - ... - } - } - */ - // Currently, it only supports HuaWei mobile phones. - public static void disable() { - sIsEnabled = false; - } - - public static boolean isInited() { - return sIsInited; - } - - // Lifecycle functions - public static boolean init(Context context, final GLSurfaceView glSurfaceView) { - if (context == null) { - Log.e(TAG, "Context is null"); - return false; - } - - if (glSurfaceView == null) { - Log.e(TAG, "glSurfaceView is null"); - return false; - } - - final IEngineDataManager.OnSystemCommandListener listener = new IEngineDataManager.OnSystemCommandListener() { - - @Override - public void onQueryFps(final int[] expectedFps, final int[] realFps) { - //@note Query FPS should not post it to GL thread since `expectedFps` and `realFps` - // need to be filled immediately. -// glSurfaceView.queueEvent(new Runnable() { -// @Override -// public void run() { - nativeOnQueryFps(expectedFps, realFps); -// } -// }); - } - - @Override - public void onChangeContinuousFrameLostConfig(final int cycle, final int maxFrameMissed) { - glSurfaceView.queueEvent(new Runnable() { - @Override - public void run() { - nativeOnChangeContinuousFrameLostConfig(cycle, maxFrameMissed); - } - }); - } - - @Override - public void onChangeLowFpsConfig(final int cycle, final float maxFrameDx) { - glSurfaceView.queueEvent(new Runnable() { - @Override - public void run() { - nativeOnChangeLowFpsConfig(cycle, maxFrameDx); - } - }); - } - - @Override - public void onChangeExpectedFps(final int fps) { - glSurfaceView.queueEvent(new Runnable() { - @Override - public void run() { - nativeOnChangeExpectedFps(fps); - } - }); - } - - @Override - public void onChangeSpecialEffectLevel(final int level) { - glSurfaceView.queueEvent(new Runnable() { - @Override - public void run() { - nativeOnChangeSpecialEffectLevel(level); - } - }); - } - - @Override - public void onChangeMuteEnabled(final boolean enabled) { - glSurfaceView.queueEvent(new Runnable() { - @Override - public void run() { - nativeOnChangeMuteEnabled(enabled); - } - }); - } - }; - - if (sIsEnabled) { - sIsInited = sManager.init(listener); - } - - nativeSetSupportOptimization(sIsInited); - - return sIsInited; - } - - public static void destroy() { - if (sIsEnabled) { - sManager.destroy(); - } - } - - public static void pause() { - if (sIsEnabled) { - sManager.pause(); - } - } - - public static void resume() { - if (sIsEnabled) { - sManager.resume(); - } - } - // - - public static String getVendorInfo() { - if (sIsEnabled) { - return sManager.getVendorInfo(); - } - return ""; - } - - private static IEngineDataManager.GameStatus convertIntegerToGameStatus(int gameStatus) { - IEngineDataManager.GameStatus[] values = IEngineDataManager.GameStatus.values(); - for (IEngineDataManager.GameStatus status : values) { - if (gameStatus == status.ordinal()) { - return status; - } - } - - return IEngineDataManager.GameStatus.INVALID; - } - /* - * @brief Notify game overhead changed - * @param gameStatus Which situation current game is in - * @param cpuLevel Current game wastes how much CPU resources, the range is [0,10] - * @param gpuLevel Current game wastes how much GPU resources, the range is [0,10] - */ - public static void notifyGameStatus(int gameStatus, int cpuLevel, int gpuLevel) { - if (!sIsEnabled) { - nativeSetSupportOptimization(false); - return; - } - - IEngineDataManager.GameStatus status = convertIntegerToGameStatus(gameStatus); - if (status == IEngineDataManager.GameStatus.INVALID) { - Log.e(TAG, "Invalid game status: " + gameStatus); - return; - } - sManager.notifyGameStatus(status, cpuLevel, gpuLevel); - } - - /* - * @brief Notify an event that some frames are lost. - * @param cycle The statistic cycle of 'Continuous Frame Lost Event', value is in millisecond, default value is 5000ms - * @param continuousFrameLostThreshold The threshold of 'Continuous Frame Lost', default value is 3, - * if there're 3 times of frame lost in 100ms, then mark a - * 'continuous frame lost', it's set by system. - * @times How many times of `Continuous Frame Lost` event happens in a `cycle' - */ - public static void notifyContinuousFrameLost(int cycle, int continuousFrameLostThreshold, int times) { - if (!sIsEnabled) { - nativeSetSupportOptimization(false); - return; - } - - sManager.notifyContinuousFrameLost(cycle, continuousFrameLostThreshold, times); - } - - /* - * @brief Notify an event that game FPS is too low - * @param cycle The statistic cycle of 'FPS Too Low Event', value is in millisecond, default value is 1000ms - * @param lowFpsThreshold The threshold of fps rate to indicate low fps, 'fps rate' = 'real fps' / 'excepted fps', - * default value is 0.3. if 'fps rate' is larger than 0.3, mark a 'low fps', it's set by system. - * - * @param lostFrameCount How many frames are lost in a 'cycle' - */ - public static void notifyLowFps(int cycle, float lowFpsThreshold, int lostFrameCount) { - if (!sIsEnabled) { - nativeSetSupportOptimization(false); - return; - } - - sManager.notifyLowFps(cycle, lowFpsThreshold, lostFrameCount); - } - - public static void notifyFpsChanged(float oldFps, float newFps) { - if (!sIsEnabled) { - nativeSetSupportOptimization(false); - return; - } - - sManager.notifyFpsChanged(oldFps, newFps); - } - - // Native methods - private native static void nativeSetSupportOptimization(boolean isSupported); - private native static void nativeOnQueryFps(/*out*/ int[] expectedFps, /*out*/ int[] realFps); - private native static void nativeOnChangeContinuousFrameLostConfig(int cycle, int continuousFrameLostThreshold); - private native static void nativeOnChangeLowFpsConfig(int cycle, float lowFpsThreshold); - private native static void nativeOnChangeExpectedFps(int fps); - private native static void nativeOnChangeSpecialEffectLevel(int level); - private native static void nativeOnChangeMuteEnabled(boolean enabled); -} diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java index 83347c306d87..c457ca194532 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java @@ -199,7 +199,7 @@ public void run() { } }); this.setRenderMode(RENDERMODE_WHEN_DIRTY); - //super.onPause(); + super.onPause(); } @Override diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index d8fc5ba68bf3..a86c566a2585 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -25,7 +25,9 @@ of this software and associated documentation files (the "Software"), to deal ****************************************************************************/ package org.cocos2dx.lib; +import android.annotation.SuppressLint; import android.content.pm.PackageManager; +import android.graphics.Rect; import android.media.AudioManager; import android.app.Activity; import android.content.ComponentName; @@ -47,9 +49,11 @@ of this software and associated documentation files (the "Software"), to deal import android.util.DisplayMetrics; import android.util.Log; import android.view.Display; +import android.view.DisplayCutout; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.ViewConfiguration; +import android.view.Window; import android.view.WindowManager; import com.android.vending.expansion.zipfile.APKExpansionSupport; @@ -64,6 +68,7 @@ of this software and associated documentation files (the "Software"), to deal import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.LinkedHashSet; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -771,6 +776,48 @@ public static boolean isScreenRound() { return false; } + /** + * Returns whether the window is always allowed to extend into the DisplayCutout areas on the short edges of the screen. + * + * @return true if the window in display cutout mode on the short edges of the screen, false otherwise + */ + @SuppressLint("InlinedApi") + public static boolean isCutoutEnabled() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + WindowManager.LayoutParams lp = sActivity.getWindow().getAttributes(); + return lp.layoutInDisplayCutoutMode == WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + + return false; + } + + /** + * Returns safe insets array. + * + * @return array of int with safe insets values + */ + @SuppressLint("NewApi") + public static int[] getSafeInsets() { + final int[] safeInsets = new int[]{0, 0, 0, 0}; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + Window cocosWindow = sActivity.getWindow(); + DisplayCutout displayCutout = cocosWindow.getDecorView().getRootWindowInsets().getDisplayCutout(); + // Judge whether it is cutouts (aka notch) screen phone by judge cutout equle to null + if (displayCutout != null) { + List rects = displayCutout.getBoundingRects(); + // Judge whether it is cutouts (aka notch) screen phone by judge cutout rects is null or zero size + if (rects != null && rects.size() != 0) { + safeInsets[0] = displayCutout.getSafeInsetBottom(); + safeInsets[1] = displayCutout.getSafeInsetLeft(); + safeInsets[2] = displayCutout.getSafeInsetRight(); + safeInsets[3] = displayCutout.getSafeInsetTop(); + } + } + } + + return safeInsets; + } + /** * Queries about whether any physical keys exist on the * any keyboard attached to the device and returns true diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java index ed7dee96ebf4..beff0786c62c 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java @@ -66,6 +66,8 @@ public class Cocos2dxVideoHelper { private final static int VideoTaskRestart = 10; private final static int VideoTaskKeepRatio = 11; private final static int VideoTaskFullScreen = 12; + private final static int VideoTaskSetLooping = 13; + private final static int VideoTaskSetUserInputEnabled = 14; final static int KeyEventBack = 1000; static class VideoHandler extends Handler{ @@ -157,11 +159,24 @@ public void handleMessage(Message msg) { } break; } + case VideoTaskSetLooping: { + Cocos2dxVideoHelper helper = mReference.get(); + helper._setLooping(msg.arg1, msg.arg2 != 0); + break; + } + + case VideoTaskSetUserInputEnabled: { + Cocos2dxVideoHelper helper = mReference.get(); + helper._setUserInputEnabled(msg.arg1, msg.arg2 != 0); + break; + } + case KeyEventBack: { Cocos2dxVideoHelper helper = mReference.get(); helper.onBackKeyEvent(); break; - } + } + default: break; } @@ -257,6 +272,36 @@ private void _setVideoURL(int index, int videoSource, String videoUrl) { } } } + + public static void setLooping(int index, boolean looping) { + Message msg = new Message(); + msg.what = VideoTaskSetLooping; + msg.arg1 = index; + msg.arg2 = looping ? 1 : 0; + mVideoHandler.sendMessage(msg); + } + + private void _setLooping(int index, boolean looping) { + Cocos2dxVideoView videoView = sVideoViews.get(index); + if (videoView != null) { + videoView.setLooping(looping); + } + } + + public static void setUserInputEnabled(int index, boolean enableInput) { + Message msg = new Message(); + msg.what = VideoTaskSetUserInputEnabled; + msg.arg1 = index; + msg.arg2 = enableInput ? 1 : 0; + mVideoHandler.sendMessage(msg); + } + + private void _setUserInputEnabled(int index, boolean enableInput) { + Cocos2dxVideoView videoView = sVideoViews.get(index); + if (videoView != null) { + videoView.setUserInputEnabled(enableInput); + } + } public static void setVideoRect(int index, int left, int top, int maxWidth, int maxHeight) { Message msg = new Message(); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java index 5626682516f9..93ea3e3b134b 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java @@ -198,7 +198,7 @@ private void initVideoView() { @Override public boolean onTouchEvent(MotionEvent event) { - if((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) + if( mUserInputEnabled && ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP)) { if (isPlaying()) { pause(); @@ -211,6 +211,8 @@ public boolean onTouchEvent(MotionEvent event) { } private boolean mIsAssetRouse = false; + private boolean mLooping = false; + private boolean mUserInputEnabled = true; private String mVideoFilePath = null; private static final String AssetResourceRoot = "assets/"; @@ -246,6 +248,14 @@ private void setVideoURI(Uri uri, Map headers) { requestLayout(); invalidate(); } + + public void setLooping(boolean looping) { + mLooping = looping; + } + + public void setUserInputEnabled(boolean enableInput) { + mUserInputEnabled = enableInput; + } public void stopPlayback() { if (mMediaPlayer != null) { @@ -291,12 +301,16 @@ private void openVideo() { mMediaPlayer.setDisplay(mSurfaceHolder); mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mMediaPlayer.setScreenOnWhilePlaying(true); + mMediaPlayer.setLooping(mLooping); // CROWDSTAR //} mDuration = -1; mCurrentBufferPercentage = 0; if (mIsAssetRouse) { AssetFileDescriptor afd = mCocos2dxActivity.getAssets().openFd(mVideoFilePath); + if (afd == null && Cocos2dxHelper.getObbFile() != null) { + afd = Cocos2dxHelper.getObbFile() .getAssetFileDescriptor(mVideoFilePath); + } mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength()); } else { mMediaPlayer.setDataSource(mCocos2dxActivity, mVideoUri); @@ -425,8 +439,13 @@ public void onPrepared(MediaPlayer mp) { public void onCompletion(MediaPlayer mp) { mCurrentState = STATE_PLAYBACK_COMPLETED; mTargetState = STATE_PLAYBACK_COMPLETED; - - release(true); + + // Do not release the player if we are looping as we still need the + // the player resources to exist + if (!mLooping) { + release(true); + } + if (mOnVideoEventListener != null) { mOnVideoEventListener.onVideoEvent(mViewTag,EVENT_COMPLETED); } @@ -438,7 +457,8 @@ public void onCompletion(MediaPlayer mp) { private static final int EVENT_PAUSED = 1; private static final int EVENT_STOPPED = 2; private static final int EVENT_COMPLETED = 3; - + private static final int EVENT_ERROR = 4; + public interface OnVideoEventListener { void onVideoEvent(int tag,int event); @@ -451,6 +471,10 @@ public boolean onError(MediaPlayer mp, int framework_err, int impl_err) { mCurrentState = STATE_ERROR; mTargetState = STATE_ERROR; + if (mOnVideoEventListener != null) { + mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_ERROR); + } + /* If an error handler has been supplied, use it and finish. */ if (mOnErrorListener != null) { if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err)) { diff --git a/cocos/platform/android/javaactivity-android.cpp b/cocos/platform/android/javaactivity-android.cpp index a44b951820be..0ddbf34bdbc6 100644 --- a/cocos/platform/android/javaactivity-android.cpp +++ b/cocos/platform/android/javaactivity-android.cpp @@ -34,6 +34,7 @@ THE SOFTWARE. #include "base/CCEventDispatcher.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCTextureCache.h" +#include "renderer/ccGLStateCache.h" #include "2d/CCDrawingPrimitives.h" #include "platform/android/jni/JniHelper.h" #include "network/CCDownloader-android.h" @@ -97,7 +98,7 @@ JNIEXPORT void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, j } else { - cocos2d::Director::getInstance()->resetMatrixStack(); + cocos2d::GL::invalidateStateCache(); cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms(); cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp deleted file mode 100644 index 30018c9398ce..000000000000 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp +++ /dev/null @@ -1,1682 +0,0 @@ -/**************************************************************************** -Copyright (c) 2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h" -#include "platform/android/jni/JniHelper.h" -#include "platform/CCFileUtils.h" -#include "platform/android/CCApplication-android.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" -#include "base/CCEventType.h" -#include "renderer/CCRenderer.h" -#include "2d/CCParticleSystem.h" -#include "2d/CCActionManager.h" -#include "audio/include/AudioEngine.h" -#include -#include -#include - -#define LOG_TAG "EngineDataManager.cpp" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) - -#define EDM_DEBUG 0 - -#define JNI_FUNC_PREFIX(func) Java_org_cocos2dx_lib_Cocos2dxEngineDataManager_##func - -using namespace cocos2d; - -#if EDM_DEBUG -#include "platform/android/jni/ProcessCpuTracker.h" - -namespace { - -std::string& trim(std::string& s) -{ - if (s.empty()) - return s; - - s.erase(0, s.find_first_not_of(" \t")); - s.erase(s.find_last_not_of(" \t") + 1); - return s; -} - -void split(const std::string& s, const std::string& delim, std::vector* ret) -{ - size_t last = 0; - size_t index = s.find(delim, last); - while (index != std::string::npos) - { - ret->push_back(s.substr(last, index - last)); - last = index + delim.length(); - index = s.find(delim, last); - } - if (index - last > 0) - { - ret->push_back(s.substr(last, index - last)); - } -} - -std::string& deleteChar(std::string& s, const char* toDeleteChar) -{ - if (s.empty()) - return s; - - size_t pos = s.find_first_of(toDeleteChar); - while (pos != std::string::npos) - { - s.erase(pos, 1); - pos = s.find_first_of(toDeleteChar); - } - - return s; -} - -bool getValueFromMap(const std::map& m, const std::string& key, std::string* outValue) -{ - if (m.empty() || outValue == NULL) - return false; - - std::map::const_iterator iter = m.find(key); - if (iter != m.end()) - { - *outValue = iter->second; - return true; - } - outValue->clear(); - return false; -} - -std::string& toLowercase(std::string& s) -{ - std::transform(s.begin(), s.end(), s.begin(), ::tolower); - return s; -} - -} // namespace { - -#endif - -namespace { - -const char* ENGINE_DATA_MANAGER_VERSION = "5"; -const char* CLASS_NAME_ENGINE_DATA_MANAGER = "org.cocos2dx.lib.Cocos2dxEngineDataManager"; -const char* CLASS_NAME_RENDERER = "org.cocos2dx.lib.Cocos2dxRenderer"; - -bool _isInitialized = false; -bool _isSupported = false; -bool _isFirstSetNextScene = true; -bool _isReplaceScene = false; -bool _isReadFile = false; -bool _isInBackground = false; - -uint32_t _drawCountInterval = 0; -const uint32_t _drawCountThreshold = 30; - -#if EDM_DEBUG -uint32_t _printCpuGpuLevelCounter = 0; -uint32_t _printCpuGpuLevelThreshold = UINT_MAX; // Print cpu/gpu level in every 60 frames even if levels aren't changed. - -uint32_t _printCpuUsageCounter = 0; -uint32_t _printCpuUsageThreshold = UINT_MAX; - -ProcessCpuTracker _cpuTracker; -bool _forceEnableOptimization = false; -#endif - -/* last time frame lost cycle was calculated */ -std::chrono::steady_clock::time_point _lastContinuousFrameLostUpdate; -std::chrono::steady_clock::time_point _lastFrameLost100msUpdate; - -/* last time low fps cycle was calculated */ -std::chrono::steady_clock::time_point _lastLowFpsUpdate; - -int _continuousFrameLostCycle = 5000; -int _continuousFrameLostThreshold = 3; -int _continuousFrameLostCount = 0; -int _frameLostCounter = 0; - -int _lowFpsCycle = 1000; -float _lowFpsThreshold = 0.3f; -int _lowFpsCounter = 0; - -int _oldCpuLevel = -1; -int _oldGpuLevel = -1; - -int _oldCpuLevelMulFactor = -1; -int _oldGpuLevelMulFactor = -1; - -float _levelDecreaseThreshold = 0.2f; - -float _cpuFpsFactor = 1.0f; -float _gpuFpsFactor = 1.0f; -bool _isFpsChanged = false; -float _oldRealFps = 60.0f; - -uint32_t _lowFpsCheckMode = 0; // 0: Continuous mode, 1: Average mode -float _lowRealFpsThreshold = 0.5f; // Unit: percentage (0 ~ 1) -std::chrono::steady_clock::time_point _lastTimeNotifyLevelByLowFps; // Only used in continuous mode -float _notifyLevelByLowFpsThreshold = 0.5f; // Unit: seconds, only used in continuous mode -int _minValueOfNotifyCpuLevelByLowFps = 4; -int _minValueOfNotifyGpuLevelByLowFps = 5; -uint32_t _continuousLowRealFpsCount = 0; // Only used in continuous mode -uint32_t _continuousLowRealFpsThreshold = 1; // Only used in continuous mode -uint32_t _calculateAvgFpsCount = 0; // Only used in average mode -float _calculateAvgFpsSum = 0.0f; // Only used in average mode -std::chrono::steady_clock::time_point _lastTimeCalculateAvgFps; // Only used in average mode - -const float DEFAULT_INTERVAL = (1.0f / 60.0f); -// The final animation interval which is used in 'onDrawFrame' -float _animationInterval = DEFAULT_INTERVAL; - -// The animation interval set by engine. -// It could be updated by 'Director::getInstance()->setAnimationInterval(value);' -// or 'Director::getInstance()->resume();', 'Director::getInstance()->startAnimation();'. -float _animationIntervalByEngineOrGame = DEFAULT_INTERVAL; - -// The animation interval set by system. -// System could set this variable through EngineDataManager to override the default FPS set by developer. -// By using this variable, system will be able to control temperature better -// and waste less power while device is in low battery mode, so game could be played longer when battery is nearly dead. -// setAnimationInterval will reset _animationIntervalBySystem to -1 since last change last takes effect. -// Currently, only HuaWei Android devices may use this variable. -float _animationIntervalBySystem = -1.0f; - -// The animation interval when scene is changing. -// _animationIntervalByEngineOrGame & _animationIntervalBySystem will not take effect -// while _animationIntervalBySceneChange is greater than 0, -// but _animationIntervalByEngineOrGame will be effective while -// Its priority is highest while it's valid ( > 0) , and it will be invalid (set to -1) after changing scene finishes. -// Currently, only HuaWei Android devices may use this variable. -float _animationIntervalBySceneChange = -1.0f; - -// The animation interval when director is paused. -// It could be updated by 'Director::getInstance()->pause();' -// Its priority is higher than _animationIntervalBySystem. -float _animationIntervalByDirectorPaused = -1.0f; - -#define CARRAY_SIZE(arr) ((int)(arr.size())) - -enum LevelChangeReason -{ - LEVEL_CHANGE_REASON_NONE = 0, - LEVEL_CHANGE_REASON_CPU = (1 << 0), - LEVEL_CHANGE_REASON_GPU = (1 << 1), - LEVEL_CHANGE_REASON_CPU_AND_GPU = (LEVEL_CHANGE_REASON_CPU | LEVEL_CHANGE_REASON_GPU) -}; - -// CPU Level - -struct CpuLevelInfo -{ - unsigned int nodeCount; - unsigned int particleCount; - unsigned int actionCount; - unsigned int audioCount; -}; - -std::vector _cpuLevelArr = { - {500 , 500, 500, 6}, - {1250, 1500, 2000, 20}, - {1750, 2000, 3000, 32}, - {2750, 2500, 7000, 50} -}; - -// GPU Level - -struct GpuLevelInfo -{ - unsigned int vertexCount; - unsigned int drawCount; -}; - -std::vector _gpuLevelArr = { - {2000, 400}, - {4000, 800}, - {6000, 1000}, - {8000, 1100}, - {10000, 1200}, - {15000, 1300}, - {22000, 1350}, - {30000, 1400}, - {40000, 1450} -}; - -// Particle Level -const std::vector _particleLevelArr = { - 0.0f, - 0.2f, - 0.4f, - 0.6f, - 0.8f, - 1.0f -}; - - -#if EDM_DEBUG -class FpsCollector -{ -public: - FpsCollector(float intervalInSeconds) - : _collectFpsInterval(intervalInSeconds) - {} - - void setCollectFpsInterval(float intervalInSeconds) - { - _collectFpsInterval = intervalInSeconds; - } - - inline float getCollectFpsInterval() const { return _collectFpsInterval; } - - void update(float fps) - { - auto now = std::chrono::steady_clock::now(); - // collect - _fpsContainer.push_back(fps); - - float duration = std::chrono::duration_cast(now - _lastTimeCollectFps).count() / 1000000.0f; - if (duration > _collectFpsInterval) - { - // output info - _lastTimeCollectFps = now; - print(); - } - } - - void reset(const std::chrono::steady_clock::time_point& time) - { - _lastTimeCollectFps = time; - _fpsContainer.clear(); - } - -private: - void print() - { - if (_fpsContainer.empty()) - return; - - std::stringstream ss; - ss.precision(3); - float sum = 0.0f; - float fps = 0.0f; - std::vector::iterator iter = _fpsContainer.begin(); - for (; iter != _fpsContainer.end(); ++iter) - { - fps = *iter; - ss << fps << ", "; - sum += fps; - } - std::string s = ss.str(); - LOGD("Collected FPS: %savg: %.01f, sum:%d", s.c_str(), sum/_fpsContainer.size(), (int)_fpsContainer.size()); - - _fpsContainer.clear(); - } -private: - float _collectFpsInterval; - std::chrono::steady_clock::time_point _lastTimeCollectFps; - std::vector _fpsContainer; -}; - -#endif - -class FpsUpdatedWatcher -{ -public: - FpsUpdatedWatcher(float threshold) - : _threshold(threshold) - , _updateCount(0) - , _isStarted(false) - { - _data.reserve(12); - } - - ~FpsUpdatedWatcher() - {} - - void start() - { - reset(); - _isStarted = true; - } - inline bool isStarted() { return _isStarted; } - - void update(float fps) - { - if (!_isStarted) - return; - - if (_data.size() >= 12) - _data.erase(_data.begin()); - - _data.push_back(fps); - ++_updateCount; - } - - void reset() - { - _data.clear(); - _updateCount = 0; - _isStarted = false; - } - - bool isStable() - { - if (_updateCount > 24) - return true; - - if (_data.size() < 12) - return false; - - float sum = 0.0f; - float average = 0.0f; - uint32_t stableCount = 0; - - std::vector::iterator iter = _data.begin(); - for (; iter != _data.end(); ++iter) - sum += *iter; - - average = sum / _data.size(); - - iter = _data.begin(); - for (; iter != _data.end(); ++iter) - { - if (fabs(*iter - average) < _threshold) - ++stableCount; - } - - return stableCount > 9; - } -private: - std::vector _data; // Collect 12 frames data - float _threshold; - int _updateCount; - bool _isStarted; -}; - -FpsUpdatedWatcher _fpsUpdatedWatcher(2.0f); - -#if EDM_DEBUG -FpsCollector _fpsCollector(0.2f); -bool _isCollectFpsEnabled = false; -#endif - -int cbCpuLevelNode(int i) { return _cpuLevelArr[i].nodeCount; } -int cbCpuLevelParticle(int i) { return _cpuLevelArr[i].particleCount; } -int cbCpuLevelAction(int i) { return _cpuLevelArr[i].actionCount; } -int cbCpuLevelAudio(int i) { return _cpuLevelArr[i].audioCount; } - -float toCpuLevelPerFactor(int value, int (*cb)(int i)) -{ - int len = CARRAY_SIZE(_cpuLevelArr); - int prevStep = 0; - int curStep = 0; - for (int i = 0; i < len; ++i) - { - curStep = cb(i); - if (value < curStep) - { - // The return value should be a float value. - // Do linear interpolation here - return i + (1.0f / (curStep - prevStep) * (value - prevStep)); - } - prevStep = curStep; - } - return len; -} - -int cbGpuLevelVertex(int i) { return _gpuLevelArr[i].vertexCount; } -int cbGpuLevelDraw(int i) { return _gpuLevelArr[i].drawCount; } - -float toGpuLevelPerFactor(int value, int (*cb)(int i)) -{ - int len = CARRAY_SIZE(_gpuLevelArr); - int prevStep = 0; - int curStep = 0; - - for (int i = 0; i < len; ++i) - { - curStep = cb(i); - if (value < curStep) - { - // The return value should be a float value. - // Do linear interpolation here - return i + (1.0f / (curStep - prevStep) * (value - prevStep)); - } - - prevStep = curStep; - - } - return len; -} - -void resetLastTime() -{ - _lastFrameLost100msUpdate = std::chrono::steady_clock::now(); - _lastContinuousFrameLostUpdate = _lastFrameLost100msUpdate; - _lastLowFpsUpdate = _lastFrameLost100msUpdate; - _lastTimeNotifyLevelByLowFps = _lastFrameLost100msUpdate; - _lastTimeCalculateAvgFps = _lastFrameLost100msUpdate; - -#if EDM_DEBUG - _fpsCollector.reset(_lastFrameLost100msUpdate); -#endif -} - -void parseDebugConfig() -{ -#if EDM_DEBUG - auto fileUtils = FileUtils::getInstance(); - - const char* configPath = "/sdcard/cc-res-level.json"; - - if (!fileUtils->isFileExist(configPath)) - { - return; - } - - LOGD("Using debug level config: %s", configPath); - - std::string buffer; - unsigned long size = 0; - unsigned char* resLevelConfig = fileUtils->getFileData(configPath, "rb", &size); - if (resLevelConfig != NULL && size > 0) - { - buffer.insert(0, (const char*)resLevelConfig, (size_t)size); - } - delete[] resLevelConfig; - - // Get std::map from config file - { - size_t pos = buffer.find_first_of('{'); - if (pos != std::string::npos) - { - buffer.replace(pos, 1, ""); - } - pos = buffer.find_last_of('}'); - - if (pos != std::string::npos) - { - buffer.replace(pos, 1, ""); - } - } - - deleteChar(buffer, "\r"); - deleteChar(buffer, "\n"); - deleteChar(buffer, "\t"); - deleteChar(buffer, " "); - - std::string cpuLevelBuffer; - { - const char* cpuLevelStartKey = "\"cpu_level\":["; - const size_t cpuLevelStartKeyLen = strlen(cpuLevelStartKey); - size_t cpuLevelStartPos = buffer.find(cpuLevelStartKey); - if (cpuLevelStartPos != std::string::npos) - { - cpuLevelStartPos += cpuLevelStartKeyLen; - size_t cpuLevelEndPos = buffer.find("]", cpuLevelStartPos); - cpuLevelBuffer = buffer.substr(cpuLevelStartPos, cpuLevelEndPos - cpuLevelStartPos); - buffer.erase(cpuLevelStartPos-cpuLevelStartKeyLen, cpuLevelBuffer.length() + cpuLevelStartKeyLen + 1); - } - } - - if (!cpuLevelBuffer.empty()) - { - LOGD("cpuLevelBuffer: %s", cpuLevelBuffer.c_str()); - } - - std::string gpuLevelBuffer; - { - const char* gpuLevelStartKey = "\"gpu_level\":["; - const size_t gpuLevelStartKeyLen = strlen(gpuLevelStartKey); - size_t gpuLevelStartPos = buffer.find(gpuLevelStartKey); - if (gpuLevelStartPos != std::string::npos) - { - gpuLevelStartPos += gpuLevelStartKeyLen; - size_t gpuLevelEndPos = buffer.find("]", gpuLevelStartPos); - gpuLevelBuffer = buffer.substr(gpuLevelStartPos, gpuLevelEndPos - gpuLevelStartPos); - buffer.erase(gpuLevelStartPos-gpuLevelStartKeyLen, gpuLevelBuffer.length() + gpuLevelStartKeyLen + 1); - } - } - - if (gpuLevelBuffer.empty()) - { - LOGD("gpuLevelBuffer: %s", gpuLevelBuffer.c_str()); - } - - LOGD("remain: %s", buffer.c_str()); - - std::vector keyValueArr; - split(buffer, ",", &keyValueArr); - - if (keyValueArr.empty()) - { - LOGE("Parse cc-res-level.json failed!"); - return; - } - - LOGD("element count: %d", (int)keyValueArr.size()); - - std::map configMap; - for (size_t i = 0, len = keyValueArr.size(); i < len; ++i) - { - std::string e = keyValueArr[i]; - if (e.empty()) - continue; - - std::vector keyValue; - split(e, ":", &keyValue); - if (keyValue.empty() || keyValue.size() != 2) - { - LOGE("Parse (%s) failed, size: %d", e.c_str(), (int)keyValue.size()); - return; - } - - deleteChar(keyValue[0], "\""); - - configMap.insert(std::make_pair(keyValue[0], keyValue[1])); - } - - std::string tmp; - if (getValueFromMap(configMap, "force_enable_optimization", &tmp)) - { - toLowercase(tmp); - if (tmp == "true") - { - _forceEnableOptimization = true; - } - LOGD("[changed] force_enable_optimization: %d", _forceEnableOptimization); - } - else - { - LOGD("[default] force_enable_optimization: %d", _forceEnableOptimization); - } - - - if (getValueFromMap(configMap, "level_log_freq", &tmp)) - { - _printCpuGpuLevelThreshold = (uint32_t)atoi(tmp.c_str()); - LOGD("[changed] level_log_freq: %u", _printCpuGpuLevelThreshold); - } - else - { - LOGD("[default] level_log_freq: %u", _printCpuGpuLevelThreshold); - } - - - if (getValueFromMap(configMap, "cpu_usage_log_freq", &tmp)) - { - _printCpuUsageThreshold = (uint32_t)atoi(tmp.c_str()); - LOGD("[changed] cpu_usage_log_freq: %u", _printCpuUsageThreshold); - } - else - { - LOGD("[default] cpu_usage_log_freq: %u", _printCpuUsageThreshold); - } - - if (getValueFromMap(configMap, "level_decrease_threshold", &tmp)) - { - _levelDecreaseThreshold = atof(tmp.c_str()); - LOGD("[changed] level_decrease_threshold: %f", _levelDecreaseThreshold); - } - else - { - LOGD("[default] level_decrease_threshold: %f", _levelDecreaseThreshold); - } - - if (getValueFromMap(configMap, "low_fps_check_mode", &tmp)) - { - _lowFpsCheckMode = (uint32_t)atoi(tmp.c_str()); - LOGD("[changed] low_fps_check_mode: %u", _lowFpsCheckMode); - } - else - { - LOGD("[default] low_fps_check_mode: %u", _lowFpsCheckMode); - } - - if (getValueFromMap(configMap, "low_realfps_threshold", &tmp)) - { - _lowRealFpsThreshold = atof(tmp.c_str()); - LOGD("[changed] low_realfps_threshold: %f", _lowRealFpsThreshold); - } - else - { - LOGD("[default] low_realfps_threshold: %f", _lowRealFpsThreshold); - } - - if (getValueFromMap(configMap, "notify_level_by_low_fps_threshold", &tmp)) - { - _notifyLevelByLowFpsThreshold = atof(tmp.c_str()); - LOGD("[changed] notify_level_by_low_fps_threshold: %f", _notifyLevelByLowFpsThreshold); - } - else - { - LOGD("[default] notify_level_by_low_fps_threshold: %f", _notifyLevelByLowFpsThreshold); - } - - if (getValueFromMap(configMap, "min_value_of_notify_cpu_level_by_low_fps", &tmp)) - { - _minValueOfNotifyCpuLevelByLowFps = atoi(tmp.c_str()); - if (_minValueOfNotifyCpuLevelByLowFps > CARRAY_SIZE(_cpuLevelArr)) - { - _minValueOfNotifyCpuLevelByLowFps = CARRAY_SIZE(_cpuLevelArr); - } - LOGD("[changed] min_value_of_notify_cpu_level_by_low_fps: %d", _minValueOfNotifyCpuLevelByLowFps); - } - else - { - LOGD("[default] min_value_of_notify_cpu_level_by_low_fps: %d", _minValueOfNotifyCpuLevelByLowFps); - } - - if (getValueFromMap(configMap, "min_value_of_notify_gpu_level_by_low_fps", &tmp)) - { - _minValueOfNotifyGpuLevelByLowFps = atoi(tmp.c_str()); - if (_minValueOfNotifyGpuLevelByLowFps > CARRAY_SIZE(_gpuLevelArr)) - { - _minValueOfNotifyGpuLevelByLowFps = CARRAY_SIZE(_gpuLevelArr); - } - LOGD("[changed] min_value_of_notify_gpu_level_by_low_fps: %d", _minValueOfNotifyGpuLevelByLowFps); - } - else - { - LOGD("[default] min_value_of_notify_gpu_level_by_low_fps: %d", _minValueOfNotifyGpuLevelByLowFps); - } - - if (getValueFromMap(configMap, "continuous_low_realfps_threshold", &tmp)) - { - _continuousLowRealFpsThreshold = (uint32_t)atoi(tmp.c_str()); - LOGD("[changed] continuous_low_realfps_threshold: %u", _continuousLowRealFpsThreshold); - } - else - { - LOGD("[default] continuous_low_realfps_threshold: %u", _continuousLowRealFpsThreshold); - } - - if (getValueFromMap(configMap, "enable_collect_fps", &tmp)) - { - toLowercase(tmp); - if (tmp == "true") - { - _isCollectFpsEnabled = true; - } - LOGD("[changed] enable_collect_fps: %d", (int)_isCollectFpsEnabled); - } - else - { - LOGD("[default] enable_collect_fps: %d", (int)_isCollectFpsEnabled); - } - - if (getValueFromMap(configMap, "collect_fps_interval", &tmp)) - { - _fpsCollector.setCollectFpsInterval(atof(tmp.c_str())); - LOGD("[changed] collect_fps_interval: %f", _fpsCollector.getCollectFpsInterval()); - } - else - { - LOGD("[default] collect_fps_interval: %f", _fpsCollector.getCollectFpsInterval()); - } - - if (!cpuLevelBuffer.empty()) - { - std::vector cpuObjectArray; - split(cpuLevelBuffer, "},", &cpuObjectArray); - if (!cpuObjectArray.empty()) - { - _cpuLevelArr.clear(); - CpuLevelInfo cpuLevelInfo; - - for (size_t i = 0, len = cpuObjectArray.size(); i < len; ++i) - { - std::string& e = cpuObjectArray[i]; - size_t pos = e.find_first_of('{'); - if (pos != std::string::npos) - { - e.replace(pos, 1, ""); - } - pos = e.find_last_of('}'); - - if (pos != std::string::npos) - { - e.replace(pos, 1, ""); - } - - LOGD("cpu level: %s", e.c_str()); - - std::vector cpuLevelElement; - split(e, ",", &cpuLevelElement); - - for (size_t j = 0; j < cpuLevelElement.size(); ++j) - { - std::map kvMap; - std::vector kvArr; - split(cpuLevelElement[j], ":", &kvArr); - if (kvArr.size() != 2) - { - LOGE("cpu level configuration error: %d", (int)kvArr.size()); - return; - } - deleteChar(kvArr[0], "\""); - - kvMap.insert(std::make_pair(kvArr[0], kvArr[1])); - - if (getValueFromMap(kvMap, "node", &tmp)) - { - cpuLevelInfo.nodeCount = (uint32_t)atoi(tmp.c_str()); - } - - if (getValueFromMap(kvMap, "particle", &tmp)) - { - cpuLevelInfo.particleCount = (uint32_t)atoi(tmp.c_str()); - } - if (getValueFromMap(kvMap, "action", &tmp)) - { - cpuLevelInfo.actionCount = (uint32_t)atoi(tmp.c_str()); - } - if (getValueFromMap(kvMap, "audio", &tmp)) - { - cpuLevelInfo.audioCount = (uint32_t)atoi(tmp.c_str()); - } - } - - _cpuLevelArr.push_back(cpuLevelInfo); - } - } - } - - if (!gpuLevelBuffer.empty()) - { - std::vector gpuObjectArray; - split(gpuLevelBuffer, "},", &gpuObjectArray); - if (!gpuObjectArray.empty()) - { - _gpuLevelArr.clear(); - GpuLevelInfo gpuLevelInfo; - - for (size_t i = 0, len = gpuObjectArray.size(); i < len; ++i) - { - std::string& e = gpuObjectArray[i]; - size_t pos = e.find_first_of('{'); - if (pos != std::string::npos) - { - e.replace(pos, 1, ""); - } - pos = e.find_last_of('}'); - - if (pos != std::string::npos) - { - e.replace(pos, 1, ""); - } - - LOGD("gpu level: %s", e.c_str()); - - std::vector gpuLevelElement; - split(e, ",", &gpuLevelElement); - - for (size_t j = 0; j < gpuLevelElement.size(); ++j) - { - std::map kvMap; - std::vector kvArr; - split(gpuLevelElement[j], ":", &kvArr); - if (kvArr.size() != 2) - { - LOGE("gpu level configuration error: %d", (int)kvArr.size()); - return; - } - deleteChar(kvArr[0], "\""); - - kvMap.insert(std::make_pair(kvArr[0], kvArr[1])); - - if (getValueFromMap(kvMap, "vertex", &tmp)) - { - gpuLevelInfo.vertexCount = (uint32_t)atoi(tmp.c_str()); - } - - if (getValueFromMap(kvMap, "draw", &tmp)) - { - gpuLevelInfo.drawCount = (uint32_t)atoi(tmp.c_str()); - } - } - - _gpuLevelArr.push_back(gpuLevelInfo); - } - } - } - - { - LOGD("-----------------------------------------"); - std::vector::iterator iter = _cpuLevelArr.begin(); - for (; iter != _cpuLevelArr.end(); ++iter) - { - CpuLevelInfo level = *iter; - LOGD("cpu level: %u, %u, %u, %u", level.nodeCount, level.particleCount, level.actionCount, level.audioCount); - } - LOGD("-----------------------------------------"); - } - - { - LOGD("========================================="); - std::vector::iterator iter = _gpuLevelArr.begin(); - for (; iter != _gpuLevelArr.end(); ++iter) - { - GpuLevelInfo level = *iter; - LOGD("gpu level: %u, %u", level.vertexCount, level.drawCount); - } - LOGD("========================================="); - } -#endif // EDM_DEBUG -} - -void setAnimationIntervalBySystem(float interval) -{ - if (!_isSupported) - return; - - LOGD("Set FPS %f by system", std::ceil(1.0f / interval)); - EngineDataManager::setAnimationInterval(interval, SetIntervalReason::BY_SYSTEM); -} - -void setAnimationIntervalBySceneChange(float interval) -{ - if (!_isSupported) - return; - - LOGD("Set FPS %f while changing scene", std::ceil(1.0f / interval)); - EngineDataManager::setAnimationInterval(interval, SetIntervalReason::BY_SCENE_CHANGE); -} - -} // namespace { - -namespace cocos2d { - -int EngineDataManager::getTotalParticleCount() -{ - auto& particleSystems = ParticleSystem::getAllParticleSystems(); - if (particleSystems.empty()) - { - return 0; - } - - int count = 0; - for (auto&& system : particleSystems) - { - count += system->getTotalParticles(); - } - - return count; -} - -// calculates frame lost event -// static -void EngineDataManager::calculateFrameLost() -{ - auto director = Director::getInstance(); - - if (_lowFpsThreshold > 0 && _continuousFrameLostThreshold > 0) - { - float frameRate = director->getFrameRate(); - - float expectedFps = 1.0f / _animationInterval; - float frameLostRate = (expectedFps - frameRate) * _animationInterval; - if (frameLostRate > _lowFpsThreshold) - { - ++_frameLostCounter; - ++_lowFpsCounter; -// LOGD("_frameLostCounter: %d, _lowFpsCounter=%d", _frameLostCounter, _lowFpsCounter); - } - - auto now = std::chrono::steady_clock::now(); - float interval = std::chrono::duration_cast(now - _lastFrameLost100msUpdate).count() / 1000000.0f; - if (interval > 0.1f) - { - _lastFrameLost100msUpdate = now; - // check lost frame count - if (_frameLostCounter >= _continuousFrameLostThreshold) - { - ++_continuousFrameLostCount; - } - // Reset frame lost counter after 100ms interval - // even it's smaller than _continuousFrameLostThreshold - _frameLostCounter = 0; - } - - interval = std::chrono::duration_cast(now - _lastContinuousFrameLostUpdate).count() / 1000000.0f; - if (interval > (_continuousFrameLostCycle / 1000.0f)) - { - _lastContinuousFrameLostUpdate = now; - if (_continuousFrameLostCount > 0) - { - // notify continuous frame lost event to system - notifyContinuousFrameLost(_continuousFrameLostCycle, _continuousFrameLostThreshold, _continuousFrameLostCount); - - // LOGD("continuous frame lost: %d", _continuousFrameLostCount); - _continuousFrameLostCount = 0; - } - } - - interval = std::chrono::duration_cast(now - _lastLowFpsUpdate).count() / 1000000.0f; - if (interval > (_lowFpsCycle / 1000.0f)) - { - _lastLowFpsUpdate = now; - if (_lowFpsCounter > 0) - { - // notify low fps event to system - notifyLowFps(_lowFpsCycle, _lowFpsThreshold, _lowFpsCounter); - // LOGD("low fps frame count: %d", _lowFpsCounter); - _lowFpsCounter = 0; - } - } - } -} - -// static -void EngineDataManager::onBeforeSetNextScene(EventCustom* event) -{ - // Reset the old status since we have changed CPU/GPU level manually. - // If the CPU level isn't 5 and GPU level isn't 0 in the next time of checking CPU/GPU level, - // Make sure that the changed CPU/GPU level will be notified. - _oldCpuLevel = -1; - _oldGpuLevel = -1; - _oldCpuLevelMulFactor = -1; - _oldGpuLevelMulFactor = -1; - - if (_isFirstSetNextScene) - { - _isFirstSetNextScene = false; - notifyGameStatus(GameStatus::LAUNCH_END, -1, -1); - } - else if (_isReplaceScene) - { - notifyGameStatus(GameStatus::SCENE_CHANGE_END, -1, -1); - } - - notifyGameStatus(GameStatus::SCENE_CHANGE_BEGIN, 5, 0); - - // SetAnimationIntervalBySceneChange to 1.0f/60.0f while there isn't in replacing scene. - if (!_isReplaceScene) - { - // Modify fps to 60 - setAnimationIntervalBySceneChange(DEFAULT_INTERVAL); - } - - _isReplaceScene = true; -} - -void EngineDataManager::onBeforeReadFile() -{ - _isReadFile = true; -} - -void EngineDataManager::notifyGameStatusIfCpuOrGpuLevelChanged() -{ - // calculate CPU & GPU levels - int cpuLevel = 0; - int gpuLevel = 0; - - int levelChangeReason = LEVEL_CHANGE_REASON_NONE; - - Director* director = Director::getInstance(); - int totalNodeCount = Node::getAttachedNodeCount(); - int totalParticleCount = getTotalParticleCount(); - int totalActionCount = director->getActionManager()->getNumberOfRunningActions(); - int totalPlayingAudioCount = experimental::AudioEngine::getPlayingAudioCount(); - - { - float cpuLevelNode = toCpuLevelPerFactor(totalNodeCount, cbCpuLevelNode); - float cpuLevelParticle = toCpuLevelPerFactor(totalParticleCount, cbCpuLevelParticle); - float cpuLevelAction = toCpuLevelPerFactor(totalActionCount, cbCpuLevelAction); - float cpuLevelAudio = toCpuLevelPerFactor(totalPlayingAudioCount, cbCpuLevelAudio); - float fCpuLevel = cpuLevelNode + cpuLevelParticle + cpuLevelAction + cpuLevelAudio; - float highestCpuLevel = CARRAY_SIZE(_cpuLevelArr) * 1.0f; - fCpuLevel = fCpuLevel > highestCpuLevel ? highestCpuLevel : fCpuLevel; - cpuLevel = std::floor(fCpuLevel); - -#if EDM_DEBUG - if (_printCpuGpuLevelCounter > _printCpuGpuLevelThreshold) - { - LOGD("DEBUG: cpu level: %d, node: (%f, %d), particle: (%f, %d), action: (%f, %d), audio: (%f, %d)", - cpuLevel, cpuLevelNode, totalNodeCount, cpuLevelParticle, totalParticleCount, cpuLevelAction, totalActionCount, cpuLevelAudio, totalPlayingAudioCount); - } -#endif - if (_oldCpuLevel < 0 - || fCpuLevel < (1.0f * _oldCpuLevel - _levelDecreaseThreshold) - || cpuLevel > _oldCpuLevel - ) - { - LOGD("NOTIFY: cpu level: %d, node: (%f, %d), particle: (%f, %d), action: (%f, %d), audio: (%f, %d)", - cpuLevel, cpuLevelNode, totalNodeCount, cpuLevelParticle, totalParticleCount, cpuLevelAction, totalActionCount, cpuLevelAudio, totalPlayingAudioCount); - levelChangeReason |= LEVEL_CHANGE_REASON_CPU; - _oldCpuLevel = cpuLevel; - } - else - { - // Adjust cpu level to old cpu level, it's necessary because we have a level decrease threshold. - // For instance, if threshold is 0.2, fCpuLevel = 1.9, cpuLevel = 1, _oldCpuLevel = 2, - // fCpuLevel is in the decrease threshold region, we need to still notify '2' to vendor. - // Therefore, reset cpuLevel to 2 here. - cpuLevel = _oldCpuLevel; - } - } - - { - auto renderer = director->getRenderer(); - int vertexCount = renderer->getDrawnVertices(); - int drawCount = renderer->getDrawnBatches(); - - float gpuLevelVertex = toGpuLevelPerFactor(vertexCount, cbGpuLevelVertex); - float gpuLevelDraw = toGpuLevelPerFactor(drawCount, cbGpuLevelDraw); - float fGpuLevel = gpuLevelVertex + gpuLevelDraw; - float highestGpuLevel = CARRAY_SIZE(_gpuLevelArr) * 1.0f; - fGpuLevel = fGpuLevel > highestGpuLevel ? highestGpuLevel : fGpuLevel; - gpuLevel = std::floor(fGpuLevel); - -#if EDM_DEBUG - if (_printCpuGpuLevelCounter > _printCpuGpuLevelThreshold) - { - LOGD("DEBUG: gpu level: %d, vertex: (%f, %d), draw: (%f, %d)", gpuLevel, gpuLevelVertex, vertexCount, gpuLevelDraw, drawCount); - } -#endif - if (_oldGpuLevel < 0 - || fGpuLevel < (1.0f * _oldGpuLevel - _levelDecreaseThreshold) - || gpuLevel > _oldGpuLevel - ) - { - LOGD("NOTIFY: gpu level: %d, vertex: (%f, %d), draw: (%f, %d)", gpuLevel, gpuLevelVertex, vertexCount, gpuLevelDraw, drawCount); - levelChangeReason |= LEVEL_CHANGE_REASON_GPU; - _oldGpuLevel = gpuLevel; - } - else - { - // Adjust gpu level to old gpu level, it's necessary because we have a level decrease threshold. - // For instance, if threshold is 0.2, fGpuLevel = 1.9, gpuLevel = 1, _oldGpuLevel = 2, - // fGpuLevel is in the decrease threshold region, we need to still notify '2' to vendor. - // Therefore, reset gpuLevel to 2 here. - gpuLevel = _oldGpuLevel; - } - } - - float expectedFps = 1.0f / _animationInterval; - float realFps = director->getFrameRate(); - bool isLowRealFps = false; - if (_fpsUpdatedWatcher.isStarted()) - { - _fpsUpdatedWatcher.update(realFps); - if (_fpsUpdatedWatcher.isStable()) - { - LOGD("FPS(%.01f) is stable now!", realFps); - _fpsUpdatedWatcher.reset(); - } - } - else - { -#if EDM_DEBUG - if (_isCollectFpsEnabled) - { - _fpsCollector.update(realFps); - } -#endif - if (0 == _lowFpsCheckMode) - { - // Low Real Fps definition: - // CurrentFrameTimeCost > ExpectedFrameTimeCost + ExpectedFrameTimeCost * LowRealFpsThreshold - isLowRealFps = (1.0f / realFps) > (_animationInterval + _animationInterval * _lowRealFpsThreshold); - if (isLowRealFps) - { - auto now = std::chrono::steady_clock::now(); - float lowFpsIntervalInSeconds = std::chrono::duration_cast(now - _lastTimeNotifyLevelByLowFps).count() / 1000000.0f; - - if (_continuousLowRealFpsCount >= _continuousLowRealFpsThreshold - && lowFpsIntervalInSeconds > _notifyLevelByLowFpsThreshold) - { - _continuousLowRealFpsCount = 0; - LOGD("Detected low fps (mode 0): real: %.01f, expected: %.01f, interval: %.03fs", realFps, expectedFps, lowFpsIntervalInSeconds); - _lastTimeNotifyLevelByLowFps = now; - } - else - { - // Reset this varible to false since it's smaller than notification threshold. - // In this way, we could avoid to notify vendor frequently. - isLowRealFps = false; - - ++_continuousLowRealFpsCount; - } - } - else - { - _continuousLowRealFpsCount = 0; - } - } - else - { - ++_calculateAvgFpsCount; - _calculateAvgFpsSum += realFps; - - auto now = std::chrono::steady_clock::now(); - float interval = std::chrono::duration_cast(now - _lastTimeCalculateAvgFps).count() / 1000000.0f; - - if (interval > _notifyLevelByLowFpsThreshold) - { - float avgFps = _calculateAvgFpsSum / _calculateAvgFpsCount; - // Low Real Fps definition: - // CurrentFrameTimeCost > ExpectedFrameTimeCost + ExpectedFrameTimeCost * LowRealFpsThreshold - isLowRealFps = (1.0f / avgFps) > (_animationInterval + _animationInterval * _lowRealFpsThreshold); - - if (isLowRealFps) - { - LOGD("Detected low fps (mode 1): avg: %.01f, expected: %.01f, interval: %.03fs, framecount: %u", avgFps, expectedFps, interval, _calculateAvgFpsCount); - } - - // Reset counter - _calculateAvgFpsCount = 0; - _calculateAvgFpsSum = 0.0f; - - // Reset last time of calculating average fps - _lastTimeCalculateAvgFps = now; - } - } - } - - if (levelChangeReason != LEVEL_CHANGE_REASON_NONE || _isFpsChanged || isLowRealFps) - { - _isFpsChanged = false; - - // LOGD("expectedFps: %f, realFps: %f", expectedFps, realFps); - if (isLowRealFps) - { - _cpuFpsFactor = _gpuFpsFactor = 1.0f; - } - else - { - _cpuFpsFactor = _gpuFpsFactor = expectedFps / 60.0f; - } - - int newCpuLevelMulFactor = std::ceil(cpuLevel * _cpuFpsFactor); - int newGpuLevelMulFactor = std::ceil(gpuLevel * _gpuFpsFactor); - - if (isLowRealFps - || newCpuLevelMulFactor != _oldCpuLevelMulFactor - || newGpuLevelMulFactor != _oldGpuLevelMulFactor) - { - const char* logPrefix = "[level changed]"; - if (isLowRealFps) - { - logPrefix = "[low fps]"; - if (newCpuLevelMulFactor < _minValueOfNotifyCpuLevelByLowFps) - { - newCpuLevelMulFactor = _minValueOfNotifyCpuLevelByLowFps; - } - - if (newGpuLevelMulFactor < _minValueOfNotifyGpuLevelByLowFps) - { - newGpuLevelMulFactor = _minValueOfNotifyGpuLevelByLowFps; - } - } - - int cpuLevelToNotify = newCpuLevelMulFactor; - int gpuLevelToNotify = newGpuLevelMulFactor; - - // Set CPU or GPU level to -2 only when fps isn't changed and isn't in low fps. - if (!_isFpsChanged && !isLowRealFps) - { - if (_oldGpuLevelMulFactor == newGpuLevelMulFactor) - { - gpuLevelToNotify = -2; // Only CPU level has been changed, pass -2 to GPU level. - } - else if (_oldCpuLevelMulFactor == newCpuLevelMulFactor) - { - cpuLevelToNotify = -2; // Only GPU level has been changed, pass -2 to CPU level. - } - } - - LOGD("%s notifyGameStatus: IN_SCENE(%d, %d), cpuLevel: %d->%d(%d), gpuLevel: %d->%d(%d), factor: %f", - logPrefix, - cpuLevel, gpuLevel, - _oldCpuLevelMulFactor, cpuLevelToNotify, newCpuLevelMulFactor, - _oldGpuLevelMulFactor, gpuLevelToNotify, newGpuLevelMulFactor, - _cpuFpsFactor); - - notifyGameStatus(GameStatus::IN_SCENE, cpuLevelToNotify, gpuLevelToNotify); - - _oldCpuLevelMulFactor = newCpuLevelMulFactor; - _oldGpuLevelMulFactor = newGpuLevelMulFactor; - } - } -} - -// static -void EngineDataManager::onAfterDrawScene(EventCustom* event) -{ - calculateFrameLost(); - -#if EDM_DEBUG - ++_printCpuGpuLevelCounter; - ++_printCpuUsageCounter; -#endif - - if (_isReplaceScene) - { - ++_drawCountInterval; - - if (_drawCountInterval > _drawCountThreshold) - { - _drawCountInterval = 0; - _isReplaceScene = false; - - // setAnimationIntervalBySceneChange to -1.0f to - // make developer's or huawei's FPS setting take effect. - setAnimationIntervalBySceneChange(-1.0f); - - _oldCpuLevel = -1; - _oldGpuLevel = -1; - _oldCpuLevelMulFactor = -1; - _oldGpuLevelMulFactor = -1; - notifyGameStatus(GameStatus::SCENE_CHANGE_END, -1, -1); - } - else if (_isReadFile) - { - _drawCountInterval = 0; - } - _isReadFile = false; - } - else - { - notifyGameStatusIfCpuOrGpuLevelChanged(); - } - -#if EDM_DEBUG - if (_printCpuUsageCounter > _printCpuUsageThreshold) - { - _printCpuUsageCounter = 0; - _cpuTracker.update(); - _cpuTracker.printCurrentState(); - } - - if (_printCpuGpuLevelCounter > _printCpuGpuLevelThreshold) - { - _printCpuGpuLevelCounter = 0; - } -#endif -} - -// static -void EngineDataManager::onEnterForeground(EventCustom* event) -{ - _isInBackground = false; - - static bool isFirstTime = true; - LOGD("onEnterForeground, isFirstTime: %d", isFirstTime); - - if (isFirstTime) - { - isFirstTime = false; - } - else - { - resetLastTime(); - // Reset the old status - _oldCpuLevel = -1; - _oldGpuLevel = -1; - _oldCpuLevelMulFactor = -1; - _oldGpuLevelMulFactor = -1; - // Notify CPU/GPU level to system since old levels have been changed. - notifyGameStatusIfCpuOrGpuLevelChanged(); - } -} - -void EngineDataManager::onEnterBackground(EventCustom* event) -{ - LOGD("EngineDataManager::onEnterBackground ..."); - _isInBackground = true; -} - -// static -void EngineDataManager::init() -{ - parseDebugConfig(); - -#if EDM_DEBUG - if (_forceEnableOptimization) - { - LOGD("init, force enable optimization!"); - _isSupported = true; - } -#endif - - if (!_isSupported) - return; - - if (_isInitialized) - return; - - resetLastTime(); - - LOGD("EngineDataManager version: %s", ENGINE_DATA_MANAGER_VERSION); - - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->addCustomEventListener(Director::EVENT_AFTER_DRAW, std::bind(onAfterDrawScene, std::placeholders::_1)); - dispatcher->addCustomEventListener(Director::EVENT_BEFORE_SET_NEXT_SCENE, std::bind(onBeforeSetNextScene, std::placeholders::_1)); - dispatcher->addCustomEventListener(EVENT_COME_TO_FOREGROUND, std::bind(onEnterForeground, std::placeholders::_1)); - dispatcher->addCustomEventListener(EVENT_COME_TO_BACKGROUND, std::bind(onEnterBackground, std::placeholders::_1)); - - notifyGameStatus(GameStatus::LAUNCH_BEGIN, 5, -1); - - -#if EDM_DEBUG - _cpuTracker.update(); -#endif - _isInitialized = true; -} - -// static -void EngineDataManager::destroy() -{ - if (!_isSupported) - return; -} - -// static -void EngineDataManager::notifyGameStatus(GameStatus type, int cpuLevel, int gpuLevel) -{ - if (!_isSupported) - return; - - JniMethodInfo methodInfo; - if (JniHelper::getStaticMethodInfo(methodInfo, CLASS_NAME_ENGINE_DATA_MANAGER, "notifyGameStatus", "(III)V")) - { - methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, (int)type, cpuLevel, gpuLevel); - methodInfo.env->DeleteLocalRef(methodInfo.classID); - } -} - -static void updateFinalAnimationInterval() -{ - if (_animationIntervalBySceneChange > 0.0f) { - _animationInterval = _animationIntervalBySceneChange; - } else if (_animationIntervalByDirectorPaused > 0.0f) { - _animationInterval = _animationIntervalByDirectorPaused; - } else if (_animationIntervalBySystem > 0.0f) { - _animationInterval = _animationIntervalBySystem; - } else { - _animationInterval = _animationIntervalByEngineOrGame; - } -} - -void EngineDataManager::setAnimationInterval(float interval, SetIntervalReason reason) -{ - float oldFps = 0.0f; - float newFps = 0.0f; - - if (reason == SetIntervalReason::BY_GAME) { - LOGD("setAnimationInterval by game: %.04f", interval); - - if (_isSupported) - { - float oldInterval = _animationIntervalBySystem > 0.0f ? _animationIntervalBySystem : _animationIntervalByEngineOrGame; - oldFps = (float)ceil(1.0f/oldInterval); - newFps = (float)ceil(1.0f/interval); - } - - _animationIntervalByDirectorPaused = -1.0f; - // Reset _animationIntervalBySystem to -1 to make developer's FPS configuration take effect. - _animationIntervalBySystem = -1.0f; - _animationIntervalByEngineOrGame = interval; - } else if (reason == SetIntervalReason::BY_ENGINE) { - LOGD("setAnimationInterval by engine: %.04f", interval); - _animationIntervalByDirectorPaused = -1.0f; - _animationIntervalByEngineOrGame = interval; - } else if (reason == SetIntervalReason::BY_SYSTEM) { - LOGD("setAnimationInterval by system: %.04f", interval); - if (interval > 0.0f) { - _animationIntervalBySystem = interval; - } else { - _animationIntervalBySystem = -1.0f; - } - } else if (reason == SetIntervalReason::BY_SCENE_CHANGE) { - LOGD("setAnimationInterval by scene change: %.04f", interval); - if (interval > 0.0f) { - _animationIntervalBySceneChange = interval; - } else { - _animationIntervalBySceneChange = -1.0f; - } - } else if (reason == SetIntervalReason::BY_DIRECTOR_PAUSE) { - LOGD("setAnimationInterval by director paused: %.04f", interval); - _animationIntervalByDirectorPaused = interval; - } else { - LOGD("setAnimationInterval by UNKNOWN reason: %.04f", interval); - } - updateFinalAnimationInterval(); - - LOGD("JNI setAnimationInterval: %f", _animationInterval); - JniHelper::callStaticVoidMethod(CLASS_NAME_RENDERER, "setAnimationInterval", _animationInterval); - - if (_isSupported) - { - // Notify system that FPS configuration has been changed by game. - // notifyFpsChanged has to be invoked at the end. - if (fabs(oldFps - newFps) > 1.0f) - { - _isFpsChanged = true; - notifyFpsChanged(oldFps, newFps); - _fpsUpdatedWatcher.start(); - } - } -} - -// static -void EngineDataManager::notifyContinuousFrameLost(int continueFrameLostCycle, int continueFrameLostThreshold, int times) -{ - if (!_isSupported) - return; - - JniMethodInfo methodInfo; - if (JniHelper::getStaticMethodInfo(methodInfo, CLASS_NAME_ENGINE_DATA_MANAGER, "notifyContinuousFrameLost", "(III)V")) - { - methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, continueFrameLostCycle, continueFrameLostThreshold, times); - methodInfo.env->DeleteLocalRef(methodInfo.classID); - } -} - -// static -void EngineDataManager::notifyLowFps(int lowFpsCycle, float lowFpsThreshold, int frames) -{ - if (!_isSupported) - return; - - JniMethodInfo methodInfo; - if (JniHelper::getStaticMethodInfo(methodInfo, CLASS_NAME_ENGINE_DATA_MANAGER, "notifyLowFps", "(IFI)V")) - { - methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, lowFpsCycle, lowFpsThreshold, frames); - methodInfo.env->DeleteLocalRef(methodInfo.classID); - } -} - -// static -void EngineDataManager::notifyFpsChanged(float oldFps, float newFps) -{ - if (!_isSupported) - return; - - LOGD("notifyFpsChanged: %.0f -> %.0f", oldFps, newFps); - JniMethodInfo methodInfo; - if (JniHelper::getStaticMethodInfo(methodInfo, CLASS_NAME_ENGINE_DATA_MANAGER, "notifyFpsChanged", "(FF)V")) - { - methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, oldFps, newFps); - methodInfo.env->DeleteLocalRef(methodInfo.classID); - } -} - -void EngineDataManager::nativeOnQueryFps(JNIEnv* env, jobject thiz, jintArray arrExpectedFps, jintArray arrRealFps) -{ - if (!_isSupported) - return; - - jsize arrLenExpectedFps = env->GetArrayLength(arrExpectedFps); - jsize arrLenRealFps = env->GetArrayLength(arrRealFps); - - if (arrLenExpectedFps > 0 && arrLenRealFps > 0) - { - Director* director = Director::getInstance(); - jboolean isCopy = JNI_FALSE; - jint* expectedFps = env->GetIntArrayElements(arrExpectedFps, &isCopy); - float animationInterval = director->getAnimationInterval(); - *expectedFps = (int)std::ceil(1.0f / animationInterval); - - jint* realFps = env->GetIntArrayElements(arrRealFps, &isCopy); - *realFps = (int)std::ceil(director->getFrameRate()); - - // Log before expectedFps & realFps is released. - LOGD("nativeOnQueryFps, realFps: %d, expected: %d", *realFps, *expectedFps); - env->ReleaseIntArrayElements(arrExpectedFps, expectedFps, 0); - env->ReleaseIntArrayElements(arrRealFps, realFps, 0); - } - else - { - LOGE("Invalid array size, expectedFps.size=%d, realFps.size=%d", arrLenExpectedFps, arrLenRealFps); - } -} - -void EngineDataManager::nativeOnChangeContinuousFrameLostConfig(JNIEnv* env, jobject thiz, jint continueFrameLostCycle, jint continueFrameLostThreshold) -{ - if (!_isSupported) - return; - - LOGD("nativeOnChangeContinuousFrameLostConfig, continueFrameLostCycle: %d, continueFrameLostThreshold: %d", continueFrameLostCycle, continueFrameLostThreshold); - - _continuousFrameLostCycle = continueFrameLostCycle; - _continuousFrameLostThreshold = continueFrameLostThreshold; -} - -void EngineDataManager::nativeOnChangeLowFpsConfig(JNIEnv* env, jobject thiz, jint lowFpsCycle, jfloat lowFpsThreshold) -{ - if (!_isSupported) - return; - - LOGD("nativeOnChangeLowFpsConfig, lowFpsCycle: %d, lowFpsThreshold: %f", lowFpsCycle, lowFpsThreshold); - _lowFpsCycle = lowFpsCycle; - _lowFpsThreshold = lowFpsThreshold; -} - -void EngineDataManager::nativeOnChangeExpectedFps(JNIEnv* env, jobject thiz, jint fps) -{ - if (!_isSupported) - return; - - if (fps < -1 || fps > 60) - { - LOGE("Setting fps (%d) isn't supported!", fps); - return; - } - - auto director = cocos2d::Director::getInstance(); - float defaultAnimationInterval = director->getAnimationInterval(); - - int defaultFps = static_cast(std::ceil(1.0f/defaultAnimationInterval)); - - if (fps > defaultFps) - { - LOGD("nativeOnChangeExpectedFps, fps (%d) is greater than default fps (%d), reset it to default!", fps, defaultFps); - fps = -1; - } - - LOGD("nativeOnChangeExpectedFps, set fps: %d, default fps: %d", fps, defaultFps); - - if (fps > 0) - { - setAnimationIntervalBySystem(1.0f/fps); - LOGD("nativeOnChangeExpectedFps, fps (%d) was set successfuly!", fps); - } - else if (fps == -1) // -1 means to reset to default FPS - { - setAnimationIntervalBySystem(-1.0f); - LOGD("nativeOnChangeExpectedFps, fps (%d) was reset successfuly!", defaultFps); - } -} - -void EngineDataManager::nativeOnChangeSpecialEffectLevel(JNIEnv* env, jobject thiz, jint level) -{ - if (!_isSupported) - return; - - LOGD("nativeOnChangeSpecialEffectLevel, set level: %d", level); - - if (level < 0 || level >= CARRAY_SIZE(_particleLevelArr)) - { - LOGE("Pass a wrong level value: %d, only 0 ~ %d is supported!", level, CARRAY_SIZE(_particleLevelArr) - 1); - return; - } - - ParticleSystem::setTotalParticleCountFactor(_particleLevelArr[level]); -} - -void EngineDataManager::nativeOnChangeMuteEnabled(JNIEnv* env, jobject thiz, jboolean isMuteEnabled) -{ - if (!_isSupported) - return; - - LOGD("nativeOnChangeMuteEnabled, isMuteEnabled: %d", isMuteEnabled); - cocos2d::experimental::AudioEngine::setEnabled(!isMuteEnabled); -} - -} // namespace cocos2d { - -///////////////////////////// -extern "C" { - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeSetSupportOptimization)(JNIEnv* env, jobject thiz, jboolean isSupported) -{ - LOGD("nativeSetSupportOptimization: %d", isSupported); - _isSupported = (isSupported == JNI_TRUE); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnQueryFps)(JNIEnv* env, jobject thiz, jintArray arrExpectedFps, jintArray arrRealFps) -{ - EngineDataManager::nativeOnQueryFps(env, thiz, arrExpectedFps, arrRealFps); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnChangeContinuousFrameLostConfig)(JNIEnv* env, jobject thiz, jint continueFrameLostCycle, jint continueFrameLostThreshold) -{ - EngineDataManager::nativeOnChangeContinuousFrameLostConfig(env, thiz, continueFrameLostCycle, continueFrameLostThreshold); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnChangeLowFpsConfig)(JNIEnv* env, jobject thiz, jint lowFpsCycle, jfloat lowFpsThreshold) -{ - EngineDataManager::nativeOnChangeLowFpsConfig(env, thiz, lowFpsCycle, lowFpsThreshold); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnChangeExpectedFps)(JNIEnv* env, jobject thiz, jint fps) -{ - EngineDataManager::nativeOnChangeExpectedFps(env, thiz, fps); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnChangeSpecialEffectLevel)(JNIEnv* env, jobject thiz, jint level) -{ - EngineDataManager::nativeOnChangeSpecialEffectLevel(env, thiz, level); -} - -JNIEXPORT void JNICALL JNI_FUNC_PREFIX(nativeOnChangeMuteEnabled)(JNIEnv* env, jobject thiz, jboolean enabled) -{ - EngineDataManager::nativeOnChangeMuteEnabled(env, thiz, enabled); -} -///////////////////////////// - -} // extern "C" { diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h deleted file mode 100644 index c07db6f60cf8..000000000000 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -Copyright (c) 2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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. -****************************************************************************/ - -#pragma once -#include "base/ccTypes.h" - -#include -#include -#include - -#include - -namespace cocos2d { - -class ParticleSystem; -class EventCustom; - -class EngineDataManager -{ -public: - static void init(); - static void destroy(); - - static std::string getVendorInfo(); - - enum class GameStatus - { - LAUNCH_BEGIN = 0, - LAUNCH_END, - SCENE_CHANGE_BEGIN, - SCENE_CHANGE_END, - IN_SCENE - }; - - static void notifyGameStatus(GameStatus type, int cpuLevel, int gpuLevel); - static void setAnimationInterval(float interval, SetIntervalReason reason); - // Used in FileUtilsAndroid::getContents - static void onBeforeReadFile(); - -private: - static void notifyContinuousFrameLost(int frameLostCycle, int continueFrameLostThreshold, int times); - static void notifyLowFps(int lowFpsCycle, float lowFpsThreshold, int frames); - static void notifyFpsChanged(float oldFps, float newFps); - static void notifyGameStatusIfCpuOrGpuLevelChanged(); - - static void calculateFrameLost(); - - static void onBeforeSetNextScene(EventCustom* event); - static void onAfterDrawScene(EventCustom* event); - static void onEnterForeground(EventCustom* event); - static void onEnterBackground(EventCustom* event); - - static int getTotalParticleCount(); - -// For JNI function use, should be public -public: - static void nativeOnQueryFps(JNIEnv* env, jobject thiz, jintArray arrExpectedFps, jintArray arrRealFps); - static void nativeOnChangeContinuousFrameLostConfig(JNIEnv* env, jobject thiz, jint continueFrameLostCycle, jint continueFrameLostThreshold); - static void nativeOnChangeLowFpsConfig(JNIEnv* env, jobject thiz, jint lowFpsCycle, jfloat lowFpsThreshold); - static void nativeOnChangeExpectedFps(JNIEnv* env, jobject thiz, jint fps); - static void nativeOnChangeSpecialEffectLevel(JNIEnv* env, jobject thiz, jint level); - static void nativeOnChangeMuteEnabled(JNIEnv* env, jobject thiz, jboolean enabled); -}; - -} // namespace cocos2d { \ No newline at end of file diff --git a/cocos/platform/android/jni/JniHelper.h b/cocos/platform/android/jni/JniHelper.h index fbf0135851a6..c4943083d6ff 100644 --- a/cocos/platform/android/jni/JniHelper.h +++ b/cocos/platform/android/jni/JniHelper.h @@ -188,6 +188,37 @@ class CC_DLL JniHelper return nullptr; } + /** + @brief Call of Java static int* method + @return address of JniMethodInfo if there are proper JniMethodInfo; otherwise nullptr. + */ + template + static int* callStaticIntArrayMethod(const std::string& className, + const std::string& methodName, + Ts... xs) { + static int ret[32]; + cocos2d::JniMethodInfo t; + std::string signature = "(" + std::string(getJNISignature(xs...)) + ")[I"; + if (cocos2d::JniHelper::getStaticMethodInfo(t, className.c_str(), methodName.c_str(), signature.c_str())) { + LocalRefMapType localRefs; + jintArray array = (jintArray) t.env->CallStaticObjectMethod(t.classID, t.methodID, convert(localRefs, t, xs)...); + jsize len = t.env->GetArrayLength(array); + if (len <= 32) { + jint* elems = t.env->GetIntArrayElements(array, 0); + if (elems) { + memcpy(ret, elems, sizeof(int) * len); + t.env->ReleaseIntArrayElements(array, elems, 0); + }; + } + t.env->DeleteLocalRef(t.classID); + deleteLocalRefs(t.env, localRefs); + return &ret[0]; + } else { + reportError(className, methodName, signature); + } + return nullptr; + } + /** @brief Call of Java static Vec3 method @return JniMethodInfo of Vec3 type if there are proper JniMethodInfo; otherwise Vec3(0, 0, 0). diff --git a/cocos/platform/android/jni/ProcessCpuTracker.cpp b/cocos/platform/android/jni/ProcessCpuTracker.cpp deleted file mode 100644 index 66acd2e2cf58..000000000000 --- a/cocos/platform/android/jni/ProcessCpuTracker.cpp +++ /dev/null @@ -1,355 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/android/jni/ProcessCpuTracker.h" - -#ifdef ANDROID -#include -#include -#include -#endif -#include -#include -#include -#include -#include - -#ifdef ANDROID -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "ProcessCpuTracker", __VA_ARGS__) -#else -#define LOGD printf -#endif - -typedef struct _CpuInfo -{ - long userTime; // Unit: jiffies - long niceTime; - long systemTime; - long idleTime; - long ioWaitTime; - long irqTime; - long softIrqTime; -}CpuInfo; - -// Return 0 means the end of buffer -static bool readLine(char* p, const char* end, char** next) -{ - if (p == NULL) - { - *next = NULL; - return false; - } - - while (*p != '\n' && p < end) - ++p; - - if (*p == '\n') - {// line break - *p = '\0'; // Set to \0 to make a sub-sequence string - *next = ++p; - return true; - } - else - {// end of buffer - *next = NULL; - return true; - } -} - -static std::vector readProcStat() -{ - std::vector cpuInfos; - cpuInfos.reserve(13); - char buffer[1024] = {0}; - -#ifdef ANDROID - int fd = open("/proc/stat", O_RDONLY); - - if (fd < 0) - { - return cpuInfos; - } - - const int len = read(fd, buffer, sizeof(buffer)-1); - close(fd); - - if (len < 0) { - LOGD("Unable to open process fd=%d", fd); - return cpuInfos; - } - buffer[len] = 0; -#else - FILE* fp = fopen("fonts/stat-huawei.txt", "rb"); - if (fp == NULL) - return cpuInfos; - fread(buffer, sizeof(buffer)-1, 1, fp); - fclose(fp); - size_t len = strlen(buffer); -#endif - - char* p = buffer; - const char* end = p + len; - char* next = NULL; - int cpuIndex; - const int COLUMN = sizeof(CpuInfo) / sizeof(long); - size_t i = 0; - - while (readLine(p, end, &next)) - { - // break if the line with no cpu prefix - if (p[0] != 'c' || p[1] != 'p' || p[2] != 'u') - break; - -// LOGD("%s\n", p); - // Removes 'cpu%d' prefix - p = p + 3; - - if (*p == ' ') - { // The first line means the average cpu usage - cpuIndex = 0; - } - else - { - cpuIndex = strtol(p, &p, 10) + 1; - } - -// LOGD("cpu index: %d\n", cpuIndex); - - cpuInfos.resize(cpuIndex + 1); - - for (i = 0; i < COLUMN; ++i) - { - long value = strtol(p, &p, 10); -// LOGD("%ld ", value); - - CpuInfo& info = cpuInfos[cpuIndex]; - long* e = (long*)&info + i; - *e = value; - } -// LOGD("%s", "\n"); - - p = next; - } - - return cpuInfos; -} - -void ProcessCpuTracker::update() -{ - static const int JIFFYMILLIS = 10; - std::vector cpuInfos = readProcStat(); - if (!cpuInfos.empty()) - { - if (_cpuTimeInfos.size() < cpuInfos.size()) - { - _cpuTimeInfos.resize(cpuInfos.size()); - } - -// LOGD("cpuInfo size: %d", (int)cpuInfos.size()); - - for (size_t i = 0, len = cpuInfos.size(); i < len; ++i) - { - CpuTimeInfo& cpuTimeInfo = _cpuTimeInfos[i]; - const CpuInfo& cpuInfo = cpuInfos[i]; - // Total user time is user + nice time. - const long usertime = (cpuInfo.userTime + cpuInfo.niceTime) * JIFFYMILLIS; - // Total system time is simply system time. - const long systemtime = cpuInfo.systemTime * JIFFYMILLIS; - // Total idle time is simply idle time. - const long idletime = cpuInfo.idleTime * JIFFYMILLIS; - // Total irq time is iowait + irq + softirq time. - const long iowaittime = cpuInfo.ioWaitTime * JIFFYMILLIS; - const long irqtime = cpuInfo.irqTime * JIFFYMILLIS; - const long softirqtime = cpuInfo.softIrqTime * JIFFYMILLIS; - // This code is trying to avoid issues with idle time going backwards, - // but currently it gets into situations where it triggers most of the time. :( - if (false || (usertime >= cpuTimeInfo.mBaseUserTime && systemtime >= cpuTimeInfo.mBaseSystemTime - && iowaittime >= cpuTimeInfo.mBaseIoWaitTime && irqtime >= cpuTimeInfo.mBaseIrqTime - && softirqtime >= cpuTimeInfo.mBaseSoftIrqTime && idletime >= cpuTimeInfo.mBaseIdleTime)) { - cpuTimeInfo.mRelUserTime = usertime - cpuTimeInfo.mBaseUserTime; - cpuTimeInfo.mRelSystemTime = systemtime - cpuTimeInfo.mBaseSystemTime; - cpuTimeInfo.mRelIoWaitTime = iowaittime - cpuTimeInfo.mBaseIoWaitTime; - cpuTimeInfo.mRelIrqTime = irqtime - cpuTimeInfo.mBaseIrqTime; - cpuTimeInfo.mRelSoftIrqTime = softirqtime - cpuTimeInfo.mBaseSoftIrqTime; - cpuTimeInfo.mRelIdleTime = idletime - cpuTimeInfo.mBaseIdleTime; -// if (true) { -// LOGD("CPU%d, Total U: %ld, N:%ld S:%ld I:%ld W:%ld Q:%ld O:%ld\n", -// (int)i, -// cpuInfo.userTime, -// cpuInfo.niceTime, -// cpuInfo.systemTime, -// cpuInfo.idleTime, -// cpuInfo.ioWaitTime, -// cpuInfo.irqTime, -// cpuInfo.softIrqTime -// ); -// LOGD("CPU%d, Rel U:%ld, S:%ld, I:%ld, Q:%ld\n", -// (int)i, -// cpuTimeInfo.mRelUserTime, -// cpuTimeInfo.mRelSystemTime, -// cpuTimeInfo.mRelIdleTime, -// cpuTimeInfo.mRelIrqTime -// ); -// if (cpuTimeInfo.mRelUserTime < 0 -// || cpuTimeInfo.mRelSystemTime < 0 -// || cpuTimeInfo.mRelIdleTime < 0 -// || cpuTimeInfo.mRelIrqTime < 0) -// { -// LOGD("CPU%d,base U:%ld, S:%ld, I:%ld, Q:%ld\n", -// (int)i, -// cpuTimeInfo.mBaseUserTime, -// cpuTimeInfo.mBaseSystemTime, -// cpuTimeInfo.mBaseIdleTime, -// cpuTimeInfo.mBaseIrqTime -// ); -// } -// } - cpuTimeInfo.mBaseUserTime = usertime; - cpuTimeInfo.mBaseSystemTime = systemtime; - cpuTimeInfo.mBaseIoWaitTime = iowaittime; - cpuTimeInfo.mBaseIrqTime = irqtime; - cpuTimeInfo.mBaseSoftIrqTime = softirqtime; - cpuTimeInfo.mBaseIdleTime = idletime; - } else { - -// if (usertime < cpuTimeInfo.mBaseUserTime) -// { -// LOGD("ERROR: usertime: %ld, base: %ld", usertime, cpuTimeInfo.mBaseUserTime); -// } -// -// if (systemtime < cpuTimeInfo.mBaseSystemTime) -// { -// LOGD("ERROR: systemtime: %ld, base: %ld", systemtime, cpuTimeInfo.mBaseSystemTime); -// } -// -// if (iowaittime < cpuTimeInfo.mBaseIoWaitTime) -// { -// LOGD("ERROR: iowaittime: %ld, base: %ld", iowaittime, cpuTimeInfo.mBaseIoWaitTime); -// } -// -// if (irqtime < cpuTimeInfo.mBaseIrqTime) -// { -// LOGD("ERROR: irqtime: %ld, base: %ld", irqtime, cpuTimeInfo.mBaseIrqTime); -// } -// -// if (softirqtime < cpuTimeInfo.mBaseSoftIrqTime) -// { -// LOGD("ERROR: softirqtime: %ld, base: %ld", softirqtime, cpuTimeInfo.mBaseSoftIrqTime); -// } -// -// if (idletime < cpuTimeInfo.mBaseIdleTime) -// { -// LOGD("ERROR: idletime: %ld, base: %ld", idletime, cpuTimeInfo.mBaseIdleTime); -// } - - if (usertime > 0 || idletime > 0) - { - cpuTimeInfo.mBaseUserTime = usertime; - cpuTimeInfo.mBaseSystemTime = systemtime; - cpuTimeInfo.mBaseIoWaitTime = iowaittime; - cpuTimeInfo.mBaseIrqTime = irqtime; - cpuTimeInfo.mBaseSoftIrqTime = softirqtime; - cpuTimeInfo.mBaseIdleTime = idletime; - } - - cpuTimeInfo.mRelUserTime = 0; - cpuTimeInfo.mRelSystemTime = 0; - cpuTimeInfo.mRelIoWaitTime = 0; - cpuTimeInfo.mRelIrqTime = 0; - cpuTimeInfo.mRelSoftIrqTime = 0; - cpuTimeInfo.mRelIdleTime = 0; - LOGD("CPU: %d, /proc/stats has gone backwards; skipping CPU update\n", (int)i); - } - } - } -} - -static long printRatio(std::stringstream& ss, long numerator, long denominator) { - long hundreds = 0; - if (denominator > 0) - { - long thousands = (numerator*1000)/denominator; - hundreds = thousands/10; - ss << hundreds; - if (hundreds < 10) { - long remainder = thousands - (hundreds*10); - - if (remainder != 0) { - ss << '.'; - ss << remainder; - } - } - } - else - { - ss << '0'; - } - ss << " "; - - return hundreds; -} - -static long printProcessCPU(std::stringstream& ss, long totalTime, long user) -{ - return printRatio(ss, user, totalTime); -} - -void ProcessCpuTracker::printCurrentState() -{ - std::stringstream ss; - long totalCpuUsage = 0; - for (size_t i = 0, len = _cpuTimeInfos.size(); i < len; ++i) - { - CpuTimeInfo& cpuTimeInfo = _cpuTimeInfos[i]; - const long totalTime = cpuTimeInfo.mRelUserTime + cpuTimeInfo.mRelSystemTime + cpuTimeInfo.mRelIoWaitTime - + cpuTimeInfo.mRelIrqTime + cpuTimeInfo.mRelSoftIrqTime + cpuTimeInfo.mRelIdleTime; - -// if (totalTime <= 0) -// { -// LOGD("cjh totalTime, i=%d: %ld mRelUserTime: %ld, mRelSystemTime: %ld, mRelIoWaitTime: %ld, mRelIrqTime: %ld, mRelSoftIrqTime: %ld, mRelIdleTime: %ld", -// (int)i, -// totalTime, -// cpuTimeInfo.mRelUserTime, -// cpuTimeInfo.mRelSystemTime, -// cpuTimeInfo.mRelIoWaitTime, -// cpuTimeInfo.mRelIrqTime, -// cpuTimeInfo.mRelSoftIrqTime, -// cpuTimeInfo.mRelIdleTime -// ); -// } - - const long preCoreUsage = printProcessCPU(ss, totalTime, cpuTimeInfo.mRelUserTime); - if (i > 0) - { - totalCpuUsage += preCoreUsage; - } - } - - ss << "T:"; - ss << totalCpuUsage; - std::string str = ss.str(); - LOGD("CPU: %s", str.c_str()); -} - - diff --git a/cocos/platform/android/jni/ProcessCpuTracker.h b/cocos/platform/android/jni/ProcessCpuTracker.h deleted file mode 100644 index eae84ab8474e..000000000000 --- a/cocos/platform/android/jni/ProcessCpuTracker.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#pragma once - -#include - -class ProcessCpuTracker -{ -public: - void update(); - void printCurrentState(); - -private: - struct CpuTimeInfo - { - CpuTimeInfo() - : mBaseUserTime(0) - , mBaseSystemTime(0) - , mBaseIoWaitTime(0) - , mBaseIrqTime(0) - , mBaseSoftIrqTime(0) - , mBaseIdleTime(0) - , mRelUserTime(0) - , mRelSystemTime(0) - , mRelIoWaitTime(0) - , mRelIrqTime(0) - , mRelSoftIrqTime(0) - , mRelIdleTime(0) - { - } - // All times are in milliseconds. They are converted from jiffies to milliseconds - // when extracted from the kernel. - long mBaseUserTime; - long mBaseSystemTime; - long mBaseIoWaitTime; - long mBaseIrqTime; - long mBaseSoftIrqTime; - long mBaseIdleTime; - - long mRelUserTime; - long mRelSystemTime; - long mRelIoWaitTime; - long mRelIrqTime; - long mRelSoftIrqTime; - long mRelIdleTime; - }; - - std::vector _cpuTimeInfos; -}; - - diff --git a/cocos/platform/apple/CCFileUtils-apple.h b/cocos/platform/apple/CCFileUtils-apple.h index 5e700d6cdb14..8c659689f829 100644 --- a/cocos/platform/apple/CCFileUtils-apple.h +++ b/cocos/platform/apple/CCFileUtils-apple.h @@ -50,7 +50,7 @@ class CC_DLL FileUtilsApple : public FileUtils virtual ~FileUtilsApple(); /* override functions */ virtual std::string getWritablePath() const override; - virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const override; + virtual std::string getFullPathForFilenameWithinDirectory(const std::string& directory, const std::string& filename) const override; virtual ValueMap getValueMapFromFile(const std::string& filename) const override; virtual ValueMap getValueMapFromData(const char* filedata, int filesize) const override; diff --git a/cocos/platform/apple/CCFileUtils-apple.mm b/cocos/platform/apple/CCFileUtils-apple.mm index 92bbfb45a8b0..e0d2274d8155 100644 --- a/cocos/platform/apple/CCFileUtils-apple.mm +++ b/cocos/platform/apple/CCFileUtils-apple.mm @@ -315,7 +315,7 @@ static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, str return true; } -std::string FileUtilsApple::getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const +std::string FileUtilsApple::getFullPathForFilenameWithinDirectory(const std::string& directory, const std::string& filename) const { if (directory[0] != '/') { diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp index b16cf473746b..74e2ca726406 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp @@ -39,9 +39,7 @@ THE SOFTWARE. #include "base/ccUtils.h" #include "base/ccUTF8.h" #include "2d/CCCamera.h" -#if CC_ICON_SET_SUPPORT #include "platform/CCImage.h" -#endif /* CC_ICON_SET_SUPPORT */ NS_CC_BEGIN @@ -207,6 +205,7 @@ GLViewImpl::GLViewImpl(bool initglfw) , _monitor(nullptr) , _mouseX(0.0f) , _mouseY(0.0f) +, _cursor(nullptr) { _viewName = "cocos2dx"; g_keyCodeMap.clear(); @@ -492,7 +491,7 @@ void GLViewImpl::setIcon(const std::vector& filelist) const { GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE(images); + CC_SAFE_DELETE_ARRAY(images); for (auto& icon: icons) { CC_SAFE_DELETE(icon); } @@ -504,6 +503,37 @@ void GLViewImpl::setDefaultIcon() const { } #endif /* CC_ICON_SET_SUPPORT */ +void GLViewImpl::setCursor(const std::string& filename, Vec2 hotspot) { + + if (_cursor) { + glfwDestroyCursor(_cursor); + _cursor = nullptr; + } + + Image* ccImage = new (std::nothrow) Image(); + if (ccImage && ccImage->initWithImageFile(filename)) { + GLFWimage image; + image.width = ccImage->getWidth(); + image.height = ccImage->getHeight(); + image.pixels = ccImage->getData(); + _cursor = glfwCreateCursor(&image, (int)(hotspot.x * image.width), (int)((1.0f - hotspot.y) * image.height)); + if (_cursor) { + glfwSetCursor(_mainWindow, _cursor); + } + } + CC_SAFE_DELETE(ccImage); +} + +void GLViewImpl::setDefaultCursor() { + + if (_cursor) { + glfwDestroyCursor(_cursor); + _cursor = nullptr; + } + + glfwSetCursor(_mainWindow, NULL); +} + void GLViewImpl::setCursorVisible( bool isVisible ) { if( _mainWindow == NULL ) diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.h b/cocos/platform/desktop/CCGLViewImpl-desktop.h index 6b493ff8dc57..1eda42c325d4 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.h +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.h @@ -102,14 +102,26 @@ class CC_DLL GLViewImpl : public GLView virtual void setDefaultIcon() const override; #endif /* CC_ICON_SET_SUPPORT */ - /* - * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. + /** + * Sets the cursor for the window with custom image. */ - void setFrameZoomFactor(float zoomFactor) override; + virtual void setCursor(const std::string& filename, Vec2 hotspot = Vec2::ANCHOR_TOP_LEFT) override; + + /** + * Sets the cursor for the window back to default. + */ + virtual void setDefaultCursor() override; + /** * Hide or Show the mouse cursor if there is one. */ virtual void setCursorVisible(bool isVisible) override; + + /* + * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. + */ + void setFrameZoomFactor(float zoomFactor) override; + /** Retina support is disabled by default * @note This method is only available on Mac. */ @@ -126,6 +138,7 @@ class CC_DLL GLViewImpl : public GLView #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) id getCocoaWindow() override { return glfwGetCocoaWindow(_mainWindow); } + id getNSGLContext() override { return glfwGetNSGLContext(_mainWindow); } // stevetranby: added #endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) protected: @@ -169,6 +182,8 @@ class CC_DLL GLViewImpl : public GLView float _mouseX; float _mouseY; + GLFWcursor* _cursor; + friend class GLFWEventHandler; public: diff --git a/cocos/platform/ios/CCApplication-ios.h b/cocos/platform/ios/CCApplication-ios.h index 7120f4ab1b37..c2c51a829870 100644 --- a/cocos/platform/ios/CCApplication-ios.h +++ b/cocos/platform/ios/CCApplication-ios.h @@ -69,7 +69,6 @@ class CC_DLL Application : public ApplicationProtocol @param interval The time, expressed in seconds, between current frame and next. */ virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; /** @brief Get current language config diff --git a/cocos/platform/ios/CCApplication-ios.mm b/cocos/platform/ios/CCApplication-ios.mm index f9e666883d71..80adacee5cac 100644 --- a/cocos/platform/ios/CCApplication-ios.mm +++ b/cocos/platform/ios/CCApplication-ios.mm @@ -64,11 +64,6 @@ of this software and associated documentation files (the "Software"), to deal [[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ]; } -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - ///////////////////////////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/cocos/platform/ios/CCDevice-ios.mm b/cocos/platform/ios/CCDevice-ios.mm index 682dbd98eb23..3de2df7ee8c5 100644 --- a/cocos/platform/ios/CCDevice-ios.mm +++ b/cocos/platform/ios/CCDevice-ios.mm @@ -339,6 +339,7 @@ - (void)accelerometer:(CMAccelerometerData *)accelerometerData float tintColorG; float tintColorB; float tintColorA; + float lineSpacing; unsigned char* data; @@ -414,6 +415,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align, NSTextAlignment nsAlign = FontUtils::_calculateTextAlignment(align); NSMutableParagraphStyle* paragraphStyle = FontUtils::_calculateParagraphStyle(enableWrap, overflow); paragraphStyle.alignment = nsAlign; + paragraphStyle.lineSpacing = info->lineSpacing; // measure text size with specified font and determine the rectangle to draw text in @@ -579,6 +581,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align, info.tintColorG = textDefinition._fontFillColor.g / 255.0f; info.tintColorB = textDefinition._fontFillColor.b / 255.0f; info.tintColorA = textDefinition._fontAlpha / 255.0f; + info.lineSpacing = textDefinition._lineSpacing; if (! _initWithString(text, align, textDefinition._fontName.c_str(), textDefinition._fontSize, &info, textDefinition._enableWrap, textDefinition._overflow)) { diff --git a/cocos/platform/linux/CCApplication-linux.cpp b/cocos/platform/linux/CCApplication-linux.cpp index 10b376ff41b3..2194a754dae9 100644 --- a/cocos/platform/linux/CCApplication-linux.cpp +++ b/cocos/platform/linux/CCApplication-linux.cpp @@ -115,11 +115,6 @@ void Application::setAnimationInterval(float interval) _animationInterval = interval*1000.0f; } -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - void Application::setResourceRootPath(const std::string& rootResDir) { _resourceRootPath = rootResDir; diff --git a/cocos/platform/linux/CCApplication-linux.h b/cocos/platform/linux/CCApplication-linux.h index 42f9817c7556..a9baba39ac99 100644 --- a/cocos/platform/linux/CCApplication-linux.h +++ b/cocos/platform/linux/CCApplication-linux.h @@ -55,7 +55,6 @@ class Application : public ApplicationProtocol @param interval The time, which expressed in second in second, between current frame and next. */ virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; /** @brief Run the message loop. diff --git a/cocos/platform/linux/CCFileUtils-linux.cpp b/cocos/platform/linux/CCFileUtils-linux.cpp index 1e45f26ab149..831a77efb865 100644 --- a/cocos/platform/linux/CCFileUtils-linux.cpp +++ b/cocos/platform/linux/CCFileUtils-linux.cpp @@ -78,7 +78,7 @@ bool FileUtilsLinux::init() fullpath[length] = '\0'; std::string appPath = fullpath; - _defaultResRootPath = appPath.substr(0, appPath.find_last_of("/")); + _defaultResRootPath = appPath.substr(0, appPath.find_last_of('/')); _defaultResRootPath += CC_RESOURCE_FOLDER_LINUX; // Set writable path to $XDG_CONFIG_HOME or ~/.config// if $XDG_CONFIG_HOME not exists. @@ -91,7 +91,7 @@ bool FileUtilsLinux::init() xdgConfigPath = xdg_config_path; } _writablePath = xdgConfigPath; - _writablePath += appPath.substr(appPath.find_last_of("/")); + _writablePath += appPath.substr(appPath.find_last_of('/')); _writablePath += "/"; return FileUtils::init(); diff --git a/cocos/platform/mac/CCApplication-mac.h b/cocos/platform/mac/CCApplication-mac.h index 9588e4b8a167..0088d09b8a5d 100644 --- a/cocos/platform/mac/CCApplication-mac.h +++ b/cocos/platform/mac/CCApplication-mac.h @@ -54,7 +54,6 @@ class CC_DLL Application : public ApplicationProtocol @param interval The time, which expressed in second in second, between current frame and next. */ virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; /** @brief Run the message loop. diff --git a/cocos/platform/mac/CCApplication-mac.mm b/cocos/platform/mac/CCApplication-mac.mm index bbbf6dcde421..12bae715f99d 100644 --- a/cocos/platform/mac/CCApplication-mac.mm +++ b/cocos/platform/mac/CCApplication-mac.mm @@ -79,11 +79,21 @@ static long getCurrentMillSecond() // Retain glview to avoid glview being released in the while loop glview->retain(); - + + unsigned int ctx_updated_count = 0; + while (!glview->windowShouldClose()) { lastTime = getCurrentMillSecond(); - + + // hack to fix issue #19080, black screen on macOS 10.14 + // stevetranby: look into doing this outside loop to get rid of condition test per frame + if(ctx_updated_count < 2) { + ctx_updated_count++; + NSOpenGLContext* ctx = (NSOpenGLContext*)glview->getNSGLContext(); + [ctx update]; + } + director->mainLoop(); glview->pollEvents(); @@ -115,11 +125,6 @@ static long getCurrentMillSecond() _animationInterval = interval*1000.0f; } -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - Application::Platform Application::getTargetPlatform() { return Platform::OS_MAC; diff --git a/cocos/platform/tizen/CCApplication-tizen.cpp b/cocos/platform/tizen/CCApplication-tizen.cpp deleted file mode 100644 index d312e44a2941..000000000000 --- a/cocos/platform/tizen/CCApplication-tizen.cpp +++ /dev/null @@ -1,624 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/tizen/CCApplication-tizen.h" -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "platform/tizen/CCGLViewImpl-tizen.h" -#include "base/CCDirector.h" -#include "base/CCEventKeyboard.h" -#include "base/CCEventDispatcher.h" -#include "base/ccUtils.h" -#include "platform/CCFileUtils.h" - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "cocos2d-x" - -ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); - -NS_CC_BEGIN - -void stopAccelerometerSensor(); -void pauseAccelerometerSensor(); -void resumeAccelerometerSensor(); - -static void makeCurrent(void) -{ - Application* app = Application::getInstance(); - evas_gl_make_current(app->_evasGL, app->_sfc, app->_ctx); -} - - -static Eina_Bool _key_down_cb(void *data, int type, void *ev) -{ - makeCurrent(); - Ecore_Event_Key *event = (Ecore_Event_Key *)ev; - if (!strcmp("XF86Stop", event->key) || !strcmp("XF86Back", event->key)) - { - cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_ESCAPE, true); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - } - else if (!strcmp("XF86Menu", event->key)) - { - cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_MENU, true); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - } - - return ECORE_CALLBACK_PASS_ON; -} - -static Eina_Bool _key_up_cb(void *data, int type, void *ev) -{ - makeCurrent(); - Ecore_Event_Key *event = (Ecore_Event_Key *)ev; - if (!strcmp("XF86Stop", event->key) || !strcmp("XF86Back", event->key)) - { - cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_ESCAPE, false); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - } - else if (!strcmp("XF86Menu", event->key)) - { - cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_MENU, false); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - } - - return ECORE_CALLBACK_PASS_ON; -} - -static void draw_gl(Evas_Object *obj) -{ - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - - director->mainLoop(); - glview->pollEvents(); -} - -static void del_gl(Evas_Object *obj) { - -} - -// sharedApplication pointer -Application* Application::__instance = nullptr; - -Application::Application() -: _win(nullptr) -, _conform(nullptr) -, _animationInterval(1.0f/60.0f*1000.0f) -, _paused(false) -{ - _orientation = APP_DEVICE_ORIENTATION_0; - CC_ASSERT(! __instance); - __instance = this; -} - -Application::~Application() -{ - CC_ASSERT(this == __instance); - __instance = nullptr; -} - -static void del_anim(void *data, Evas *evas, Evas_Object *obj, void *event_info) -{ - Ecore_Animator *ani = (Ecore_Animator *)evas_object_data_get(obj, "ani"); - ecore_animator_del(ani); -} - -static Eina_Bool anim(void *data) { - elm_glview_changed_set((Evas_Object*)data); - return EINA_TRUE; -} - -static void init_gl(Evas_Object *obj) { - Application *ad = Application::getInstance(); - - //save current ctx - ad->_evasGL = elm_glview_evas_gl_get(obj); - ad->_ctx = evas_gl_current_context_get(ad->_evasGL); - ad->_sfc = evas_gl_current_surface_get(ad->_evasGL); - - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if (glview == nullptr) { - glview = GLViewImpl::create("Cocos2dxTizen"); - - int w, h; - elm_glview_size_get(obj, &w, &h); - glview->setFrameSize(w, h); - director->setOpenGLView(glview); - } - - ad->initGLContextAttrs(); - // Initialize instance and cocos2d. - if (! ad->applicationDidFinishLaunching()) - { - return; - } -} - -static void create_indicator(Application *ad) { - elm_win_conformant_set(ad->_win, EINA_TRUE); - - elm_win_indicator_mode_set(ad->_win, ELM_WIN_INDICATOR_SHOW); - elm_win_indicator_opacity_set(ad->_win, ELM_WIN_INDICATOR_TRANSPARENT); - - ad->_conform = elm_conformant_add(ad->_win); - evas_object_size_hint_weight_set(ad->_conform, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->_win, ad->_conform); - evas_object_show(ad->_conform); -} - -static Evas_Object* add_win(const char *name) { - Evas_Object *win; - - win = elm_win_util_standard_add(name, "tizen"); - - if (!win) - return nullptr; - //fix openURL tests not goes to another program issue - // elm_win_fullscreen_set(win, EINA_TRUE); - evas_object_show(win); - - return win; -} - -//touch call back -static void touches_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Multi_Down *)event_info; - int id = ev->device; - float x = ev->canvas.x; - float y = ev->canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y); -} - -static void touches_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Multi_Move *)event_info; - int id = ev->device; - float x = ev->cur.canvas.x; - float y = ev->cur.canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(1, &id, &x, &y); -} - -static void touches_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Multi_Up *)event_info; - int id = ev->device; - float x = ev->canvas.x; - float y = ev->canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y); -} - -static void touch_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Mouse_Down *)event_info; - int id = ev->button; - float x = ev->canvas.x; - float y = ev->canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y); -} - -static void touch_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Mouse_Move *)event_info; - int id = ev->buttons; - float x = ev->cur.canvas.x; - float y = ev->cur.canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(1, &id, &x, &y); -} - -static void touch_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) -{ - auto ev = (Evas_Event_Mouse_Up *)event_info; - int id = ev->button; - float x = ev->canvas.x; - float y = ev->canvas.y; - - makeCurrent(); - cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y); -} - -static Elm_GLView_Mode get_glview_mode(const GLContextAttrs &attrs) -{ - /* for performance */ - Elm_GLView_Mode mode = ELM_GLVIEW_DIRECT; - - /* alpha */ - if (attrs.alphaBits > 0) - { - //fixme if enable this, cpp-test show white screen only. - //mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_ALPHA); - } - - /* depth */ - if (attrs.depthBits > 24) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_DEPTH_32); - } - else if (attrs.depthBits > 16) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_DEPTH_24); - } - else if (attrs.depthBits > 8) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_DEPTH_16); - } - else if (attrs.depthBits > 0) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_DEPTH_8); - } - - /* stencil */ - if (attrs.stencilBits > 8) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_STENCIL_16); - } - else if (attrs.stencilBits > 4) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_STENCIL_8); - } - else if (attrs.stencilBits > 2) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_STENCIL_4); - } - else if (attrs.stencilBits > 1) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_STENCIL_2); - } - else if (attrs.stencilBits > 0) - { - mode = (Elm_GLView_Mode)(mode | ELM_GLVIEW_STENCIL_1); - } - - return mode; -} - -static bool app_create(void *data) { - /* Hook to take necessary actions before main event loop starts - * Initialize UI resources and application's data - * If this function returns true, the main loop of application starts - * If this function returns false, the application is terminated. */ - - Evas_Object *gl; - Application *ad = (Application *)data; - - if (!data) - return false; - - /* Create and initialize GLView */ - elm_config_accel_preference_set("opengl"); - /* Create the window */ - ad->_win = add_win("cocos2d-x"); - - if (!ad->_win) - return false; - - int rots[2]; - rots[0] = ad->_orientation; - rots[1] = rots[0] + 180 % 360; - elm_win_wm_rotation_available_rotations_set(ad->_win, rots, 2); - - ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, ad); - ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_up_cb, ad); - - gl = elm_glview_add(ad->_win); - elm_win_resize_object_add(ad->_win, gl); - ELEMENTARY_GLVIEW_GLOBAL_USE(gl); - evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - /* Create and initialize GLView */ - ad->initGLContextAttrs(); - auto attrs = GLView::getGLContextAttrs(); - auto mode = get_glview_mode(attrs); - elm_glview_mode_set(gl, mode); - - /* The resize policy tells GLView what to do with the surface when it - * resizes. ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to - * destroy the current surface and recreate it to the new size. - */ - //elm_glview_resize_policy_set(gl, ELM_GLVIEW_RESIZE_POLICY_RECREATE); - - /* The render policy sets how GLView should render GL code. - * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the GL callback - * called only when the object is visible. - * ELM_GLVIEW_RENDER_POLICY_ALWAYS would cause the callback to be - * called even if the object were hidden. - */ - elm_glview_render_policy_set(gl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND); - - /* The initialize callback function gets registered here */ - elm_glview_init_func_set(gl, init_gl); - - /* The delete callback function gets registered here */ - elm_glview_del_func_set(gl, del_gl); - - /* The resize callback function gets registered here */ - // Cocos2d-x doesn't support to change orientation from portrait to landscape. - // So comment next line. -// elm_glview_resize_func_set(gl, resize_gl); - - /* The render callback function gets registered here */ - elm_glview_render_func_set(gl, draw_gl); - - /* Add the GLView to the box and show it */ - evas_object_show(gl); - - elm_object_focus_set(gl, EINA_TRUE); - - /* This adds an animator so that the app will regularly - * trigger updates of the GLView using elm_glview_changed_set(). - * - * NOTE: If you delete GL, this animator will keep running trying to access - * GL so this animator needs to be deleted with ecore_animator_del(). - */ - ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER); - ad->_ani = ecore_animator_add(anim, gl); - evas_object_data_set(gl, "ani", ad->_ani); - evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, del_anim, gl); - - /* Add Mouse Event Callbacks */ - evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, touch_down_cb, ad); - evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_MOVE, touch_move_cb, ad); - evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_UP, touch_up_cb, ad); - - evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_DOWN, touches_down_cb, ad); - evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_MOVE, touches_move_cb, ad); - evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_UP, touches_up_cb, ad); - - - - create_indicator(ad); - - return true; -} - -static void app_pause(void *data) -{ - /* Take necessary actions when application becomes invisible. */ - if(!data) - { - return; - } - pauseAccelerometerSensor(); - - Application* app = ((Application *)data); - app->applicationDidEnterBackground(); - - ecore_animator_freeze(app->_ani); - app->setPauseFlag(true); -} - -static void app_resume(void *data) -{ - /* Take necessary actions when application becomes visible. */ - if(!data) - { - return; - } - - Application* app = ((Application *)data); - app->applicationWillEnterForeground(); - resumeAccelerometerSensor(); - - ecore_animator_thaw(app->_ani); - app->setPauseFlag(false); -} - -static void app_terminate(void *data) -{ - /* Release all resources. */ - if(!data) - { - return; - } - stopAccelerometerSensor(); - Director::getInstance()->end(); - // Application* app = ((Application *)data); - // delete app; -} - -static void app_control(app_control_h app_control, void *data) -{ - /* Handle the launch request. */ -} - -int Application::run() -{ - ui_app_lifecycle_callback_s event_callback = { nullptr, }; - - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.pause = app_pause; - event_callback.resume = app_resume; - event_callback.app_control = app_control; - -/* ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad); - ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]); -*/ - int ret = ui_app_main(_argc, _argv, &event_callback, this); - if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, LOG_TAG, "The application failed to start, and returned %d", ret); - } - - return ret; -} - -void Application::setAnimationInterval(float interval) -{ - _animationInterval = interval*1000.0f; - ecore_animator_frametime_set(interval); -} - -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - -void Application::setResourceRootPath(const std::string& rootResDir) -{ - _resourceRootPath = rootResDir; - if (_resourceRootPath[_resourceRootPath.length() - 1] != '/') - { - _resourceRootPath += '/'; - } - FileUtils* pFileUtils = FileUtils::getInstance(); - std::vector searchPaths = pFileUtils->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), _resourceRootPath); - pFileUtils->setSearchPaths(searchPaths); -} - -const std::string& Application::getResourceRootPath(void) -{ - return _resourceRootPath; -} - -Application::Platform Application::getTargetPlatform() -{ - return Platform::OS_TIZEN; -} - -void Application::setDeviceOrientation(int orientation) -{ - _orientation = orientation; -} - -void Application::setMainArgs(int argc, char **argv) -{ - _argc = argc; - _argv = argv; -} -bool Application::openURL(const std::string &url) -{ - bool flag = false; - if(0==url.length()) - { - return flag; - } - app_control_h app_control; - - app_control_create(&app_control); - app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW); - app_control_set_uri(app_control, url.c_str()); - - int ctrlError; - if ((ctrlError=app_control_send_launch_request(app_control, NULL, NULL)) == APP_CONTROL_ERROR_NONE) - { - flag = true; - } - else - { - dlog_print(DLOG_ERROR, LOG_TAG, "open url failed, and returned %d", ctrlError); - } - - app_control_destroy(app_control); - return flag; -} - -////////////////////////////////////////////////////////////////////////// -// static member function -////////////////////////////////////////////////////////////////////////// -Application* Application::getInstance() -{ - CC_ASSERT(__instance); - return __instance; -} - -// @deprecated Use getInstance() instead -Application* Application::sharedApplication() -{ - return Application::getInstance(); -} - -const char * Application::getCurrentLanguageCode() -{ - static char code[3]={0}; - char *pLanguageName = getenv("LANG"); - if (!pLanguageName) - return "en"; - strtok(pLanguageName, "_"); - if (!pLanguageName) - return "en"; - strncpy(code,pLanguageName,2); - code[2]='\0'; - return code; -} - -std::string Application::getVersion() -{ - //TODO - return ""; -} - -LanguageType Application::getCurrentLanguage() -{ - char *pLanguageName = getenv("LANG"); - if (!pLanguageName) - { - return LanguageType::ENGLISH; - } - strtok(pLanguageName, "_"); - if (!pLanguageName) - { - return LanguageType::ENGLISH; - } - - return utils::getLanguageTypeByISO2(pLanguageName); -} - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - diff --git a/cocos/platform/tizen/CCApplication-tizen.h b/cocos/platform/tizen/CCApplication-tizen.h deleted file mode 100644 index 76f4d23b3b91..000000000000 --- a/cocos/platform/tizen/CCApplication-tizen.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#ifndef CCAPLICATION_TIZEN_H_ -#define CCAPLICATION_TIZEN_H_ - -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" -#include - -#include - -NS_CC_BEGIN -class Rect; - -class Application : public ApplicationProtocol -{ -public: - /** - * @js ctor - */ - Application(); - /** - * @js NA - * @lua NA - */ - virtual ~Application(); - - /** - @brief Callback by Director for limit FPS. - @param interval The time, which expressed in second in second, between current frame and next. - */ - virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current application instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - - /* override functions */ - virtual LanguageType getCurrentLanguage() override; - - std::string getVersion() override; - - /** - @brief Get current language iso 639-1 code - @return Current language iso 639-1 code - */ - virtual const char * getCurrentLanguageCode() override; - - /** - @brief Open url in default browser - @param String with url to open. - @return true if the resource located by the URL was successfully opened; otherwise false. - */ - virtual bool openURL(const std::string &url) override; - - /** - * Sets the Resource root path. - * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); - - /** - * Gets the Resource root path. - * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void); - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform() override; - - void setDeviceOrientation(int orientation); - void setMainArgs(int argc, char **argv); - void setPauseFlag(bool pause){_paused = pause;} - bool isPaused(){return _paused;} -public: - Evas_Object * _win; - Evas_Object * _conform; - - Evas_GL * _evasGL; - Evas_GL_Context * _ctx; - Evas_GL_Surface * _sfc; - Ecore_Animator * _ani; - - int _orientation; - int _argc; - char **_argv; -protected: - long _animationInterval; //micro second - std::string _resourceRootPath; - bool _paused; - static Application * __instance; -}; - -NS_CC_END - -#endif // CCAPLICATION_TIZEN_H_ - -#endif /* CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN */ diff --git a/cocos/platform/tizen/CCCommon-tizen.cpp b/cocos/platform/tizen/CCCommon-tizen.cpp deleted file mode 100644 index 4b4e60b5f0f0..000000000000 --- a/cocos/platform/tizen/CCCommon-tizen.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/CCCommon.h" -#include "platform/tizen/CCStdC-tizen.h" -#include "base/CCConsole.h" - -NS_CC_BEGIN - -void MessageBox(const char * msg, const char * title) -{ - log("%s: %s", title, msg); -} - -void LuaLog(const char * format) -{ - puts(format); -} - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCDevice-tizen.cpp b/cocos/platform/tizen/CCDevice-tizen.cpp deleted file mode 100644 index 9e4381bb0001..000000000000 --- a/cocos/platform/tizen/CCDevice-tizen.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/CCDevice.h" - -#include -#include -#include -#include -#include -#include - -#include "base/CCEventDispatcher.h" -#include "base/CCEventAcceleration.h" -#include "base/CCDirector.h" -#include "platform/CCFileUtils.h" -#include "platform/tizen/CCApplication-tizen.h" - -using namespace std; -NS_CC_BEGIN - -static sensor_h s_sensorHandle = nullptr; -static sensor_listener_h s_sensorListener = nullptr; -static float s_sensorInterval = 30.0f; - -#define GRAVITY_EARTH 9.80665f - -static bool checkAccelerometerValues(sensor_event_s *sensor_data) -{ - for(int i = 0; i < sensor_data->value_count; ++i) - { - float value = sensor_data->values[i]; - - if(isnan(value))//or other limitations - { - return false; - } - } - return true; -} - -static void accelerometer_sensor_cb(sensor_h _sensor, sensor_event_s *sensor_data, void *user_data) -{ - if(!checkAccelerometerValues(sensor_data)) - { - CCLOG("sensor value is invalid!!"); - return; - } - if(3 != sensor_data->value_count) - { - return; - } - Acceleration *_acceleration = new Acceleration(); - _acceleration->x = sensor_data->values[0] / GRAVITY_EARTH; - _acceleration->y = sensor_data->values[1] / GRAVITY_EARTH; - _acceleration->z = sensor_data->values[2] / GRAVITY_EARTH; - _acceleration->timestamp = (double)sensor_data->timestamp / 1e6; - - double tmp = _acceleration->x; - Application *app = Application::getInstance(); - int orientation = elm_win_rotation_get(app->_win); - - switch (orientation) - { - case 0: - _acceleration->x = _acceleration->y; - _acceleration->y = tmp; - break; - - case 90: - _acceleration->x = -_acceleration->y; - _acceleration->y = tmp; - break; - - case 180: - _acceleration->x = -_acceleration->y; - _acceleration->y = -tmp; - break; - - case 270: - _acceleration->x = _acceleration->y; - _acceleration->y = -tmp; - break; - default: - CCLOG("unknown orientation"); - } - - cocos2d::EventAcceleration event(*_acceleration); - auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher(); - dispatcher->dispatchEvent(&event); -} - -void stopAccelerometerSensor() -{ - if (s_sensorListener) - { - sensor_listener_stop(s_sensorListener); - sensor_destroy_listener(s_sensorListener); - s_sensorListener = nullptr; - s_sensorHandle = nullptr; - } -} - -void startAccelerometerSensor() -{ - if (!s_sensorListener) - { - sensor_get_default_sensor(SENSOR_ACCELEROMETER, &s_sensorHandle); - auto err = sensor_create_listener(s_sensorHandle, &s_sensorListener); - if(SENSOR_ERROR_NONE != err) - { - CCLOG("create sensor failed!"); - } - sensor_listener_set_event_cb(s_sensorListener, s_sensorInterval, accelerometer_sensor_cb, NULL); - sensor_listener_start(s_sensorListener); - } -} - -static bool s_resumeAccelerometerSensor = false; - -void pauseAccelerometerSensor() -{ - if (s_sensorListener) - { - s_resumeAccelerometerSensor = true; - stopAccelerometerSensor(); - } - else - { - s_resumeAccelerometerSensor = false; - } -} - -void resumeAccelerometerSensor() -{ - if (s_resumeAccelerometerSensor) - { - startAccelerometerSensor(); - } -} - -void Device::setAccelerometerEnabled(bool isEnabled) -{ - if(isEnabled) - { - startAccelerometerSensor(); - } - else - { - stopAccelerometerSensor(); - } -} - -void Device::setAccelerometerInterval(float interval) -{ - s_sensorInterval = interval; - if(s_sensorListener) - { - sensor_listener_set_interval(s_sensorListener, s_sensorInterval); - } -} - -int Device::getDPI() -{ - static int dpi = -1; - if (dpi == -1) - { - auto ret = system_info_get_platform_int("tizen.org/feature/screen.dpi",&dpi); - if(ret != SYSTEM_INFO_ERROR_NONE) - { - //error handing - dpi = -1; - } - } - return dpi; -} - -static void getTextBitmapData(const char * text, const FontDefinition& textDefinition, Data& bitmapData, int &bitmapWidth, int &bitmapHeight) -{ - //create canvas object - auto method = evas_render_method_lookup("buffer"); - if (method <= 0) - { - log("ERROR: evas was not compiled with 'buffer' engine!"); - return ; - } - - //evas_init();//not necessary, removed when use Tizen 2.4. - auto canvas = evas_new(); - if(!canvas){ - log("ERROR: could not instantiate new evas canvas."); - return; - } - evas_output_method_set(canvas, method); - - std::string fontFullPath; - if(textDefinition._fontName.empty()) - { - fontFullPath = "Sans"; - } - else - { - fontFullPath= FileUtils::getInstance()->fullPathForFilename(textDefinition._fontName); - } - - const char* fontName = fontFullPath.c_str(); - const char* textAlign = "left"; - const char* textValign = "top"; - char richTextStyle[50]; - richTextStyle[0] = 0; - - if (textDefinition._stroke._strokeEnabled) - { - sprintf(richTextStyle,"style=outline outline_color=#%02X%02X%02X", - textDefinition._stroke._strokeColor.r, textDefinition._stroke._strokeColor.g, textDefinition._stroke._strokeColor.b); - } - - switch (textDefinition._alignment) - { - case TextHAlignment::CENTER: - textAlign = "center"; - break; - case TextHAlignment::RIGHT: - textAlign = "right"; - break; - default: - break; - } - double valignment = 0.0; - switch(textDefinition._vertAlignment) - { - case TextVAlignment::CENTER: - textValign = "center"; - valignment = 0.5; - break; - case TextVAlignment::BOTTOM: - textValign = "bottom"; - valignment = 1.0; - break; - default: - break; - } - - auto richText = (char*)malloc(strlen(text) + 150); - sprintf(richText,"DEFAULT='font=%s font_size=%d align=%s valign=%s %s color=#%02X%02X%02X wrap=word'", - fontName, textDefinition._fontSize, textAlign, textValign, richTextStyle, - textDefinition._fontFillColor.b, textDefinition._fontFillColor.g, textDefinition._fontFillColor.r); - - auto entry = evas_object_textblock_add(canvas); - auto st = evas_textblock_style_new(); - evas_textblock_style_set(st, richText); - evas_object_textblock_style_set(entry, st); - evas_textblock_style_free(st); - evas_object_textblock_valign_set(entry, valignment); - - evas_object_textblock_text_markup_set(entry, evas_textblock_text_utf8_to_markup(entry, text)); - free(richText); - - evas_object_resize(entry, 2048, 0);//allocate one default size first. - - Evas_Coord width = textDefinition._dimensions.width; - Evas_Coord height = textDefinition._dimensions.height; - if(0==width*height) - { - evas_object_textblock_size_formatted_get(entry, &width, &height); - } - - evas_object_resize(entry, width, height); - - //init canvas - evas_output_size_set(canvas, width, height); - evas_output_viewport_set(canvas, 0, 0, width, height); - - auto einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas); - if (!einfo){ - log("ERROR: could not get evas engine info!"); - evas_free(canvas); - return ; - } - - // ARGB32 is sizeof(int), that is 4 bytes, per pixel - bitmapWidth = width; - bitmapHeight = height; - void* pixels = malloc(bitmapWidth * bitmapHeight * 4); - if (!pixels){ - log("ERROR: could not allocate canvas pixels!"); - evas_free(canvas); - return; - } - - einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32; - einfo->info.dest_buffer = pixels; - einfo->info.dest_buffer_row_bytes = bitmapWidth * sizeof(int); - einfo->info.use_color_key = 0; - einfo->info.alpha_threshold = 0; - einfo->info.func.new_update_region = NULL; - einfo->info.func.free_update_region = NULL; - evas_engine_info_set(canvas, (Evas_Engine_Info *)einfo); - - //render - evas_object_show(entry); - auto updates = evas_render_updates(canvas); - evas_render_updates_free(updates); - - bitmapData.fastSet((unsigned char*)pixels,bitmapWidth * bitmapHeight * 4); - - evas_free(canvas); - //evas_shutdown();//not necessary, removed when use Tizen 2.4. -} - -Data Device::getTextureDataForText(const char * text, const FontDefinition& textDefinition, TextAlign align, int &width, int &height, bool& hasPremultipliedAlpha) -{ - Data ret; - do - { - getTextBitmapData(text, textDefinition, ret, width, height); - hasPremultipliedAlpha = true; - } while (0); - - return ret; -} - -void Device::setKeepScreenOn(bool value) -{ -} - -void Device::vibrate(float /*duration*/) -{ -} - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCFileUtils-tizen.cpp b/cocos/platform/tizen/CCFileUtils-tizen.cpp deleted file mode 100644 index 504f81994d8c..000000000000 --- a/cocos/platform/tizen/CCFileUtils-tizen.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/tizen/CCFileUtils-tizen.h" -#include -#include - -using namespace std; -NS_CC_BEGIN - -FileUtils* FileUtils::getInstance() -{ - if (s_sharedFileUtils == nullptr) - { - s_sharedFileUtils = new FileUtilsTizen(); - if(!s_sharedFileUtils->init()) - { - delete s_sharedFileUtils; - s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init FileUtilsTizen"); - } - } - - return s_sharedFileUtils; -} - -FileUtilsTizen::FileUtilsTizen() -{ - -} - -bool FileUtilsTizen::init() -{ - _defaultResRootPath = app_get_resource_path(); - _writablePath = app_get_data_path(); - - return FileUtils::init(); -} - -string FileUtilsTizen::getWritablePath() const -{ - return _writablePath; -} - -bool FileUtilsTizen::isFileExistInternal(const std::string& strFilePath) const -{ - if (strFilePath.empty()) - { - return false; - } - - std::string strPath = strFilePath; - if (!isAbsolutePath(strPath)) - { // Not absolute path, add the default root path at the beginning. - strPath.insert(0, _defaultResRootPath); - } - - struct stat sts; - return (stat(strPath.c_str(), &sts) != -1) ? true : false; -} - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCFileUtils-tizen.h b/cocos/platform/tizen/CCFileUtils-tizen.h deleted file mode 100644 index e72d60eb34c2..000000000000 --- a/cocos/platform/tizen/CCFileUtils-tizen.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#ifndef __CC_FILEUTILS_TIZEN_H__ -#define __CC_FILEUTILS_TIZEN_H__ - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#include "base/ccTypes.h" -#include - -NS_CC_BEGIN - -/** - * @addtogroup platform - * @{ - */ - -//! @brief Helper class to handle file operations -class CC_DLL FileUtilsTizen : public FileUtils -{ -public: - /* override functions */ - virtual bool init() override; - - virtual std::string getWritablePath() const override; - -private: - FileUtilsTizen(); - - std::string _writablePath; - - virtual bool isFileExistInternal(const std::string& strFilePath) const override; - - friend class FileUtils; -}; - -// end of platform group -/// @} - -NS_CC_END - -#endif // __CC_FILEUTILS_TIZEN_H__ - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - diff --git a/cocos/platform/tizen/CCGL-tizen.h b/cocos/platform/tizen/CCGL-tizen.h deleted file mode 100644 index 77abe2cba5fc..000000000000 --- a/cocos/platform/tizen/CCGL-tizen.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 __CCGL_H__ -#define __CCGL_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include - -#ifndef glGenVertexArrays - #define glGenVertexArrays glGenVertexArraysOES -#endif -#ifndef glDeleteVertexArrays - #define glDeleteVertexArrays glDeleteVertexArraysOES -#endif -#ifndef GL_WRITE_ONLY - #define GL_WRITE_ONLY GL_WRITE_ONLY_OES -#endif -#ifndef glMapBuffer - #define glMapBuffer glMapBufferOES -#endif -#ifndef glUnmapBuffer - #define glUnmapBuffer glUnmapBufferOES -#endif -#ifndef GL_BGRA - #define GL_BGRA GL_BGRA_EXT -#endif -#ifndef glBindVertexArray - #define glBindVertexArray glBindVertexArrayOES -#endif -#ifndef glClearDepth - #define glClearDepth glClearDepthf -#endif -#ifndef GL_DEPTH24_STENCIL8 - #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES -#endif - - -ELEMENTARY_GLVIEW_GLOBAL_DECLARE(); - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#endif // __CCGL_H__ diff --git a/cocos/platform/tizen/CCGLViewImpl-tizen.cpp b/cocos/platform/tizen/CCGLViewImpl-tizen.cpp deleted file mode 100644 index 53f474432c16..000000000000 --- a/cocos/platform/tizen/CCGLViewImpl-tizen.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/tizen/CCGLViewImpl-tizen.h" -#include -#include -#include -#include -#include "platform/CCApplication.h" -#include "base/CCIMEDispatcher.h" -#include "base/CCDirector.h" - -NS_CC_BEGIN - -GLViewImpl* GLViewImpl::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) -{ - auto ret = new GLViewImpl; - if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { - ret->autorelease(); - return ret; - } - - return nullptr; -} - -GLViewImpl* GLViewImpl::create(const std::string& viewName) -{ - auto ret = new GLViewImpl; - if(ret && ret->initWithFullScreen(viewName)) { - ret->autorelease(); - return ret; - } - - return nullptr; -} - -GLViewImpl* GLViewImpl::createWithFullScreen(const std::string& viewName) -{ - auto ret = new GLViewImpl(); - if(ret && ret->initWithFullScreen(viewName)) { - ret->autorelease(); - return ret; - } - - return nullptr; -} - -GLViewImpl::GLViewImpl() -{ - -} - -GLViewImpl::~GLViewImpl() -{ - -} - -bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) -{ - return true; -} - -bool GLViewImpl::initWithFullScreen(const std::string& viewName) -{ - return true; -} - - -bool GLViewImpl::isOpenGLReady() -{ - return (_screenSize.width != 0 && _screenSize.height != 0); -} - -void GLViewImpl::end() -{ - ui_app_exit(); -} - -void GLViewImpl::swapBuffers() -{ -} - -//============================================================================================ -static Evas_Object * s_keypadWin = nullptr; -static Evas_Object * s_keypadEntry = nullptr; -Ecore_IMF_Context *s_imf = nullptr; - -static void imfEventCommitCallback(void *data, Ecore_IMF_Context *ctx, void *event_info) -{ - auto commit_str = (char *)event_info; - if (commit_str) - { - cocos2d::IMEDispatcher::sharedDispatcher()->dispatchInsertText(commit_str, strlen(commit_str)); - } -} - -static void entryKeyCallback(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - auto keyInfo = (Evas_Event_Key_Up*)event_info; - if (keyInfo->key && !strcmp(keyInfo->key,"BackSpace")) - { - cocos2d::IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - } -} - -static void stateChangedCallback(void *data, Ecore_IMF_Context *ctx, int value) -{ - if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) - { - evas_object_del(s_keypadWin); - s_keypadWin = nullptr; - s_imf = nullptr; - } -} - -static void closeKeypad() -{ - ecore_imf_context_input_panel_event_callback_add (s_imf, ECORE_IMF_INPUT_PANEL_STATE_EVENT, stateChangedCallback, NULL); - elm_entry_input_panel_hide(s_keypadEntry); -} - -static void entryActivatedCallback(void *data, Evas_Object *obj, void *event_info) -{ - closeKeypad(); -} - -static void keyPadBackCallback(void *data, Evas_Object *obj, void *event_info) -{ - closeKeypad(); -} - -static void blankAreaClickedCallback(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - closeKeypad(); -} - -void GLViewImpl::setIMEKeyboardState(bool open) -{ - if (open) - { - if (!s_keypadWin) - { - auto frameSize = Director::getInstance()->getOpenGLView()->getFrameSize(); - auto app = Application::getInstance(); - - s_keypadWin = elm_win_add(app->_win, "cocos2d-x textfield", ELM_WIN_BASIC); - elm_win_autodel_set(s_keypadWin, EINA_TRUE); - elm_win_conformant_set(s_keypadWin, EINA_TRUE); - elm_win_alpha_set(s_keypadWin, EINA_TRUE); - eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, keyPadBackCallback, NULL); - evas_object_show(s_keypadWin); - - int rots[2]; - rots[0] = (int)elm_win_rotation_get(app->_win); - rots[1] = rots[0] + 180 % 360; - elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); - - auto rectangle = elm_bg_add(s_keypadWin); - evas_object_resize(rectangle, frameSize.width, frameSize.height + 50); - evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0); - evas_object_move(rectangle, 0, -50); - evas_object_show(rectangle); - - evas_object_repeat_events_set(rectangle, EINA_TRUE); - evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MOUSE_UP, blankAreaClickedCallback, NULL); - evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MULTI_UP, blankAreaClickedCallback, NULL); - - s_keypadEntry = elm_entry_add(rectangle); - elm_entry_single_line_set(s_keypadEntry, EINA_TRUE); - evas_object_resize(s_keypadEntry, frameSize.width, 50); - evas_object_move(s_keypadEntry, 0, -50); - elm_entry_input_panel_return_key_type_set(s_keypadEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); - elm_entry_prediction_allow_set(s_keypadEntry, EINA_FALSE); - evas_object_event_callback_add(s_keypadEntry, EVAS_CALLBACK_KEY_UP, entryKeyCallback, NULL); - evas_object_show(s_keypadEntry); - - elm_object_focus_set(s_keypadEntry, EINA_TRUE); - evas_object_smart_callback_add(s_keypadEntry, "activated", entryActivatedCallback, NULL); - elm_entry_input_panel_show(s_keypadEntry); - - s_imf = (Ecore_IMF_Context*)elm_entry_imf_context_get(s_keypadEntry); - ecore_imf_context_event_callback_add(s_imf, ECORE_IMF_CALLBACK_COMMIT, imfEventCommitCallback, s_keypadEntry); - } - } - else if (s_keypadWin) - { - closeKeypad(); - } -} - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCGLViewImpl-tizen.h b/cocos/platform/tizen/CCGLViewImpl-tizen.h deleted file mode 100644 index b6718aceafcf..000000000000 --- a/cocos/platform/tizen/CCGLViewImpl-tizen.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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_EGLVIEWIMPL_TIZEN_H__ -#define __CC_EGLVIEWIMPL_TIZEN_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/CCGLView.h" - -NS_CC_BEGIN - -class CC_DLL GLViewImpl : public GLView -{ -public: - - // static function - static GLViewImpl* create(const std::string &viewname); - static GLViewImpl* createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor = 1.0f); - static GLViewImpl* createWithFullScreen(const std::string& viewName); - - bool isOpenGLReady() override; - void end() override; - void swapBuffers() override; - void setIMEKeyboardState(bool bOpen) override; - -protected: - GLViewImpl(); - virtual ~GLViewImpl(); - - 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_TIZEN - -#endif // end of __CC_EGLVIEWIMPL_TIZEN_H__ diff --git a/cocos/platform/tizen/CCPlatformDefine-tizen.h b/cocos/platform/tizen/CCPlatformDefine-tizen.h deleted file mode 100644 index acf92853af49..000000000000 --- a/cocos/platform/tizen/CCPlatformDefine-tizen.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include - -#define CC_DLL - -#include -#define CC_ASSERT(cond) assert(cond) -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - -/* Define NULL pointer value */ -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/tizen/CCStdC-tizen.cpp b/cocos/platform/tizen/CCStdC-tizen.cpp deleted file mode 100644 index 330f0d401b24..000000000000 --- a/cocos/platform/tizen/CCStdC-tizen.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/tizen/CCStdC-tizen.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - -int CC_DLL gettimeofday(struct timeval * val, struct timezone *) -{ - if (val) - { - SYSTEMTIME wtm; - GetLocalTime(&wtm); - - struct tm tTm; - tTm.tm_year = wtm.wYear - 1900; - tTm.tm_mon = wtm.wMonth - 1; - tTm.tm_mday = wtm.wDay; - tTm.tm_hour = wtm.wHour; - tTm.tm_min = wtm.wMinute; - tTm.tm_sec = wtm.wSecond; - tTm.tm_isdst = -1; - - val->tv_sec = (long)mktime(&tTm); // time_t is 64-bit on win32 - val->tv_usec = wtm.wMilliseconds * 1000; - } - return 0; -} -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) - -using namespace Osp::System; - -int CC_DLL gettimeofday(struct timeval * val, struct timezone *) -{ - if (val) - { - long long curTick = 0; - SystemTime::GetTicks(curTick); - unsigned int ms = curTick; - val->tv_sec = ms / 1000; - val->tv_usec = (ms % 1000) * 1000; - } - return 0; -} - -#endif // CC_PLATFORM_WIN32 - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCStdC-tizen.h b/cocos/platform/tizen/CCStdC-tizen.h deleted file mode 100644 index e553ece8c9bb..000000000000 --- a/cocos/platform/tizen/CCStdC-tizen.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014-2016 Chukong Technologies Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#include "platform/CCPlatformMacros.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN - -#endif // __CC_STD_C_H__ diff --git a/cocos/platform/win32/CCApplication-win32.cpp b/cocos/platform/win32/CCApplication-win32.cpp index ab5f918cc4e4..6c5b8a57ca3a 100644 --- a/cocos/platform/win32/CCApplication-win32.cpp +++ b/cocos/platform/win32/CCApplication-win32.cpp @@ -151,11 +151,6 @@ void Application::setAnimationInterval(float interval) _animationInterval.QuadPart = (LONGLONG)(interval * freq.QuadPart); } -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - ////////////////////////////////////////////////////////////////////////// // static member function ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/platform/win32/CCApplication-win32.h b/cocos/platform/win32/CCApplication-win32.h index 4b890b107dba..7fd979ceca6a 100644 --- a/cocos/platform/win32/CCApplication-win32.h +++ b/cocos/platform/win32/CCApplication-win32.h @@ -67,7 +67,6 @@ class CC_DLL Application : public ApplicationProtocol /* override functions */ virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; virtual LanguageType getCurrentLanguage(); diff --git a/cocos/platform/win32/CCDevice-win32.cpp b/cocos/platform/win32/CCDevice-win32.cpp index c0ab398b0a54..47a3a5a43608 100644 --- a/cocos/platform/win32/CCDevice-win32.cpp +++ b/cocos/platform/win32/CCDevice-win32.cpp @@ -31,6 +31,8 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include "platform/CCStdC.h" +#include + NS_CC_BEGIN int Device::getDPI() @@ -171,12 +173,12 @@ class BitmapDC if (fontPath.size() > 0) { _curFontPath = fontPath; - wchar_t * pwszBuffer = utf8ToUtf16(_curFontPath); + wchar_t * pwszBuffer = utf8ToUtf16(fontPath); if (pwszBuffer) { if (AddFontResource(pwszBuffer)) { - SendMessage(_wnd, WM_FONTCHANGE, 0, 0); + PostMessage(_wnd, WM_FONTCHANGE, 0, 0); } delete[] pwszBuffer; pwszBuffer = nullptr; @@ -218,7 +220,7 @@ class BitmapDC CC_BREAK_IF(!pszText || nLen <= 0); RECT rc = { 0, 0, 0, 0 }; - DWORD dwCalcFmt = DT_CALCRECT; + DWORD dwCalcFmt = DT_CALCRECT | DT_NOPREFIX; if (!enableWrap) { dwCalcFmt |= DT_SINGLELINE; @@ -298,12 +300,11 @@ class BitmapDC { int nRet = 0; wchar_t * pwszBuffer = nullptr; - wchar_t* fixedText = nullptr; do { CC_BREAK_IF(!pszText); - DWORD dwFmt = DT_WORDBREAK; + DWORD dwFmt = DT_WORDBREAK | DT_NOPREFIX; if (!enableWrap) { dwFmt |= DT_SINGLELINE; } @@ -332,37 +333,7 @@ class BitmapDC memset(pwszBuffer, 0, sizeof(wchar_t)*nBufLen); nLen = MultiByteToWideChar(CP_UTF8, 0, pszText, nLen, pwszBuffer, nBufLen); - if (strchr(pszText, '&')) - { - fixedText = new wchar_t[nLen * 2 + 1]; - int fixedIndex = 0; - for (int index = 0; index < nLen; ++index) - { - if (pwszBuffer[index] == '&') - { - fixedText[fixedIndex] = '&'; - fixedText[fixedIndex + 1] = '&'; - fixedIndex += 2; - } - else - { - fixedText[fixedIndex] = pwszBuffer[index]; - fixedIndex += 1; - } - } - fixedText[fixedIndex] = '\0'; - nLen = fixedIndex; - } - - SIZE newSize; - if (fixedText) - { - newSize = sizeWithText(fixedText, nLen, dwFmt, fontName, textSize, tSize.cx, tSize.cy, enableWrap, overflow); - } - else - { - newSize = sizeWithText(pwszBuffer, nLen, dwFmt, fontName, textSize, tSize.cx, tSize.cy, enableWrap, overflow); - } + SIZE newSize = sizeWithText(pwszBuffer, nLen, dwFmt, fontName, textSize, tSize.cx, tSize.cy, enableWrap, overflow); RECT rcText = { 0 }; // if content width is 0, use text size as content size @@ -429,20 +400,12 @@ class BitmapDC SetTextColor(_DC, RGB(255, 255, 255)); // white color // draw text - if (fixedText) - { - nRet = DrawTextW(_DC, fixedText, nLen, &rcText, dwFmt); - } - else - { - nRet = DrawTextW(_DC, pwszBuffer, nLen, &rcText, dwFmt); - } + nRet = DrawTextW(_DC, pwszBuffer, nLen, &rcText, dwFmt); SelectObject(_DC, hOldBmp); SelectObject(_DC, hOldFont); } while (0); CC_SAFE_DELETE_ARRAY(pwszBuffer); - delete[] fixedText; return nRet; } @@ -471,7 +434,7 @@ class BitmapDC if (pwszBuffer) { RemoveFontResource(pwszBuffer); - SendMessage(_wnd, WM_FONTCHANGE, 0, 0); + PostMessage(_wnd, WM_FONTCHANGE, 0, 0); delete[] pwszBuffer; pwszBuffer = nullptr; } @@ -558,4 +521,4 @@ void Device::vibrate(float duration) NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 \ No newline at end of file +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/cocos/platform/win32/CCFileUtils-win32.cpp b/cocos/platform/win32/CCFileUtils-win32.cpp index 42480c2c50f5..d0cc12ebae8e 100644 --- a/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/cocos/platform/win32/CCFileUtils-win32.cpp @@ -36,6 +36,9 @@ THE SOFTWARE. #include #include +#include +#include + using namespace std; #define DECLARE_GUARD std::lock_guard mutexGuard(_mutex) @@ -104,7 +107,7 @@ bool FileUtilsWin32::init() { DECLARE_GUARD; _checkPath(); - _defaultResRootPath = s_resourcePath; + _defaultResRootPath = s_resourcePath + "Resources/"; return FileUtils::init(); } @@ -217,12 +220,12 @@ std::string FileUtilsWin32::getPathForFilename(const std::string& filename, cons return FileUtils::getPathForFilename(unixFileName, unixResolutionDirectory, unixSearchPath); } -std::string FileUtilsWin32::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename) const +std::string FileUtilsWin32::getFullPathForFilenameWithinDirectory(const std::string& strDirectory, const std::string& strFilename) const { std::string unixDirectory = convertPathFormatToUnixStyle(strDirectory); std::string unixFilename = convertPathFormatToUnixStyle(strFilename); - return FileUtils::getFullPathForDirectoryAndFilename(unixDirectory, unixFilename); + return FileUtils::getFullPathForFilenameWithinDirectory(unixDirectory, unixFilename); } void FileUtilsWin32::listFilesRecursively(const std::string& dirPath, std::vector *files) const @@ -271,9 +274,19 @@ void FileUtilsWin32::listFilesRecursively(const std::string& dirPath, std::vecto } } +long FileUtilsWin32::getFileSize(const std::string &filepath) const +{ + struct _stat tmp; + if (_stat(filepath.c_str(), &tmp) == 0) + { + return (long)tmp.st_size; + } + return 0; +} + std::vector FileUtilsWin32::listFiles(const std::string& dirPath) const { - std::string fullpath = fullPathForFilename(dirPath); + std::string fullpath = fullPathForDirectory(dirPath); std::vector files; if (isDirectoryExist(fullpath)) { diff --git a/cocos/platform/win32/CCFileUtils-win32.h b/cocos/platform/win32/CCFileUtils-win32.h index 8c11b14609ec..d1c2fccbef10 100644 --- a/cocos/platform/win32/CCFileUtils-win32.h +++ b/cocos/platform/win32/CCFileUtils-win32.h @@ -112,6 +112,8 @@ class CC_DLL FileUtilsWin32 : public FileUtils virtual FileUtils::Status getContents(const std::string& filename, ResizableBuffer* buffer) const override; + virtual long getFileSize(const std::string &filepath) const override; + /** * Gets full path for filename, resolution directory and search path. * @@ -132,7 +134,7 @@ class CC_DLL FileUtilsWin32 : public FileUtils * @param filename The name of the file. * @return The full path of the file, if the file can't be found, it will return an empty string. */ - virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const override; + virtual std::string getFullPathForFilenameWithinDirectory(const std::string& directory, const std::string& filename) const override; /** * List all files in a directory. diff --git a/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp b/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp deleted file mode 100644 index 89b709088f4f..000000000000 --- a/cocos/platform/win8.1-universal/Cocos2dRenderer.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ - -#include "Cocos2dRenderer.h" -#include "AppDelegate.h" -#include "platform/winrt/CCGLViewImpl-winrt.h" -#include "platform/CCApplication.h" -#include "renderer/CCTextureCache.h" - -// These are used by the shader compilation methods. -#include -#include -#include - -using namespace Platform; -using namespace Windows::UI::Core; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::Graphics::Display; -using namespace cocos2d; - -Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, DisplayOrientations orientation, CoreDispatcher^ dispatcher, Panel^ panel) - : m_app(nullptr) - , m_width(width) - , m_height(height) - , m_dpi(dpi) - , m_dispatcher(dispatcher) - , m_panel(panel) - , m_orientation(orientation) -{ - m_app = new AppDelegate(); -} - -Cocos2dRenderer::~Cocos2dRenderer() -{ - delete m_app; -} - -void Cocos2dRenderer::Resume() -{ - auto director = cocos2d::Director::getInstance(); - auto glview = director->getOpenGLView(); - - if (!glview) - { - GLViewImpl* glview = GLViewImpl::create("Test Cpp"); - glview->setDispatcher(m_dispatcher.Get()); - glview->setPanel(m_panel.Get()); - glview->Create(static_cast(m_width), static_cast(m_height), m_dpi, m_orientation); - director->setOpenGLView(glview); - CCApplication::getInstance()->run(); - } - else - { - Application::getInstance()->applicationWillEnterForeground(); - cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); - } -} - -void Cocos2dRenderer::Pause() -{ - if (Director::getInstance()->getOpenGLView()) { - Application::getInstance()->applicationDidEnterBackground(); - cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent); - } -} - -bool Cocos2dRenderer::AppShouldExit() -{ - return GLViewImpl::sharedOpenGLView()->AppShouldExit(); -} - -void Cocos2dRenderer::DeviceLost() -{ - Pause(); - - auto director = cocos2d::Director::getInstance(); - if (director->getOpenGLView()) { - cocos2d::GL::invalidateStateCache(); - cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms(); - cocos2d::DrawPrimitives::init(); - cocos2d::VolatileTextureMgr::reloadAllTextures(); - - cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED); - director->getEventDispatcher()->dispatchEvent(&recreatedEvent); - director->setGLDefaultValues(); - - Application::getInstance()->applicationWillEnterForeground(); - cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); - } -} - - - -void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi, DisplayOrientations orientation) -{ - auto glView = GLViewImpl::sharedOpenGLView(); - - if (orientation != m_orientation) - { - m_orientation = orientation; - glView->UpdateOrientation(orientation); - } - - if (width != m_width || height != m_height) - { - m_width = width; - m_height = height; - glView->UpdateForWindowSizeChange(static_cast(width), static_cast(height)); - } - - if (dpi != m_dpi) - { - m_dpi = dpi; - glView->SetDPI(m_dpi); - } - - glView->ProcessEvents(); - glView->Render(); -} - -void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args) -{ - GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args); -} - -void Cocos2dRenderer::QueueBackButtonEvent() -{ - GLViewImpl::sharedOpenGLView()->QueueBackKeyPress(); -} - -void Cocos2dRenderer::QueueKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args) -{ - GLViewImpl::sharedOpenGLView()->QueueWinRTKeyboardEvent(type, args); -} diff --git a/cocos/platform/win8.1-universal/Cocos2dRenderer.h b/cocos/platform/win8.1-universal/Cocos2dRenderer.h deleted file mode 100644 index 871452962453..000000000000 --- a/cocos/platform/win8.1-universal/Cocos2dRenderer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ -#pragma once - -#include - - - - -class AppDelegate; - -class Cocos2dRenderer -{ -public: - Cocos2dRenderer(int width, int height, float dpi, - Windows::Graphics::Display::DisplayOrientations orientation, - Windows::UI::Core::CoreDispatcher^ dispatcher, Windows::UI::Xaml::Controls::Panel^ panel); - ~Cocos2dRenderer(); - void Draw(GLsizei width, GLsizei height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation); - void QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); - void QueueKeyboardEvent(cocos2d::WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args); - void QueueBackButtonEvent(); - void Pause(); - void Resume(); - void DeviceLost(); - bool AppShouldExit(); - -private: - - int m_width; - int m_height; - float m_dpi; - - // The AppDelegate for the Cocos2D app - AppDelegate* m_app; - Platform::Agile m_dispatcher; - Platform::Agile m_panel; - Windows::Graphics::Display::DisplayOrientations m_orientation; -}; diff --git a/cocos/platform/win8.1-universal/OpenGLES.cpp b/cocos/platform/win8.1-universal/OpenGLES.cpp deleted file mode 100644 index e1cda61ebe0d..000000000000 --- a/cocos/platform/win8.1-universal/OpenGLES.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ - -#include "OpenGLES.h" -using namespace Platform; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; - -OpenGLES::OpenGLES() : - mEglDisplay(EGL_NO_DISPLAY), - mEglContext(EGL_NO_CONTEXT), - mEglConfig(nullptr) -{ - Initialize(); -} - -OpenGLES::~OpenGLES() -{ - Cleanup(); -} - -void OpenGLES::Initialize() -{ - const EGLint configAttributes[] = - { - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 8, - EGL_STENCIL_SIZE, 8, - EGL_NONE - }; - - const EGLint contextAttributes[] = - { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - - const EGLint defaultDisplayAttributes[] = - { - // These are the default display attributes, used to request ANGLE's D3D11 renderer. - // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+. - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - - // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices. - // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it. - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - - // EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call - // the IDXGIDevice3::Trim method on behalf of the application when it gets suspended. - // Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement. - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, - EGL_NONE, - }; - - const EGLint fl9_3DisplayAttributes[] = - { - // These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3. - // These attributes are used if the call to eglInitialize fails with the default display attributes. - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, - EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, - EGL_NONE, - }; - - const EGLint warpDisplayAttributes[] = - { - // These attributes can be used to request D3D11 WARP. - // They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes. - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, - EGL_NONE, - }; - - EGLConfig config = NULL; - - // eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11. - PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast(eglGetProcAddress("eglGetPlatformDisplayEXT")); - if (!eglGetPlatformDisplayEXT) - { - throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT"); - } - - // - // To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying - // parameters passed to eglGetPlatformDisplayEXT: - // 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+. - // 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again - // using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3. - // 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again - // using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer. - // - - // This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details. - mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes); - if (mEglDisplay == EGL_NO_DISPLAY) - { - throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); - } - - if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) - { - // This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on some mobile devices). - mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes); - if (mEglDisplay == EGL_NO_DISPLAY) - { - throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); - } - - if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) - { - // This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU. - mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes); - if (mEglDisplay == EGL_NO_DISPLAY) - { - throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); - } - - if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) - { - // If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred. - throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL"); - } - } - } - - EGLint numConfigs = 0; - if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0)) - { - throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig"); - } - - mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes); - if (mEglContext == EGL_NO_CONTEXT) - { - throw Exception::CreateException(E_FAIL, L"Failed to create EGL context"); - } -} - -void OpenGLES::Cleanup() -{ - if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT) - { - eglDestroyContext(mEglDisplay, mEglContext); - mEglContext = EGL_NO_CONTEXT; - } - - if (mEglDisplay != EGL_NO_DISPLAY) - { - eglTerminate(mEglDisplay); - mEglDisplay = EGL_NO_DISPLAY; - } -} - -void OpenGLES::Reset() -{ - Cleanup(); - Initialize(); -} - -EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize, const float* resolutionScale) -{ - if (!panel) - { - throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid"); - } - - if (renderSurfaceSize != nullptr && resolutionScale != nullptr) - { - throw Exception::CreateException(E_INVALIDARG, L"A size and a scale can't both be specified"); - } - - EGLSurface surface = EGL_NO_SURFACE; - - const EGLint surfaceAttributes[] = - { - // EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above). - // If you have compilation issues with it then please update your Visual Studio templates. - EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_NONE - }; - - // Create a PropertySet and initialize with the EGLNativeWindowType. - PropertySet^ surfaceCreationProperties = ref new PropertySet(); - surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel); - - // If a render surface size is specified, add it to the surface creation properties - if (renderSurfaceSize != nullptr) - { - surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize)); - } - - // If a resolution scale is specified, add it to the surface creation properties - if (resolutionScale != nullptr) - { - surfaceCreationProperties->Insert(ref new String(EGLRenderResolutionScaleProperty), PropertyValue::CreateSingle(*resolutionScale)); - } - - surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast(surfaceCreationProperties), surfaceAttributes); - if (surface == EGL_NO_SURFACE) - { - throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface"); - } - - return surface; -} - -void OpenGLES::GetSurfaceDimensions(const EGLSurface surface, EGLint* width, EGLint* height) -{ - eglQuerySurface(mEglDisplay, surface, EGL_WIDTH, width); - eglQuerySurface(mEglDisplay, surface, EGL_HEIGHT, height); -} - -void OpenGLES::DestroySurface(const EGLSurface surface) -{ - if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE) - { - eglDestroySurface(mEglDisplay, surface); - } -} - -void OpenGLES::MakeCurrent(const EGLSurface surface) -{ - if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE) - { - throw Exception::CreateException(E_FAIL, L"Failed to make EGLSurface current"); - } -} - -EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface) -{ - return (eglSwapBuffers(mEglDisplay, surface)); -} diff --git a/cocos/platform/win8.1-universal/OpenGLES.h b/cocos/platform/win8.1-universal/OpenGLES.h deleted file mode 100644 index c157ffabd06f..000000000000 --- a/cocos/platform/win8.1-universal/OpenGLES.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ - -#pragma once - -// OpenGL ES includes -#include - -// EGL includes -#include -#include -#include -#include - -class OpenGLES -{ -public: - OpenGLES(); - ~OpenGLES(); - - EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize, const float* renderResolutionScale); - void GetSurfaceDimensions(const EGLSurface surface, EGLint *width, EGLint *height); - void DestroySurface(const EGLSurface surface); - void MakeCurrent(const EGLSurface surface); - EGLBoolean SwapBuffers(const EGLSurface surface); - void Reset(); - void Cleanup(); - -private: - void Initialize(); - -private: - EGLDisplay mEglDisplay; - EGLContext mEglContext; - EGLConfig mEglConfig; -}; diff --git a/cocos/platform/win8.1-universal/OpenGLESPage.xaml b/cocos/platform/win8.1-universal/OpenGLESPage.xaml deleted file mode 100644 index b59232a2fa6f..000000000000 --- a/cocos/platform/win8.1-universal/OpenGLESPage.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp deleted file mode 100644 index e0d4ab2b887a..000000000000 --- a/cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp +++ /dev/null @@ -1,469 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ - -#include "App.xaml.h" -#include "OpenGLESPage.xaml.h" - -using namespace CocosAppWinRT; -using namespace cocos2d; -using namespace Platform; -using namespace Concurrency; -using namespace Windows::Foundation; -using namespace Windows::Graphics::Display; -using namespace Windows::System::Threading; -using namespace Windows::UI::Core; -using namespace Windows::UI::Input; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; - -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900 -using namespace Windows::Phone::UI::Input; -#endif - -OpenGLESPage::OpenGLESPage() : - OpenGLESPage(nullptr) -{ - -} - -OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : - mOpenGLES(openGLES), - mRenderSurface(EGL_NO_SURFACE), - mCoreInput(nullptr), - mDpi(0.0f), - mDeviceLost(false), - mCursorVisible(true), - mVisible(false), - mOrientation(DisplayOrientations::Landscape) -{ - InitializeComponent(); - - Windows::UI::Core::CoreWindow^ window = Windows::UI::Xaml::Window::Current->CoreWindow; - - window->VisibilityChanged += - ref new Windows::Foundation::TypedEventHandler(this, &OpenGLESPage::OnVisibilityChanged); - - window->KeyDown += ref new TypedEventHandler(this, &OpenGLESPage::OnKeyPressed); - - window->KeyUp += ref new TypedEventHandler(this, &OpenGLESPage::OnKeyReleased); - - window->CharacterReceived += ref new TypedEventHandler(this, &OpenGLESPage::OnCharacterReceived); - - - DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); - - currentDisplayInformation->OrientationChanged += - ref new TypedEventHandler(this, &OpenGLESPage::OnOrientationChanged); - - mOrientation = currentDisplayInformation->CurrentOrientation; - - this->Loaded += - ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded); - -#if _MSC_VER >= 1900 - if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.UI.ViewManagement.StatusBar")) - { - Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync(); - } - - if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) - { - HardwareButtons::BackPressed += ref new EventHandler(this, &OpenGLESPage::OnBackButtonPressed); - } -#else -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync(); - HardwareButtons::BackPressed += ref new EventHandler(this, &OpenGLESPage::OnBackButtonPressed); -#else - // Disable all pointer visual feedback for better performance when touching. - // This is not supported on Windows Phone applications. - auto pointerVisualizationSettings = Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView(); - pointerVisualizationSettings->IsContactFeedbackEnabled = false; - pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false; -#endif -#endif - - CreateInput(); -} - -void OpenGLESPage::CreateInput() -{ - // Register our SwapChainPanel to get independent input pointer events - auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^) - { - // The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on. - mCoreInput = swapChainPanel->CreateCoreIndependentInputSource( - Windows::UI::Core::CoreInputDeviceTypes::Mouse | - Windows::UI::Core::CoreInputDeviceTypes::Touch | - Windows::UI::Core::CoreInputDeviceTypes::Pen - ); - - // Register for pointer events, which will be raised on the background thread. - mCoreInput->PointerPressed += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerPressed); - mCoreInput->PointerMoved += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerMoved); - mCoreInput->PointerReleased += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerReleased); - mCoreInput->PointerWheelChanged += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerWheelChanged); - - if (GLViewImpl::sharedOpenGLView() && !GLViewImpl::sharedOpenGLView()->isCursorVisible()) - { - mCoreInput->PointerCursor = nullptr; - } - - // Begin processing input messages as they're delivered. - mCoreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit); - }); - - // Run task on a dedicated high priority background thread. - mInputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced); -} - -OpenGLESPage::~OpenGLESPage() -{ - StopRenderLoop(); - DestroyRenderSurface(); -} - -void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) -{ - // The SwapChainPanel has been created and arranged in the page layout, so EGL can be initialized. - CreateRenderSurface(); - StartRenderLoop(); - mVisible = true; -} - -void OpenGLESPage::CreateRenderSurface() -{ - if (mOpenGLES && mRenderSurface == EGL_NO_SURFACE) - { - // The app can configure the SwapChainPanel which may boost performance. - // By default, this template uses the default configuration. - mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, nullptr, nullptr); - - // You can configure the SwapChainPanel to render at a lower resolution and be scaled up to - // the swapchain panel size. This scaling is often free on mobile hardware. - // - // One way to configure the SwapChainPanel is to specify precisely which resolution it should render at. - // Size customRenderSurfaceSize = Size(800, 600); - // mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, &customRenderSurfaceSize, nullptr); - // - // Another way is to tell the SwapChainPanel to render at a certain scale factor compared to its size. - // e.g. if the SwapChainPanel is 1920x1280 then setting a factor of 0.5f will make the app render at 960x640 - // float customResolutionScale = 0.5f; - // mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, nullptr, &customResolutionScale); - // - } -} - -void OpenGLESPage::DestroyRenderSurface() -{ - if (mOpenGLES) - { - mOpenGLES->DestroySurface(mRenderSurface); - } - mRenderSurface = EGL_NO_SURFACE; -} - -void OpenGLESPage::RecoverFromLostDevice() -{ - critical_section::scoped_lock lock(mRenderSurfaceCriticalSection); - DestroyRenderSurface(); - mOpenGLES->Reset(); - CreateRenderSurface(); - std::unique_lock locker(mSleepMutex); - mDeviceLost = false; - mSleepCondition.notify_one(); -} - -void OpenGLESPage::TerminateApp() -{ - { - critical_section::scoped_lock lock(mRenderSurfaceCriticalSection); - - if (mOpenGLES) - { - mOpenGLES->DestroySurface(mRenderSurface); - mOpenGLES->Cleanup(); - } - } - Windows::UI::Xaml::Application::Current->Exit(); -} - -void OpenGLESPage::StartRenderLoop() -{ - // If the render loop is already running then do not start another thread. - if (mRenderLoopWorker != nullptr && mRenderLoopWorker->Status == Windows::Foundation::AsyncStatus::Started) - { - return; - } - - DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); - mDpi = currentDisplayInformation->LogicalDpi; - - auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher; - - // Create a task for rendering that will be run on a background thread. - auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action) - { - mOpenGLES->MakeCurrent(mRenderSurface); - - GLsizei panelWidth = 0; - GLsizei panelHeight = 0; - mOpenGLES->GetSurfaceDimensions(mRenderSurface, &panelWidth, &panelHeight); - - if (mRenderer.get() == nullptr) - { - mRenderer = std::make_shared(panelWidth, panelHeight, mDpi, mOrientation, dispatcher, swapChainPanel); - } - - mRenderer->Resume(); - - while (action->Status == Windows::Foundation::AsyncStatus::Started) - { - if (!mVisible) - { - mRenderer->Pause(); - } - - // wait until app is visible again or thread is cancelled - while (!mVisible) - { - std::unique_lock lock(mSleepMutex); - mSleepCondition.wait(lock); - - if (action->Status != Windows::Foundation::AsyncStatus::Started) - { - return; // thread was cancelled. Exit thread - } - - if (mVisible) - { - mRenderer->Resume(); - } - else // spurious wake up - { - continue; - } - } - - mOpenGLES->GetSurfaceDimensions(mRenderSurface, &panelWidth, &panelHeight); - mRenderer.get()->Draw(panelWidth, panelHeight, mDpi, mOrientation); - - // Recreate input dispatch - if (GLViewImpl::sharedOpenGLView() && mCursorVisible != GLViewImpl::sharedOpenGLView()->isCursorVisible()) - { - CreateInput(); - mCursorVisible = GLViewImpl::sharedOpenGLView()->isCursorVisible(); - } - - if (mRenderer->AppShouldExit()) - { - // run on main UI thread - swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new DispatchedHandler([=]() - { - TerminateApp(); - })); - - return; - } - - EGLBoolean result = GL_FALSE; - { - critical_section::scoped_lock lock(mRenderSurfaceCriticalSection); - result = mOpenGLES->SwapBuffers(mRenderSurface); - } - - if (result != GL_TRUE) - { - // The call to eglSwapBuffers was not be successful (i.e. due to Device Lost) - // If the call fails, then we must reinitialize EGL and the GL resources. - mRenderer->Pause(); - mDeviceLost = true; - - // XAML objects like the SwapChainPanel must only be manipulated on the UI thread. - swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() - { - RecoverFromLostDevice(); - }, CallbackContext::Any)); - - // wait until OpenGL is reset or thread is cancelled - while (mDeviceLost) - { - std::unique_lock lock(mSleepMutex); - mSleepCondition.wait(lock); - - if (action->Status != Windows::Foundation::AsyncStatus::Started) - { - return; // thread was cancelled. Exit thread - } - - if (!mDeviceLost) - { - mOpenGLES->MakeCurrent(mRenderSurface); - // restart cocos2d-x - mRenderer->DeviceLost(); - } - else // spurious wake up - { - continue; - } - } - } - } - }); - - // Run task on a dedicated high priority background thread. - mRenderLoopWorker = Windows::System::Threading::ThreadPool::RunAsync(workItemHandler, Windows::System::Threading::WorkItemPriority::High, Windows::System::Threading::WorkItemOptions::TimeSliced); -} - -void OpenGLESPage::StopRenderLoop() -{ - if (mRenderLoopWorker) - { - mRenderLoopWorker->Cancel(); - std::unique_lock locker(mSleepMutex); - mSleepCondition.notify_one(); - mRenderLoopWorker = nullptr; - } -} - -void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e) -{ - bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse; - if (mRenderer) - { - mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MousePressed : PointerEventType::PointerPressed, e); - } -} - -void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e) -{ - bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse; - if (mRenderer) - { - mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MouseMoved : PointerEventType::PointerMoved, e); - } -} - -void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e) -{ - bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse; - - if (mRenderer) - { - mRenderer->QueuePointerEvent(isMouseEvent ? PointerEventType::MouseReleased : PointerEventType::PointerReleased, e); - } -} - -void OpenGLESPage::OnPointerWheelChanged(Object^ sender, PointerEventArgs^ e) -{ - bool isMouseEvent = e->CurrentPoint->PointerDevice->PointerDeviceType == Windows::Devices::Input::PointerDeviceType::Mouse; - if (mRenderer && isMouseEvent) - { - mRenderer->QueuePointerEvent(PointerEventType::MouseWheelChanged, e); - } -} - -void OpenGLESPage::OnKeyPressed(CoreWindow^ sender, KeyEventArgs^ e) -{ - //log("OpenGLESPage::OnKeyPressed %d", e->VirtualKey); - if (mRenderer) - { - mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyPressed, e); - } -} - -void OpenGLESPage::OnCharacterReceived(CoreWindow^ sender, CharacterReceivedEventArgs^ e) -{ -#if 0 - if (!e->KeyStatus.WasKeyDown) - { - log("OpenGLESPage::OnCharacterReceived %d", e->KeyCode); - } -#endif -} - -void OpenGLESPage::OnKeyReleased(CoreWindow^ sender, KeyEventArgs^ e) -{ - //log("OpenGLESPage::OnKeyReleased %d", e->VirtualKey); - if (mRenderer) - { - mRenderer->QueueKeyboardEvent(WinRTKeyboardEventType::KeyReleased, e); - } -} - - -void OpenGLESPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args) -{ - mOrientation = sender->CurrentOrientation; -} - -void OpenGLESPage::SetVisibility(bool isVisible) -{ - if (isVisible && mRenderSurface != EGL_NO_SURFACE) - { - if (!mVisible) - { - std::unique_lock locker(mSleepMutex); - mVisible = true; - mSleepCondition.notify_one(); - } - } - else - { - mVisible = false; - } -} - -void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) -{ - if (args->Visible && mRenderSurface != EGL_NO_SURFACE) - { - SetVisibility(true); - } - else - { - SetVisibility(false); - } -} - -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900 -/* -We set args->Handled = true to prevent the app from quitting when the back button is pressed. -This is because this back button event happens on the XAML UI thread and not the cocos2d-x UI thread. -We need to give the game developer a chance to decide to exit the app depending on where they -are in their game. They can receive the back button event by listening for the -EventKeyboard::KeyCode::KEY_ESCAPE event. - -The default behavior is to exit the app if the EventKeyboard::KeyCode::KEY_ESCAPE event -is not handled by the game. -*/ -void OpenGLESPage::OnBackButtonPressed(Object^ sender, BackPressedEventArgs^ args) -{ - if (mRenderer) - { - mRenderer->QueueBackButtonEvent(); - args->Handled = true; - } -} -#endif \ No newline at end of file diff --git a/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h b/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h deleted file mode 100644 index 9fffbad9ca46..000000000000 --- a/cocos/platform/win8.1-universal/OpenGLESPage.xaml.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -* cocos2d-x http://www.cocos2d-x.org -* -* Copyright (c) 2010-2014 - cocos2d-x community -* Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -* -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and limitations under the License. -*/ - -#pragma once - -#include "OpenGLES.h" -#include "OpenGLESPage.g.h" -#include -#include -#include - -#include "Cocos2dRenderer.h" - -namespace CocosAppWinRT -{ - public ref class OpenGLESPage sealed - { - public: - OpenGLESPage(); - virtual ~OpenGLESPage(); - void SetVisibility(bool isVisible); - - internal: - OpenGLESPage(OpenGLES* openGLES); - - private: - void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900 - void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args); -#endif - void CreateRenderSurface(); - void DestroyRenderSurface(); - void RecoverFromLostDevice(); - void TerminateApp(); - void StartRenderLoop(); - void StopRenderLoop(); - - void CreateInput(); - - OpenGLES* mOpenGLES; - std::shared_ptr mRenderer; - - EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page - Concurrency::critical_section mRenderSurfaceCriticalSection; - Windows::Foundation::IAsyncAction^ mRenderLoopWorker; - - // Track user input on a background worker thread. - Windows::Foundation::IAsyncAction^ mInputLoopWorker; - Windows::UI::Core::CoreIndependentInputSource^ mCoreInput; - - // Independent touch and pen handling functions. - void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); - void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); - void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); - void OnPointerWheelChanged(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); - - // Independent keyboard handling functions. - void OnKeyPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); - void OnKeyReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); - - void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args); - - void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); - - float mDpi; - bool mDeviceLost; - bool mVisible; - bool mCursorVisible; - Windows::Graphics::Display::DisplayOrientations mOrientation; - - std::mutex mSleepMutex; - std::condition_variable mSleepCondition; - }; -} diff --git a/cocos/platform/win8.1-universal/cocos2d-js/pch.h b/cocos/platform/win8.1-universal/cocos2d-js/pch.h deleted file mode 100644 index 6e3a12daa1fc..000000000000 --- a/cocos/platform/win8.1-universal/cocos2d-js/pch.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -// -// pch.h -// Header for standard system include files. -// - -#pragma once - -#include "mozilla\Char16.h" -#include "cocos2d.h" -#include "cocos-ext.h" - - diff --git a/cocos/platform/win8.1-universal/pch.cpp b/cocos/platform/win8.1-universal/pch.cpp deleted file mode 100644 index b13a83b5cc02..000000000000 --- a/cocos/platform/win8.1-universal/pch.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "pch.h" diff --git a/cocos/platform/win8.1-universal/pch.h b/cocos/platform/win8.1-universal/pch.h deleted file mode 100644 index 1c4d7fa940d2..000000000000 --- a/cocos/platform/win8.1-universal/pch.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -// -// pch.h -// Header for standard system include files. -// - -#pragma once - -#include -#include - -#include "cocos2d.h" -#include "cocos-ext.h" - - diff --git a/cocos/platform/winrt/CCApplication.cpp b/cocos/platform/winrt/CCApplication.cpp deleted file mode 100644 index 18a1dcd36048..000000000000 --- a/cocos/platform/winrt/CCApplication.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT -#include "platform/winrt/CCGLViewImpl-winrt.h" -using namespace Windows::UI::Core; -using namespace Windows::Foundation; - -#else -#include "platform/wp8/CCGLViewImpl-wp8.h" -#endif -#include "base/CCDirector.h" -#include -#include "platform/CCFileUtils.h" -#include "platform/winrt/CCWinRTUtils.h" -#include "platform/CCApplication.h" -#include "tinyxml2/tinyxml2.h" - -/** -@brief This function change the PVRFrame show/hide setting in register. -@param bEnable If true show the PVRFrame window, otherwise hide. -*/ - -NS_CC_BEGIN - -// sharedApplication pointer -Application * Application::sm_pSharedApplication = nullptr; - - - - - -//////////////////////////////////////////////////////////////////////////////// -// implement Application -//////////////////////////////////////////////////////////////////////////////// - -// sharedApplication pointer -Application * s_pSharedApplication = nullptr; - -Application::Application() : -m_openURLDelegate(nullptr) -{ - m_nAnimationInterval.QuadPart = 0; - CC_ASSERT(! sm_pSharedApplication); - sm_pSharedApplication = this; -} - -Application::~Application() -{ - CC_ASSERT(this == sm_pSharedApplication); - sm_pSharedApplication = nullptr; -} - -int Application::run() -{ - // Initialize instance and cocos2d. - if (!applicationDidFinishLaunching()) - { - return 0; - } - - GLViewImpl::sharedOpenGLView()->Run(); - return 0; -} - -void Application::setAnimationInterval(float interval) -{ - LARGE_INTEGER nFreq; - QueryPerformanceFrequency(&nFreq); - m_nAnimationInterval.QuadPart = (LONGLONG)(interval * nFreq.QuadPart); -} - -void Application::setAnimationInterval(float interval, SetIntervalReason reason) -{ - setAnimationInterval(interval); -} - -////////////////////////////////////////////////////////////////////////// -// static member function -////////////////////////////////////////////////////////////////////////// -Application* Application::getInstance() -{ - CC_ASSERT(sm_pSharedApplication); - return sm_pSharedApplication; -} - -const char * Application::getCurrentLanguageCode() -{ - static std::string code = "en"; - -#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - auto languages = Windows::System::UserProfile::GlobalizationPreferences::Languages; - code = PlatformStringToString(languages->GetAt(0)); -#else - ULONG numLanguages = 0; - DWORD cchLanguagesBuffer = 0; - BOOL result = GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numLanguages, NULL, &cchLanguagesBuffer); - - if (result) { - WCHAR* pwszLanguagesBuffer = new WCHAR[cchLanguagesBuffer]; - result = GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numLanguages, pwszLanguagesBuffer, &cchLanguagesBuffer); - if (result) { - - code = StringWideCharToUtf8(pwszLanguagesBuffer); - } - - if (pwszLanguagesBuffer) - { - delete [] pwszLanguagesBuffer; - } - } - - -#endif - return code.c_str(); -} - - -LanguageType Application::getCurrentLanguage() -{ - const char* code = getCurrentLanguageCode(); - - return utils::getLanguageTypeByISO2(code); -} - -Application::Platform Application::getTargetPlatform() -{ - if (isWindowsPhone()) - { - return Platform::OS_WP8; - } - else - { - return Platform::OS_WINRT; - } -} - -std::string Application::getVersion() -{ - std::string r(""); - std::string s = FileUtils::getInstance()->getStringFromFile("WMAppManifest.xml"); - if (!s.empty()) { - tinyxml2::XMLDocument doc; - if (!doc.Parse(s.c_str())) { - tinyxml2::XMLElement *app = doc.RootElement()->FirstChildElement("App"); - if (app) { - const char* version = app->Attribute("Version"); - if (version) { - r = version; - } - } - } - } - return r; -} - -bool Application::openURL(const std::string &url) -{ -#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - auto dispatcher = cocos2d::GLViewImpl::sharedOpenGLView()->getDispatcher(); - dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([url]() { - auto uri = ref new Windows::Foundation::Uri(PlatformStringFromString(url)); - concurrency::task launchUriOperation(Windows::System::Launcher::LaunchUriAsync(uri)); - })); - return true; -#else - if (m_openURLDelegate) - { - m_openURLDelegate(PlatformStringFromString(url)); - return true; - } - else - { - return false; - } -#endif -} - -void Application::setResourceRootPath(const std::string& rootResDir) -{ - m_resourceRootPath = rootResDir; - std::replace(m_resourceRootPath.begin(), m_resourceRootPath.end(), '\\', '/'); - if (m_resourceRootPath[m_resourceRootPath.length() - 1] != '/') - { - m_resourceRootPath += '/'; - } - FileUtils* pFileUtils = FileUtils::getInstance(); - std::vector searchPaths = pFileUtils->getSearchPaths(); - searchPaths.insert(searchPaths.begin(), m_resourceRootPath); - pFileUtils->setSearchPaths(searchPaths); -} - -const std::string& Application::getResourceRootPath(void) -{ - return m_resourceRootPath; -} - -void Application::setStartupScriptFilename(const std::string& startupScriptFile) -{ - m_startupScriptFilename = startupScriptFile; - std::replace(m_startupScriptFilename.begin(), m_startupScriptFilename.end(), '\\', '/'); -} - -NS_CC_END - - diff --git a/cocos/platform/winrt/CCApplication.h b/cocos/platform/winrt/CCApplication.h deleted file mode 100644 index 182246061771..000000000000 --- a/cocos/platform/winrt/CCApplication.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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_APPLICATION_WINRT_H__ -#define __CC_APPLICATION_WINRT_H__ - -#include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#include "platform/CCStdC.h" -#include "platform/CCCommon.h" -#include "platform/CCApplicationProtocol.h" -#include "platform/winrt/InputEvent.h" -#include - -NS_CC_BEGIN - - -class CC_DLL Application : public ApplicationProtocol -{ -public: - Application(); - virtual ~Application(); - - /** - @brief Run the message loop. - */ - int run(); - - /** - @brief Get current application instance. - @return Current application instance pointer. - */ - static Application* getInstance(); - - /* override functions */ - virtual void setAnimationInterval(float interval) override; - virtual void setAnimationInterval(float interval, SetIntervalReason reason) override; - - virtual LanguageType getCurrentLanguage() override; - virtual const char * getCurrentLanguageCode() override; - - /** - @brief Get target platform - */ - virtual Platform getTargetPlatform() override; - - /** - @brief Get application version - */ - virtual std::string getVersion() override; - - /** - @brief Open url in default browser - @param String with url to open. - @return true if the resource located by the URL was successfully opened; otherwise false. - */ - virtual bool openURL(const std::string &url); - - /** - @brief Set the callback responsible for opening a URL. - @param del The delegate that will handle opening a URL. We can't pass back a Platform::String due to name clash. - */ - void SetXamlOpenURLDelegate(const std::function& del) - { - m_openURLDelegate = del; - } - - /** - * Sets the Resource root path. - * @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); - - /** - * Gets the Resource root path. - * @deprecated Please use CCFileUtils::sharedFileUtils()->getSearchPaths() instead. - */ - CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void); - - void setStartupScriptFilename(const std::string& startupScriptFile); - - const std::string& getStartupScriptFilename(void) - { - return m_startupScriptFilename; - } - -protected: - LARGE_INTEGER m_nAnimationInterval; - std::string m_resourceRootPath; - std::string m_startupScriptFilename; - - std::function m_openURLDelegate; - - static Application * sm_pSharedApplication; -}; - -NS_CC_END - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - -#endif // __CC_APPLICATION_WINRT_H__ diff --git a/cocos/platform/winrt/CCCommon.cpp b/cocos/platform/winrt/CCCommon.cpp deleted file mode 100644 index 890cc8ef73b7..000000000000 --- a/cocos/platform/winrt/CCCommon.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCCommon.h" -#include "platform/CCStdC.h" -#include "platform/winrt/CCGLViewImpl-winrt.h" -#include "platform/winrt/CCWinRTUtils.h" - -#if defined(VLD_DEBUG_MEMORY) -#include -#endif - -NS_CC_BEGIN - - -void MessageBox(const char * pszMsg, const char * pszTitle) -{ - // Create the message dialog and set its content - Platform::String^ message = PlatformStringFromString(pszMsg); - Platform::String^ title = PlatformStringFromString(pszTitle); - GLViewImpl::sharedOpenGLView()->ShowMessageBox(title, message); -} - - -void CCLuaLog(const char *pszMsg) -{ -#if defined(COCOS2D_DEBUG) - int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0); - WCHAR* widebuff = new WCHAR[bufflen + 1]; - memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1)); - MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen); - - - OutputDebugStringW(widebuff); - OutputDebugStringA("\n"); - - bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL); - char* buff = new char[bufflen + 1]; - memset(buff, 0, sizeof(char) * (bufflen + 1)); - WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL); - puts(buff); - - delete[] widebuff; - delete[] buff; -#endif -} - -NS_CC_END diff --git a/cocos/platform/winrt/CCDevice.cpp b/cocos/platform/winrt/CCDevice.cpp deleted file mode 100644 index 6ca544b8883d..000000000000 --- a/cocos/platform/winrt/CCDevice.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#include "platform/CCDevice.h" -#include "platform/CCFileUtils.h" -#include "platform/winrt/CCFreeTypeFont.h" -#include "platform/winrt/CCWinRTUtils.h" -#include "platform/CCStdC.h" -#include "platform/winrt/CCGLViewImpl-winrt.h" - -using namespace Windows::Graphics::Display; -using namespace Windows::Devices::Sensors; -using namespace Windows::Foundation; -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -using namespace Windows::Phone::Devices::Notification; -#endif // (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - -NS_CC_BEGIN - -CCFreeTypeFont sFT; - -int Device::getDPI() -{ - return cocos2d::GLViewImpl::sharedOpenGLView()->GetDPI(); -} - -static Accelerometer^ sAccelerometer = nullptr; - - -void Device::setAccelerometerEnabled(bool isEnabled) -{ - static Windows::Foundation::EventRegistrationToken sToken; - static bool sEnabled = false; - - // we always need to reset the accelerometer - if (sAccelerometer) - { - sAccelerometer->ReadingChanged -= sToken; - sAccelerometer = nullptr; - sEnabled = false; - } - - if (isEnabled) - { - sAccelerometer = Accelerometer::GetDefault(); - - if(sAccelerometer == nullptr) - { - // It's not a friendly experience and may cause crash. - //MessageBox("This device does not have an accelerometer.","Alert"); - log("This device does not have an accelerometer."); - return; - } - - setAccelerometerInterval(0.0f); - sEnabled = true; - - sToken = sAccelerometer->ReadingChanged += ref new TypedEventHandler - - ([](Accelerometer^ a, AccelerometerReadingChangedEventArgs^ e) - { - if (!sEnabled) - { - return; - } - - AccelerometerReading^ reading = e->Reading; - cocos2d::Acceleration acc; - acc.x = reading->AccelerationX; - acc.y = reading->AccelerationY; - acc.z = reading->AccelerationZ; - acc.timestamp = 0; - - auto orientation = GLViewImpl::sharedOpenGLView()->getDeviceOrientation(); - - if (isWindowsPhone()) - { - switch (orientation) - { - case DisplayOrientations::Portrait: - acc.x = reading->AccelerationX; - acc.y = reading->AccelerationY; - break; - - case DisplayOrientations::Landscape: - acc.x = -reading->AccelerationY; - acc.y = reading->AccelerationX; - break; - - case DisplayOrientations::PortraitFlipped: - acc.x = -reading->AccelerationX; - acc.y = reading->AccelerationY; - break; - - case DisplayOrientations::LandscapeFlipped: - acc.x = reading->AccelerationY; - acc.y = -reading->AccelerationX; - break; - - default: - acc.x = reading->AccelerationX; - acc.y = reading->AccelerationY; - break; - } - } - else // Windows Store App - { - // from http://msdn.microsoft.com/en-us/library/windows/apps/dn440593 - switch (orientation) - { - case DisplayOrientations::Portrait: - acc.x = reading->AccelerationY; - acc.y = -reading->AccelerationX; - break; - - case DisplayOrientations::Landscape: - acc.x = reading->AccelerationX; - acc.y = reading->AccelerationY; - break; - - case DisplayOrientations::PortraitFlipped: - acc.x = -reading->AccelerationY; - acc.y = reading->AccelerationX; - break; - - case DisplayOrientations::LandscapeFlipped: - acc.x = -reading->AccelerationX; - acc.y = -reading->AccelerationY; - break; - - default: - acc.x = reading->AccelerationY; - acc.y = -reading->AccelerationX; - break; - } - } - - std::shared_ptr event(new AccelerometerEvent(acc)); - cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(event); - }); - } -} - -void Device::setAccelerometerInterval(float interval) -{ - if (sAccelerometer) - { - try { - int minInterval = sAccelerometer->MinimumReportInterval; - int reqInterval = (int) interval; - sAccelerometer->ReportInterval = reqInterval < minInterval ? minInterval : reqInterval; - } - catch (Platform::COMException^) - { - CCLOG("Device::setAccelerometerInterval not supported on this device"); - } - } - else - { - CCLOG("Device::setAccelerometerInterval: accelerometer not enabled."); - } -} - - - -Data Device::getTextureDataForText(const char * text, const FontDefinition& textDefinition, TextAlign align, int &width, int &height, bool& hasPremultipliedAlpha) -{ - Data ret; - ssize_t dataLen; - - unsigned char* data = sFT.initWithString(text, textDefinition, align, width, height, dataLen); - - if (data) - { - ret.fastSet(data, dataLen); - hasPremultipliedAlpha = false; - } - - return ret; -} - -void Device::setKeepScreenOn(bool /*value*/) -{ -} - -void Device::vibrate(float duration) -{ -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - Windows::Foundation::TimeSpan timespan; - // A time period expressed in 100-nanosecond units, see https://msdn.microsoft.com/en-us/library/windows/apps/windows.foundation.timespan.aspx - // The duration is limited to a maximum of 5 seconds, see https://msdn.microsoft.com/en-us/library/windows/apps/windows.phone.devices.notification.vibrationdevice.aspx - timespan.Duration = std::min(static_cast(duration * 10000), 50000); - - VibrationDevice^ testVibrationDevice = VibrationDevice::GetDefault(); - testVibrationDevice->Vibrate(timespan); -#endif // (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -} - -NS_CC_END - -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp deleted file mode 100644 index afacc7fe4d68..000000000000 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ /dev/null @@ -1,472 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/winrt/CCFileUtilsWinRT.h" -#include -#include "platform/winrt/CCWinRTUtils.h" -#include "platform/CCCommon.h" -#include "tinydir/tinydir.h" -using namespace std; - -NS_CC_BEGIN - -static std::string s_pszResourcePath; - -// D:\aaa\bbb\ccc\ddd\abc.txt --> D:/aaa/bbb/ccc/ddd/abc.txt -static inline std::string convertPathFormatToUnixStyle(const std::string& path) -{ - std::string ret = path; - size_t len = ret.length(); - for (size_t i = 0; i < len; ++i) - { - if (ret[i] == '\\') - { - ret[i] = '/'; - } - } - return ret; -} - -static std::string UTF8StringToMultiByte(const std::string& strUtf8) -{ - std::string ret; - if (!strUtf8.empty()) - { - std::wstring strWideChar = StringUtf8ToWideChar(strUtf8); - int nNum = WideCharToMultiByte(CP_ACP, 0, strWideChar.c_str(), -1, nullptr, 0, nullptr, FALSE); - if (nNum) - { - char* ansiString = new char[nNum + 1]; - ansiString[0] = 0; - - nNum = WideCharToMultiByte(CP_ACP, 0, strWideChar.c_str(), -1, ansiString, nNum + 1, nullptr, FALSE); - - ret = ansiString; - delete[] ansiString; - } - else - { - CCLOG("Wrong convert to Ansi code:0x%x", GetLastError()); - } - } - - return ret; -} - -static void _checkPath() -{ - if (s_pszResourcePath.empty()) - { - // TODO: needs to be tested - s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\Resources" + '\\'); - } -} - -FileUtils* FileUtils::getInstance() -{ - if (s_sharedFileUtils == nullptr) - { - s_sharedFileUtils = new CCFileUtilsWinRT(); - if(!s_sharedFileUtils->init()) - { - delete s_sharedFileUtils; - s_sharedFileUtils = nullptr; - CCLOG("ERROR: Could not init CCFileUtilsWinRT"); - } - } - return s_sharedFileUtils; -} - -CCFileUtilsWinRT::CCFileUtilsWinRT() -{ -} - -bool CCFileUtilsWinRT::init() -{ - _checkPath(); - _defaultResRootPath = s_pszResourcePath; - return FileUtils::init(); -} - -std::string CCFileUtilsWinRT::getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath) const -{ - std::string unixFileName = convertPathFormatToUnixStyle(filename); - std::string unixResolutionDirectory = convertPathFormatToUnixStyle(resolutionDirectory); - std::string unixSearchPath = convertPathFormatToUnixStyle(searchPath); - - return FileUtils::getPathForFilename(unixFileName, unixResolutionDirectory, unixSearchPath); -} - -std::string CCFileUtilsWinRT::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename) const -{ - std::string unixDirectory = convertPathFormatToUnixStyle(strDirectory); - std::string unixFilename = convertPathFormatToUnixStyle(strFilename); - return FileUtils::getFullPathForDirectoryAndFilename(unixDirectory, unixFilename); -} - -std::string CCFileUtilsWinRT::getSuitableFOpen(const std::string& filenameUtf8) const -{ - return UTF8StringToMultiByte(filenameUtf8); -} - -long CCFileUtilsWinRT::getFileSize(const std::string &filepath) -{ - WIN32_FILE_ATTRIBUTE_DATA fad; - if (!GetFileAttributesEx(StringUtf8ToWideChar(filepath).c_str(), GetFileExInfoStandard, &fad)) - { - return 0; // error condition, could call GetLastError to find out more - } - LARGE_INTEGER size; - size.HighPart = fad.nFileSizeHigh; - size.LowPart = fad.nFileSizeLow; - return (long)size.QuadPart; -} - -FileUtils::Status CCFileUtilsWinRT::getContents(const std::string& filename, ResizableBuffer* buffer) -{ - if (filename.empty()) - return FileUtils::Status::NotExists; - - // read the file from hardware - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename); - - HANDLE fileHandle = ::CreateFile2(StringUtf8ToWideChar(fullPath).c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING, nullptr); - if (fileHandle == INVALID_HANDLE_VALUE) - return FileUtils::Status::OpenFailed; - - FILE_STANDARD_INFO info = {0}; - if (::GetFileInformationByHandleEx(fileHandle, FileStandardInfo, &info, sizeof(info)) == 0) - { - ::CloseHandle(fileHandle); - return FileUtils::Status::OpenFailed; - } - - if (info.EndOfFile.HighPart > 0) - { - ::CloseHandle(fileHandle); - return FileUtils::Status::TooLarge; - } - - buffer->resize(info.EndOfFile.LowPart); - DWORD sizeRead = 0; - BOOL successed = ::ReadFile(fileHandle, buffer->buffer(), info.EndOfFile.LowPart, &sizeRead, nullptr); - ::CloseHandle(fileHandle); - - if (!successed) - { - buffer->resize(sizeRead); - CCLOG("Get data from file(%s) failed, error code is %s", filename.data(), std::to_string(::GetLastError()).data()); - return FileUtils::Status::ReadFailed; - } - return FileUtils::Status::OK; -} - -bool CCFileUtilsWinRT::isFileExistInternal(const std::string& strFilePath) const -{ - bool ret = false; - FILE * pf = nullptr; - - std::string strPath = strFilePath; - if (!isAbsolutePath(strPath)) - { // Not absolute path, add the default root path at the beginning. - strPath.insert(0, _defaultResRootPath); - } - - strPath = getSuitableFOpen(strPath); - - if (!strPath.empty() && (pf = fopen(strPath.c_str(), "rb"))) - { - ret = true; - fclose(pf); - } - return ret; -} - -bool CCFileUtilsWinRT::isDirectoryExistInternal(const std::string& dirPath) const -{ - WIN32_FILE_ATTRIBUTE_DATA wfad; - std::wstring wdirPath = StringUtf8ToWideChar(dirPath); - if (GetFileAttributesEx(wdirPath.c_str(), GetFileExInfoStandard, &wfad)) - { - return true; - } - return false; -} - -bool CCFileUtilsWinRT::createDirectory(const std::string& path) -{ - CCASSERT(!path.empty(), "Invalid path"); - - if (isDirectoryExist(path)) - return true; - - // Split the path - size_t start = 0; - size_t found = path.find_first_of("/\\", start); - std::string subpath; - std::vector dirs; - - if (found != std::string::npos) - { - while (true) - { - subpath = path.substr(start, found - start + 1); - if (!subpath.empty()) - dirs.push_back(subpath); - start = found + 1; - found = path.find_first_of("/\\", start); - if (found == std::string::npos) - { - if (start < path.length()) - { - dirs.push_back(path.substr(start)); - } - break; - } - } - } - - WIN32_FILE_ATTRIBUTE_DATA wfad; - - if (!(GetFileAttributesEx(StringUtf8ToWideChar(path).c_str(), GetFileExInfoStandard, &wfad))) - { - subpath = ""; - for (unsigned int i = 0, size = dirs.size(); i < size; ++i) - { - subpath += dirs[i]; - if (i > 0 && !isDirectoryExist(subpath)) - { - BOOL ret = CreateDirectory(StringUtf8ToWideChar(subpath).c_str(), NULL); - if (!ret && ERROR_ALREADY_EXISTS != GetLastError()) - { - return false; - } - } - } - } - return true; -} - -bool CCFileUtilsWinRT::removeDirectory(const std::string& path) -{ - std::wstring wpath = StringUtf8ToWideChar(path); - std::wstring files = wpath + L"*.*"; - WIN32_FIND_DATA wfd; - HANDLE search = FindFirstFileEx(files.c_str(), FindExInfoStandard, &wfd, FindExSearchNameMatch, NULL, 0); - bool ret = true; - if (search != INVALID_HANDLE_VALUE) - { - BOOL find = true; - while (find) - { - //. .. - if (wfd.cFileName[0] != '.') - { - std::wstring temp = wpath + wfd.cFileName; - if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - temp += '/'; - ret = ret && this->removeDirectory(StringWideCharToUtf8(temp)); - } - else - { - SetFileAttributes(temp.c_str(), FILE_ATTRIBUTE_NORMAL); - ret = ret && DeleteFile(temp.c_str()); - } - } - find = FindNextFile(search, &wfd); - } - FindClose(search); - } - if (ret && RemoveDirectory(wpath.c_str())) - { - return true; - } - return false; -} - -bool CCFileUtilsWinRT::isAbsolutePath(const std::string& strPath) const -{ - if ( strPath.length() > 2 - && ( (strPath[0] >= 'a' && strPath[0] <= 'z') || (strPath[0] >= 'A' && strPath[0] <= 'Z') ) - && strPath[1] == ':') - { - return true; - } - return false; -} - -bool CCFileUtilsWinRT::removeFile(const std::string &path) -{ - std::wstring wpath = StringUtf8ToWideChar(path); - if (DeleteFile(wpath.c_str())) - { - return true; - } - else - { - CCLOG("Remove file failed with error: %d", GetLastError()); - return false; - } -} - -bool CCFileUtilsWinRT::renameFile(const std::string &oldfullpath, const std::string& newfullpath) -{ - CCASSERT(!oldfullpath.empty(), "Invalid path"); - CCASSERT(!newfullpath.empty(), "Invalid path"); - - std::regex pat("\\/"); - std::string _oldfullpath = std::regex_replace(oldfullpath, pat, "\\"); - std::string _newfullpath = std::regex_replace(newfullpath, pat, "\\"); - - std::wstring _wNewfullpath = StringUtf8ToWideChar(_newfullpath); - - if (FileUtils::getInstance()->isFileExist(_newfullpath)) - { - if (!DeleteFile(_wNewfullpath.c_str())) - { - CCLOGERROR("Fail to delete file %s !Error code is 0x%x", newfullpath.c_str(), GetLastError()); - } - } - - if (MoveFileEx(StringUtf8ToWideChar(_oldfullpath).c_str(), _wNewfullpath.c_str(), - MOVEFILE_REPLACE_EXISTING & MOVEFILE_WRITE_THROUGH)) - { - return true; - } - else - { - CCLOGERROR("Fail to rename file %s to %s !Error code is 0x%x", oldfullpath.c_str(), newfullpath.c_str(), GetLastError()); - return false; - } -} - -bool CCFileUtilsWinRT::renameFile(const std::string &path, const std::string &oldname, const std::string &name) -{ - CCASSERT(!path.empty(), "Invalid path"); - std::string oldPath = path + oldname; - std::string newPath = path + name; - - return renameFile(oldPath, newPath); -} - -string CCFileUtilsWinRT::getWritablePath() const -{ - auto localFolderPath = Windows::Storage::ApplicationData::Current->LocalFolder->Path; - return convertPathFormatToUnixStyle(std::string(PlatformStringToString(localFolderPath)) + '\\'); -} - -void CCFileUtilsWinRT::listFilesRecursively(const std::string& dirPath, std::vector *files) const -{ - std::string fullpath = fullPathForFilename(dirPath); - if (isDirectoryExist(fullpath)) - { - tinydir_dir dir; - std::wstring fullpathstr = StringUtf8ToWideChar(fullpath); - - if (tinydir_open(&dir, &fullpathstr[0]) != -1) - { - while (dir.has_next) - { - tinydir_file file; - if (tinydir_readfile(&dir, &file) == -1) - { - // Error getting file - break; - } - std::string fileName = StringWideCharToUtf8(file.name); - - if (fileName != "." && fileName != "..") - { - std::string filepath = StringWideCharToUtf8(file.path); - if (file.is_dir) - { - filepath.append("/"); - files->push_back(filepath); - listFilesRecursively(filepath, files); - } - else - { - files->push_back(filepath); - } - } - - if (tinydir_next(&dir) == -1) - { - // Error getting next file - break; - } - } - } - tinydir_close(&dir); - } -} - -std::vector CCFileUtilsWinRT::listFiles(const std::string& dirPath) const -{ - std::string fullpath = fullPathForFilename(dirPath); - std::vector files; - if (isDirectoryExist(fullpath)) - { - tinydir_dir dir; - std::wstring fullpathstr = StringUtf8ToWideChar(fullpath); - - if (tinydir_open(&dir, &fullpathstr[0]) != -1) - { - while (dir.has_next) - { - tinydir_file file; - if (tinydir_readfile(&dir, &file) == -1) - { - // Error getting file - break; - } - - std::string filepath = StringWideCharToUtf8(file.path); - if (file.is_dir) - { - filepath.append("/"); - } - files.push_back(filepath); - - if (tinydir_next(&dir) == -1) - { - // Error getting next file - break; - } - } - } - tinydir_close(&dir); - } - return files; -} - -string CCFileUtilsWinRT::getAppPath() -{ - Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current; - return convertPathFormatToUnixStyle(std::string(PlatformStringToString(package->InstalledLocation->Path))); -} - -NS_CC_END diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.h b/cocos/platform/winrt/CCFileUtilsWinRT.h deleted file mode 100644 index ff2c35c7f6e8..000000000000 --- a/cocos/platform/winrt/CCFileUtilsWinRT.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - Copyright (c) Microsoft Open Technologies, Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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_FILEUTILS_WINRT_H__ -#define __CC_FILEUTILS_WINRT_H__ - -#include -#include - -#include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" -#include "base/ccTypes.h" - -NS_CC_BEGIN - -/** - * @addtogroup platform - * @{ - */ - -//! @brief Helper class to handle file operations -class CC_DLL CCFileUtilsWinRT : public FileUtils -{ - friend class FileUtils; -protected: - CCFileUtilsWinRT(); -public: - /* override functions */ - bool init(); - virtual std::string getWritablePath() const; - virtual bool isAbsolutePath(const std::string& strPath) const; - virtual std::string getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath) const override; - virtual std::string getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename) const override; - virtual std::string getSuitableFOpen(const std::string& filenameUtf8) const override; - virtual long getFileSize(const std::string &filepath) override; - virtual FileUtils::Status getContents(const std::string& filename, ResizableBuffer* buffer) override; - static std::string getAppPath(); - - /** - * List all files in a directory. - * - * @param dirPath The path of the directory, it could be a relative or an absolute path. - * @return File paths in a string vector - */ - virtual std::vector listFiles(const std::string& dirPath) const; - - /** - * List all files recursively in a directory. - * - * @param dirPath The path of the directory, it could be a relative or an absolute path. - * @return File paths in a string vector - */ - virtual void listFilesRecursively(const std::string& dirPath, std::vector *files) const; - -private: - virtual bool isFileExistInternal(const std::string& strFilePath) const override; - - /** - * Renames a file under the given directory. - * - * @param path The parent directory path of the file, it must be an absolute path. - * @param oldname The current name of the file. - * @param name The new name of the file. - * @return True if the file have been renamed successfully, false if not. - */ - virtual bool renameFile(const std::string &path, const std::string &oldname, const std::string &name) override; - - - /** - * Renames a file. - * - * @param oldfullpath The current name of the file, including path and name. - * @param newfullpath The new name of the file, including path and name - * @return True if the file have been renamed successfully, false if not. - */ - virtual bool renameFile(const std::string &oldfullpath, const std::string& newfullpath) override; - - /** - * Checks whether a directory exists without considering search paths and resolution orders. - * @param dirPath The directory (with absolute path) to look up for - * @return Returns true if the directory found at the given absolute path, otherwise returns false - */ - virtual bool isDirectoryExistInternal(const std::string& dirPath) const override; - - /** - * Removes a file. - * - * @param filepath The full path of the file, it must be an absolute path. - * @return True if the file have been removed successfully, false if not. - */ - virtual bool removeFile(const std::string &filepath) override; - - /** - * Creates a directory. - * - * @param dirPath The path of the directory, it must be an absolute path. - * @return True if the directory have been created successfully, false if not. - */ - virtual bool createDirectory(const std::string& dirPath) override; - - /** - * Removes a directory. - * - * @param dirPath The full path of the directory, it must be an absolute path. - * @return True if the directory have been removed successfully, false if not. - */ - virtual bool removeDirectory(const std::string& dirPath) override; -}; - -// end of platform group -/// @} - -NS_CC_END - -#endif // __CC_FILEUTILS_WINRT_H__ - diff --git a/cocos/platform/winrt/CCFreeTypeFont.cpp b/cocos/platform/winrt/CCFreeTypeFont.cpp deleted file mode 100644 index 9cfbf6bc2969..000000000000 --- a/cocos/platform/winrt/CCFreeTypeFont.cpp +++ /dev/null @@ -1,754 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org http://cocos2d-x.org - Copyright (c) Microsoft Open Technologies, Inc. - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "platform/winrt/CCFreeTypeFont.h" -#include "base/CCDirector.h" -#include "platform/CCFileUtils.h" - -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -NS_CC_BEGIN - -static map s_fontsNames; -static FT_Library s_FreeTypeLibrary = nullptr; - -const std::string CCFreeTypeFont::DEFAULT_FONT = "arial"; - -CCFreeTypeFont::CCFreeTypeFont() - :m_space(" ") - , m_face(nullptr) -{ - -} - -CCFreeTypeFont::~CCFreeTypeFont() -{ - reset(); -} - -void CCFreeTypeFont::reset() -{ - for(auto& line : m_lines) - { - line->glyphs.clear(); - delete line; - } - - m_lines.clear(); - - if(m_face) - { - FT_Done_Face(m_face); - m_face = nullptr; - } -} - -unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefinition& textDefinition, Device::TextAlign align, int &width, int &height, ssize_t& dataLength) -{ - FT_Error error = 0; - ssize_t size = 0; - unsigned char* pBuffer = nullptr; - unsigned char* data = nullptr; - - Size winSize = Director::getInstance()->getWinSizeInPixels(); - m_windowWidth = (int)winSize.width; - - m_inWidth = textDefinition._dimensions.width; - m_inHeight = textDefinition._dimensions.height; - - m_fontFillColorR = textDefinition._fontFillColor.r; - m_fontFillColorG = textDefinition._fontFillColor.g; - m_fontFillColorB = textDefinition._fontFillColor.b; - m_fontFillColorA = textDefinition._fontAlpha; - -#if 0 - // check the cache for the font file buffer - auto ittFontNames = s_fontsNames.find(textDefinition._fontName); - if(ittFontNames != s_fontsNames.end()) - { - pBuffer = ittFontNames->second.pBuffer; - size = ittFontNames->second.size; - } -#endif // 0 - - - if(!pBuffer) - { - // attempt to load font from Resources fonts folder - pBuffer = loadFont(textDefinition._fontName.c_str(), &size); - if(!pBuffer) - { - // attempt to load font from System fonts folder - pBuffer = loadSystemFont(textDefinition._fontName.c_str(), &size); - } - if(!pBuffer) - { - // attempt to load default font from Resources fonts folder - pBuffer = loadFont(DEFAULT_FONT.c_str(), &size); - } - if(!pBuffer) - { - // attempt to load default font from System fonts folder - pBuffer = loadSystemFont(DEFAULT_FONT.c_str(), &size); - } - - if(!pBuffer) // font not found! - { - return false; - } - -#if 0 - // cache the font file buffer - FontBufferInfo info; - info.pBuffer = pBuffer; - info.size = size; - s_fontsNames[textDefinition._fontName]=info; -#endif // 0 - - } - - m_fontName = textDefinition._fontName; - m_text = text; - - if(!s_FreeTypeLibrary) - { - error = FT_Init_FreeType(&s_FreeTypeLibrary); - } - - if(!error && !m_face) - { - error = FT_New_Memory_Face(s_FreeTypeLibrary, pBuffer, size, 0, &m_face); - } - - if(!error) - { - error = FT_Select_Charmap(m_face, FT_ENCODING_UNICODE); - } - - - if(!error) - { - error = FT_Set_Char_Size(m_face, textDefinition._fontSize << 6, textDefinition._fontSize << 6, 72, 72); - } - - if(!error) - { - error = initGlyphs(text); - } - - if (!error) - { - data = getBitmap(align, width, height, dataLength); - } - - delete [] pBuffer; - - reset(); - - return data; -} - -unsigned char* CCFreeTypeFont::getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength) -{ - int lineNumber = 0; - int totalLines = static_cast(m_lines.size()); - - m_width = m_inWidth ? m_inWidth : m_textWidth; - m_height = m_inHeight ? m_inHeight : m_textHeight; - - unsigned int size = m_width * m_height * 4; - unsigned char* pBuffer = new unsigned char[size]; - dataLength = size; - if(!pBuffer) - { - dataLength = 0; - return nullptr; - } - memset(pBuffer, 0, size); - - for (auto& line : m_lines) - { - FT_Vector pen = getPenForAlignment(line, eAlignMask, lineNumber, totalLines); - drawText(line, pBuffer, &pen); - lineNumber++; - } - width = m_width; - height = m_height; - - return pBuffer; -} - -FT_Vector CCFreeTypeFont::getPenForAlignment(FTLineInfo* pInfo, Device::TextAlign eAlignMask,int lineNumber, int totalLines) -{ - FT_Error error = 0; - FT_Vector pen; - - int top; - int stringWidth = pInfo->bbox.xMax - pInfo->bbox.xMin; - int maxLineNumber = totalLines - 1; - pen.x = 0; - pen.y = 0; - - switch(eAlignMask) - { - case Device::TextAlign::TOP: // Horizontal center and vertical top. - pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); - break; - - case Device::TextAlign::TOP_LEFT: // Horizontal left and vertical top. - pen.x -=pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); - break; - - case Device::TextAlign::TOP_RIGHT: // Horizontal right and vertical top. - pen.x = m_width - stringWidth - pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); - break; - - case Device::TextAlign::BOTTOM_RIGHT: // Horizontal right and vertical bottom. - pen.x = m_width - stringWidth - pInfo->bbox.xMin; - pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight); - break; - - case Device::TextAlign::BOTTOM: // Horizontal center and vertical bottom. - pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin; - pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight); - break; - - case Device::TextAlign::BOTTOM_LEFT: // Horizontal left and vertical bottom. - pen.x -=pInfo->bbox.xMin; - top = (m_height - m_textHeight) / 2; - pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight); - break; - - case Device::TextAlign::CENTER: // Horizontal center and vertical center - pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin; - top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; - break; - - case Device::TextAlign::RIGHT: // Horizontal right and vertical center. - pen.x = m_width - stringWidth - pInfo->bbox.xMin; - top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; - break; - - case Device::TextAlign::LEFT: // Horizontal left and vertical center. - default: - pen.x -=pInfo->bbox.xMin; - top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; - break; - } - - return pen; -} - -void CCFreeTypeFont::drawText(FTLineInfo* pInfo, unsigned char* pBuffer, FT_Vector *pen) -{ - - auto glyphs = pInfo->glyphs; - for (auto& glyph : glyphs) - { - FT_Glyph image = glyph.image; - FT_Error error = FT_Glyph_To_Bitmap(&image, FT_RENDER_MODE_NORMAL, 0, 1); - if (!error) - { - FT_BitmapGlyph bit = (FT_BitmapGlyph)image; - draw_bitmap(pBuffer, &bit->bitmap, pen->x + glyph.pos.x + bit->left,pen->y - bit->top); - FT_Done_Glyph(image); - } - } -} - - -void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_Int x, FT_Int y) -{ - FT_Int i, j, p, q; - FT_Int x_max = x + bitmap->width; - FT_Int y_max = y + bitmap->rows; - float fontAlpha = m_fontFillColorA / 255.0f; - - for (i = x, p = 0; i < x_max; i++, p++) - { - for ( j = y, q = 0; j < y_max; j++, q++ ) - { - if (i < 0 || j < 0 || i >= m_width || j >= m_height) - continue; - - unsigned char value = bitmap->buffer[q * bitmap->width + p]; - - if(value > 0) - { - FT_Int index = (j * m_width * 4) + (i * 4); - pBuffer[index++] = m_fontFillColorR; - pBuffer[index++] = m_fontFillColorG; - pBuffer[index++] = m_fontFillColorB; - pBuffer[index++] = value * fontAlpha; - } - } - } -} - -void CCFreeTypeFont::endLine() -{ - if(m_currentLine) - { - m_lines.push_back(m_currentLine); - m_textWidth = std::max((long)m_textWidth,m_currentLine->bbox.xMax - m_currentLine->bbox.xMin); - m_textHeight += m_lineHeight; - } -} - -void CCFreeTypeFont::newLine() -{ - m_currentLine = new FTLineInfo(); - m_currentLine->width = 0; - m_currentLine->pen.x = 0; - m_currentLine->pen.y = 0; -} - - -FT_Error CCFreeTypeFont::addWord(const std::string& word) -{ - std::vector glyphs; // glyphs for the word - FT_BBox bbox; // bounding box containing all of the glyphs in the word - int maxWidth = m_inWidth ? m_inWidth : m_windowWidth; - std::string newWord; - - if(m_currentLine->width > 0) - { - newWord = ' ' + word; - } - else - { - newWord = word; - } - - FT_Error error = initWordGlyphs(glyphs, newWord, m_currentLine->pen); - if(!error) - { - compute_bbox(glyphs, &bbox); - if(m_currentLine->width == 0 || bbox.xMax <= maxWidth) - { - m_currentLine->glyphs.insert(m_currentLine->glyphs.end(),glyphs.begin(),glyphs.end()); - if(m_currentLine->width == 0) - { - m_currentLine->bbox = bbox; - } - else - { - m_currentLine->bbox.xMax = bbox.xMax; - } - m_currentLine->width = m_currentLine->bbox.xMax - m_currentLine->bbox.xMin; - } - else - { - endLine(); - newLine(); - addWord(word); - } - } - return error; -} - -FT_Error CCFreeTypeFont::initGlyphs(const char* text) -{ - FT_Error error = 0; - std::stringstream stringStream(text); - std::string line; - vector lines; - vector words; - - m_textWidth = 0; - m_textHeight = 0; - // the height of a line of text based on the max height of a glyph in the font size - m_lineHeight = ((m_face->size->metrics.ascender) >> 6) - ((m_face->size->metrics.descender) >> 6); - - m_lines.clear(); - - while(std::getline(stringStream, line) && !error) - { - newLine(); - - std::size_t prev = 0, pos; - while ((pos = line.find_first_of(" ", prev)) != std::string::npos) - { - if (pos > prev) - { - addWord(line.substr(prev, pos-prev)); - } - prev = pos + 1; - } - if (prev < line.length()) - { - addWord(line.substr(prev, std::string::npos)); - } - endLine(); - } - - return error; -} - -// if linewidth > m_inWidth -// get words for line - -void CCFreeTypeFont::initWords(const char* text) -{ - std::stringstream stringStream(text); - std::string line; - vector lines; - vector words; - - while(std::getline(stringStream, line)) - { - lines.push_back(line); - } - - for (auto& line : lines) - { - std::size_t prev = 0, pos; - while ((pos = line.find_first_of(" ';", prev)) != std::string::npos) - { - if (pos > prev) - words.push_back(line.substr(prev, pos-prev)); - prev = pos+1; - } - if (prev < line.length()) - words.push_back(line.substr(prev, std::string::npos)); - } - - for (auto& word : words) - { - std::string foo(word); - } -} - -FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std::string& text, FT_Vector& pen) -{ - FT_GlyphSlot slot = m_face->glyph; - FT_UInt glyph_index; - FT_UInt previous = 0; - FT_Error error = 0; - PGlyph glyph; - unsigned int numGlyphs = 0; - - int num_chars = static_cast(text.size()); - int nBufLen = num_chars + 1; - wchar_t * pwszBuffer = new wchar_t[nBufLen]; - if(!pwszBuffer) - { - return -1; - } - - memset(pwszBuffer,0,nBufLen); - num_chars = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), num_chars, pwszBuffer, nBufLen); - pwszBuffer[num_chars] = '\0'; - - glyphs.clear(); - glyphs.resize(num_chars); - FT_Bool useKerning = FT_HAS_KERNING(m_face); - - for (int n = 0; n < num_chars; n++) - { - glyph = &glyphs[numGlyphs]; - - /* convert character code to glyph index */ - FT_ULong c = pwszBuffer[n]; - glyph_index = FT_Get_Char_Index(m_face, c); - - if (useKerning && previous && glyph_index) - { - FT_Vector delta; - FT_Get_Kerning(m_face, previous, glyph_index, - FT_KERNING_DEFAULT, &delta); - pen.x += delta.x >> 6; - } - - /* store current pen position */ - glyph->pos = pen; - glyph->index = glyph_index; - - /* load glyph image into the slot without rendering */ - error = FT_Load_Glyph(m_face, glyph_index, FT_LOAD_DEFAULT); - if (error) - continue; /* ignore errors, jump to next glyph */ - - /* extract glyph image and store it in our table */ - error = FT_Get_Glyph(m_face->glyph, &glyph->image); - if (error) - continue; /* ignore errors, jump to next glyph */ - - /* translate the glyph image now */ - FT_Glyph_Transform(glyph->image, 0, &glyph->pos); - - /* increment pen position */ - pen.x += slot->advance.x >> 6; - - /* record current glyph index */ - previous = glyph_index; - - numGlyphs++; - } - - CC_SAFE_DELETE_ARRAY(pwszBuffer); - - return error; -} - -void CCFreeTypeFont::compute_bbox(std::vector& glyphs, FT_BBox *abbox) -{ - FT_BBox bbox; - FT_BBox glyph_bbox; - - /* initialize string bbox to "empty" values */ - bbox.xMin = 32000; - bbox.xMax = -32000; - - // use the max and min values for the entire font face - bbox.yMin = (m_face->size->metrics.descender) >> 6; - bbox.yMax = (m_face->size->metrics.ascender) >> 6; - - /* for each glyph image, compute its bounding box, */ - /* translate it, and grow the string bbox */ - for (auto& glyph : glyphs) - { - FT_Glyph_Get_CBox(glyph.image, ft_glyph_bbox_pixels, &glyph_bbox); - - glyph_bbox.xMin += glyph.pos.x; - glyph_bbox.xMax += glyph.pos.x; - glyph_bbox.yMin += glyph.pos.y; - glyph_bbox.yMax += glyph.pos.y; - - if (glyph_bbox.xMin < bbox.xMin) - bbox.xMin = glyph_bbox.xMin; - - if (glyph_bbox.yMin < bbox.yMin) - bbox.yMin = glyph_bbox.yMin; - - if (glyph_bbox.xMax > bbox.xMax) - bbox.xMax = glyph_bbox.xMax; - - if (glyph_bbox.yMax > bbox.yMax) - bbox.yMax = glyph_bbox.yMax; - } - - /* check that we really grew the string bbox */ - if (bbox.xMin > bbox.xMax) - { - bbox.xMin = 0; - bbox.yMin = 0; - bbox.xMax = 0; - bbox.yMax = 0; - } - - /* return string bbox */ - *abbox = bbox; -} - -unsigned char* CCFreeTypeFont::loadFont(const char *pFontName, ssize_t *size) -{ - - - std::string lowerCase(pFontName); - std::string path(pFontName); - - for (unsigned int i = 0, length = lowerCase.length(); i < length; ++i) - { - lowerCase[i] = tolower(lowerCase[i]); - } - - if (lowerCase == "") - { - lowerCase = DEFAULT_FONT; - path = lowerCase; - } - - if (std::string::npos == lowerCase.find("fonts/")) - { - path = "fonts/" + lowerCase; - } - - if (std::string::npos == lowerCase.find(".ttf")) - { - path += ".ttf"; - } - - std::string fullpath = FileUtils::getInstance()->fullPathForFilename(path.c_str()); - - if (fullpath == "") - { - return nullptr; - } - - Data d; - FileUtils::getInstance()->getContents(fullpath, &d); - return d.takeBuffer(size); -} - -unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *size) -{ - std::string aName(pFontName); - unsigned char* pBuffer = nullptr; - HRESULT hr = S_OK; - IDWriteFactory *writeFactory = nullptr; - IDWriteFontCollection *fontCollection = nullptr; - IDWriteFontFamily *fontFamily = nullptr; - IDWriteFont *matchingFont = nullptr; - IDWriteFontFace *fontFace = nullptr; - IDWriteFontFile *fontFile = nullptr; - IDWriteFontFileLoader *fontFileLoader = nullptr; - IDWriteFontFileStream *fontFileStream = nullptr; - UINT32 index; - BOOL exists; - std::wstring fontNameW; - const void *fontFileReferenceKey = nullptr; - UINT32 fontFileReferenceKeySize; - void *fragmentContext = nullptr; - - for (unsigned int i = 0, length = aName.length(); i < length; ++i) - { - aName[i] = tolower(aName[i]); - } - fontNameW.assign(aName.begin(), aName.end()); - - //create the factory - hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast(&writeFactory)); - - if(SUCCEEDED(hr)) - { - //obtain the fonts owned by the machine - hr = writeFactory->GetSystemFontCollection(&fontCollection, TRUE); - } - - //get the font - if(SUCCEEDED(hr)) - { - hr = fontCollection->FindFamilyName(fontNameW.c_str(), &index, &exists); - if(SUCCEEDED(hr) && exists) - { - hr = fontCollection->GetFontFamily(index, &fontFamily); - - if(SUCCEEDED(hr)) - { - hr = fontFamily->GetFirstMatchingFont(DWRITE_FONT_WEIGHT_REGULAR, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &matchingFont); - } - - if(SUCCEEDED(hr)) - { - hr = matchingFont->CreateFontFace(&fontFace); - } - - if(SUCCEEDED(hr)) - { - UINT32 numberOfFiles = 1; - hr = fontFace->GetFiles(&numberOfFiles, &fontFile); - } - - if(SUCCEEDED(hr)) - { - //create the font file stream - hr = fontFile->GetReferenceKey(&fontFileReferenceKey, &fontFileReferenceKeySize); - } - - if(SUCCEEDED(hr)) - { - hr = fontFile->GetLoader(&fontFileLoader); - } - - if(SUCCEEDED(hr)) - { - hr = fontFileLoader->CreateStreamFromKey(fontFileReferenceKey, fontFileReferenceKeySize, &fontFileStream); - } - - if(SUCCEEDED(hr)) - { - //finally get the font file dat - UINT64 fileSize; - const void *fragmentStart = nullptr; - hr = fontFileStream->GetFileSize(&fileSize); - - if(SUCCEEDED(hr)) - { - hr = fontFileStream->ReadFileFragment(&fragmentStart, 0, fileSize, &fragmentContext); - } - - if(SUCCEEDED(hr)) - { - pBuffer = (unsigned char*)malloc((size_t)fileSize); - memcpy(pBuffer, fragmentStart, (size_t)fileSize); - *size = (unsigned long)fileSize; - } - } - } - } - - //clean up all the DWrite stuff - if(fontFileStream) - { - fontFileStream->ReleaseFileFragment(fragmentContext); - fontFileStream->Release(); - } - if(fontFileLoader) - { - fontFileLoader->Release(); - } - if(fontFile) - { - fontFile->Release(); - } - if(fontFace) - { - fontFace->Release(); - } - if(matchingFont) - { - matchingFont->Release(); - } - if(fontFamily) - { - fontFamily->Release(); - } - if(fontCollection) - { - fontCollection->Release(); - } - if(writeFactory) - { - writeFactory->Release(); - } - - return pBuffer; -} - -NS_CC_END diff --git a/cocos/platform/winrt/CCFreeTypeFont.h b/cocos/platform/winrt/CCFreeTypeFont.h deleted file mode 100644 index 3e6ebbb6f388..000000000000 --- a/cocos/platform/winrt/CCFreeTypeFont.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __PLATFORM_WINRT_FREETYPE_H__ -#define __PLATFORM_WINRT_FREETYPE_H__ - -#include "platform/CCCommon.h" -#include "platform/CCDevice.h" -#include -#include -#include - -#define generic GenericFromFreeTypeLibrary -#define internal InternalFromFreeTypeLibrary -#include -#include -#include -#include -#include -#undef generic -#undef internal - -NS_CC_BEGIN - -typedef struct TGlyph_ -{ - FT_UInt index; // glyph index - FT_Vector pos; // glyph origin on the baseline - FT_Glyph image; // glyph image -} TGlyph, *PGlyph; - -typedef struct FontBufferInfo -{ - unsigned char* pBuffer; - unsigned long size; -} FontBufferInfo; - -typedef struct FTWordInfo -{ - std::vector glyphs; // glyphs for the word - FT_BBox bbox; // bounding box containing all of the glyphs in the word -} FTWordInfo; - - -typedef struct FTLineInfo -{ - std::vector glyphs; // glyphs for the line text - FT_BBox bbox; // bounding box containing all of the glyphs in the line - unsigned int width; // width of the line - FT_Vector pen; // current pen position -} FTLineInfo; - - -class CC_DLL CCFreeTypeFont -{ -public: - CCFreeTypeFont(); - ~CCFreeTypeFont(); - - unsigned char* initWithString(const char * text, const FontDefinition& textDefinition, Device::TextAlign align, int &width, int &height, ssize_t& dataLength); - - static const std::string DEFAULT_FONT; - -private: - - unsigned char* getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength); - - - unsigned char* loadFont(const char *pFontName, ssize_t* size); - - unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t* size); - - FT_Error CCFreeTypeFont::initGlyphs(const char* text); - FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std::string& text, FT_Vector& pen); - - void compute_bbox(std::vector& glyphs, FT_BBox *abbox); - - void drawText(FTLineInfo* pInfo, unsigned char* pBuffer, FT_Vector *pen); - - void draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap,FT_Int x,FT_Int y); - - void initWords(const char* text); - - void reset(); - - FT_Vector getPenForAlignment(FTLineInfo* pInfo, Device::TextAlign eAlignMask, int lineNumber, int totalLines); - - FT_Error addWord(const std::string& word); - void newLine(); - void endLine(); - - const std::string m_space; - - std::string m_text; - std::string m_fontName; - FT_Face m_face; - std::vector m_lines; - - int m_inWidth; // requested width of text box - int m_inHeight; // requested height of text box - int m_width; // final bitMap width - int m_height; // final bitMap height - int m_textWidth; // width of text text after word wrapping and line breaks - int m_textHeight; // height of text text after word wrapping and line breaks - int m_lineHeight; // height of a line for the font size - int m_windowWidth; // the width of the window - - FTLineInfo* m_currentLine; // the current line object to add words to. - - int m_fontFillColorR; - int m_fontFillColorG; - int m_fontFillColorB; - int m_fontFillColorA; -}; - -NS_CC_END - -#endif diff --git a/cocos/platform/winrt/CCGL.h b/cocos/platform/winrt/CCGL.h deleted file mode 100644 index becb9eb129b6..000000000000 --- a/cocos/platform/winrt/CCGL.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __CCGL_H__ -#define __CCGL_H__ - -#define GL_BGRA GL_BGRA_EXT -#define glClearDepth glClearDepthf -#define GL_WRITE_ONLY GL_WRITE_ONLY_OES - -#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT -#include "EGL/egl.h" -#include "EGL/eglext.h" -#include "EGL/eglplatform.h" -#include "GLES2/gl2.h" -#include "GLES2/gl2ext.h" -#include "GLES3/gl3.h" - -#define glClearDepth glClearDepthf -#define glDeleteVertexArrays glDeleteVertexArraysOES -#define glGenVertexArrays glGenVertexArraysOES -#define glBindVertexArray glBindVertexArrayOES -#define glMapBuffer glMapBufferOES -#define glUnmapBuffer glUnmapBufferOES - -#define GL_WRITE_ONLY GL_WRITE_ONLY_OES - -#endif - - - -#endif // __CCGL_H__ diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp deleted file mode 100644 index 87d7e9949e78..000000000000 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp +++ /dev/null @@ -1,643 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/winrt/CCGLViewImpl-winrt.h" -#include "base/ccMacros.h" -#include "base/CCDirector.h" -#include "base/CCTouch.h" -#include "base/CCIMEDispatcher.h" -#include "base/CCEventListenerKeyboard.h" -#include "platform/winrt/CCApplication.h" -#include "platform/winrt/CCWinRTUtils.h" -#include "deprecated/CCNotificationCenter.h" -#include "base/CCEventDispatcher.h" -#include "base/CCEventMouse.h" - -#include - -using namespace Platform; -using namespace Concurrency; -using namespace Windows::System; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Graphics::Display; -using namespace Windows::UI::Input; -using namespace Windows::UI::Core; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::System; -using namespace Windows::UI::ViewManagement; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Core; -using namespace Windows::ApplicationModel::Activation; -using namespace Platform; -using namespace Microsoft::WRL; - - -NS_CC_BEGIN - -static GLViewImpl* s_pEglView = nullptr; - -GLViewImpl* GLViewImpl::create(const std::string& viewName) -{ - auto ret = new GLViewImpl; - if(ret && ret->initWithFullScreen(viewName)) - { - ret->autorelease(); - return ret; - } - - return nullptr; -} - -GLViewImpl::GLViewImpl() - : _frameZoomFactor(1.0f) - , _supportTouch(true) - , _isRetina(false) - , _isCursorVisible(true) - , m_lastPointValid(false) - , m_running(false) - , m_initialized(false) - , m_windowClosed(false) - , m_windowVisible(true) - , m_width(0) - , m_height(0) - , m_orientation(DisplayOrientations::Landscape) - , m_appShouldExit(false) - , _lastMouseButtonPressed(EventMouse::MouseButton::BUTTON_UNSET) -{ - s_pEglView = this; - _viewName = "cocos2dx"; - - m_keyboard = ref new KeyBoardWinRT(); - - m_backButtonListener = EventListenerKeyboard::create(); - m_backButtonListener->onKeyReleased = CC_CALLBACK_2(GLViewImpl::BackButtonListener, this); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(m_backButtonListener, INT_MAX); -} - -GLViewImpl::~GLViewImpl() -{ - CC_ASSERT(this == s_pEglView); - s_pEglView = nullptr; - - // TODO: cleanup -} - -bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) -{ - setViewName(viewName); - setFrameSize(rect.size.width, rect.size.height); - setFrameZoomFactor(frameZoomFactor); - return true; -} - -bool GLViewImpl::initWithFullScreen(const std::string& viewName) -{ - return initWithRect(viewName, Rect(0, 0, m_width, m_height), 1.0f); -} - -bool GLViewImpl::Create(float width, float height, float dpi, DisplayOrientations orientation) -{ - m_orientation = orientation; - m_dpi = dpi; - UpdateForWindowSizeChange(width, height); - return true; -} - -void cocos2d::GLViewImpl::setCursorVisible(bool isVisible) -{ - _isCursorVisible = isVisible; -} - -void GLViewImpl::setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher) -{ - m_dispatcher = dispatcher; -} - -void GLViewImpl::setPanel(Windows::UI::Xaml::Controls::Panel^ panel) -{ - m_panel = panel; -} - -void GLViewImpl::setIMEKeyboardState(bool bOpen) -{ - std::string str; - setIMEKeyboardState(bOpen, str); -} - -bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message) -{ - if (m_dispatcher.Get()) - { - m_dispatcher.Get()->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([title, message]() - { - // Show the message dialog - auto msg = ref new Windows::UI::Popups::MessageDialog(message, title); - // Set the command to be invoked when a user presses 'ESC' - msg->CancelCommandIndex = 1; - msg->ShowAsync(); - })); - - return true; - } - return false; -} - -void GLViewImpl::setIMEKeyboardState(bool bOpen, const std::string& str) -{ - if(bOpen) - { - m_keyboard->ShowKeyboard(PlatformStringFromString(str)); - } - else - { - m_keyboard->HideKeyboard(PlatformStringFromString(str)); - } -} - -void GLViewImpl::swapBuffers() -{ - -} - -bool GLViewImpl::isOpenGLReady() -{ - return true; -} - -void GLViewImpl::end() -{ - m_windowClosed = true; - m_appShouldExit = true; -} - -void GLViewImpl::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args) -{ -} - -void GLViewImpl::OnResuming(Platform::Object^ sender, Platform::Object^ args) -{ -} - -// user pressed the Back Key on the phone -void GLViewImpl::OnBackKeyPress() -{ - cocos2d::EventKeyboard::KeyCode cocos2dKey = EventKeyboard::KeyCode::KEY_ESCAPE; - cocos2d::EventKeyboard event(cocos2dKey, false); - cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); -} - -void GLViewImpl::BackButtonListener(EventKeyboard::KeyCode keyCode, Event* event) -{ - if (keyCode == EventKeyboard::KeyCode::KEY_ESCAPE) - { - CCLOG("*********************************************************************"); - CCLOG("GLViewImpl::BackButtonListener: Exiting application!"); - CCLOG(""); - CCLOG("If you want to listen for Windows Phone back button events,"); - CCLOG("add a listener for EventKeyboard::KeyCode::KEY_ESCAPE"); - CCLOG("Make sure you call stopPropagation() on the Event if you don't"); - CCLOG("want your app to exit when the back button is pressed."); - CCLOG(""); - CCLOG("For example, add the following to your scene..."); - CCLOG("auto listener = EventListenerKeyboard::create();"); - CCLOG("listener->onKeyReleased = CC_CALLBACK_2(HelloWorld::onKeyReleased, this);"); - CCLOG("getEventDispatcher()->addEventListenerWithFixedPriority(listener, 1);"); - CCLOG(""); - CCLOG("void HelloWorld::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event)"); - CCLOG("{"); - CCLOG(" if (keyCode == EventKeyboard::KeyCode::KEY_ESCAPE)"); - CCLOG(" {"); - CCLOG(" if (myAppShouldNotQuit) // or whatever logic you want..."); - CCLOG(" {"); - CCLOG(" event->stopPropagation();"); - CCLOG(" }"); - CCLOG(" }"); - CCLOG("}"); - CCLOG(""); - CCLOG("You MUST call event->stopPropagation() if you don't want your app to quit!"); - CCLOG("*********************************************************************"); - - Director::getInstance()->end(); - } -} - -bool GLViewImpl::AppShouldExit() -{ - return m_appShouldExit; -} - -void GLViewImpl::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) -{ - OnPointerPressed(args); -} - -void GLViewImpl::OnPointerPressed(PointerEventArgs^ args) -{ - intptr_t id = args->CurrentPoint->PointerId; - Vec2 pt = GetPoint(args); - handleTouchesBegin(1, &id, &pt.x, &pt.y); -} - -void GLViewImpl::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) -{ - float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta; - intptr_t id = 0; - Vec2 p(0.0f,0.0f); - handleTouchesBegin(1, &id, &p.x, &p.y); - p.y += direction; - handleTouchesMove(1, &id, &p.x, &p.y); - handleTouchesEnd(1, &id, &p.x, &p.y); -} - -void GLViewImpl::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) -{ - m_windowVisible = args->Visible; -} - -void GLViewImpl::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) -{ - m_windowClosed = true; -} - -void GLViewImpl::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) -{ - OnPointerMoved(args); -} - -void GLViewImpl::OnPointerMoved( PointerEventArgs^ args) -{ - auto currentPoint = args->CurrentPoint; - if (currentPoint->IsInContact) - { - if (m_lastPointValid) - { - intptr_t id = args->CurrentPoint->PointerId; - Vec2 p = GetPoint(args); - handleTouchesMove(1, &id, &p.x, &p.y); - } - m_lastPoint = currentPoint->Position; - m_lastPointValid = true; - } - else - { - m_lastPointValid = false; - } -} - -void GLViewImpl::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) -{ - OnPointerReleased(args); -} - -void GLViewImpl::OnPointerReleased(PointerEventArgs^ args) -{ - intptr_t id = args->CurrentPoint->PointerId; - Vec2 pt = GetPoint(args); - handleTouchesEnd(1, &id, &pt.x, &pt.y); -} - -void cocos2d::GLViewImpl::OnMousePressed(Windows::UI::Core::PointerEventArgs^ args) -{ - Vec2 mousePosition = GetPointMouse(args); - - // Emulated touch, if left mouse button - if (args->CurrentPoint->Properties->IsLeftButtonPressed) - { - intptr_t id = 0; - Vec2 pt = GetPoint(args); - handleTouchesBegin(1, &id, &pt.x, &pt.y); - } - - if (_lastMouseButtonPressed != EventMouse::MouseButton::BUTTON_UNSET) - { - EventMouse event(EventMouse::MouseEventType::MOUSE_UP); - - event.setMouseButton(_lastMouseButtonPressed); - event.setCursorPosition(mousePosition.x, mousePosition.y); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - } - - EventMouse event(EventMouse::MouseEventType::MOUSE_DOWN); - // Set current button - if (args->CurrentPoint->Properties->IsLeftButtonPressed) - { - _lastMouseButtonPressed = EventMouse::MouseButton::BUTTON_LEFT; - } - else if (args->CurrentPoint->Properties->IsRightButtonPressed) - { - _lastMouseButtonPressed = EventMouse::MouseButton::BUTTON_RIGHT; - } - else if (args->CurrentPoint->Properties->IsMiddleButtonPressed) - { - _lastMouseButtonPressed = EventMouse::MouseButton::BUTTON_MIDDLE; - } - event.setMouseButton(_lastMouseButtonPressed); - event.setCursorPosition(mousePosition.x, mousePosition.y); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); -} - -void cocos2d::GLViewImpl::OnMouseMoved(Windows::UI::Core::PointerEventArgs^ args) -{ - Vec2 mousePosition = GetPointMouse(args); - - // Emulated touch, if left mouse button - if (args->CurrentPoint->Properties->IsLeftButtonPressed) - { - intptr_t id = 0; - Vec2 pt = GetPoint(args); - handleTouchesMove(1, &id, &pt.x, &pt.y); - } - - EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE); - // Set current button - if (args->CurrentPoint->Properties->IsLeftButtonPressed) - { - event.setMouseButton(EventMouse::MouseButton::BUTTON_LEFT); - } - else if (args->CurrentPoint->Properties->IsRightButtonPressed) - { - event.setMouseButton(EventMouse::MouseButton::BUTTON_RIGHT); - } - else if (args->CurrentPoint->Properties->IsMiddleButtonPressed) - { - event.setMouseButton(EventMouse::MouseButton::BUTTON_MIDDLE); - } - event.setCursorPosition(mousePosition.x, mousePosition.y); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); -} - -void cocos2d::GLViewImpl::OnMouseReleased(Windows::UI::Core::PointerEventArgs^ args) -{ - Vec2 mousePosition = GetPointMouse(args); - - // Emulated touch, if left mouse button - if (_lastMouseButtonPressed == EventMouse::MouseButton::BUTTON_LEFT) - { - intptr_t id = 0; - Vec2 pt = GetPoint(args); - handleTouchesEnd(1, &id, &pt.x, &pt.y); - } - - EventMouse event(EventMouse::MouseEventType::MOUSE_UP); - - event.setMouseButton(_lastMouseButtonPressed); - event.setCursorPosition(mousePosition.x, mousePosition.y); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); - - _lastMouseButtonPressed = EventMouse::MouseButton::BUTTON_UNSET; -} - -void cocos2d::GLViewImpl::OnMouseWheelChanged(Windows::UI::Core::PointerEventArgs^ args) -{ - Vec2 mousePosition = GetPointMouse(args); - - EventMouse event(EventMouse::MouseEventType::MOUSE_SCROLL); - - float delta = args->CurrentPoint->Properties->MouseWheelDelta; - - if (args->CurrentPoint->Properties->IsHorizontalMouseWheel) - { - event.setScrollData(delta, 0.0f); - } - else - { - event.setScrollData(0.0f, -delta); - } - - event.setCursorPosition(mousePosition.x, mousePosition.y); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); -} - -void GLViewImpl::resize(int width, int height) -{ - -} - -void GLViewImpl::setFrameZoomFactor(float fZoomFactor) -{ - _frameZoomFactor = fZoomFactor; - Director::getInstance()->setProjection(Director::getInstance()->getProjection()); - //resize(m_obScreenSize.width * fZoomFactor, m_obScreenSize.height * fZoomFactor); -} - -float GLViewImpl::getFrameZoomFactor() -{ - return _frameZoomFactor; -} - -void GLViewImpl::centerWindow() -{ - // not implemented in WinRT. Window is always full screen -} - -GLViewImpl* GLViewImpl::sharedOpenGLView() -{ - return s_pEglView; -} - -int GLViewImpl::Run() -{ - // XAML version does not have a run loop - m_running = true; - return 0; -}; - -void GLViewImpl::Render() -{ - OnRendering(); -} - -void GLViewImpl::OnRendering() -{ - if(m_running && m_initialized) - { - Director::getInstance()->mainLoop(); - } -} - -// called by orientation change from WP8 XAML -void GLViewImpl::UpdateOrientation(DisplayOrientations orientation) -{ - if(m_orientation != orientation) - { - m_orientation = orientation; - UpdateWindowSize(); - } -} - -// called by size change from WP8 XAML -void GLViewImpl::UpdateForWindowSizeChange(float width, float height) -{ - if (width != m_width || height != m_height) - { - m_width = width; - m_height = height; - UpdateWindowSize(); - } -} - -#if 0 -win32 version - -void GLViewEventHandler::OnGLFWWindowSizeFunCallback(GLFWwindow *windows, int width, int height) -{ - auto view = Director::getInstance()->getOpenGLView(); - if(view && view->getResolutionPolicy() != ResolutionPolicy::UNKNOWN) - { - Size resSize=view->getDesignResolutionSize(); - ResolutionPolicy resPolicy=view->getResolutionPolicy(); - view->setFrameSize(width, height); - view->setDesignResolutionSize(resSize.width, resSize.height, resPolicy); - Director::getInstance()->setViewport(); - } -} -#endif - -void GLViewImpl::UpdateWindowSize() -{ - float width, height; - - width = m_width; - height = m_height; - - - //CCSize designSize = getDesignResolutionSize(); - if(!m_initialized) - { - m_initialized = true; - GLView::setFrameSize(width, height); - } - - auto view = Director::getInstance()->getOpenGLView(); - if(view && view->getResolutionPolicy() != ResolutionPolicy::UNKNOWN) - { - Size resSize=view->getDesignResolutionSize(); - ResolutionPolicy resPolicy=view->getResolutionPolicy(); - view->setFrameSize(width, height); - view->setDesignResolutionSize(resSize.width, resSize.height, resPolicy); - auto director = Director::getInstance(); - director->setViewport(); - director->setProjection(director->getProjection()); - } -} - -cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p) -{ - cocos2d::Vec2 returnValue; - - float x = p.X; - float y = p.Y; - returnValue = Vec2(x, y); - -#if 0 - switch (m_orientation) - { - case DisplayOrientations::Portrait: - default: - returnValue = Vec2(x, y); - break; - case DisplayOrientations::Landscape: - returnValue = Vec2(y, m_width - x); - break; - case DisplayOrientations::PortraitFlipped: - returnValue = Vec2(m_width - x, m_height - y); - break; - case DisplayOrientations::LandscapeFlipped: - returnValue = Vec2(m_height - y, x); - break; - } -#endif - - float zoomFactor = GLViewImpl::sharedOpenGLView()->getFrameZoomFactor(); - if(zoomFactor > 0.0f) { - returnValue.x /= zoomFactor; - returnValue.y /= zoomFactor; - } - - // CCLOG("%.2f %.2f : %.2f %.2f", p.X, p.Y,returnValue.x, returnValue.y); - - return returnValue; -} - -Vec2 GLViewImpl::GetPoint(PointerEventArgs^ args) { - - return TransformToOrientation(args->CurrentPoint->Position); -} - -Vec2 GLViewImpl::GetPointMouse(PointerEventArgs^ args) { - - Vec2 position = TransformToOrientation(args->CurrentPoint->Position); - - //Because Windows and cocos2d-x uses different Y axis, we need to convert the coordinate here - position.x = (position.x - _viewPortRect.origin.x) / _scaleX; - position.y = (_viewPortRect.origin.y + _viewPortRect.size.height - position.y) / _scaleY; - - return position; -} - - -void GLViewImpl::QueueBackKeyPress() -{ - std::shared_ptr e(new BackButtonEvent()); - mInputEvents.push(e); -} - -void GLViewImpl::QueuePointerEvent(PointerEventType type, PointerEventArgs^ args) -{ - std::shared_ptr e(new PointerEvent(type, args)); - mInputEvents.push(e); -} - -void GLViewImpl::QueueWinRTKeyboardEvent(WinRTKeyboardEventType type, KeyEventArgs^ args) -{ - std::shared_ptr e(new WinRTKeyboardEvent(type, args)); - mInputEvents.push(e); -} - -void GLViewImpl::OnWinRTKeyboardEvent(WinRTKeyboardEventType type, KeyEventArgs^ args) -{ - m_keyboard->OnWinRTKeyboardEvent(type, args); -} - -void GLViewImpl::QueueEvent(std::shared_ptr& event) -{ - mInputEvents.push(event); -} - -void GLViewImpl::ProcessEvents() -{ - std::shared_ptr e; - while (mInputEvents.try_pop(e)) - { - e->execute(); - } -} - -NS_CC_END diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.h b/cocos/platform/winrt/CCGLViewImpl-winrt.h deleted file mode 100644 index 53a5ea3bf9e0..000000000000 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.h +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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_EGLVIEWIMPL_WINRT_H__ -#define __CC_EGLVIEWIMPL_WINRT_H__ - -#include "platform/winrt/CCStdC.h" -#include "platform/CCCommon.h" -#include "platform/winrt/Keyboard-winrt.h" -#include "platform/CCGLView.h" -#include "base/CCEventKeyboard.h" - -#include -#include -#include -#include -#include - -NS_CC_BEGIN - -class GLViewImpl; - -class CC_DLL GLViewImpl : public GLView -{ -public: - static GLViewImpl* create(const std::string& viewName); - - /* override functions */ - virtual bool isOpenGLReady(); - virtual void end(); - virtual void swapBuffers(); - - Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; - Size getRenerTargetSize() const { return Size(m_width, m_height); } - - virtual void setIMEKeyboardState(bool bOpen) override; - virtual void setIMEKeyboardState(bool bOpen, const std::string& str); - - virtual bool Create(float width, float height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation); - - /** - * Hide or Show the mouse cursor if there is one. - * - * @param isVisible Hide or Show the mouse cursor if there is one. - */ - virtual void setCursorVisible(bool isVisible) override; - - bool isCursorVisible() { return _isCursorVisible; } - - void setDispatcher(Windows::UI::Core::CoreDispatcher^ dispatcher); - Windows::UI::Core::CoreDispatcher^ getDispatcher() {return m_dispatcher.Get();} - - void setPanel(Windows::UI::Xaml::Controls::Panel^ panel); - Windows::UI::Xaml::Controls::Panel^ getPanel() {return m_panel.Get();} - - void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args); - void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args); - void OnPointerReleased(Windows::UI::Core::PointerEventArgs^ args); - - void OnMousePressed(Windows::UI::Core::PointerEventArgs^ args); - void OnMouseMoved(Windows::UI::Core::PointerEventArgs^ args); - void OnMouseReleased(Windows::UI::Core::PointerEventArgs^ args); - void OnMouseWheelChanged(Windows::UI::Core::PointerEventArgs^ args); - - void OnWinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args); - - - void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerMoved(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); - void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); - void OnResuming(Platform::Object^ sender, Platform::Object^ args); - void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); - void OnBackKeyPress(); - bool AppShouldExit(); - void BackButtonListener(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event); - - void QueueBackKeyPress(); - void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); - void QueueWinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args); - void QueueEvent(std::shared_ptr& event); - - bool ShowMessageBox(Platform::String^ title, Platform::String^ message); - - int Run(); - void Render(); - - void resize(int width, int height); - - float getFrameZoomFactor(); - void centerWindow(); - - void UpdateOrientation(Windows::Graphics::Display::DisplayOrientations orientation); - void UpdateForWindowSizeChange(float width, float height); - - void SetDPI(float dpi) { m_dpi = dpi; } - float GetDPI() { return m_dpi; } - - // static function - /** - @brief get the shared main open gl window - */ - static GLViewImpl* sharedOpenGLView(); - - void ProcessEvents(); - -protected: - GLViewImpl(); - virtual ~GLViewImpl(); - - 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. - */ - void setFrameZoomFactor(float zoomFactor); - - inline bool isRetina() { return _isRetina; }; - - float _frameZoomFactor; - bool _supportTouch; - bool _isRetina; - bool _isCursorVisible; - - -private: - CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl); - - void OnRendering(); - void UpdateWindowSize(); - - cocos2d::Vec2 TransformToOrientation(Windows::Foundation::Point point); - cocos2d::Vec2 GetPoint(Windows::UI::Core::PointerEventArgs^ args); - cocos2d::Vec2 GetPointMouse(Windows::UI::Core::PointerEventArgs^ args); - - Windows::Foundation::Rect m_windowBounds; - Windows::Foundation::EventRegistrationToken m_eventToken; - Windows::Foundation::Point m_lastPoint; - - float m_width; - float m_height; - float m_dpi; - - Windows::Graphics::Display::DisplayOrientations m_orientation; - Windows::Foundation::Rect m_keyboardRect; - - bool m_lastPointValid; - bool m_windowClosed; - bool m_windowVisible; - // PointerReleased for mouse not send button id, need save in PointerPressed last button - EventMouse::MouseButton _lastMouseButtonPressed; - - bool m_running; - bool m_initialized; - bool m_appShouldExit; - - Concurrency::concurrent_queue> mInputEvents; - - Platform::Agile m_dispatcher; - Platform::Agile m_panel; - - KeyBoardWinRT^ m_keyboard; - - cocos2d::EventListenerKeyboard* m_backButtonListener; - -}; - -NS_CC_END - -#endif // end of __CC_EGLVIEWIMPL_WINRT_H__ diff --git a/cocos/platform/winrt/CCGLViewImpl.cpp b/cocos/platform/winrt/CCGLViewImpl.cpp deleted file mode 100644 index 82984e5eb6df..000000000000 --- a/cocos/platform/winrt/CCGLViewImpl.cpp +++ /dev/null @@ -1,585 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#include "platform/winrt/CCGLViewImpl.h" -#include "base/ccMacros.h" -#include "base/CCDirector.h" -#include "base/CCTouch.h" -#include "base/CCIMEDispatcher.h" -#include "platform/winrt/CCApplication.h" -#include "platform/winrt/CCWinRTUtils.h" - -#if (_MSC_VER >= 1800) -#include -#endif - - -using namespace Platform; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Graphics::Display; -using namespace Windows::UI::Input; -using namespace Windows::UI::Core; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::System; -using namespace Windows::UI::ViewManagement; - -NS_CC_BEGIN - -static GLViewImpl* s_pEglView = nullptr; - -////////////////////////////////////////////////////////////////////////// -// implement GLView -////////////////////////////////////////////////////////////////////////// - -// Initialize the DirectX resources required to run. -void WinRTWindow::Initialize(CoreWindow^ window, SwapChainBackgroundPanel^ panel) -{ - m_window = window; - //TODO: remove esUtils - //esInitContext ( &m_esContext ); - - ANGLE_D3D_FEATURE_LEVEL featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_1; - -#if (_MSC_VER >= 1800) - // WinRT on Windows 8.1 can compile shaders at run time so we don't care about the DirectX feature level - featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_ANY; -#endif - - - HRESULT result = CreateWinrtEglWindow(WINRT_EGL_IUNKNOWN(panel), featureLevel, m_eglWindow.GetAddressOf()); - - if (!SUCCEEDED(result)) - { - CCLOG("Unable to create Angle EGL Window: %d", result); - return; - } - - m_esContext.hWnd = m_eglWindow; - // width and height are ignored and determined from the CoreWindow the SwapChainBackgroundPanel is in. - - //TODO: remove esUtils - //esCreateWindow ( &m_esContext, TEXT("Cocos2d-x"), 0, 0, ES_WINDOW_RGB | ES_WINDOW_ALPHA | ES_WINDOW_DEPTH | ES_WINDOW_STENCIL ); - - m_window->PointerPressed += - ref new TypedEventHandler(this, &WinRTWindow::OnPointerPressed); - m_window->PointerReleased += - ref new TypedEventHandler(this, &WinRTWindow::OnPointerReleased); - m_window->PointerMoved += - ref new TypedEventHandler(this, &WinRTWindow::OnPointerMoved); - m_window->PointerWheelChanged += - ref new TypedEventHandler(this, &WinRTWindow::OnPointerWheelChanged); - - m_dummy = ref new Button(); - m_dummy->Opacity = 0.0; - m_dummy->Width=1; - m_dummy->Height=1; - m_dummy->IsEnabled = true; - panel->Children->Append(m_dummy); - - m_textBox = ref new TextBox(); - m_textBox->Opacity = 0.0; - m_textBox->Width=1; - m_textBox->Height=1; - m_textBox->MaxLength = 1; - - panel->Children->Append(m_textBox); - m_textBox->AddHandler(UIElement::KeyDownEvent, ref new KeyEventHandler(this, &WinRTWindow::OnTextKeyDown), true); - m_textBox->AddHandler(UIElement::KeyUpEvent, ref new KeyEventHandler(this, &WinRTWindow::OnTextKeyUp), true); - m_textBox->IsEnabled = false; - - auto keyboard = InputPane::GetForCurrentView(); - keyboard->Showing += ref new TypedEventHandler(this, &WinRTWindow::ShowKeyboard); - keyboard->Hiding += ref new TypedEventHandler(this, &WinRTWindow::HideKeyboard); - setIMEKeyboardState(false); -} - -WinRTWindow::WinRTWindow(CoreWindow^ window) : - m_lastPointValid(false), - m_textInputEnabled(false) -{ - window->SizeChanged += - ref new TypedEventHandler(this, &WinRTWindow::OnWindowSizeChanged); - - DisplayProperties::LogicalDpiChanged += - ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnLogicalDpiChanged); - - DisplayProperties::OrientationChanged += - ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnOrientationChanged); - - DisplayProperties::DisplayContentsInvalidated += - ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnDisplayContentsInvalidated); - - m_eventToken = CompositionTarget::Rendering::add(ref new EventHandler(this, &WinRTWindow::OnRendering)); -} - - -void WinRTWindow::swapBuffers() -{ - eglSwapBuffers(m_esContext.eglDisplay, m_esContext.eglSurface); -} - - - -void WinRTWindow::OnSuspending() -{ -#if (_MSC_VER >= 1800) - Microsoft::WRL::ComPtr dxgiDevice; - Microsoft::WRL::ComPtr device = m_eglWindow->GetAngleD3DDevice(); - HRESULT result = device.As(&dxgiDevice); - if (SUCCEEDED(result)) - { - dxgiDevice->Trim(); - } -#endif -} - - -void WinRTWindow::ResizeWindow() -{ - GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(); -} - -cocos2d::Vec2 WinRTWindow::GetCCPoint(PointerEventArgs^ args) { - auto p = args->CurrentPoint; - float x = getScaledDPIValue(p->Position.X); - float y = getScaledDPIValue(p->Position.Y); - Vec2 pt(x, y); - - float zoomFactor = GLViewImpl::sharedOpenGLView()->getFrameZoomFactor(); - - if(zoomFactor > 0.0f) { - pt.x /= zoomFactor; - pt.y /= zoomFactor; - } - return pt; -} - -void WinRTWindow::ShowKeyboard(InputPane^ inputPane, InputPaneVisibilityEventArgs^ args) -{ - GLViewImpl::sharedOpenGLView()->ShowKeyboard(args->OccludedRect); -} - -void WinRTWindow::HideKeyboard(InputPane^ inputPane, InputPaneVisibilityEventArgs^ args) -{ - GLViewImpl::sharedOpenGLView()->HideKeyboard(args->OccludedRect); -} - -void WinRTWindow::setIMEKeyboardState(bool bOpen) -{ - m_textInputEnabled = bOpen; - if(m_textInputEnabled) - { - m_textBox->IsEnabled = true; - m_textBox->Focus(FocusState::Pointer); - } - else - { - m_dummy->Focus(FocusState::Pointer); - m_textBox->IsEnabled = false; - } -} - - - -void WinRTWindow::OnTextKeyDown(Object^ sender, KeyRoutedEventArgs^ args) -{ -#if 0 - if(!m_textInputEnabled) - { - return; - } - - auto key = args->Key; - - switch(key) - { - default: - break; - } -#endif -} - -void WinRTWindow::OnTextKeyUp(Object^ sender, KeyRoutedEventArgs^ args) -{ - if(!m_textInputEnabled) - { - return; - } - - args->Handled = true; - - auto key = args->Key; - - switch(key) - { - case VirtualKey::Escape: - // TODO:: fix me - //Director::getInstance()->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked); - args->Handled = true; - break; - case VirtualKey::Back: - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - break; - case VirtualKey::Enter: - setIMEKeyboardState(false); - IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1); - break; - default: - char szUtf8[8] = {0}; - int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)m_textBox->Text->Data(), 1, szUtf8, sizeof(szUtf8), NULL, NULL); - IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen); - break; - } - m_textBox->Text = ""; -} - - -void WinRTWindow::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) -{ - float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta; - int id = 0; - Vec2 p(0.0f,0.0f); - GLViewImpl::sharedOpenGLView()->handleTouchesBegin(1, &id, &p.x, &p.y); - p.y += direction; - GLViewImpl::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y); - GLViewImpl::sharedOpenGLView()->handleTouchesEnd(1, &id, &p.x, &p.y); -} - -// user pressed the Back Key on the phone -void GLViewImpl::OnBackKeyPress() -{ -#if 0 - if (m_delegate) - { - m_delegate->Invoke(Cocos2dEvent::TerminateApp); - } -#endif // 0 - -} - - -void GLViewImpl::OnPointerPressed(PointerEventArgs^ args) -{ -#if 0 - int id = args->CurrentPoint->PointerId; - Vec2 pt = GetPoint(args); - handleTouchesBegin(1, &id, &pt.x, &pt.y); -#endif -} - -void GLViewImpl::OnPointerMoved(PointerEventArgs^ args) -{ -#if 0 - auto currentPoint = args->CurrentPoint; - if (currentPoint->IsInContact) - { - if (m_lastPointValid) - { - int id = args->CurrentPoint->PointerId; - Vec2 p = GetPoint(args); - handleTouchesMove(1, &id, &p.x, &p.y); - } - m_lastPoint = currentPoint->Position; - m_lastPointValid = true; - } - else - { - m_lastPointValid = false; - } -#endif -} - -void GLViewImpl::OnPointerReleased(PointerEventArgs^ args) -{ -#if 0 - int id = args->CurrentPoint->PointerId; - Vec2 pt = GetPoint(args); - handleTouchesEnd(1, &id, &pt.x, &pt.y); -#endif // 0 - -} - - - -void WinRTWindow::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) -{ - int id = args->CurrentPoint->PointerId; - Vec2 pt = GetCCPoint(args); - GLViewImpl::sharedOpenGLView()->handleTouchesBegin(1, &id, &pt.x, &pt.y); -} - -void WinRTWindow::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) -{ - auto currentPoint = args->CurrentPoint; - if (currentPoint->IsInContact) - { - if (m_lastPointValid) - { - int id = args->CurrentPoint->PointerId; - Vec2 p = GetCCPoint(args); - GLViewImpl::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y); - } - m_lastPoint = currentPoint->Position; - m_lastPointValid = true; - } - else - { - m_lastPointValid = false; - } -} - -void WinRTWindow::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) -{ - int id = args->CurrentPoint->PointerId; - Vec2 pt = GetCCPoint(args); - GLViewImpl::sharedOpenGLView()->handleTouchesEnd(1, &id, &pt.x, &pt.y); -} - -void WinRTWindow::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) -{ - ResizeWindow(); - GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(); -} - -void WinRTWindow::OnLogicalDpiChanged(Object^ sender) -{ - GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(); -} - -void WinRTWindow::OnOrientationChanged(Object^ sender) -{ - ResizeWindow(); - GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(); -} - -void WinRTWindow::OnDisplayContentsInvalidated(Object^ sender) -{ - GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(); -} - -void WinRTWindow::OnRendering(Object^ sender, Object^ args) -{ - GLViewImpl::sharedOpenGLView()->OnRendering(); -} - - -GLViewImpl::GLViewImpl() - : m_window(nullptr) - , m_fFrameZoomFactor(1.0f) - , m_bSupportTouch(false) - , m_lastPointValid(false) - , m_running(false) - , m_winRTWindow(nullptr) - , m_initialized(false) -{ - s_pEglView = this; - _viewName = "Cocos2dxWinRT"; -} - -GLViewImpl::~GLViewImpl() -{ - CC_ASSERT(this == s_pEglView); - s_pEglView = nullptr; - - // TODO: cleanup -} - -bool GLViewImpl::Create(CoreWindow^ window, SwapChainBackgroundPanel^ panel) -{ - bool bRet = false; - m_window = window; - - m_bSupportTouch = true; - m_winRTWindow = ref new WinRTWindow(window); - m_winRTWindow->Initialize(window, panel); - m_initialized = false; - UpdateForWindowSizeChange(); - return bRet; -} - -bool GLViewImpl::isOpenGLReady() -{ - // TODO: need to revisit this - return (m_window.Get() != nullptr); -} - -void GLViewImpl::end() -{ - // TODO: need to implement - -} - -void GLViewImpl::swapBuffers() -{ - m_winRTWindow->swapBuffers(); -} - - -void GLViewImpl::setIMEKeyboardState(bool bOpen) -{ - if(m_winRTWindow) - { - m_winRTWindow->setIMEKeyboardState(bOpen); - } -} - - -void GLViewImpl::resize(int width, int height) -{ - -} - -void GLViewImpl::setFrameZoomFactor(float fZoomFactor) -{ - m_fFrameZoomFactor = fZoomFactor; - resize((int) (_screenSize.width * fZoomFactor), (int) (_screenSize.height * fZoomFactor)); - centerWindow(); - Director::getInstance()->setProjection(Director::getInstance()->getProjection()); -} - - -float GLViewImpl::getFrameZoomFactor() -{ - return m_fFrameZoomFactor; -} - -void GLViewImpl::setFrameSize(float width, float height) -{ - // not implemented in WinRT. Window is always full screen - // GLViewProtocol::setFrameSize(width, height); -} - -void GLViewImpl::centerWindow() -{ - // not implemented in WinRT. Window is always full screen -} - -void GLViewImpl::OnSuspending() -{ - if (m_winRTWindow) - { - m_winRTWindow->OnSuspending(); - } -} - -GLViewImpl* GLViewImpl::sharedOpenGLView() -{ - return s_pEglView; -} - -int GLViewImpl::Run() -{ - m_running = true; - - return 0; -}; - - -void GLViewImpl::OnRendering() -{ - if(m_running && m_initialized) - { - Director::sharedDirector()->mainLoop(); - } -} - -void GLViewImpl::HideKeyboard(Windows::Foundation::Rect r) -{ - return; // not implemented -#if 0 - float height = m_keyboardRect.Height; - float factor = _scaleY / CC_CONTENT_SCALE_FACTOR(); - height = (float)height / factor; - - Rect rect_end(0, 0, 0, 0); - Rect rect_begin(0, 0, _screenSize.width / factor, height); - - IMEKeyboardNotificationInfo info; - info.begin = rect_begin; - info.end = rect_end; - info.duration = 0; - IMEDispatcher::sharedDispatcher()->dispatchKeyboardWillHide(info); - IMEDispatcher::sharedDispatcher()->dispatchKeyboardDidHide(info); -#endif -} - -void GLViewImpl::ShowKeyboard(Windows::Foundation::Rect r) -{ - return; // not implemented -#if 0 - float height = r.Height; - float factor = _scaleY / CC_CONTENT_SCALE_FACTOR(); - height = (float)height / factor; - - Rect rect_begin(0.0f, 0.0f - height, _screenSize.width / factor, height); - Rect rect_end(0.0f, 0.0f, _screenSize.width / factor, height); - - CCIMEKeyboardNotificationInfo info; - info.begin = rect_begin; - info.end = rect_end; - info.duration = 0; - CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardWillShow(info); - CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardDidShow(info); - m_keyboardRect = r; -#endif -} - - -void GLViewImpl::UpdateForWindowSizeChange() -{ - float width = ConvertDipsToPixels(m_window->Bounds.Width); - float height = ConvertDipsToPixels(m_window->Bounds.Height); - - if(!m_initialized) - { - m_initialized = true; - GLView::setFrameSize(width, height); - } - else - { - setFrameSize(width, height); - Size designSize = getDesignResolutionSize(); - GLViewImpl::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL); - Director::sharedDirector()->setProjection(Director::sharedDirector()->getProjection()); - } -} - -void GLViewImpl::QueueEvent(std::shared_ptr& event) -{ - std::lock_guard guard(mMutex); - mInputEvents.push(event); -} - -NS_CC_END - -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/platform/winrt/CCGLViewImpl.h b/cocos/platform/winrt/CCGLViewImpl.h deleted file mode 100644 index 9467a401f75d..000000000000 --- a/cocos/platform/winrt/CCGLViewImpl.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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_EGLVIEWIMPL_WINRT_H__ -#define __CC_EGLVIEWIMPL_WINRT_H__ - -#include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#include "platform/winrt/CCStdC.h" -#include "platform/winrt/CCGL.h" -#include "platform/CCCommon.h" -#include "platform/winrt/InputEvent.h" -#include "platform/CCGLView.h" - -#include - -#include -#include -#include -#include - -NS_CC_BEGIN - -class CCEGL; -class GLViewImpl; - -ref class WinRTWindow sealed -{ - -public: - WinRTWindow(Windows::UI::Core::CoreWindow^ window); - void Initialize(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel); - void setIMEKeyboardState(bool bOpen); - void swapBuffers(); - - -private: - cocos2d::Vec2 GetCCPoint(Windows::UI::Core::PointerEventArgs^ args); - - void OnTextKeyDown(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); - void OnTextKeyUp(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); - - void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerMoved(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); - void OnLogicalDpiChanged(Platform::Object^ sender); - void OnOrientationChanged(Platform::Object^ sender); - void OnDisplayContentsInvalidated(Platform::Object^ sender); - void OnRendering(Platform::Object^ sender, Platform::Object^ args); - void OnSuspending(); - void ResizeWindow(); - - - void ShowKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args); - void HideKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args); - - Platform::Agile m_window; - - Windows::Foundation::Point m_lastPoint; - Windows::Foundation::EventRegistrationToken m_eventToken; - bool m_lastPointValid; - bool m_textInputEnabled; - Microsoft::WRL::ComPtr m_eglWindow; - Windows::UI::Xaml::Controls::TextBox^ m_textBox; - Windows::UI::Xaml::Controls::Button^ m_dummy; - - ESContext m_esContext; - - - friend GLViewImpl; -}; - -class CC_DLL GLViewImpl : public GLView -{ -public: - GLViewImpl(); - virtual ~GLViewImpl(); - - /* override functions */ - virtual bool isOpenGLReady(); - virtual void end(); - virtual void swapBuffers(); - virtual void setFrameSize(float width, float height); - virtual void setIMEKeyboardState(bool bOpen); - void ShowKeyboard(Windows::Foundation::Rect r); - void HideKeyboard(Windows::Foundation::Rect r); - virtual bool Create(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel); - void UpdateForWindowSizeChange(); - void OnRendering(); - void OnSuspending(); - void GLViewImpl::QueueEvent(std::shared_ptr& event); - - void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args); - void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args); - void OnPointerReleased(Windows::UI::Core::PointerEventArgs^ args); - void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnBackKeyPress(); - - -private: - Windows::Foundation::EventRegistrationToken m_eventToken; - Windows::Foundation::Point m_lastPoint; - bool m_lastPointValid; - -public: - - // winrt platform functions - Windows::UI::Core::CoreWindow^ getWindow() { return m_window.Get(); }; - - int Run(); - - void resize(int width, int height); - /* - * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. - */ - void setFrameZoomFactor(float fZoomFactor); - float getFrameZoomFactor(); - void centerWindow(); - - - // static function - /** - @brief get the shared main open gl window - */ - static GLViewImpl* sharedOpenGLView(); - -protected: - -private: - Platform::Agile m_window; - bool m_running; - bool m_initialized; - bool m_bSupportTouch; - float m_fFrameZoomFactor; - WinRTWindow^ m_winRTWindow; - Windows::Foundation::Rect m_keyboardRect; - - std::queue> mInputEvents; - std::mutex mMutex; -}; - -NS_CC_END - -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#endif // end of __CC_EGLVIEWIMPL_WINRT_H__ diff --git a/cocos/platform/winrt/CCPThreadWinRT.cpp b/cocos/platform/winrt/CCPThreadWinRT.cpp deleted file mode 100644 index 0eae3a39ea09..000000000000 --- a/cocos/platform/winrt/CCPThreadWinRT.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#include "platform/winrt/CCPThreadWinRT.h" - -NS_CC_BEGIN - -void pthread_mutex_init(pthread_mutex_t* m, void* attributes) { - *m = CreateMutexEx(NULL,FALSE,0,NULL); -} - -int pthread_mutex_lock(pthread_mutex_t* m) { - return WaitForSingleObjectEx(*m,INFINITE,FALSE); -} - -int pthread_mutex_unlock(pthread_mutex_t* m) { - return ReleaseMutex(*m); -} - -void pthread_mutex_destroy(pthread_mutex_t* m) -{ - if(m) - { - CloseHandle(*m); - } -} - - -NS_CC_END - -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/platform/winrt/CCPThreadWinRT.h b/cocos/platform/winrt/CCPThreadWinRT.h deleted file mode 100644 index 367eb5f99a9a..000000000000 --- a/cocos/platform/winrt/CCPThreadWinRT.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __CCPTHREADWINRT_H__ -#define __CCPTHREADWINRT_H__ - - -#include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include "platform/CCPlatformMacros.h" - - -NS_CC_BEGIN - -typedef HANDLE pthread_t; -typedef HANDLE pthread_mutex_t; -typedef int pthread_cond_t; -#define pthread_cond_wait(x, y) - -void pthread_mutex_init(pthread_mutex_t* m, void* attributes); - -int pthread_mutex_lock(pthread_mutex_t* m); - -int pthread_mutex_unlock(pthread_mutex_t* m); - -void pthread_mutex_destroy(pthread_mutex_t* m); - -#define pthread_cond_destroy(x) -#define pthread_cond_signal(x) -#define pthread_cond_init(x, y) - -NS_CC_END - - -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -#endif // __CCPTHREADWINRT_H__ diff --git a/cocos/platform/winrt/CCPlatformDefine-winrt.h b/cocos/platform/winrt/CCPlatformDefine-winrt.h deleted file mode 100644 index e40c5e4437c5..000000000000 --- a/cocos/platform/winrt/CCPlatformDefine-winrt.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __CCPLATFORMDEFINE_H__ -#define __CCPLATFORMDEFINE_H__ - -#if defined(CC_STATIC) -#define CC_DLL -#else -#if defined(_USRDLL) -#define CC_DLL __declspec(dllexport) -#else /* use a DLL library */ -#define CC_DLL __declspec(dllimport) -#endif -#endif - - - -#include - -#if CC_DISABLE_ASSERT > 0 -#define CC_ASSERT(cond) -#else -#define CC_ASSERT(cond) assert(cond) -#endif -#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam - - -#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/winrt/CCPrecompiledShaders.cpp b/cocos/platform/winrt/CCPrecompiledShaders.cpp deleted file mode 100644 index 4acb74f6f89d..000000000000 --- a/cocos/platform/winrt/CCPrecompiledShaders.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/winrt/CCPrecompiledShaders.h" -#include "platform/winrt/CCWinRTUtils.h" -#include "renderer/CCGLProgram.h" -#include "platform/winrt/sha1.h" - -using namespace Windows::Graphics::Display; -using namespace Windows::Storage; -using namespace Platform; -using namespace Windows::Storage; -using namespace Windows::Storage::Pickers; -using namespace Windows::Storage::Streams; -using namespace concurrency; - -NS_CC_BEGIN - -// singleton stuff -static CCPrecompiledShaders *s_pPrecompiledShaders = nullptr; - -#define SHADER_NAME_PREFIX "s_" - - -CCPrecompiledShaders* CCPrecompiledShaders::getInstance(void) -{ - if (!s_pPrecompiledShaders) - { - s_pPrecompiledShaders = new CCPrecompiledShaders(); - } - - return s_pPrecompiledShaders; -} - -CCPrecompiledShaders::CCPrecompiledShaders(void) - : m_isDirty(false) -{ - Init(); -} - -void CCPrecompiledShaders::Init(void) -{ - m_programs.clear(); - m_precompiledPrograms.clear(); - - // add existing precompiled programs to dictionary - loadPrecompiledPrograms(); -} - -CCPrecompiledShaders::~CCPrecompiledShaders(void) -{ -} - -static std::string computeHash(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) -{ - SHA1Context sha; - int err; - err = SHA1Reset(&sha); - std::string result = ""; - uint8_t hash[SHA1HashSize]; - char hashString[SHA1HashSize * 2 + 1]; - - if(!err) - { - err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,static_cast(strlen(vShaderByteArray))); - } - if(!err) - { - err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray, static_cast(strlen(fShaderByteArray))); - } - if(!err) - { - char* shader_version = (char*) glGetString(GL_SHADING_LANGUAGE_VERSION); - err = SHA1Input(&sha,(const unsigned char *) shader_version, static_cast(strlen(shader_version))); - } - if(!err) - { - err = SHA1Result(&sha, hash); - } - if(!err) - { - SHA1ConvertMessageToString(hash, hashString); - result = hashString; - } - - return result; -} - -std::string CCPrecompiledShaders::addShaders(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) -{ - return computeHash(vShaderByteArray, fShaderByteArray); -} - - -void CCPrecompiledShaders::loadPrecompiledPrograms() -{ - m_precompiledPrograms.clear(); -#if defined(PRECOMPILED_SHADERS) - for(int i = 0; i < s_numPrograms; i++) - { - PrecompiledProgram* p = new PrecompiledProgram(); - p->key = s_programKeys[i]; - p->program = s_programs[i]; - p->length = s_programLengths[i]; - m_precompiledPrograms[s_programKeys[i]] = p; - } -#endif -} - -void CCPrecompiledShaders::addPrecompiledProgram(const char* key, const unsigned char* program, int programLength) -{ - std::string id = key; - PrecompiledProgram* p = nullptr; - auto it = m_precompiledPrograms.find(id); - if (it != m_precompiledPrograms.end()) - { - p = it->second; - } - else - { - p = new PrecompiledProgram(); - m_precompiledPrograms[id] = p; - } - p->key = key; - p->program = program; - p->length = programLength; -} - -bool CCPrecompiledShaders::loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) -{ - std::string id = computeHash(vShaderByteArray, fShaderByteArray); - - auto it = m_precompiledPrograms.find(id); - if(it == m_precompiledPrograms.end()) - return false; - - glProgramBinaryOES(program, GL_PROGRAM_BINARY_ANGLE, (const GLvoid*) it->second->program, it->second->length); - - return true; -} - -bool CCPrecompiledShaders::addProgram(GLuint program, const std::string& id) -{ - int length; - - auto it = m_programs.find(id); - if(it != m_programs.end()) - return true; - - auto it2 = m_precompiledPrograms.find(id); - if(it2 == m_precompiledPrograms.end()) - m_isDirty = true; - - CompiledProgram* p = new CompiledProgram(); - - glGetProgramiv(program, GL_PROGRAM_BINARY_LENGTH_OES, &length); - p->program.reserve(length); - p->length = length; - p->key = id; - GLenum binaryFormat; - glGetProgramBinaryOES(program, length, NULL, &binaryFormat, p->program.data()); - m_programs[id] = p; - - return true; -} - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - -void CCPrecompiledShaders::savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder) -{ - Platform::String ^fileName = L"precompiledshaders.h"; - - auto saveTask = create_task(folder->CreateFileAsync(fileName, CreationCollisionOption::ReplaceExisting)); - - saveTask.then([this](StorageFile^ file) - { - InMemoryRandomAccessStream^ memoryStream = ref new InMemoryRandomAccessStream(); - DataWriter^ dataWriter = ref new DataWriter(memoryStream); - - Platform::String^ programLengths = "const int s_programLengths[] = {"; - Platform::String^ programs = "const unsigned char* s_programs[] = {"; - Platform::String^ programKeys = "const char* s_programKeys[] = {"; - - int numPrograms = 0; - - dataWriter->WriteString(L"#define PRECOMPILED_SHADERS\n\n"); - - - for (auto& iter : m_programs) - { - CompiledProgram* p = (CompiledProgram*)iter.second; - Platform::String^ keyName = PlatformStringFromString(p->key); - Platform::String^ programName = SHADER_NAME_PREFIX + keyName; - - dataWriter->WriteString("const unsigned char "); - dataWriter->WriteString(programName); - dataWriter->WriteString("[] = {\n"); - - char temp[32]; - unsigned char* buffer = p->program.data(); - - for(int i = 0; i < p->length - 1; i++) - { - if(i % 8 == 0) - dataWriter->WriteString("\n"); - sprintf_s(temp, "%3i, ", buffer[i]); - dataWriter->WriteString(PlatformStringFromString(temp)); - } - if((p->length - 1) % 8 == 0) - dataWriter->WriteString("\n"); - sprintf_s(temp, "%3i, ", buffer[p->length - 1]); - dataWriter->WriteString(PlatformStringFromString(temp)); - dataWriter->WriteString("\n};\n\n"); - - if(numPrograms != 0) - { - programLengths += (","); - programs += (","); - programKeys += (","); - } - programLengths += p->length; - programs += programName; - programKeys += "\"" + keyName + "\""; - numPrograms++; - } - - programLengths += "};\n"; - programs += "};\n"; - programKeys += "};\n"; - - Platform::String^ n = ref new Platform::String(L"const int s_numPrograms = "); - n += numPrograms; - n += ";\n"; - - dataWriter->WriteString(n); - dataWriter->WriteString(programLengths); - dataWriter->WriteString(programs); - dataWriter->WriteString(programKeys); - - return FileIO::WriteBufferAsync(file, dataWriter->DetachBuffer()); - }); - -} - -void CCPrecompiledShaders::savePrecompiledShaders() -{ - if(!m_isDirty) - return; - - - FolderPicker^ folderPicker = ref new FolderPicker(); - folderPicker->SuggestedStartLocation = PickerLocationId::Desktop; - folderPicker->FileTypeFilter->Append(".h"); - - auto saveTask = create_task(folderPicker->PickSingleFolderAsync()); - saveTask.then([this](StorageFolder^ folder) - { - if(folder != nullptr) - { - savePrecompiledPrograms(folder); - m_isDirty = false; - } - }); -} -#endif - - - -NS_CC_END - - diff --git a/cocos/platform/winrt/CCPrecompiledShaders.h b/cocos/platform/winrt/CCPrecompiledShaders.h deleted file mode 100644 index 0a13957d8e38..000000000000 --- a/cocos/platform/winrt/CCPrecompiledShaders.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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_PRECOMPILED_SHADERS_H__ -#define __CC_PRECOMPILED_SHADERS_H__ - -#include "platform/CCCommon.h" -#include "platform/winrt/CCGL.h" - -#include -#include -#include - -NS_CC_BEGIN - -typedef struct _PrecompiledProgram -{ - const char* key; - const unsigned char* program; - int length; -} PrecompiledProgram; - -typedef struct _CompiledProgram -{ - std::string key; - std::vector program; - int length; -} CompiledProgram; - - -class CC_DLL CCPrecompiledShaders -{ -public: - CCPrecompiledShaders(); - virtual ~CCPrecompiledShaders(); - - /** - @brief Get current precompiled shaders instance. - @return Current precompiled shaders instance pointer. - */ - static CCPrecompiledShaders* getInstance(); - - void addPrecompiledProgram(const char* key, const unsigned char* program, int programLength); - std::string addShaders(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray); - bool addProgram(GLuint program, const std::string& id); - - bool loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray); - - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - void savePrecompiledShaders(); -#endif - -protected: - void savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder); - void loadPrecompiledPrograms(); - - void Init(); - - std::map m_programs; - std::map m_precompiledPrograms; - - bool m_isDirty; -}; - -NS_CC_END - -#endif // __CC_PRECOMPILED_SHADERS_H__ diff --git a/cocos/platform/winrt/CCStdC.cpp b/cocos/platform/winrt/CCStdC.cpp deleted file mode 100644 index ad3a2d77fc5b..000000000000 --- a/cocos/platform/winrt/CCStdC.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/CCStdC.h" - -int CC_DLL gettimeofday(struct timeval * val, struct timezone *) -{ - if (val) - { - SYSTEMTIME wtm; - GetLocalTime(&wtm); - - struct tm tTm; - tTm.tm_year = wtm.wYear - 1900; - tTm.tm_mon = wtm.wMonth - 1; - tTm.tm_mday = wtm.wDay; - tTm.tm_hour = wtm.wHour; - tTm.tm_min = wtm.wMinute; - tTm.tm_sec = wtm.wSecond; - tTm.tm_isdst = -1; - - val->tv_sec = (long)mktime(&tTm); // time_t is 64-bit on win32 - val->tv_usec = wtm.wMilliseconds * 1000; - } - return 0; -} diff --git a/cocos/platform/winrt/CCStdC.h b/cocos/platform/winrt/CCStdC.h deleted file mode 100644 index 91a5ab102a6e..000000000000 --- a/cocos/platform/winrt/CCStdC.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - - -#include "platform/CCPlatformMacros.h" -#include -#include -#include - -#ifndef __SSIZE_T -#define __SSIZE_T -typedef SSIZE_T ssize_t; -#endif // __SSIZE_T - -// for math.h on win32 platform - -#if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES // make M_PI can be use -#endif - -#if _MSC_VER < 1900 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - -#include -#include -#include -#include -#include -#include - -#ifndef M_PI - #define M_PI 3.14159265358 -#endif -#ifndef M_PI_2 - #define M_PI_2 1.57079632679 -#endif - - -// for MIN MAX and sys/time.h on win32 platform -#ifndef NOMINMAX - #define NOMINMAX -#endif - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#include - -#ifdef WINRT_NO_WINSOCK -#undef timeval -struct timeval -{ - long tv_sec; // seconds - long tv_usec; // microSeconds -}; -#else -// Structure timeval has define in winsock.h, include windows.h for it. -#define _WINSOCKAPI_ -#include -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif -#endif - -struct timezone -{ - int tz_minuteswest; - int tz_dsttime; -}; - -int CC_DLL gettimeofday(struct timeval *, struct timezone *); - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT - -#endif // __CC_STD_C_H__ - diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp deleted file mode 100644 index 2b5ea35ba833..000000000000 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/winrt/CCWinRTUtils.h" -#include -#include -#include -#include -#include -#include "base/ccMacros.h" -#include "platform/CCPlatformMacros.h" -#include "platform/CCFileUtils.h" -#include "base/CCUserDefault.h" - -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; - -NS_CC_BEGIN - -using namespace Windows::Graphics::Display; -using namespace Windows::Storage; -using namespace concurrency; -using namespace Platform; -using namespace Windows::Storage; -using namespace Windows::Storage::Pickers; -using namespace Windows::Storage::Streams; -using namespace Windows::Networking::Connectivity; - -bool isWindowsPhone() -{ -#if _MSC_VER >= 1900 - if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) - return true; - else - return false; -#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - return true; -#else - return false; -#endif -} - -CC_DEPRECATED_ATTRIBUTE std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len /*= -1*/) -{ - if (len == -1) - { - return StringUtf8ToWideChar(pszUtf8Str); - } - else - { - std::wstring ret; - do - { - if (!pszUtf8Str || !len) break; - - // get UTF16 string length - int wLen = MultiByteToWideChar(CP_UTF8, 0, pszUtf8Str, len, 0, 0); - if (0 == wLen || 0xFFFD == wLen) break; - - // convert string - wchar_t * pwszStr = new wchar_t[wLen + 1]; - if (!pwszStr) break; - pwszStr[wLen] = 0; - MultiByteToWideChar(CP_UTF8, 0, pszUtf8Str, len, pwszStr, wLen + 1); - ret = pwszStr; - CC_SAFE_DELETE_ARRAY(pwszStr); - } while (0); - return ret; - } -} - -CC_DEPRECATED_ATTRIBUTE std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr) -{ - return StringWideCharToUtf8(pwszStr); -} - - -std::wstring StringUtf8ToWideChar(const std::string& strUtf8) -{ - std::wstring ret; - if (!strUtf8.empty()) - { - int nNum = MultiByteToWideChar(CP_UTF8, 0, strUtf8.c_str(), -1, nullptr, 0); - if (nNum) - { - WCHAR* wideCharString = new WCHAR[nNum + 1]; - wideCharString[0] = 0; - - nNum = MultiByteToWideChar(CP_UTF8, 0, strUtf8.c_str(), -1, wideCharString, nNum + 1); - - ret = wideCharString; - delete[] wideCharString; - } - else - { - CCLOG("Wrong convert to WideChar code:0x%x", GetLastError()); - } - } - return ret; -} - -std::string StringWideCharToUtf8(const std::wstring& strWideChar) -{ - std::string ret; - if (!strWideChar.empty()) - { - int nNum = WideCharToMultiByte(CP_UTF8, 0, strWideChar.c_str(), -1, nullptr, 0, nullptr, FALSE); - if (nNum) - { - char* utf8String = new char[nNum + 1]; - utf8String[0] = 0; - - nNum = WideCharToMultiByte(CP_UTF8, 0, strWideChar.c_str(), -1, utf8String, nNum + 1, nullptr, FALSE); - - ret = utf8String; - delete[] utf8String; - } - else - { - CCLOG("Wrong convert to Utf8 code:0x%x", GetLastError()); - } - } - - return ret; -} - -std::string PlatformStringToString(Platform::String^ s) { - return StringWideCharToUtf8(std::wstring(s->Data())); -} - -Platform::String^ PlatformStringFromString(const std::string& s) -{ - std::wstring ws = StringUtf8ToWideChar(s); - return ref new Platform::String(ws.data(), static_cast(ws.length())); -} - -#if 0 -// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels. -float ConvertDipsToPixels(float dips) -{ - static const float dipsPerInch = 96.0f; - return floor(dips * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer. -} - -float getScaledDPIValue(float v) { - auto dipFactor = DisplayProperties::LogicalDpi / 96.0f; - return v * dipFactor; -} -#endif - -void CC_DLL CCLogIPAddresses() -{ - auto hostnames = NetworkInformation::GetHostNames(); - int length = hostnames->Size; - - for(int i = 0; i < length; i++) - { - auto hn = hostnames->GetAt(i); - if (hn->IPInformation != nullptr) - { - std::string s = PlatformStringToString(hn->DisplayName); - log("IP Address: %s:", s.c_str()); - } - } -} - -std::string CC_DLL getDeviceIPAddresses() -{ - std::stringstream result; - - auto hostnames = NetworkInformation::GetHostNames(); - int length = hostnames->Size; - - for(int i = 0; i < length; i++) - { - auto hn = hostnames->GetAt(i); - if (hn->IPInformation != nullptr) - { - result << PlatformStringToString(hn->DisplayName) << std::endl; - } - } - - return result.str(); -} - -Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name) -{ - if (parent == nullptr || name == nullptr || name->Length() == 0) - { - return nullptr; - } - - FrameworkElement^ element = dynamic_cast(parent); - if (element == nullptr) - { - return nullptr; - } - - if (element->Name == name) - { - return element; - } - - Panel^ panel = dynamic_cast(element); - if (panel == nullptr) - { - return nullptr; - } - - int count = panel->Children->Size; - for (int i = 0; i < count; i++) - { - auto result = findXamlElement(panel->Children->GetAt(i), name); - if (result != nullptr) - { - return result; - } - } - - return nullptr; -} - - -bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element) -{ - Panel^ panel = dynamic_cast(parent); - if (panel == nullptr) - { - return false; - } - - UIElement^ uiElement = dynamic_cast(element); - if (uiElement == nullptr) - { - return false; - } - - unsigned int index; - if (!panel->Children->IndexOf(uiElement, &index)) - { - return false; - } - - panel->Children->RemoveAt(index); - - return true; -} - -bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove) -{ - Panel^ panel = dynamic_cast(parent); - if (panel == nullptr) - { - return false; - } - - UIElement^ addElement = dynamic_cast(add); - if (addElement == nullptr) - { - return false; - } - - UIElement^ removeElement = dynamic_cast(remove); - if (removeElement == nullptr) - { - return false; - } - - unsigned int index; - if (!panel->Children->IndexOf(removeElement, &index)) - { - return false; - } - - panel->Children->RemoveAt(index); - panel->Children->InsertAt(index, addElement); - - return true; -} - -// Function that reads from a binary file asynchronously. -Concurrency::task^> ReadDataAsync(Platform::String^ path) -{ - using namespace Windows::Storage; - using namespace Concurrency; - - return create_task(StorageFile::GetFileFromPathAsync(path)).then([&](StorageFile^ f) - { - return FileIO::ReadBufferAsync(f); - - }).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array^ - { - auto fileData = ref new Platform::Array(fileBuffer->Length); - Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData); - return fileData; - }); -} - -std::string computeHashForFile(const std::string& filePath) -{ - std::string ret = filePath; - size_t pos = ret.find_last_of('/'); - - if (pos != std::string::npos) { - ret = ret.substr(pos); - } - - pos = ret.find_last_of('.'); - - if (pos != std::string::npos) { - ret = ret.substr(0, pos); - } - - CREATEFILE2_EXTENDED_PARAMETERS extParams = { 0 }; - extParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; - extParams.dwFileFlags = FILE_FLAG_RANDOM_ACCESS; - extParams.dwSecurityQosFlags = SECURITY_ANONYMOUS; - extParams.dwSize = sizeof(extParams); - extParams.hTemplateFile = nullptr; - extParams.lpSecurityAttributes = nullptr; - - Microsoft::WRL::Wrappers::FileHandle file(CreateFile2(std::wstring(filePath.begin(), filePath.end()).c_str(), GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, &extParams)); - - if (file.Get() != INVALID_HANDLE_VALUE) { - FILE_BASIC_INFO fInfo = { 0 }; - if (GetFileInformationByHandleEx(file.Get(), FileBasicInfo, &fInfo, sizeof(FILE_BASIC_INFO))) { - std::stringstream ss; - ss << ret << "_"; - ss << fInfo.CreationTime.QuadPart; - ss << fInfo.ChangeTime.QuadPart; - ret = ss.str(); - } - } - - return ret; -} - -bool createMappedCacheFile(const std::string& srcFilePath, std::string& cacheFilePath, const std::string& ext /* = "" */) -{ - bool ret = false; - auto folderPath = FileUtils::getInstance()->getWritablePath(); - cacheFilePath = folderPath + computeHashForFile(srcFilePath) + ext; - std::string prevFile = UserDefault::getInstance()->getStringForKey(srcFilePath.c_str()); - - if (prevFile == cacheFilePath) { - ret = FileUtils::getInstance()->isFileExist(cacheFilePath); - } - else { - FileUtils::getInstance()->removeFile(prevFile); - } - - UserDefault::getInstance()->setStringForKey(srcFilePath.c_str(), cacheFilePath); - return ret; -} - -void destroyMappedCacheFile(const std::string& key) -{ - std::string value = UserDefault::getInstance()->getStringForKey(key.c_str()); - - if (!value.empty()) { - FileUtils::getInstance()->removeFile(value); - } - - UserDefault::getInstance()->setStringForKey(key.c_str(), ""); -} - -NS_CC_END diff --git a/cocos/platform/winrt/CCWinRTUtils.h b/cocos/platform/winrt/CCWinRTUtils.h deleted file mode 100644 index d29e9f673b86..000000000000 --- a/cocos/platform/winrt/CCWinRTUtils.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __CCWINRT_UTILS_H__ -#define __CCWINRT_UTILS_H__ - -#include "platform/CCPlatformMacros.h" -#include - -#include - -NS_CC_BEGIN - -bool isWindowsPhone(); - -CC_DEPRECATED_ATTRIBUTE std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1); -CC_DEPRECATED_ATTRIBUTE std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr); - -std::wstring CC_DLL StringUtf8ToWideChar(const std::string& strUtf8); -std::string CC_DLL StringWideCharToUtf8(const std::wstring& strWideChar); - -Platform::Object^ findXamlElement(Platform::Object^ parent, Platform::String^ name); -bool removeXamlElement(Platform::Object^ parent, Platform::Object^ element); -bool replaceXamlElement(Platform::Object^ parent, Platform::Object^ add, Platform::Object^ remove); - -std::string PlatformStringToString(Platform::String^ s); -Platform::String^ PlatformStringFromString(const std::string& s); - -Concurrency::task^> ReadDataAsync(Platform::String^ path); - -void CC_DLL CCLogIPAddresses(); - -std::string CC_DLL getDeviceIPAddresses(); - -std::string computeHashForFile(const std::string& filePath); - -// creates a cache file path corresponding to given source file. -// srcFilePath - source file. -// cacheFilePath - cache file path to be used to save cache. -// return true if file already exists -bool createMappedCacheFile(/*In*/ const std::string& srcFilePath, /*Out*/ std::string& cacheFilePath, /*Optional*/ const std::string& ext = ""); -void destroyMappedCacheFile(const std::string& key); - -NS_CC_END - -#endif // __CCWINRT_UTILS_H__ diff --git a/cocos/platform/winrt/InputEvent.cpp b/cocos/platform/winrt/InputEvent.cpp deleted file mode 100644 index 168bc89643c1..000000000000 --- a/cocos/platform/winrt/InputEvent.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 "platform/winrt/InputEvent.h" -#include "platform/winrt/CCWinRTUtils.h" -#include "platform/winrt/CCGLViewImpl-winrt.h" -#include "base/CCEventAcceleration.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" -#include "base/CCIMEDispatcher.h" - -NS_CC_BEGIN - -AccelerometerEvent::AccelerometerEvent(const Acceleration& event) - : m_event(event) -{ - -} - -void AccelerometerEvent::execute() -{ - auto dispatcher = Director::getInstance()->getEventDispatcher(); - cocos2d::EventAcceleration accEvent(m_event); - dispatcher->dispatchEvent(&accEvent); -} - - -PointerEvent::PointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args) - : m_type(type), m_args(args) -{ - -} - -void PointerEvent::execute() -{ - switch(m_type) - { - case PointerEventType::PointerPressed: - GLViewImpl::sharedOpenGLView()->OnPointerPressed(m_args.Get()); - break; - case PointerEventType::PointerMoved: - GLViewImpl::sharedOpenGLView()->OnPointerMoved(m_args.Get()); - break; - case PointerEventType::PointerReleased: - GLViewImpl::sharedOpenGLView()->OnPointerReleased(m_args.Get()); - break; - case cocos2d::MousePressed: - GLViewImpl::sharedOpenGLView()->OnMousePressed(m_args.Get()); - break; - case cocos2d::MouseMoved: - GLViewImpl::sharedOpenGLView()->OnMouseMoved(m_args.Get()); - break; - case cocos2d::MouseReleased: - GLViewImpl::sharedOpenGLView()->OnMouseReleased(m_args.Get()); - break; - case cocos2d::MouseWheelChanged: - GLViewImpl::sharedOpenGLView()->OnMouseWheelChanged(m_args.Get()); - break; - } -} - -KeyboardEvent::KeyboardEvent(Cocos2dKeyEvent type) - : m_type(type), m_text(nullptr) -{ - -} - -KeyboardEvent::KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text) - : m_type(type), m_text(text) -{ - -} - -void KeyboardEvent::execute() -{ - switch(m_type) - { - case Cocos2dKeyEvent::Text: - { - std::string utf8String = PlatformStringToString(m_text.Get()); - IMEDispatcher::sharedDispatcher()->dispatchInsertText(utf8String.c_str(), utf8String.size()); - break; - } - - default: - switch (m_type) - { - case Cocos2dKeyEvent::Escape: - //Director::getInstance()()->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked); - break; - case Cocos2dKeyEvent::Back: - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - break; - case Cocos2dKeyEvent::Enter: - IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1); - break; - default: - break; - } - break; - } -} - -WinRTKeyboardEvent::WinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args) - : m_type(type), m_key(args) -{ -} - -void WinRTKeyboardEvent::execute() -{ - GLViewImpl::sharedOpenGLView()->OnWinRTKeyboardEvent(m_type, m_key.Get()); -} - -BackButtonEvent::BackButtonEvent() -{ - -} - -void BackButtonEvent::execute() -{ - GLViewImpl::sharedOpenGLView()->OnBackKeyPress(); -} - -CustomInputEvent::CustomInputEvent(const std::function& fun) -: m_fun(fun) -{ -} - -void CustomInputEvent::execute() -{ - m_fun(); -} - -UIEditBoxEvent::UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler^ handle) - : m_sender(sender) - , m_text(text) - , m_handler(handle) -{ - -} - -void UIEditBoxEvent::execute() -{ - if (m_handler.Get()) - { - m_handler.Get()->Invoke(m_sender.Get(), m_text.Get()); - } -} - -UIEditBoxEndEvent::UIEditBoxEndEvent(Platform::Object^ sender, Platform::String^ text, int action, Windows::Foundation::EventHandler^ handle) - : m_sender(sender) - , m_text(text) - , m_action(action) - , m_handler(handle) -{ - -} - -void UIEditBoxEndEvent::execute() -{ - if (m_handler.Get()) - { - auto args = ref new EndEventArgs(m_action, m_text.Get()); - m_handler.Get()->Invoke(m_sender.Get(), args); - } -} - -NS_CC_END - - diff --git a/cocos/platform/winrt/InputEvent.h b/cocos/platform/winrt/InputEvent.h deleted file mode 100644 index fda9cb4fde33..000000000000 --- a/cocos/platform/winrt/InputEvent.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __WINRT_INPUT_EVENT__ -#define __WINRT_INPUT_EVENT__ - -#include "platform/CCPlatformMacros.h" -#include "platform/winrt/InputEventTypes.h" -#include "base/ccTypes.h" -#include - -NS_CC_BEGIN - - -enum PointerEventType -{ - PointerPressed, - PointerMoved, - PointerReleased, - MousePressed, - MouseMoved, - MouseReleased, - MouseWheelChanged, -}; -enum MouseButton -{ - Left = 0, - Right = 1, - Middle = 2, - None -}; - -class CC_DLL InputEvent -{ -public: - InputEvent() {}; - virtual ~InputEvent() {}; - virtual void execute() = 0; -}; - - -class CC_DLL AccelerometerEvent : public InputEvent -{ -public: - AccelerometerEvent(const cocos2d::Acceleration& event); - virtual void execute(); - -private: - cocos2d::Acceleration m_event; -}; - -class CC_DLL PointerEvent : public InputEvent -{ -public: - PointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); - virtual void execute(); - - -private: - PointerEventType m_type; - Platform::Agile m_args; -}; - -class CC_DLL KeyboardEvent : public InputEvent - -{ -public: - KeyboardEvent(Cocos2dKeyEvent type); - KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text); - virtual void execute(); - -private: - Cocos2dKeyEvent m_type; - Platform::Agile m_text; -}; - -enum WinRTKeyboardEventType -{ - KeyPressed, - KeyReleased, -}; - -class CC_DLL WinRTKeyboardEvent : public InputEvent -{ -public: - WinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args); - virtual void execute(); - -private: - WinRTKeyboardEventType m_type; - Platform::Agile m_key; -}; - - -class CC_DLL BackButtonEvent : public InputEvent -{ -public: - BackButtonEvent(); - virtual void execute(); -}; - -class CC_DLL CustomInputEvent : public InputEvent -{ -public: - CustomInputEvent(const std::function&); - virtual void execute(); -private: - std::function m_fun; -}; - -class UIEditBoxEvent : public cocos2d::InputEvent -{ -public: - UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler^ handle); - - virtual void execute(); - -protected: - Platform::Agile m_sender; - Platform::Agile m_text; - Platform::Agile^> m_handler; -}; - -ref class EndEventArgs sealed { -public: - EndEventArgs(int action, Platform::String^ text) : m_text(text), m_action(action) {} - int GetAction() { return m_action; } - Platform::String^ GetText() { return m_text; } -private: - int m_action; - Platform::String^ m_text; -}; - -class UIEditBoxEndEvent : public cocos2d::InputEvent -{ -public: - UIEditBoxEndEvent(Platform::Object^ sender, Platform::String^ text, int action, Windows::Foundation::EventHandler^ handle); - virtual void execute(); -protected: - int m_action; - Platform::Agile m_sender; - Platform::Agile m_text; - Platform::Agile^> m_handler; -}; - -NS_CC_END - -#endif // #ifndef __WINRT_INPUT_EVENT__ - diff --git a/cocos/platform/winrt/InputEventTypes.h b/cocos/platform/winrt/InputEventTypes.h deleted file mode 100644 index d9385b1a09cd..000000000000 --- a/cocos/platform/winrt/InputEventTypes.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org -Copyright (c) Microsoft Open Technologies, Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -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 __INPUT_EVENT_TYPES__ -#define __INPUT_EVENT_TYPES__ - - -NS_CC_BEGIN - - -enum class Cocos2dKeyEvent : int -{ - Text, - Escape, - Back, - Enter -}; - -NS_CC_END - - -#endif // #ifndef __INPUT_EVENT_TYPES__ - diff --git a/cocos/platform/winrt/Keyboard-winrt.cpp b/cocos/platform/winrt/Keyboard-winrt.cpp deleted file mode 100644 index e2a37843e255..000000000000 --- a/cocos/platform/winrt/Keyboard-winrt.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -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 "platform/winrt/Keyboard-winrt.h" -#include "base/CCEventKeyboard.h" -#include "platform/winrt/CCGLViewImpl-winrt.h" -#include "base/CCIMEDispatcher.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" - -using namespace cocos2d; -using namespace Platform; -using namespace Windows::System; -using namespace Windows::System::Threading; -using namespace Windows::UI::Core; -using namespace Windows::UI::Input; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Input; - -NS_CC_BEGIN - -struct keyCodeItem -{ - int key; - EventKeyboard::KeyCode keyCode; -}; - -static std::map g_keyCodeMap; - -// http://www.kbdedit.com/manual/low_level_vk_list.html -// https://msdn.microsoft.com/library/windows/apps/windows.system.virtualkey.aspx - -static keyCodeItem g_keyCodeStructArray [] = { - /* The unknown key */ - { (int) VirtualKey::None, EventKeyboard::KeyCode::KEY_NONE }, - /* Printable keys */ - { (int) VirtualKey::Space, EventKeyboard::KeyCode::KEY_SPACE }, - { (int) VK_OEM_7, EventKeyboard::KeyCode::KEY_APOSTROPHE }, - { (int) VK_OEM_COMMA, EventKeyboard::KeyCode::KEY_COMMA }, - { (int) VK_OEM_MINUS, EventKeyboard::KeyCode::KEY_MINUS }, - { (int) VK_OEM_PERIOD, EventKeyboard::KeyCode::KEY_PERIOD }, - { (int) VK_OEM_2, EventKeyboard::KeyCode::KEY_SLASH }, - { (int) VK_OEM_3, EventKeyboard::KeyCode::KEY_TILDE }, - - { (int) VirtualKey::Number0, EventKeyboard::KeyCode::KEY_0 }, - { (int) VirtualKey::Number1, EventKeyboard::KeyCode::KEY_1 }, - { (int) VirtualKey::Number2, EventKeyboard::KeyCode::KEY_2 }, - { (int) VirtualKey::Number3, EventKeyboard::KeyCode::KEY_3 }, - { (int) VirtualKey::Number4, EventKeyboard::KeyCode::KEY_4 }, - { (int) VirtualKey::Number5, EventKeyboard::KeyCode::KEY_5 }, - { (int) VirtualKey::Number6, EventKeyboard::KeyCode::KEY_6 }, - { (int) VirtualKey::Number7, EventKeyboard::KeyCode::KEY_7 }, - { (int) VirtualKey::Number8, EventKeyboard::KeyCode::KEY_8 }, - { (int) VirtualKey::Number9, EventKeyboard::KeyCode::KEY_9 }, - { (int) VK_OEM_1, EventKeyboard::KeyCode::KEY_SEMICOLON }, - { (int) VK_OEM_PLUS, EventKeyboard::KeyCode::KEY_EQUAL }, - { (int) VirtualKey::A, EventKeyboard::KeyCode::KEY_A }, - { (int) VirtualKey::B, EventKeyboard::KeyCode::KEY_B }, - { (int) VirtualKey::C, EventKeyboard::KeyCode::KEY_C }, - { (int) VirtualKey::D, EventKeyboard::KeyCode::KEY_D }, - { (int) VirtualKey::E, EventKeyboard::KeyCode::KEY_E }, - { (int) VirtualKey::F, EventKeyboard::KeyCode::KEY_F }, - { (int) VirtualKey::G, EventKeyboard::KeyCode::KEY_G }, - { (int) VirtualKey::H, EventKeyboard::KeyCode::KEY_H }, - { (int) VirtualKey::I, EventKeyboard::KeyCode::KEY_I }, - { (int) VirtualKey::J, EventKeyboard::KeyCode::KEY_J }, - { (int) VirtualKey::K, EventKeyboard::KeyCode::KEY_K }, - { (int) VirtualKey::L, EventKeyboard::KeyCode::KEY_L }, - { (int) VirtualKey::M, EventKeyboard::KeyCode::KEY_M }, - { (int) VirtualKey::N, EventKeyboard::KeyCode::KEY_N }, - { (int) VirtualKey::O, EventKeyboard::KeyCode::KEY_O }, - { (int) VirtualKey::P, EventKeyboard::KeyCode::KEY_P }, - { (int) VirtualKey::Q, EventKeyboard::KeyCode::KEY_Q }, - { (int) VirtualKey::R, EventKeyboard::KeyCode::KEY_R }, - { (int) VirtualKey::S, EventKeyboard::KeyCode::KEY_S }, - { (int) VirtualKey::T, EventKeyboard::KeyCode::KEY_T }, - { (int) VirtualKey::U, EventKeyboard::KeyCode::KEY_U }, - { (int) VirtualKey::V, EventKeyboard::KeyCode::KEY_V }, - { (int) VirtualKey::W, EventKeyboard::KeyCode::KEY_W }, - { (int) VirtualKey::X, EventKeyboard::KeyCode::KEY_X }, - { (int) VirtualKey::Y, EventKeyboard::KeyCode::KEY_Y }, - { (int) VirtualKey::Z, EventKeyboard::KeyCode::KEY_Z }, - { VK_OEM_4, EventKeyboard::KeyCode::KEY_LEFT_BRACKET }, - { VK_OEM_5, EventKeyboard::KeyCode::KEY_BACK_SLASH }, - { VK_OEM_6, EventKeyboard::KeyCode::KEY_RIGHT_BRACKET }, - // { GLFW_KEY_GRAVE_ACCENT , EventKeyboard::KeyCode::KEY_GRAVE }, - - /* Function keys */ - { (int) VirtualKey::Escape, EventKeyboard::KeyCode::KEY_ESCAPE }, - { (int) VirtualKey::Enter, EventKeyboard::KeyCode::KEY_ENTER }, - { (int) VirtualKey::Tab, EventKeyboard::KeyCode::KEY_TAB }, - { (int) VirtualKey::Back, EventKeyboard::KeyCode::KEY_BACKSPACE }, - { (int) VirtualKey::Insert, EventKeyboard::KeyCode::KEY_INSERT }, - { (int) VirtualKey::Delete, EventKeyboard::KeyCode::KEY_DELETE }, - { (int) VirtualKey::Right, EventKeyboard::KeyCode::KEY_RIGHT_ARROW }, - { (int) VirtualKey::Left, EventKeyboard::KeyCode::KEY_LEFT_ARROW }, - { (int) VirtualKey::Down, EventKeyboard::KeyCode::KEY_DOWN_ARROW }, - { (int) VirtualKey::Up, EventKeyboard::KeyCode::KEY_UP_ARROW }, - { VK_PRIOR, EventKeyboard::KeyCode::KEY_PG_UP }, - { VK_NEXT, EventKeyboard::KeyCode::KEY_PG_DOWN }, - { VK_HOME, EventKeyboard::KeyCode::KEY_HOME }, - { VK_END, EventKeyboard::KeyCode::KEY_END }, - { VK_CAPITAL, EventKeyboard::KeyCode::KEY_CAPS_LOCK }, - { VK_SCROLL, EventKeyboard::KeyCode::KEY_SCROLL_LOCK }, - { VK_NUMLOCK, EventKeyboard::KeyCode::KEY_NUM_LOCK }, - { VK_SNAPSHOT, EventKeyboard::KeyCode::KEY_PRINT }, - { VK_PAUSE, EventKeyboard::KeyCode::KEY_PAUSE }, - { (int) VirtualKey::F1, EventKeyboard::KeyCode::KEY_F1 }, - { (int) VirtualKey::F2, EventKeyboard::KeyCode::KEY_F2 }, - { (int) VirtualKey::F3, EventKeyboard::KeyCode::KEY_F3 }, - { (int) VirtualKey::F4, EventKeyboard::KeyCode::KEY_F4 }, - { (int) VirtualKey::F5, EventKeyboard::KeyCode::KEY_F5 }, - { (int) VirtualKey::F6, EventKeyboard::KeyCode::KEY_F6 }, - { (int) VirtualKey::F7, EventKeyboard::KeyCode::KEY_F7 }, - { (int) VirtualKey::F8, EventKeyboard::KeyCode::KEY_F8 }, - { (int) VirtualKey::F9, EventKeyboard::KeyCode::KEY_F9 }, - { (int) VirtualKey::F10, EventKeyboard::KeyCode::KEY_F10 }, - { (int) VirtualKey::F11, EventKeyboard::KeyCode::KEY_F11 }, - { (int) VirtualKey::F12, EventKeyboard::KeyCode::KEY_F12 }, - { (int) VirtualKey::F13, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F14, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F15, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F16, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F17, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F18, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F19, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F20, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F21, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F22, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F23, EventKeyboard::KeyCode::KEY_NONE }, - { (int) VirtualKey::F24, EventKeyboard::KeyCode::KEY_NONE }, - - { (int) VirtualKey::NumberPad0, EventKeyboard::KeyCode::KEY_0 }, - { (int) VirtualKey::NumberPad1, EventKeyboard::KeyCode::KEY_1 }, - { (int) VirtualKey::NumberPad2, EventKeyboard::KeyCode::KEY_2 }, - { (int) VirtualKey::NumberPad3, EventKeyboard::KeyCode::KEY_3 }, - { (int) VirtualKey::NumberPad4, EventKeyboard::KeyCode::KEY_4 }, - { (int) VirtualKey::NumberPad5, EventKeyboard::KeyCode::KEY_5 }, - { (int) VirtualKey::NumberPad6, EventKeyboard::KeyCode::KEY_6 }, - { (int) VirtualKey::NumberPad7, EventKeyboard::KeyCode::KEY_7 }, - { (int) VirtualKey::NumberPad8, EventKeyboard::KeyCode::KEY_8 }, - { (int) VirtualKey::NumberPad9, EventKeyboard::KeyCode::KEY_9 }, -#if 0 - { GLFW_KEY_KP_1, EventKeyboard::KeyCode::KEY_1 }, - { GLFW_KEY_KP_2, EventKeyboard::KeyCode::KEY_2 }, - { GLFW_KEY_KP_3, EventKeyboard::KeyCode::KEY_3 }, - { GLFW_KEY_KP_4, EventKeyboard::KeyCode::KEY_4 }, - { GLFW_KEY_KP_5, EventKeyboard::KeyCode::KEY_5 }, - { GLFW_KEY_KP_6, EventKeyboard::KeyCode::KEY_6 }, - { GLFW_KEY_KP_7, EventKeyboard::KeyCode::KEY_7 }, - { GLFW_KEY_KP_8, EventKeyboard::KeyCode::KEY_8 }, - { GLFW_KEY_KP_9, EventKeyboard::KeyCode::KEY_9 }, -#endif - { (int) VirtualKey::Decimal, EventKeyboard::KeyCode::KEY_PERIOD }, - { (int) VirtualKey::Divide, EventKeyboard::KeyCode::KEY_KP_DIVIDE }, - { (int) VirtualKey::Multiply, EventKeyboard::KeyCode::KEY_KP_MULTIPLY }, - { (int) VirtualKey::Subtract, EventKeyboard::KeyCode::KEY_KP_MINUS }, - { (int) VirtualKey::Add, EventKeyboard::KeyCode::KEY_KP_PLUS }, - //{ GLFW_KEY_KP_ENTER , EventKeyboard::KeyCode::KEY_KP_ENTER }, - //{ GLFW_KEY_KP_EQUAL , EventKeyboard::KeyCode::KEY_EQUAL }, - { (int) VirtualKey::Shift, EventKeyboard::KeyCode::KEY_LEFT_SHIFT }, - { (int) VirtualKey::Control, EventKeyboard::KeyCode::KEY_LEFT_CTRL }, - { VK_LMENU, EventKeyboard::KeyCode::KEY_LEFT_ALT }, - { (int) VirtualKey::LeftWindows, EventKeyboard::KeyCode::KEY_HYPER }, - { (int) VirtualKey::RightShift, EventKeyboard::KeyCode::KEY_RIGHT_SHIFT }, - { (int) VirtualKey::RightControl, EventKeyboard::KeyCode::KEY_RIGHT_CTRL }, - { VK_RMENU, EventKeyboard::KeyCode::KEY_RIGHT_ALT }, - { (int) VirtualKey::RightWindows, EventKeyboard::KeyCode::KEY_HYPER }, - { (int) VirtualKey::Menu, EventKeyboard::KeyCode::KEY_MENU }, - { (int) VirtualKey::LeftMenu, EventKeyboard::KeyCode::KEY_MENU }, - { (int) VirtualKey::RightMenu, EventKeyboard::KeyCode::KEY_MENU } -}; - -KeyBoardWinRT::KeyBoardWinRT() -{ - g_keyCodeMap.clear(); - for (auto& item : g_keyCodeStructArray) - { - g_keyCodeMap[item.key] = item.keyCode; - } -} - -KeyBoardWinRT::~KeyBoardWinRT() -{ - -} - - -void KeyBoardWinRT::ShowKeyboard(Platform::String^ text) -{ - auto panel = cocos2d::GLViewImpl::sharedOpenGLView()->getPanel(); - auto dispatcher = cocos2d::GLViewImpl::sharedOpenGLView()->getDispatcher(); - - if (dispatcher && panel) - { - // run on main UI thread - dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text, panel]() - { - if (m_textBox == nullptr) - { - m_useInputMethod = false; - m_textBox = ref new TextBox(); - m_textBox->Opacity = 0.0; - m_textBox->Width = 1; - m_textBox->Height = 1; - m_textBox->TextChanged += ref new TextChangedEventHandler(this, &KeyBoardWinRT::OnTextChanged); - m_textBox->TextCompositionStarted += ref new Windows::Foundation::TypedEventHandler(this, &KeyBoardWinRT::OnTextCompositionStarted); - - m_textBox->TextCompositionEnded += ref new Windows::Foundation::TypedEventHandler(this, &KeyBoardWinRT::OnTextCompositionEnded); -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - // Need to use InputScopeNameValue::Search to prevent auto-capitalize - m_textBox->InputScope = ref new InputScope(); - auto n = m_textBox->InputScope->Names; - n->Append(ref new InputScopeName(InputScopeNameValue::Search)); -#endif - panel->Children->Append(m_textBox); - } - m_textBox->SelectionLength = 0; - m_textBox->SelectionStart = 32768; - m_textBox->Focus(FocusState::Programmatic); - })); - } -} - -void KeyBoardWinRT::HideKeyboard(Platform::String^ text) -{ - auto panel = cocos2d::GLViewImpl::sharedOpenGLView()->getPanel(); - auto dispatcher = cocos2d::GLViewImpl::sharedOpenGLView()->getDispatcher(); - - if (dispatcher && panel) - { - // run on main UI thread - dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, text, panel]() - { - if (m_textBox != nullptr) - { - unsigned int index; - if (panel->Children->IndexOf(m_textBox, &index)) - { - panel->Children->RemoveAt(index); - } - } - m_textBox = nullptr; - })); - } -} - -void KeyBoardWinRT::OnWinRTKeyboardEvent(WinRTKeyboardEventType type, KeyEventArgs^ args) -{ - bool pressed = (type == WinRTKeyboardEventType::KeyPressed); - - // Is key repeats - bool repeat = pressed && args->KeyStatus.WasKeyDown; - - int key = static_cast(args->VirtualKey); - auto it = g_keyCodeMap.find(key); - if (it != g_keyCodeMap.end()) - { - - EventKeyboard::KeyCode keyCode = it->second; - - EventKeyboard event(keyCode, pressed); - if (!repeat) - { - auto dispatcher = Director::getInstance()->getEventDispatcher(); - dispatcher->dispatchEvent(&event); - if (keyCode == EventKeyboard::KeyCode::KEY_ENTER) - { - IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1); - } - } - - if (pressed && !event.isStopped()) - { - switch (keyCode) - { - case EventKeyboard::KeyCode::KEY_BACKSPACE: - IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); - break; - case EventKeyboard::KeyCode::KEY_HOME: - case EventKeyboard::KeyCode::KEY_KP_HOME: - case EventKeyboard::KeyCode::KEY_DELETE: - case EventKeyboard::KeyCode::KEY_KP_DELETE: - case EventKeyboard::KeyCode::KEY_END: - case EventKeyboard::KeyCode::KEY_LEFT_ARROW: - case EventKeyboard::KeyCode::KEY_RIGHT_ARROW: - case EventKeyboard::KeyCode::KEY_ESCAPE: - IMEDispatcher::sharedDispatcher()->dispatchControlKey(keyCode); - break; - default: - break; - } - } - } - else - { - log("GLViewImpl::OnWinRTKeyboardEvent Virtual Key Code %d not supported", key); - } -} - -void KeyBoardWinRT::OnTextChanged(Platform::Object^ sender, TextChangedEventArgs^ args) -{ - if (m_useInputMethod) { - return; - } - auto text = m_textBox->Text; - if (text) - { - std::shared_ptr e(new cocos2d::KeyboardEvent(Cocos2dKeyEvent::Text, text)); - cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e); - m_textBox->Text = L""; - } -} - -void KeyBoardWinRT::OnTextCompositionStarted(Windows::UI::Xaml::Controls::TextBox^, Windows::UI::Xaml::Controls::TextCompositionStartedEventArgs^ args) -{ - m_useInputMethod = true; -} - -void KeyBoardWinRT::OnTextCompositionEnded(Windows::UI::Xaml::Controls::TextBox^, Windows::UI::Xaml::Controls::TextCompositionEndedEventArgs^ args) -{ - m_useInputMethod = false; - auto text = m_textBox->Text; - if (text) - { - std::shared_ptr e(new cocos2d::KeyboardEvent(Cocos2dKeyEvent::Text, text)); - cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e); - m_textBox->Text = L""; - } -} - -NS_CC_END - diff --git a/cocos/platform/winrt/Keyboard-winrt.h b/cocos/platform/winrt/Keyboard-winrt.h deleted file mode 100644 index d8cbf6ae775c..000000000000 --- a/cocos/platform/winrt/Keyboard-winrt.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -* Portions Copyright (c) Microsoft Open Technologies, Inc. -* All Rights Reserved -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. -****************************************************************************/ - -#pragma once - -#include -#include "platform/winrt/InputEvent.h" - -NS_CC_BEGIN - -ref class KeyBoardWinRT sealed -{ -public: - KeyBoardWinRT(); - virtual ~KeyBoardWinRT(); - - void ShowKeyboard(Platform::String^ text); - void HideKeyboard(Platform::String^ text); - -internal: - void OnWinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args); - -private: - void OnTextChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::TextChangedEventArgs^ args); - void OnTextCompositionStarted(Windows::UI::Xaml::Controls::TextBox^, Windows::UI::Xaml::Controls::TextCompositionStartedEventArgs^ args); - void OnTextCompositionEnded(Windows::UI::Xaml::Controls::TextBox^, Windows::UI::Xaml::Controls::TextCompositionEndedEventArgs^ args); - - Windows::UI::Xaml::Controls::TextBox^ m_textBox; - - bool m_useInputMethod; -}; - -NS_CC_END diff --git a/cocos/platform/winrt/WICImageLoader-winrt.cpp b/cocos/platform/winrt/WICImageLoader-winrt.cpp deleted file mode 100644 index 7c83cfaacf0b..000000000000 --- a/cocos/platform/winrt/WICImageLoader-winrt.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/**************************************************************************** -Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -The MIT License (MIT) - -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. - -Based upon code from the DirectX Tool Kit by Microsoft Corporation, -obtained from https://directxtk.codeplex.com -****************************************************************************/ -#include "platform/winrt/WICImageLoader-winrt.h" -#include "platform/winrt/CCWinRTUtils.h" - -NS_CC_BEGIN - -#if CC_USE_WIC - - IWICImagingFactory* WICImageLoader::_wicFactory = NULL; - -static WICConvert g_WICConvert[] = -{ - // Note target GUID in this conversion table must be one of those directly supported by cocos2d-x - - { GUID_WICPixelFormatBlackWhite, GUID_WICPixelFormat8bppGray }, // DXGI_FORMAT_R8_UNORM - - { GUID_WICPixelFormat1bppIndexed, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat2bppIndexed, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat4bppIndexed, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat8bppIndexed, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - - { GUID_WICPixelFormat2bppGray, GUID_WICPixelFormat8bppGray }, // DXGI_FORMAT_R8_UNORM - { GUID_WICPixelFormat4bppGray, GUID_WICPixelFormat8bppGray }, // DXGI_FORMAT_R8_UNORM - - { GUID_WICPixelFormat16bppGrayFixedPoint, GUID_WICPixelFormat16bppGrayHalf }, // DXGI_FORMAT_R16_FLOAT - { GUID_WICPixelFormat32bppGrayFixedPoint, GUID_WICPixelFormat32bppGrayFloat }, // DXGI_FORMAT_R32_FLOAT - - { GUID_WICPixelFormat16bppBGR555, GUID_WICPixelFormat16bppBGRA5551 }, // DXGI_FORMAT_B5G5R5A1_UNORM - - { GUID_WICPixelFormat32bppBGR101010, GUID_WICPixelFormat32bppRGBA1010102 }, // DXGI_FORMAT_R10G10B10A2_UNORM - - { GUID_WICPixelFormat24bppBGR, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat24bppRGB, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat32bppPBGRA, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - { GUID_WICPixelFormat32bppPRGBA, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - - { GUID_WICPixelFormat48bppRGB, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R16G16B16A16_UNORM - { GUID_WICPixelFormat48bppBGR, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R16G16B16A16_UNORM - - { GUID_WICPixelFormat48bppRGBFixedPoint, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R16G16B16A16_FLOAT - { GUID_WICPixelFormat48bppBGRFixedPoint, GUID_WICPixelFormat24bppRGB }, // DXGI_FORMAT_R16G16B16A16_FLOAT - - //#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE) - // { GUID_WICPixelFormat32bppRGB, GUID_WICPixelFormat32bppRGBA }, // DXGI_FORMAT_R8G8B8A8_UNORM - // { GUID_WICPixelFormat64bppRGB, GUID_WICPixelFormat64bppRGBA }, // DXGI_FORMAT_R16G16B16A16_UNORM - // { GUID_WICPixelFormat64bppPRGBAHalf, GUID_WICPixelFormat64bppRGBAHalf }, // DXGI_FORMAT_R16G16B16A16_FLOAT - //#endif - - // We don't support n-channel formats -}; - -WICImageLoader::WICImageLoader() : - _width(0), - _height(0), - _dataLen(0), - _bpp(0), - _data(0) -{ - memset((void*)&_format, 0, sizeof(_format)); -} - -WICImageLoader::~WICImageLoader() -{ - if(_data != NULL && _dataLen > 0) { - delete[] _data; - _data = NULL; - } -} - -bool WICImageLoader::decodeImageData(ImageBlob blob, size_t size) -{ - bool bRet = false; - HRESULT hr = E_FAIL; - - IWICStream* pWicStream = NULL; - IWICImagingFactory* pWicFactory = getWICFactory(); - - if(NULL != pWicFactory) - { - hr = pWicFactory->CreateStream(&pWicStream); - } - - if(SUCCEEDED(hr)) - { - hr = pWicStream->InitializeFromMemory((BYTE*)blob, static_cast(size)); - } - - IWICBitmapDecoder* pDecoder = NULL; - - if(SUCCEEDED(hr)) - { - hr = pWicFactory->CreateDecoderFromStream(pWicStream, NULL, WICDecodeMetadataCacheOnLoad, &pDecoder); - } - - bRet = processImage(pDecoder); - - SafeRelease(&pWicStream); - SafeRelease(&pDecoder); - - return bRet; -} - -bool WICImageLoader::processImage(IWICBitmapDecoder* pDecoder) -{ - HRESULT hr = E_FAIL; - IWICBitmapFrameDecode* pFrame = NULL; - - if(NULL != pDecoder) - { - hr = pDecoder->GetFrame(0, &pFrame); - } - - if(SUCCEEDED(hr)) - { - hr = pFrame->GetPixelFormat(&_format); - } - - IWICFormatConverter* pConv = NULL; - - if(SUCCEEDED(hr)) - { - hr = convertFormatIfRequired(pFrame, &pConv); - } - - if(SUCCEEDED(hr)) - { - _bpp = getBitsPerPixel(_format); - - if(NULL != pConv) - { - hr = pConv->GetSize((UINT*)&_width, (UINT*)&_height); - } - else - { - hr = pFrame->GetSize((UINT*)&_width, (UINT*)&_height); - } - } - - assert(_bpp > 0); - assert(_width > 0 && _height > 0); - - if(SUCCEEDED(hr)) - { - size_t rowPitch = (_width * _bpp + 7) / 8; - _dataLen = rowPitch * _height; - _data = new (std::nothrow) BYTE[_dataLen]; - - if(NULL != pConv) - { - hr = pConv->CopyPixels(NULL, static_cast(rowPitch), static_cast(_dataLen), _data); - } - else - { - hr = pFrame->CopyPixels(NULL, static_cast(rowPitch), static_cast(_dataLen), _data); - } - } - - SafeRelease(&pFrame); - SafeRelease(&pConv); - return SUCCEEDED(hr); -} - -HRESULT WICImageLoader::convertFormatIfRequired(IWICBitmapFrameDecode* pFrame, IWICFormatConverter** ppConv) -{ - *ppConv = NULL; - - if( (memcmp(&_format, &GUID_WICPixelFormat8bppGray, sizeof(WICPixelFormatGUID)) == 0) || - (memcmp(&_format, &GUID_WICPixelFormat8bppAlpha, sizeof(WICPixelFormatGUID)) == 0) || - (memcmp(&_format, &GUID_WICPixelFormat24bppRGB, sizeof(WICPixelFormatGUID)) == 0) || - (memcmp(&_format, &GUID_WICPixelFormat32bppRGBA, sizeof(WICPixelFormatGUID)) == 0)) - { - return S_OK; - } - - HRESULT hr = E_FAIL; - IWICImagingFactory* pFactory = getWICFactory(); - IWICFormatConverter* pConv = NULL; - - if(NULL != pFactory) - { - hr = pFactory->CreateFormatConverter(&pConv); - } - - WICPixelFormatGUID destFormat = GUID_WICPixelFormat32bppRGBA; // Fallback to RGBA 32-bit format which is supported by all devices - - for( size_t i=0; i < _countof(g_WICConvert); ++i ) - { - if ( memcmp( &g_WICConvert[i].source, &_format, sizeof(WICPixelFormatGUID) ) == 0 ) - { - memcpy( &destFormat, &g_WICConvert[i].target, sizeof(WICPixelFormatGUID) ); - break; - } - } - - BOOL bCanConv = FALSE; - - if(SUCCEEDED(hr)) - { - hr = pConv->CanConvert(_format, destFormat, &bCanConv); - } - - if(SUCCEEDED(hr) && bCanConv == TRUE) - { - hr = pConv->Initialize(pFrame, destFormat, WICBitmapDitherTypeErrorDiffusion, 0, 0, WICBitmapPaletteTypeCustom); - } - - if(SUCCEEDED(hr)) - { - memcpy(&_format, &destFormat, sizeof(WICPixelFormatGUID)); - *ppConv = pConv; - } - - return SUCCEEDED(hr); -} - -size_t WICImageLoader::getBitsPerPixel(WICPixelFormatGUID format) -{ - HRESULT hr = E_FAIL; - - IWICImagingFactory* pfactory = getWICFactory(); - - IWICComponentInfo* pCInfo = NULL; - - if(pfactory != NULL) - { - hr = pfactory->CreateComponentInfo(format, &pCInfo); - } - - WICComponentType cType; - - if(SUCCEEDED(hr)) - { - hr = pCInfo->GetComponentType(&cType); - } - - IWICPixelFormatInfo* pPInfo = NULL; - - if(SUCCEEDED(hr) && cType == WICPixelFormat) - { - hr = pCInfo->QueryInterface(IID_IWICPixelFormatInfo, (void**)&pPInfo); - } - - UINT bpp = 0; - - if(SUCCEEDED(hr)) - { - hr = pPInfo->GetBitsPerPixel(&bpp); - } - - SafeRelease(&pCInfo); - SafeRelease(&pPInfo); - return bpp; -} - -int WICImageLoader::getHeight() -{ - return _height; -} - -int WICImageLoader::getWidth() -{ - return _width; -} - -size_t WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen) -{ - if(dataLen < _dataLen) - return 0; - - memcpy((void*)rawData, _data, _dataLen); - - return _dataLen; -} - -size_t WICImageLoader::getImageDataSize() -{ - return _dataLen; -} - -WICPixelFormatGUID WICImageLoader::getPixelFormat() -{ - return _format; -} - -bool WICImageLoader::encodeImageData(std::string path, const unsigned char* data, size_t dataLen, WICPixelFormatGUID pixelFormat, int width, int height, GUID containerFormat) -{ - assert(data != NULL); - assert(dataLen > 0 && width > 0 && height > 0); - - IWICImagingFactory* pFact = getWICFactory(); - - HRESULT hr = E_FAIL; - IWICStream* pStream = NULL; - - if (NULL != pFact) { - hr = pFact->CreateStream(&pStream); - } - - if (SUCCEEDED(hr)) { - hr = pStream->InitializeFromFilename(StringUtf8ToWideChar(path).c_str(), GENERIC_WRITE); - } - - IWICBitmapEncoder* pEnc = NULL; - - if (SUCCEEDED(hr)) { - hr = pFact->CreateEncoder(containerFormat, NULL, &pEnc); - } - - if (SUCCEEDED(hr)) { - hr = pEnc->Initialize(pStream, WICBitmapEncoderNoCache); - } - - IWICBitmapFrameEncode* pFrame = NULL; - IPropertyBag2* pProp = NULL; - - if (SUCCEEDED(hr)) { - hr = pEnc->CreateNewFrame(&pFrame, &pProp); - } - - if (SUCCEEDED(hr)) { - hr = pFrame->Initialize(pProp); - } - - if (SUCCEEDED(hr)) { - hr = pFrame->SetSize(width, height); - } - - if (SUCCEEDED(hr)) { - WICPixelFormatGUID targetFormat = pixelFormat; - hr = pFrame->SetPixelFormat(&targetFormat); - - if (targetFormat != pixelFormat) { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) { - size_t bpp = getBitsPerPixel(pixelFormat); - size_t stride = (width * bpp + 7) / 8; - - hr = pFrame->WritePixels(height, static_cast(stride), static_cast(dataLen), (BYTE*)data); - } - - if (SUCCEEDED(hr)) { - hr = pFrame->Commit(); - } - - if (SUCCEEDED(hr)) { - hr = pEnc->Commit(); - } - - SafeRelease(&pStream); - SafeRelease(&pEnc); - SafeRelease(&pFrame); - SafeRelease(&pProp); - return SUCCEEDED(hr); -} - -IWICImagingFactory* WICImageLoader::getWICFactory() -{ - if(NULL == _wicFactory) - { - HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - - if(SUCCEEDED(hr)) - { - hr = CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID*)&_wicFactory); - } - - if(FAILED(hr)) - { - SafeRelease(&_wicFactory); - } - } - - return _wicFactory; -} - -#endif - -NS_CC_END diff --git a/cocos/platform/winrt/WICImageLoader-winrt.h b/cocos/platform/winrt/WICImageLoader-winrt.h deleted file mode 100644 index b3c9934861ee..000000000000 --- a/cocos/platform/winrt/WICImageLoader-winrt.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. - -The MIT License (MIT) - -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. - -Based upon code from the DirectX Tool Kit by Microsoft Corporation, -obtained from https://directxtk.codeplex.com -****************************************************************************/ - -#ifndef __WIC_IMAGE_LOADER_H__ -#define __WIC_IMAGE_LOADER_H__ - -#include "base/ccConfig.h" - - -#if CC_USE_WIC - -#include -#include -#include -#include "platform/CCPlatformMacros.h" - -NS_CC_BEGIN - - - typedef const unsigned char* ImageBlob; - -struct WICConvert -{ - WICPixelFormatGUID source; - WICPixelFormatGUID target; -}; - -class CC_DLL WICImageLoader -{ -public: - - WICImageLoader(); - ~WICImageLoader(); - - int getWidth(); - int getHeight(); - size_t getImageDataSize(); - WICPixelFormatGUID getPixelFormat(); - size_t getImageData(ImageBlob rawData, size_t dataLen); - bool decodeImageData(ImageBlob data, size_t dataLen); - bool encodeImageData(std::string path, const unsigned char* data, size_t dataLen, WICPixelFormatGUID pixelFormat, int width, int height, GUID containerFormat); - -protected: - bool processImage(IWICBitmapDecoder* decoder); - size_t getBitsPerPixel(WICPixelFormatGUID format); - HRESULT convertFormatIfRequired(IWICBitmapFrameDecode* pFrame, IWICFormatConverter** ppConv); - - static IWICImagingFactory* getWICFactory(); - -private: - int _height; - int _width; - size_t _dataLen; - size_t _bpp; - WICPixelFormatGUID _format; - BYTE* _data; - - - static IWICImagingFactory* _wicFactory; -}; - -template -void SafeRelease(T **ppObj) -{ - if(*ppObj != NULL) - { - (*ppObj)->Release(); - *ppObj = NULL; - } -} - - -NS_CC_END - -#endif -#endif // #ifndef __WIC_IMAGE_LOADER_H__ - diff --git a/cocos/platform/winrt/inet_ntop_winrt.cpp b/cocos/platform/winrt/inet_ntop_winrt.cpp deleted file mode 100644 index 88c5a2d0de70..000000000000 --- a/cocos/platform/winrt/inet_ntop_winrt.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 1996-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* - * Original code by Paul Vixie. "curlified" by Gisle Vanem. - */ - -/* Portions Copyright (c) Microsoft Open Technologies, Inc. */ - -/*modifications by Microsoft Open Technologies, Inc. to implement missing inet_ntop() from Windows Phone 8 SDK */ - - -#include -#include - -#if defined(_DEBUG) -#define DEBUGASSERT(x) assert(x) -#else -#define DEBUGASSERT(x) -#endif - -#define ERRNO ((int)GetLastError()) -#define SET_ERRNO(x) (SetLastError((DWORD)(x))) - - -#define ENABLE_IPV6 - -#ifndef HAVE_INET_NTOP - -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#if 0 -#define _MPRINTF_REPLACE /* use our functions only */ -#include -#endif // 0 - - -//#include "inet_ntop.h" - -#define IN6ADDRSZ 16 -#define INADDRSZ 4 -#define INT16SZ 2 - -/* - * Format an IPv4 address, more or less like inet_ntoa(). - * - * Returns `dst' (as a const) - * Note: - * - uses no statics - * - takes a unsigned char* not an in_addr as input - */ -static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size) -{ - char tmp[sizeof "255.255.255.255"]; - size_t len; - - DEBUGASSERT(size >= 16); - - tmp[0] = '\0'; - (void)snprintf(tmp, sizeof(tmp), "%d.%d.%d.%d", - ((int)((unsigned char)src[0])) & 0xff, - ((int)((unsigned char)src[1])) & 0xff, - ((int)((unsigned char)src[2])) & 0xff, - ((int)((unsigned char)src[3])) & 0xff); - - len = strlen(tmp); - if(len == 0 || len >= size) { - SET_ERRNO(ENOSPC); - return (NULL); - } - strcpy(dst, tmp); - return dst; -} - -#ifdef ENABLE_IPV6 -/* - * Convert IPv6 binary address into presentation (printable) format. - */ -static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) -{ - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; - char *tp; - struct { - long base; - long len; - } best, cur; - unsigned long words[IN6ADDRSZ / INT16SZ]; - int i; - - /* Preprocess: - * Copy the input (bytewise) array into a wordwise array. - * Find the longest run of 0x00's in src[] for :: shorthanding. - */ - memset(words, '\0', sizeof(words)); - for(i = 0; i < IN6ADDRSZ; i++) - words[i/2] |= (src[i] << ((1 - (i % 2)) << 3)); - - best.base = -1; - cur.base = -1; - best.len = 0; - cur.len = 0; - - for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - if(words[i] == 0) { - if(cur.base == -1) - cur.base = i, cur.len = 1; - else - cur.len++; - } - else if(cur.base != -1) { - if(best.base == -1 || cur.len > best.len) - best = cur; - cur.base = -1; - } - } - if((cur.base != -1) && (best.base == -1 || cur.len > best.len)) - best = cur; - if(best.base != -1 && best.len < 2) - best.base = -1; - /* Format the result. */ - tp = tmp; - for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - /* Are we inside the best run of 0x00's? */ - if(best.base != -1 && i >= best.base && i < (best.base + best.len)) { - if(i == best.base) - *tp++ = ':'; - continue; - } - - /* Are we following an initial run of 0x00s or any real hex? - */ - if(i != 0) - *tp++ = ':'; - - /* Is this address an encapsulated IPv4? - */ - if(i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { - if(!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) { - SET_ERRNO(ENOSPC); - return (NULL); - } - tp += strlen(tp); - break; - } - tp += snprintf(tp, 5, "%lx", words[i]); - } - - /* Was it a trailing run of 0x00's? - */ - if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) - *tp++ = ':'; - *tp++ = '\0'; - - /* Check for overflow, copy, and we're done. - */ - if((size_t)(tp - tmp) > size) { - SET_ERRNO(ENOSPC); - return (NULL); - } - strcpy(dst, tmp); - return dst; -} -#endif /* ENABLE_IPV6 */ - -/* - * Convert a network format address to presentation format. - * - * Returns pointer to presentation format address (`buf'). - * Returns NULL on error and errno set with the specific - * error, EAFNOSUPPORT or ENOSPC. - * - * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So use macro ERRNO to fetch the - * errno this function sets when returning NULL, not SOCKERRNO. - */ -char *inet_ntop(int af, const void *src, char *buf, size_t size) -{ - switch (af) { - case AF_INET: - return inet_ntop4((const unsigned char*)src, buf, size); -#ifdef ENABLE_IPV6 - case AF_INET6: - return inet_ntop6((const unsigned char*)src, buf, size); -#endif - default: - SET_ERRNO(EAFNOSUPPORT); - return NULL; - } -} -#endif /* HAVE_INET_NTOP */ diff --git a/cocos/platform/winrt/inet_ntop_winrt.h b/cocos/platform/winrt/inet_ntop_winrt.h deleted file mode 100644 index 12954aa5c0b5..000000000000 --- a/cocos/platform/winrt/inet_ntop_winrt.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef HEADER_CURL_INET_NTOP_WINRT_H -#define HEADER_CURL_INET_NTOP_WINRT_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * - * Portions Copyright (c) Microsoft Open Technologies, Inc. - - - ***************************************************************************/ - -#if _MSC_VER < 1900 -char *inet_ntop(int af, const void *addr, char *buf, size_t size); -#endif - -#endif /* HEADER_CURL_INET_NTOP_H */ - diff --git a/cocos/platform/winrt/inet_pton_winrt.cpp b/cocos/platform/winrt/inet_pton_winrt.cpp deleted file mode 100644 index f9bc0d20e6f0..000000000000 --- a/cocos/platform/winrt/inet_pton_winrt.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* This is from the BIND 4.9.4 release, modified to compile by itself */ - -/* Copyright (c) 1996 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -/* Portions Copyright (c) Microsoft Open Technologies, Inc. */ - -/*modifications by Microsoft Open Technologies, Inc. to implement missing inet_pton() from Windows 8 SDK */ - -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - -#include -#include - -#define ERRNO ((int)GetLastError()) -#define SET_ERRNO(x) (SetLastError((DWORD)(x))) - -#include "platform/winrt/inet_pton_winrt.h" - -#define ENABLE_IPV6 - -#define IN6ADDRSZ 16 -#define INADDRSZ 4 -#define INT16SZ 2 - -/* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. - */ - -static int inet_pton4(const char *src, unsigned char *dst); -#ifdef ENABLE_IPV6 -static int inet_pton6(const char *src, unsigned char *dst); -#endif - -/* int - * inet_pton(af, src, dst) - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - * notice: - * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So use macro ERRNO to fetch the - * errno this function sets when returning (-1), not SOCKERRNO. - * author: - * Paul Vixie, 1996. - */ - -int inet_pton(int af, const char *src, void *dst) -{ - switch (af) { - case AF_INET: - return (inet_pton4(src, (unsigned char *)dst)); -#ifdef ENABLE_IPV6 - case AF_INET6: - return (inet_pton6(src, (unsigned char *)dst)); -#endif - default: - SET_ERRNO(EAFNOSUPPORT); - return (-1); - } - /* NOTREACHED */ -} - -/* int - * inet_pton4(src, dst) - * like inet_aton() but without all the hexadecimal and shorthand. - * return: - * 1 if `src' is a valid dotted quad, else 0. - * notice: - * does not touch `dst' unless it's returning 1. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton4(const char *src, unsigned char *dst) -{ - static const char digits[] = "0123456789"; - int saw_digit, octets, ch; - unsigned char tmp[INADDRSZ], *tp; - - saw_digit = 0; - octets = 0; - tp = tmp; - *tp = 0; - while((ch = *src++) != '\0') { - const char *pch; - - if((pch = strchr(digits, ch)) != NULL) { - unsigned int val = *tp * 10 + (unsigned int)(pch - digits); - - if(saw_digit && *tp == 0) - return (0); - if(val > 255) - return (0); - *tp = (unsigned char)val; - if(! saw_digit) { - if(++octets > 4) - return (0); - saw_digit = 1; - } - } - else if(ch == '.' && saw_digit) { - if(octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } - else - return (0); - } - if(octets < 4) - return (0); - memcpy(dst, tmp, INADDRSZ); - return (1); -} - -#ifdef ENABLE_IPV6 -/* int - * inet_pton6(src, dst) - * convert presentation level address to network order binary form. - * return: - * 1 if `src' is a valid [RFC1884 2.2] address, else 0. - * notice: - * (1) does not touch `dst' unless it's returning 1. - * (2) :: in a full address is silently ignored. - * credit: - * inspired by Mark Andrews. - * author: - * Paul Vixie, 1996. - */ -static int -inet_pton6(const char *src, unsigned char *dst) -{ - static const char xdigits_l[] = "0123456789abcdef", - xdigits_u[] = "0123456789ABCDEF"; - unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp; - const char *xdigits, *curtok; - int ch, saw_xdigit; - size_t val; - - memset((tp = tmp), 0, IN6ADDRSZ); - endp = tp + IN6ADDRSZ; - colonp = NULL; - /* Leading :: requires some special handling. */ - if(*src == ':') - if(*++src != ':') - return (0); - curtok = src; - saw_xdigit = 0; - val = 0; - while((ch = *src++) != '\0') { - const char *pch; - - if((pch = strchr((xdigits = xdigits_l), ch)) == NULL) - pch = strchr((xdigits = xdigits_u), ch); - if(pch != NULL) { - val <<= 4; - val |= (pch - xdigits); - if(++saw_xdigit > 4) - return (0); - continue; - } - if(ch == ':') { - curtok = src; - if(!saw_xdigit) { - if(colonp) - return (0); - colonp = tp; - continue; - } - if(tp + INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - saw_xdigit = 0; - val = 0; - continue; - } - if(ch == '.' && ((tp + INADDRSZ) <= endp) && - inet_pton4(curtok, tp) > 0) { - tp += INADDRSZ; - saw_xdigit = 0; - break; /* '\0' was seen by inet_pton4(). */ - } - return (0); - } - if(saw_xdigit) { - if(tp + INT16SZ > endp) - return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; - } - if(colonp != NULL) { - /* - * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. - */ - const ssize_t n = tp - colonp; - ssize_t i; - - if(tp == endp) - return (0); - for(i = 1; i <= n; i++) { - *(endp - i) = *(colonp + n - i); - *(colonp + n - i) = 0; - } - tp = endp; - } - if(tp != endp) - return (0); - memcpy(dst, tmp, IN6ADDRSZ); - return (1); -} -#endif /* ENABLE_IPV6 */ - -#endif /* HAVE_INET_PTON */ diff --git a/cocos/platform/winrt/inet_pton_winrt.h b/cocos/platform/winrt/inet_pton_winrt.h deleted file mode 100644 index 15a0110b99ce..000000000000 --- a/cocos/platform/winrt/inet_pton_winrt.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HEADER_CURL_INET_PTON_WINIRT_H -#define HEADER_CURL_INET_PTON_WINIRT_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * Portions Copyright (c) Microsoft Open Technologies, Inc. - * - ***************************************************************************/ - -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -int inet_pton(int af, const char *src, void *dst); -#endif - -#endif /* HEADER_CURL_INET_PTON_WINIRT_H */ - diff --git a/cocos/platform/winrt/pch.cpp b/cocos/platform/winrt/pch.cpp deleted file mode 100644 index b13a83b5cc02..000000000000 --- a/cocos/platform/winrt/pch.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "pch.h" diff --git a/cocos/platform/winrt/pch.h b/cocos/platform/winrt/pch.h deleted file mode 100644 index 5a5a0f1001c5..000000000000 --- a/cocos/platform/winrt/pch.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#pragma once - -#include "platform/winrt/targetver.h" - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include -#include "cocos2d.h" -#include "cocos-ext.h" \ No newline at end of file diff --git a/cocos/platform/winrt/sha1.cpp b/cocos/platform/winrt/sha1.cpp deleted file mode 100644 index 9d181fe65ec2..000000000000 --- a/cocos/platform/winrt/sha1.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* - * sha1.cpp - * - * Copyright (C) The Internet Society (2001). All Rights Reserved. - * This document and translations of it may be copied and furnished to others, - * and derivative works that comment on or otherwise explain it or assist in its - * implementation may be prepared, copied, published and distributed, in whole or in part, - * without restriction of any kind, provided that the above copyright notice and this paragraph - * are included on all such copies and derivative works. However, this document itself may not - * be modified in any way, such as by removing the copyright notice or references to the Internet Society - * or other Internet organizations, except as needed for the purpose of developing Internet standards in - * which case the procedures for copyrights defined in the Internet Standards process must be followed, - * or as required to translate it into languages other than English. - * - * The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. - * - * This document and the information contained herein is provided on an "AS IS" basis and - * THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS - * OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * Source: - * http://www.faqs.org/rfcs/rfc3174.html - * - * Description: - * This file implements the Secure Hashing Algorithm 1 as - * defined in FIPS PUB 180-1 published April 17, 1995. - * - * The SHA-1, produces a 160-bit message digest for a given - * data stream. It should take about 2**n steps to find a - * message with the same digest as a given message and - * 2**(n/2) to find any two messages with the same digest, - * when n is the digest size in bits. Therefore, this - * algorithm can serve as a means of providing a - * "fingerprint" for a message. - * - * Portability Issues: - * SHA-1 is defined in terms of 32-bit "words". This code - * uses (included via "sha1.h" to define 32 and 8 - * bit unsigned integer types. If your C compiler does not - * support 32 bit unsigned integers, this code is not - * appropriate. - * - * Caveats: - * SHA-1 is designed to work with messages less than 2^64 bits - * long. Although SHA-1 allows a message digest to be generated - * for messages of any number of bits less than 2^64, this - * implementation only works with messages with a length that is - * a multiple of the size of an 8-bit character. - * - */ - -#include "platform/winrt/sha1.h" - -/* - * Define the SHA1 circular left shift macro - */ -#define SHA1CircularShift(bits,word) \ - (((word) << (bits)) | ((word) >> (32-(bits)))) - -/* Local Function Prototyptes */ -void SHA1PadMessage(SHA1Context *); -void SHA1ProcessMessageBlock(SHA1Context *); - -/* - * SHA1Reset - * - * Description: - * This function will initialize the SHA1Context in preparation - * for computing a new SHA1 message digest. - * - * Parameters: - * context: [in/out] - * The context to reset. - * - * Returns: - * sha Error Code. - * - */ -int SHA1Reset(SHA1Context *context) -{ - if (!context) - { - return shaNull; - } - - context->Length_Low = 0; - context->Length_High = 0; - context->Message_Block_Index = 0; - - context->Intermediate_Hash[0] = 0x67452301; - context->Intermediate_Hash[1] = 0xEFCDAB89; - context->Intermediate_Hash[2] = 0x98BADCFE; - context->Intermediate_Hash[3] = 0x10325476; - context->Intermediate_Hash[4] = 0xC3D2E1F0; - - context->Computed = 0; - context->Corrupted = 0; - - return shaSuccess; -} - -/* - * SHA1Result - * - * Description: - * This function will return the 160-bit message digest into the - * Message_Digest array provided by the caller. - * NOTE: The first octet of hash is stored in the 0th element, - * the last octet of hash in the 19th element. - * - * Parameters: - * context: [in/out] - * The context to use to calculate the SHA-1 hash. - * Message_Digest: [out] - * Where the digest is returned. - * - * Returns: - * sha Error Code. - * - */ -int SHA1Result( SHA1Context *context, - uint8_t Message_Digest[SHA1HashSize]) -{ - int i; - - if (!context || !Message_Digest) - { - return shaNull; - } - - if (context->Corrupted) - { - return context->Corrupted; - } - - if (!context->Computed) - { - SHA1PadMessage(context); - for(i=0; i<64; ++i) - { - /* message may be sensitive, clear it out */ - context->Message_Block[i] = 0; - } - context->Length_Low = 0; /* and clear length */ - context->Length_High = 0; - context->Computed = 1; - - } - - for(i = 0; i < SHA1HashSize; ++i) - { - Message_Digest[i] = context->Intermediate_Hash[i>>2] - >> 8 * ( 3 - ( i & 0x03 ) ); - } - - return shaSuccess; -} - -/* - * SHA1Input - * - * Description: - * This function accepts an array of octets as the next portion - * of the message. - * - * Parameters: - * context: [in/out] - * The SHA context to update - * message_array: [in] - * An array of characters representing the next portion of - * the message. - * length: [in] - * The length of the message in message_array - * - * Returns: - * sha Error Code. - * - */ -int SHA1Input( SHA1Context *context, - const uint8_t *message_array, - unsigned length) -{ - if (!length) - { - return shaSuccess; - } - - if (!context || !message_array) - { - return shaNull; - } - - if (context->Computed) - { - context->Corrupted = shaStateError; - - return shaStateError; - } - - if (context->Corrupted) - { - return context->Corrupted; - } - while(length-- && !context->Corrupted) - { - context->Message_Block[context->Message_Block_Index++] = - (*message_array & 0xFF); - - context->Length_Low += 8; - if (context->Length_Low == 0) - { - context->Length_High++; - if (context->Length_High == 0) - { - /* Message is too long */ - context->Corrupted = 1; - } - } - - if (context->Message_Block_Index == 64) - { - SHA1ProcessMessageBlock(context); - } - - message_array++; - } - - return shaSuccess; -} - -/* - * SHA1ProcessMessageBlock - * - * Description: - * This function will process the next 512 bits of the message - * stored in the Message_Block array. - * - * Parameters: - * None. - * - * Returns: - * Nothing. - * - * Comments: - - * Many of the variable names in this code, especially the - * single character names, were used because those were the - * names used in the publication. - * - * - */ -void SHA1ProcessMessageBlock(SHA1Context *context) -{ - const uint32_t K[] = { /* Constants defined in SHA-1 */ - 0x5A827999, - 0x6ED9EBA1, - 0x8F1BBCDC, - 0xCA62C1D6 - }; - int t; /* Loop counter */ - uint32_t temp; /* Temporary word value */ - uint32_t W[80]; /* Word sequence */ - uint32_t A, B, C, D, E; /* Word buffers */ - - /* - * Initialize the first 16 words in the array W - */ - for(t = 0; t < 16; t++) - { - W[t] = context->Message_Block[t * 4] << 24; - W[t] |= context->Message_Block[t * 4 + 1] << 16; - W[t] |= context->Message_Block[t * 4 + 2] << 8; - W[t] |= context->Message_Block[t * 4 + 3]; - } - - for(t = 16; t < 80; t++) - { - W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); - } - - A = context->Intermediate_Hash[0]; - B = context->Intermediate_Hash[1]; - C = context->Intermediate_Hash[2]; - D = context->Intermediate_Hash[3]; - E = context->Intermediate_Hash[4]; - - for(t = 0; t < 20; t++) - { - temp = SHA1CircularShift(5,A) + - ((B & C) | ((~B) & D)) + E + W[t] + K[0]; - E = D; - D = C; - C = SHA1CircularShift(30,B); - - B = A; - A = temp; - } - - for(t = 20; t < 40; t++) - { - temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1]; - E = D; - D = C; - C = SHA1CircularShift(30,B); - B = A; - A = temp; - } - - for(t = 40; t < 60; t++) - { - temp = SHA1CircularShift(5,A) + - ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2]; - E = D; - D = C; - C = SHA1CircularShift(30,B); - B = A; - A = temp; - } - - for(t = 60; t < 80; t++) - { - temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3]; - E = D; - D = C; - C = SHA1CircularShift(30,B); - B = A; - A = temp; - } - - context->Intermediate_Hash[0] += A; - context->Intermediate_Hash[1] += B; - context->Intermediate_Hash[2] += C; - context->Intermediate_Hash[3] += D; - context->Intermediate_Hash[4] += E; - - context->Message_Block_Index = 0; -} - -/* - * SHA1PadMessage - * - - * Description: - * According to the standard, the message must be padded to an even - * 512 bits. The first padding bit must be a '1'. The last 64 - * bits represent the length of the original message. All bits in - * between should be 0. This function will pad the message - * according to those rules by filling the Message_Block array - * accordingly. It will also call the ProcessMessageBlock function - * provided appropriately. When it returns, it can be assumed that - * the message digest has been computed. - * - * Parameters: - * context: [in/out] - * The context to pad - * ProcessMessageBlock: [in] - * The appropriate SHA*ProcessMessageBlock function - * Returns: - * Nothing. - * - */ - -void SHA1PadMessage(SHA1Context *context) -{ - /* - * Check to see if the current message block is too small to hold - * the initial padding bits and length. If so, we will pad the - * block, process it, and then continue padding into a second - * block. - */ - if (context->Message_Block_Index > 55) - { - context->Message_Block[context->Message_Block_Index++] = 0x80; - while(context->Message_Block_Index < 64) - { - context->Message_Block[context->Message_Block_Index++] = 0; - } - - SHA1ProcessMessageBlock(context); - - while(context->Message_Block_Index < 56) - { - context->Message_Block[context->Message_Block_Index++] = 0; - } - } - else - { - context->Message_Block[context->Message_Block_Index++] = 0x80; - while(context->Message_Block_Index < 56) - { - - context->Message_Block[context->Message_Block_Index++] = 0; - } - } - - /* - * Store the message length as the last 8 octets - */ - context->Message_Block[56] = context->Length_High >> 24; - context->Message_Block[57] = context->Length_High >> 16; - context->Message_Block[58] = context->Length_High >> 8; - context->Message_Block[59] = context->Length_High; - context->Message_Block[60] = context->Length_Low >> 24; - context->Message_Block[61] = context->Length_Low >> 16; - context->Message_Block[62] = context->Length_Low >> 8; - context->Message_Block[63] = context->Length_Low; - - SHA1ProcessMessageBlock(context); -} - -static const char alphabet[] = "0123456789ABCDEF"; - -void SHA1ConvertMessageToString(uint8_t *hash_binary, char* hash_string) -{ - for (int i = 0; i != SHA1HashSize; ++i) - { - hash_string[2*i] = alphabet[hash_binary[i] / 16]; - hash_string[2*i + 1] = alphabet[hash_binary[i] % 16]; - } - hash_string[SHA1HashSize * 2] = '\0'; -} diff --git a/cocos/platform/winrt/sha1.h b/cocos/platform/winrt/sha1.h deleted file mode 100644 index e00a028461cb..000000000000 --- a/cocos/platform/winrt/sha1.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * sha1.h - * Copyright (C) The Internet Society (2001). All Rights Reserved. - * This document and translations of it may be copied and furnished to others, - * and derivative works that comment on or otherwise explain it or assist in its - * implementation may be prepared, copied, published and distributed, in whole or in part, - * without restriction of any kind, provided that the above copyright notice and this paragraph - * are included on all such copies and derivative works. However, this document itself may not - * be modified in any way, such as by removing the copyright notice or references to the Internet Society - * or other Internet organizations, except as needed for the purpose of developing Internet standards in - * which case the procedures for copyrights defined in the Internet Standards process must be followed, - * or as required to translate it into languages other than English. - * - * The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. - * - * This document and the information contained herein is provided on an "AS IS" basis and - * THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS - * OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * This is the header file for code which implements the Secure - * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published - * April 17, 1995. - * - * Many of the variable names in this code, especially the - * single character names, were used because those were the names - * used in the publication. - * - * Please read the file sha1.c for more information. - * - */ - -#ifndef _SHA1_H_ -#define _SHA1_H_ - -#include -/* - * If you do not have the ISO standard stdint.h header file, then you - * must typdef the following: - * name meaning - * uint32_t unsigned 32 bit integer - * uint8_t unsigned 8 bit integer (i.e., unsigned char) - * int_least16_t integer of >= 16 bits - * - */ - -#ifndef _SHA_enum_ -#define _SHA_enum_ -enum -{ - shaSuccess = 0, - shaNull, /* Null pointer parameter */ - shaInputTooLong, /* input data too long */ - shaStateError /* called Input after Result */ -}; -#endif -#define SHA1HashSize 20 - -/* - * This structure will hold context information for the SHA-1 - * hashing operation - */ -typedef struct SHA1Context -{ - uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */ - - uint32_t Length_Low; /* Message length in bits */ - uint32_t Length_High; /* Message length in bits */ - - /* Index into message block array */ - int_least16_t Message_Block_Index; - uint8_t Message_Block[64]; /* 512-bit message blocks */ - - int Computed; /* Is the digest computed? */ - int Corrupted; /* Is the message digest corrupted? */ -} SHA1Context; - -/* - * Function Prototypes - */ - -int SHA1Reset( SHA1Context *); -int SHA1Input( SHA1Context *, - const uint8_t *, - unsigned int); -int SHA1Result( SHA1Context *, - uint8_t Message_Digest[SHA1HashSize]); -void SHA1ConvertMessageToString(uint8_t *hash_binary, char* hash_string); - - -#endif diff --git a/cocos/platform/winrt/shaders/precompiledshaders.h b/cocos/platform/winrt/shaders/precompiledshaders.h deleted file mode 100644 index 6d39511d398c..000000000000 --- a/cocos/platform/winrt/shaders/precompiledshaders.h +++ /dev/null @@ -1,5456 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#define PRECOMPILED_SHADERS - -const unsigned char s_2140AC5CB6D3788EBF81062827FA30CB4E9DB1BA[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, - 67, 67, 95, 80, 77, 97, 116, 114, -105, 120, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 4, 0, - 0, 0, 94, 139, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 67, 67, - 95, 84, 101, 120, 116, 117, 114, 101, - 48, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 1, 0, 0, - 0, 2, 0, 0, 0, 10, 0, 0, - 0, 67, 67, 95, 80, 77, 97, 116, -114, 105, 120, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 0, 0, 0, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 0, 0, 0, 1, 0, - 0, 0, 248, 3, 0, 0, 0, 5, - 0, 0, 0, 0, 0, 0, 185, 153, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68, 88, - 66, 67, 11, 95, 74, 206, 145, 124, - 32, 219, 67, 19, 26, 23, 189, 75, - 35, 86, 1, 0, 0, 0, 248, 3, - 0, 0, 6, 0, 0, 0, 56, 0, - 0, 0, 228, 0, 0, 0, 244, 1, - 0, 0, 112, 2, 0, 0, 48, 3, - 0, 0, 124, 3, 0, 0, 65, 111, -110, 57, 164, 0, 0, 0, 164, 0, - 0, 0, 0, 2, 255, 255, 124, 0, - 0, 0, 40, 0, 0, 0, 0, 0, - 40, 0, 0, 0, 40, 0, 0, 0, - 40, 0, 1, 0, 36, 0, 0, 0, - 40, 0, 0, 0, 0, 0, 1, 2, -255, 255, 31, 0, 0, 2, 0, 0, - 0, 128, 0, 0, 15, 176, 31, 0, - 0, 2, 0, 0, 0, 128, 1, 0, - 3, 176, 31, 0, 0, 2, 0, 0, - 0, 144, 0, 8, 15, 160, 66, 0, - 0, 3, 0, 0, 15, 128, 1, 0, -228, 176, 0, 8, 228, 160, 5, 0, - 0, 3, 0, 0, 15, 128, 0, 0, -228, 128, 0, 0, 228, 176, 1, 0, - 0, 2, 0, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 1, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 2, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 3, 8, - 15, 128, 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, 8, 1, - 0, 0, 64, 0, 0, 0, 66, 0, - 0, 0, 90, 0, 0, 3, 0, 96, - 16, 0, 0, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 98, 16, 0, 3, 50, 16, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 3, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, 69, 0, - 0, 9, 242, 0, 16, 0, 0, 0, - 0, 0, 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, 0, 0, - 0, 0, 0, 96, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 242, 0, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 1, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 2, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 3, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 7, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 184, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -255, 255, 0, 65, 0, 0, 134, 0, - 0, 0, 92, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 113, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, 4, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 1, 0, 0, 0, 13, 0, - 0, 0, 115, 97, 109, 112, 108, 101, -114, 95, 95, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 116, -101, 120, 116, 117, 114, 101, 95, 95, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 77, 105, 99, 114, -111, 115, 111, 102, 116, 32, 40, 82, - 41, 32, 72, 76, 83, 76, 32, 83, -104, 97, 100, 101, 114, 32, 67, 111, -109, 112, 105, 108, 101, 114, 32, 54, - 46, 51, 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, 73, 83, - 71, 78, 68, 0, 0, 0, 2, 0, - 0, 0, 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 0, 0, 56, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 3, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 171, -171, 171, 79, 83, 71, 78, 116, 0, - 0, 0, 4, 0, 0, 0, 8, 0, - 0, 0, 104, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 3, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, 97, 114, -103, 101, 116, 0, 171, 171, 68, 88, - 66, 67, 53, 89, 218, 251, 179, 193, -226, 187, 197, 89, 218, 37, 36, 176, -206, 80, 1, 0, 0, 0, 0, 5, - 0, 0, 6, 0, 0, 0, 56, 0, - 0, 0, 92, 1, 0, 0, 224, 2, - 0, 0, 92, 3, 0, 0, 44, 4, - 0, 0, 144, 4, 0, 0, 65, 111, -110, 57, 28, 1, 0, 0, 28, 1, - 0, 0, 0, 2, 254, 255, 232, 0, - 0, 0, 52, 0, 0, 0, 1, 0, - 36, 0, 0, 0, 48, 0, 0, 0, - 48, 0, 0, 0, 36, 0, 1, 0, - 48, 0, 0, 0, 0, 0, 4, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 254, 255, 81, 0, - 0, 5, 5, 0, 15, 160, 0, 0, - 0, 63, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, - 0, 2, 5, 0, 0, 128, 0, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 1, 128, 1, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 2, 128, 2, 0, - 15, 144, 9, 0, 0, 3, 0, 0, - 1, 128, 3, 0, 228, 160, 1, 0, -228, 144, 9, 0, 0, 3, 0, 0, - 2, 128, 4, 0, 228, 160, 1, 0, -228, 144, 2, 0, 0, 3, 0, 0, - 1, 128, 0, 0, 85, 128, 0, 0, - 0, 128, 5, 0, 0, 3, 0, 0, - 4, 192, 0, 0, 0, 128, 5, 0, - 0, 160, 9, 0, 0, 3, 0, 0, - 1, 128, 2, 0, 228, 160, 1, 0, -228, 144, 1, 0, 0, 2, 1, 0, - 2, 128, 0, 0, 0, 129, 9, 0, - 0, 3, 1, 0, 1, 128, 1, 0, -228, 160, 1, 0, 228, 144, 4, 0, - 0, 4, 0, 0, 3, 192, 0, 0, - 85, 128, 0, 0, 228, 160, 1, 0, -228, 128, 1, 0, 0, 2, 0, 0, - 8, 192, 0, 0, 85, 128, 1, 0, - 0, 2, 0, 0, 15, 224, 0, 0, -228, 144, 1, 0, 0, 2, 1, 0, - 3, 224, 2, 0, 228, 144, 255, 255, - 0, 0, 83, 72, 68, 82, 124, 1, - 0, 0, 64, 0, 1, 0, 95, 0, - 0, 0, 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 1, 0, - 0, 0, 95, 0, 0, 3, 50, 16, - 16, 0, 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 50, 32, - 16, 0, 1, 0, 0, 0, 103, 0, - 0, 4, 242, 32, 16, 0, 2, 0, - 0, 0, 1, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 50, 32, - 16, 0, 1, 0, 0, 0, 70, 16, - 16, 0, 2, 0, 0, 0, 17, 0, - 0, 8, 18, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 54, 0, - 0, 6, 34, 32, 16, 0, 2, 0, - 0, 0, 10, 0, 16, 128, 65, 0, - 0, 0, 0, 0, 0, 0, 17, 0, - 0, 8, 18, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 17, 0, - 0, 8, 34, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 0, 0, - 0, 7, 18, 0, 16, 0, 0, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 130, 32, - 16, 0, 2, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 56, 0, - 0, 7, 66, 32, 16, 0, 2, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 1, 64, 0, 0, 0, 0, - 0, 63, 17, 0, 0, 8, 18, 32, - 16, 0, 2, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 11, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 200, 0, - 0, 0, 1, 0, 0, 0, 72, 0, - 0, 0, 1, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 254, 255, 0, 65, - 0, 0, 148, 0, 0, 0, 60, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 36, 71, -108, 111, 98, 97, 108, 115, 0, 171, -171, 171, 60, 0, 0, 0, 1, 0, - 0, 0, 96, 0, 0, 0, 64, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 120, 0, 0, 0, 0, 0, - 0, 0, 64, 0, 0, 0, 2, 0, - 0, 0, 132, 0, 0, 0, 0, 0, - 0, 0, 95, 67, 67, 95, 80, 77, - 97, 116, 114, 105, 120, 0, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_42003E3EDB1E484A842EB95165D48A439ED6AAE8[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 81, 139, 0, 0, 240, -141, 0, 0, 13, 0, 0, 0, 118, - 95, 101, 102, 102, 101, 99, 116, 67, -111, 108, 111, 114, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 3, 0, 0, 0, - 12, 0, 0, 0, 67, 67, 95, 77, - 86, 80, 77, 97, 116, 114, 105, 120, - 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 0, 0, 0, 1, 0, 0, 0, 13, - 0, 0, 0, 118, 95, 101, 102, 102, -101, 99, 116, 67, 111, 108, 111, 114, - 0, 0, 0, 0, 2, 0, 0, 0, - 44, 7, 0, 0, 4, 5, 0, 0, - 0, 0, 0, 0, 185, 153, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 88, 66, 67, -106, 137, 150, 242, 70, 59, 121, 115, - 1, 56, 143, 240, 248, 24, 67, 104, - 1, 0, 0, 0, 44, 7, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, -244, 1, 0, 0, 172, 4, 0, 0, - 40, 5, 0, 0, 100, 6, 0, 0, -176, 6, 0, 0, 65, 111, 110, 57, -180, 1, 0, 0, 180, 1, 0, 0, - 0, 2, 255, 255, 128, 1, 0, 0, - 52, 0, 0, 0, 1, 0, 40, 0, - 0, 0, 52, 0, 0, 0, 52, 0, - 1, 0, 36, 0, 0, 0, 52, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 255, 255, 81, 0, 0, 5, - 1, 0, 15, 160, 31, 133, 235, 190, -254, 255, 71, 65, 0, 0, 0, 192, - 0, 0, 64, 64, 81, 0, 0, 5, - 2, 0, 15, 160, 0, 0, 0, 191, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 0, 0, 0, 128, 0, 0, 15, 176, - 31, 0, 0, 2, 0, 0, 0, 128, - 1, 0, 3, 176, 31, 0, 0, 2, - 0, 0, 0, 144, 0, 8, 15, 160, - 66, 0, 0, 3, 0, 0, 15, 128, - 1, 0, 228, 176, 0, 8, 228, 160, - 7, 0, 0, 2, 0, 0, 1, 128, - 0, 0, 255, 128, 2, 0, 0, 3, - 0, 0, 2, 128, 0, 0, 255, 128, - 1, 0, 0, 160, 5, 0, 0, 3, - 0, 0, 18, 128, 0, 0, 85, 128, - 1, 0, 85, 160, 6, 0, 0, 2, - 0, 0, 1, 128, 0, 0, 0, 128, - 2, 0, 0, 3, 0, 0, 1, 128, - 0, 0, 0, 128, 2, 0, 0, 160, - 2, 0, 0, 3, 0, 0, 17, 128, - 0, 0, 0, 128, 0, 0, 0, 128, - 4, 0, 0, 4, 0, 0, 4, 128, - 0, 0, 0, 128, 1, 0, 170, 160, - 1, 0, 255, 160, 5, 0, 0, 3, - 0, 0, 1, 128, 0, 0, 0, 128, - 0, 0, 0, 128, 5, 0, 0, 3, - 0, 0, 1, 128, 0, 0, 0, 128, - 0, 0, 170, 128, 4, 0, 0, 4, - 0, 0, 4, 128, 0, 0, 85, 128, - 1, 0, 170, 160, 1, 0, 255, 160, - 5, 0, 0, 3, 0, 0, 2, 128, - 0, 0, 85, 128, 0, 0, 85, 128, - 5, 0, 0, 3, 0, 0, 2, 128, - 0, 0, 85, 128, 0, 0, 170, 128, - 11, 0, 0, 3, 1, 0, 8, 128, - 0, 0, 85, 128, 0, 0, 0, 128, - 18, 0, 0, 4, 1, 0, 7, 128, - 0, 0, 85, 128, 0, 0, 228, 176, - 0, 0, 228, 160, 1, 0, 0, 2, - 0, 8, 15, 128, 1, 0, 228, 128, - 1, 0, 0, 2, 1, 8, 15, 128, - 1, 0, 228, 128, 1, 0, 0, 2, - 2, 8, 15, 128, 1, 0, 228, 128, - 1, 0, 0, 2, 3, 8, 15, 128, - 1, 0, 228, 128, 255, 255, 0, 0, - 83, 72, 68, 82, 176, 2, 0, 0, - 64, 0, 0, 0, 172, 0, 0, 0, - 89, 0, 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 90, 0, 0, 3, 0, 96, 16, 0, - 0, 0, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 0, 0, 0, 0, - 85, 85, 0, 0, 98, 16, 0, 3, -114, 16, 16, 0, 0, 0, 0, 0, - 98, 16, 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 0, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 1, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 2, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 3, 0, 0, 0, 104, 0, 0, 2, - 2, 0, 0, 0, 69, 0, 0, 9, -242, 0, 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, 0, 0, - 70, 126, 16, 0, 0, 0, 0, 0, - 0, 96, 16, 0, 0, 0, 0, 0, - 75, 0, 0, 5, 18, 0, 16, 0, - 0, 0, 0, 0, 58, 0, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 10, - 50, 0, 16, 0, 0, 0, 0, 0, -198, 0, 16, 0, 0, 0, 0, 0, - 2, 64, 0, 0, 0, 0, 0, 191, - 31, 133, 235, 190, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 32, 0, 7, - 34, 0, 16, 0, 0, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 254, 255, 71, 65, - 0, 32, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 50, 0, 0, 9, - 66, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 0, 192, - 1, 64, 0, 0, 0, 0, 64, 64, - 56, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 56, 0, 0, 7, - 18, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 42, 0, 16, 0, 0, 0, 0, 0, - 50, 0, 0, 9, 66, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 192, 1, 64, 0, 0, - 0, 0, 64, 64, 56, 0, 0, 7, - 34, 0, 16, 0, 0, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 130, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 42, 0, 16, 0, - 0, 0, 0, 0, 50, 0, 0, 10, - 34, 0, 16, 0, 0, 0, 0, 0, - 42, 0, 16, 128, 65, 0, 0, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 128, 63, 52, 0, 0, 7, -130, 0, 16, 0, 1, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 58, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 210, 0, 16, 0, - 0, 0, 0, 0, 246, 15, 16, 0, - 0, 0, 0, 0, 6, 25, 16, 0, - 0, 0, 0, 0, 50, 0, 0, 10, -114, 0, 16, 0, 1, 0, 0, 0, - 70, 130, 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 86, 5, 16, 0, - 0, 0, 0, 0, 134, 3, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 1, 0, 0, 0, 70, 14, 16, 0, - 1, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 2, 0, 0, 0, - 70, 14, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 3, 0, 0, 0, 70, 14, 16, 0, - 1, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 20, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, - 52, 1, 0, 0, 1, 0, 0, 0, -176, 0, 0, 0, 3, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 255, 255, - 0, 65, 0, 0, 0, 1, 0, 0, -124, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, -145, 0, 0, 0, 2, 0, 0, 0, - 5, 0, 0, 0, 4, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 1, 0, 0, 0, 13, 0, 0, 0, -166, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, -115, 97, 109, 112, 108, 101, 114, 95, - 95, 67, 67, 95, 84, 101, 120, 116, -117, 114, 101, 48, 0, 116, 101, 120, -116, 117, 114, 101, 95, 95, 67, 67, - 95, 84, 101, 120, 116, 117, 114, 101, - 48, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 166, 0, 0, 0, - 1, 0, 0, 0, 200, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 224, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, - 2, 0, 0, 0, 240, 0, 0, 0, - 0, 0, 0, 0, 95, 118, 95, 101, -102, 102, 101, 99, 116, 67, 111, 108, -111, 114, 0, 171, 1, 0, 3, 0, - 1, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 105, 99, 114, -111, 115, 111, 102, 116, 32, 40, 82, - 41, 32, 72, 76, 83, 76, 32, 83, -104, 97, 100, 101, 114, 32, 67, 111, -109, 112, 105, 108, 101, 114, 32, 54, - 46, 51, 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, 171, 171, - 73, 83, 71, 78, 68, 0, 0, 0, - 2, 0, 0, 0, 8, 0, 0, 0, - 56, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 7, 0, 0, - 56, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 3, 3, 0, 0, - 84, 69, 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, 71, 78, -116, 0, 0, 0, 4, 0, 0, 0, - 8, 0, 0, 0, 104, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 104, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 15, 0, 0, 0, 104, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 15, 0, 0, 0, 104, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 3, 0, 0, 0, - 15, 0, 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, 171, 171, - 68, 88, 66, 67, 235, 56, 180, 223, -125, 231, 231, 218, 70, 75, 12, 63, -200, 233, 69, 121, 1, 0, 0, 0, - 4, 5, 0, 0, 6, 0, 0, 0, - 56, 0, 0, 0, 92, 1, 0, 0, -224, 2, 0, 0, 92, 3, 0, 0, - 48, 4, 0, 0, 148, 4, 0, 0, - 65, 111, 110, 57, 28, 1, 0, 0, - 28, 1, 0, 0, 0, 2, 254, 255, -232, 0, 0, 0, 52, 0, 0, 0, - 1, 0, 36, 0, 0, 0, 48, 0, - 0, 0, 48, 0, 0, 0, 36, 0, - 1, 0, 48, 0, 0, 0, 0, 0, - 4, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 2, 254, 255, - 81, 0, 0, 5, 5, 0, 15, 160, - 0, 0, 0, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 2, 5, 0, 0, 128, - 0, 0, 15, 144, 31, 0, 0, 2, - 5, 0, 1, 128, 1, 0, 15, 144, - 31, 0, 0, 2, 5, 0, 2, 128, - 2, 0, 15, 144, 9, 0, 0, 3, - 0, 0, 1, 128, 3, 0, 228, 160, - 1, 0, 228, 144, 9, 0, 0, 3, - 0, 0, 2, 128, 4, 0, 228, 160, - 1, 0, 228, 144, 2, 0, 0, 3, - 0, 0, 1, 128, 0, 0, 85, 128, - 0, 0, 0, 128, 5, 0, 0, 3, - 0, 0, 4, 192, 0, 0, 0, 128, - 5, 0, 0, 160, 9, 0, 0, 3, - 0, 0, 1, 128, 2, 0, 228, 160, - 1, 0, 228, 144, 1, 0, 0, 2, - 1, 0, 2, 128, 0, 0, 0, 129, - 9, 0, 0, 3, 1, 0, 1, 128, - 1, 0, 228, 160, 1, 0, 228, 144, - 4, 0, 0, 4, 0, 0, 3, 192, - 0, 0, 85, 128, 0, 0, 228, 160, - 1, 0, 228, 128, 1, 0, 0, 2, - 0, 0, 8, 192, 0, 0, 85, 128, - 1, 0, 0, 2, 0, 0, 15, 224, - 0, 0, 228, 144, 1, 0, 0, 2, - 1, 0, 3, 224, 2, 0, 228, 144, -255, 255, 0, 0, 83, 72, 68, 82, -124, 1, 0, 0, 64, 0, 1, 0, - 95, 0, 0, 0, 89, 0, 0, 4, - 70, 142, 32, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 95, 0, 0, 3, -242, 16, 16, 0, 0, 0, 0, 0, - 95, 0, 0, 3, 242, 16, 16, 0, - 1, 0, 0, 0, 95, 0, 0, 3, - 50, 16, 16, 0, 2, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 101, 0, 0, 3, - 50, 32, 16, 0, 1, 0, 0, 0, -103, 0, 0, 4, 242, 32, 16, 0, - 2, 0, 0, 0, 1, 0, 0, 0, -104, 0, 0, 2, 1, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 0, 0, 0, 0, 70, 30, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, - 50, 32, 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 2, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 6, 34, 32, 16, 0, - 2, 0, 0, 0, 10, 0, 16, 128, - 65, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 2, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 17, 0, 0, 8, 34, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 0, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -130, 32, 16, 0, 2, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 66, 32, 16, 0, - 2, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 63, 17, 0, 0, 8, - 18, 32, 16, 0, 2, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 11, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, -204, 0, 0, 0, 1, 0, 0, 0, - 72, 0, 0, 0, 1, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 254, 255, - 0, 65, 0, 0, 152, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 36, 71, 108, 111, 98, 97, 108, 115, - 0, 171, 171, 171, 60, 0, 0, 0, - 1, 0, 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 120, 0, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, - 2, 0, 0, 0, 136, 0, 0, 0, - 0, 0, 0, 0, 95, 67, 67, 95, - 77, 86, 80, 77, 97, 116, 114, 105, -120, 0, 171, 171, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 105, 99, 114, -111, 115, 111, 102, 116, 32, 40, 82, - 41, 32, 72, 76, 83, 76, 32, 83, -104, 97, 100, 101, 114, 32, 67, 111, -109, 112, 105, 108, 101, 114, 32, 54, - 46, 51, 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, 171, 171, - 73, 83, 71, 78, 92, 0, 0, 0, - 3, 0, 0, 0, 8, 0, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 15, 0, 0, - 80, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 15, 0, 0, - 80, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 3, 3, 0, 0, - 84, 69, 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, 71, 78, -104, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 80, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 3, 12, 0, 0, 89, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 15, 0, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 83, 86, 95, - 80, 111, 115, 105, 116, 105, 111, 110, - 0, 171, 171, 171, -}; - -const unsigned char s_5132957B676AE174BDF34524AE4A80338F866279[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 80, 139, - 0, 0, 10, 0, 0, 0, 97, 95, -116, 101, 120, 67, 111, 111, 114, 100, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 2, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, - 0, 67, 67, 95, 77, 86, 80, 77, - 97, 116, 114, 105, 120, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 4, 0, 0, 0, 94, 139, 0, - 0, 0, 0, 0, 0, 11, 0, 0, - 0, 67, 67, 95, 84, 101, 120, 116, -117, 114, 101, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 2, 0, 0, 0, - 12, 0, 0, 0, 67, 67, 95, 77, - 86, 80, 77, 97, 116, 114, 105, 120, - 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 0, 0, 0, 1, 0, 0, 0, 156, - 3, 0, 0, 144, 4, 0, 0, 0, - 0, 0, 0, 185, 153, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 68, 88, 66, 67, 203, -117, 183, 110, 154, 52, 220, 70, 125, -228, 9, 112, 112, 45, 175, 213, 1, - 0, 0, 0, 156, 3, 0, 0, 6, - 0, 0, 0, 56, 0, 0, 0, 200, - 0, 0, 0, 176, 1, 0, 0, 44, - 2, 0, 0, 236, 2, 0, 0, 32, - 3, 0, 0, 65, 111, 110, 57, 136, - 0, 0, 0, 136, 0, 0, 0, 0, - 2, 255, 255, 96, 0, 0, 0, 40, - 0, 0, 0, 0, 0, 40, 0, 0, - 0, 40, 0, 0, 0, 40, 0, 1, - 0, 36, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 1, 2, 255, 255, 31, - 0, 0, 2, 0, 0, 0, 128, 0, - 0, 3, 176, 31, 0, 0, 2, 0, - 0, 0, 144, 0, 8, 15, 160, 66, - 0, 0, 3, 0, 0, 15, 128, 0, - 0, 228, 176, 0, 8, 228, 160, 1, - 0, 0, 2, 0, 8, 15, 128, 0, - 0, 228, 128, 1, 0, 0, 2, 1, - 8, 15, 128, 0, 0, 228, 128, 1, - 0, 0, 2, 2, 8, 15, 128, 0, - 0, 228, 128, 1, 0, 0, 2, 3, - 8, 15, 128, 0, 0, 228, 128, 255, -255, 0, 0, 83, 72, 68, 82, 224, - 0, 0, 0, 64, 0, 0, 0, 56, - 0, 0, 0, 90, 0, 0, 3, 0, - 96, 16, 0, 0, 0, 0, 0, 88, - 24, 0, 4, 0, 112, 16, 0, 0, - 0, 0, 0, 85, 85, 0, 0, 98, - 16, 0, 3, 50, 16, 16, 0, 0, - 0, 0, 0, 101, 0, 0, 3, 242, - 32, 16, 0, 0, 0, 0, 0, 101, - 0, 0, 3, 242, 32, 16, 0, 1, - 0, 0, 0, 101, 0, 0, 3, 242, - 32, 16, 0, 2, 0, 0, 0, 101, - 0, 0, 3, 242, 32, 16, 0, 3, - 0, 0, 0, 104, 0, 0, 2, 1, - 0, 0, 0, 69, 0, 0, 9, 242, - 0, 16, 0, 0, 0, 0, 0, 70, - 16, 16, 0, 0, 0, 0, 0, 70, -126, 16, 0, 0, 0, 0, 0, 0, - 96, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 242, 32, 16, 0, 0, - 0, 0, 0, 70, 14, 16, 0, 0, - 0, 0, 0, 54, 0, 0, 5, 242, - 32, 16, 0, 1, 0, 0, 0, 70, - 14, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 242, 32, 16, 0, 2, - 0, 0, 0, 70, 14, 16, 0, 0, - 0, 0, 0, 54, 0, 0, 5, 242, - 32, 16, 0, 3, 0, 0, 0, 70, - 14, 16, 0, 0, 0, 0, 0, 62, - 0, 0, 1, 83, 84, 65, 84, 116, - 0, 0, 0, 6, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 5, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 82, - 68, 69, 70, 184, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 28, 0, 0, 0, 0, - 4, 255, 255, 0, 65, 0, 0, 134, - 0, 0, 0, 92, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 1, - 0, 0, 0, 113, 0, 0, 0, 2, - 0, 0, 0, 5, 0, 0, 0, 4, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 1, 0, 0, 0, 13, - 0, 0, 0, 115, 97, 109, 112, 108, -101, 114, 95, 95, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, -116, 101, 120, 116, 117, 114, 101, 95, - 95, 67, 67, 95, 84, 101, 120, 116, -117, 114, 101, 48, 0, 77, 105, 99, -114, 111, 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, 76, 32, - 83, 104, 97, 100, 101, 114, 32, 67, -111, 109, 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, 48, 48, - 46, 49, 54, 51, 56, 52, 0, 73, - 83, 71, 78, 44, 0, 0, 0, 1, - 0, 0, 0, 8, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 0, 3, 3, 0, 0, 84, - 69, 88, 67, 79, 79, 82, 68, 0, -171, 171, 171, 79, 83, 71, 78, 116, - 0, 0, 0, 4, 0, 0, 0, 8, - 0, 0, 0, 104, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 104, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 1, 0, 0, 0, 15, - 0, 0, 0, 104, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 2, 0, 0, 0, 15, - 0, 0, 0, 104, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 3, 0, 0, 0, 15, - 0, 0, 0, 83, 86, 95, 84, 97, -114, 103, 101, 116, 0, 171, 171, 68, - 88, 66, 67, 110, 14, 140, 120, 239, -110, 56, 78, 103, 37, 245, 162, 140, -151, 93, 223, 1, 0, 0, 0, 144, - 4, 0, 0, 6, 0, 0, 0, 56, - 0, 0, 0, 68, 1, 0, 0, 156, - 2, 0, 0, 24, 3, 0, 0, 236, - 3, 0, 0, 56, 4, 0, 0, 65, -111, 110, 57, 4, 1, 0, 0, 4, - 1, 0, 0, 0, 2, 254, 255, 208, - 0, 0, 0, 52, 0, 0, 0, 1, - 0, 36, 0, 0, 0, 48, 0, 0, - 0, 48, 0, 0, 0, 36, 0, 1, - 0, 48, 0, 0, 0, 0, 0, 4, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 2, 254, 255, 81, - 0, 0, 5, 5, 0, 15, 160, 0, - 0, 0, 63, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 31, - 0, 0, 2, 5, 0, 0, 128, 0, - 0, 15, 144, 31, 0, 0, 2, 5, - 0, 1, 128, 1, 0, 15, 144, 9, - 0, 0, 3, 0, 0, 1, 128, 3, - 0, 228, 160, 0, 0, 228, 144, 9, - 0, 0, 3, 0, 0, 2, 128, 4, - 0, 228, 160, 0, 0, 228, 144, 2, - 0, 0, 3, 0, 0, 1, 128, 0, - 0, 85, 128, 0, 0, 0, 128, 5, - 0, 0, 3, 0, 0, 4, 192, 0, - 0, 0, 128, 5, 0, 0, 160, 9, - 0, 0, 3, 0, 0, 1, 128, 2, - 0, 228, 160, 0, 0, 228, 144, 1, - 0, 0, 2, 1, 0, 2, 128, 0, - 0, 0, 129, 9, 0, 0, 3, 1, - 0, 1, 128, 1, 0, 228, 160, 0, - 0, 228, 144, 4, 0, 0, 4, 0, - 0, 3, 192, 0, 0, 85, 128, 0, - 0, 228, 160, 1, 0, 228, 128, 1, - 0, 0, 2, 0, 0, 8, 192, 0, - 0, 85, 128, 1, 0, 0, 2, 0, - 0, 3, 224, 1, 0, 228, 144, 255, -255, 0, 0, 83, 72, 68, 82, 80, - 1, 0, 0, 64, 0, 1, 0, 84, - 0, 0, 0, 89, 0, 0, 4, 70, -142, 32, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 95, 0, 0, 3, 242, - 16, 16, 0, 0, 0, 0, 0, 95, - 0, 0, 3, 50, 16, 16, 0, 1, - 0, 0, 0, 101, 0, 0, 3, 50, - 32, 16, 0, 0, 0, 0, 0, 103, - 0, 0, 4, 242, 32, 16, 0, 1, - 0, 0, 0, 1, 0, 0, 0, 104, - 0, 0, 2, 1, 0, 0, 0, 54, - 0, 0, 5, 50, 32, 16, 0, 0, - 0, 0, 0, 70, 16, 16, 0, 1, - 0, 0, 0, 17, 0, 0, 8, 18, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 54, 0, 0, 6, 34, - 32, 16, 0, 1, 0, 0, 0, 10, - 0, 16, 128, 65, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 8, 18, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 17, 0, 0, 8, 34, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 18, - 0, 16, 0, 0, 0, 0, 0, 26, - 0, 16, 0, 0, 0, 0, 0, 10, - 0, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 130, 32, 16, 0, 1, - 0, 0, 0, 26, 0, 16, 0, 0, - 0, 0, 0, 56, 0, 0, 7, 66, - 32, 16, 0, 1, 0, 0, 0, 10, - 0, 16, 0, 0, 0, 0, 0, 1, - 64, 0, 0, 0, 0, 0, 63, 17, - 0, 0, 8, 18, 32, 16, 0, 1, - 0, 0, 0, 70, 142, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 70, - 30, 16, 0, 0, 0, 0, 0, 62, - 0, 0, 1, 83, 84, 65, 84, 116, - 0, 0, 0, 10, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 82, - 68, 69, 70, 204, 0, 0, 0, 1, - 0, 0, 0, 72, 0, 0, 0, 1, - 0, 0, 0, 28, 0, 0, 0, 0, - 4, 254, 255, 0, 65, 0, 0, 152, - 0, 0, 0, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 36, 71, 108, 111, 98, - 97, 108, 115, 0, 171, 171, 171, 60, - 0, 0, 0, 1, 0, 0, 0, 96, - 0, 0, 0, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 120, - 0, 0, 0, 0, 0, 0, 0, 64, - 0, 0, 0, 2, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 0, 0, 95, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 171, 171, 3, - 0, 3, 0, 4, 0, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 77, -105, 99, 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, 101, 114, - 32, 67, 111, 109, 112, 105, 108, 101, -114, 32, 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, 56, 52, - 0, 171, 171, 73, 83, 71, 78, 68, - 0, 0, 0, 2, 0, 0, 0, 8, - 0, 0, 0, 56, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 15, - 15, 0, 0, 56, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 1, 0, 0, 0, 3, - 3, 0, 0, 84, 69, 88, 67, 79, - 79, 82, 68, 0, 171, 171, 171, 79, - 83, 71, 78, 80, 0, 0, 0, 2, - 0, 0, 0, 8, 0, 0, 0, 56, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 0, 3, 12, 0, 0, 65, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 3, 0, 0, 0, 1, - 0, 0, 0, 15, 0, 0, 0, 84, - 69, 88, 67, 79, 79, 82, 68, 0, - 83, 86, 95, 80, 111, 115, 105, 116, -105, 111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_61ACD51E94A6AA8035DE722FB113F24350C0D113[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 6, 20, 0, 0, 240, -141, 0, 0, 14, 0, 0, 0, 67, - 67, 95, 97, 108, 112, 104, 97, 95, -118, 97, 108, 117, 101, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 1, 0, 0, 0, 3, 0, 0, - 0, 12, 0, 0, 0, 67, 67, 95, - 77, 86, 80, 77, 97, 116, 114, 105, -120, 0, 0, 0, 0, 0, 0, 0, - 0, 11, 0, 0, 0, 67, 67, 95, - 84, 101, 120, 116, 117, 114, 101, 48, - 0, 0, 0, 0, 1, 0, 0, 0, - 14, 0, 0, 0, 67, 67, 95, 97, -108, 112, 104, 97, 95, 118, 97, 108, -117, 101, 0, 0, 0, 0, 2, 0, - 0, 0, 36, 5, 0, 0, 4, 5, - 0, 0, 0, 0, 0, 0, 185, 153, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68, 88, - 66, 67, 100, 113, 175, 29, 164, 71, -177, 78, 120, 99, 172, 209, 227, 249, -113, 132, 1, 0, 0, 0, 36, 5, - 0, 0, 6, 0, 0, 0, 56, 0, - 0, 0, 88, 1, 0, 0, 164, 2, - 0, 0, 32, 3, 0, 0, 92, 4, - 0, 0, 168, 4, 0, 0, 65, 111, -110, 57, 24, 1, 0, 0, 24, 1, - 0, 0, 0, 2, 255, 255, 228, 0, - 0, 0, 52, 0, 0, 0, 1, 0, - 40, 0, 0, 0, 52, 0, 0, 0, - 52, 0, 1, 0, 36, 0, 0, 0, - 52, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 255, 255, 81, 0, - 0, 5, 1, 0, 15, 160, 0, 0, -128, 191, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, - 0, 2, 0, 0, 0, 128, 0, 0, - 15, 176, 31, 0, 0, 2, 0, 0, - 0, 128, 1, 0, 3, 176, 31, 0, - 0, 2, 0, 0, 0, 144, 0, 8, - 15, 160, 66, 0, 0, 3, 0, 0, - 15, 128, 1, 0, 228, 176, 0, 8, -228, 160, 2, 0, 0, 3, 1, 0, - 8, 128, 0, 0, 255, 129, 0, 0, - 0, 160, 88, 0, 0, 4, 1, 0, - 15, 128, 1, 0, 255, 128, 1, 0, - 0, 160, 1, 0, 85, 160, 65, 0, - 0, 1, 1, 0, 15, 128, 5, 0, - 0, 3, 0, 0, 15, 128, 0, 0, -228, 128, 0, 0, 228, 176, 1, 0, - 0, 2, 1, 0, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 2, 0, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 3, 0, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 0, 8, - 15, 128, 1, 0, 228, 128, 1, 0, - 0, 2, 1, 8, 15, 128, 2, 0, -228, 128, 1, 0, 0, 2, 2, 8, - 15, 128, 3, 0, 228, 128, 1, 0, - 0, 2, 3, 8, 15, 128, 0, 0, -228, 128, 255, 255, 0, 0, 83, 72, - 68, 82, 68, 1, 0, 0, 64, 0, - 0, 0, 81, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 0, 0, 0, 0, 85, 85, - 0, 0, 98, 16, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 3, 0, - 0, 0, 104, 0, 0, 2, 2, 0, - 0, 0, 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, 70, 16, - 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, 29, 0, - 0, 8, 18, 0, 16, 0, 1, 0, - 0, 0, 10, 128, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 58, 0, - 16, 0, 0, 0, 0, 0, 13, 0, - 4, 3, 10, 0, 16, 0, 1, 0, - 0, 0, 56, 0, 0, 7, 242, 0, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 1, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 2, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 3, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 9, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 52, 1, 0, 0, 1, 0, - 0, 0, 176, 0, 0, 0, 3, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -255, 255, 0, 65, 0, 0, 0, 1, - 0, 0, 124, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 145, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, 4, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 1, 0, 0, 0, 13, 0, - 0, 0, 166, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 115, 97, 109, 112, 108, 101, -114, 95, 95, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 116, -101, 120, 116, 117, 114, 101, 95, 95, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 36, 71, 108, 111, - 98, 97, 108, 115, 0, 171, 166, 0, - 0, 0, 1, 0, 0, 0, 200, 0, - 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 224, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 2, 0, 0, 0, 240, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 97, 108, 112, 104, 97, 95, -118, 97, 108, 117, 101, 0, 0, 0, - 3, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 68, 0, - 0, 0, 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 56, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 116, 0, 0, 0, 4, 0, - 0, 0, 8, 0, 0, 0, 104, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 3, 0, - 0, 0, 15, 0, 0, 0, 83, 86, - 95, 84, 97, 114, 103, 101, 116, 0, -171, 171, 68, 88, 66, 67, 235, 56, -180, 223, 125, 231, 231, 218, 70, 75, - 12, 63, 200, 233, 69, 121, 1, 0, - 0, 0, 4, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 92, 1, - 0, 0, 224, 2, 0, 0, 92, 3, - 0, 0, 48, 4, 0, 0, 148, 4, - 0, 0, 65, 111, 110, 57, 28, 1, - 0, 0, 28, 1, 0, 0, 0, 2, -254, 255, 232, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 36, 0, 0, 0, - 48, 0, 0, 0, 48, 0, 0, 0, - 36, 0, 1, 0, 48, 0, 0, 0, - 0, 0, 4, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 2, -254, 255, 81, 0, 0, 5, 5, 0, - 15, 160, 0, 0, 0, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, 5, 0, - 0, 128, 0, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 1, 128, 1, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 2, 128, 2, 0, 15, 144, 9, 0, - 0, 3, 0, 0, 1, 128, 3, 0, -228, 160, 1, 0, 228, 144, 9, 0, - 0, 3, 0, 0, 2, 128, 4, 0, -228, 160, 1, 0, 228, 144, 2, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 85, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 4, 192, 0, 0, - 0, 128, 5, 0, 0, 160, 9, 0, - 0, 3, 0, 0, 1, 128, 2, 0, -228, 160, 1, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 2, 128, 0, 0, - 0, 129, 9, 0, 0, 3, 1, 0, - 1, 128, 1, 0, 228, 160, 1, 0, -228, 144, 4, 0, 0, 4, 0, 0, - 3, 192, 0, 0, 85, 128, 0, 0, -228, 160, 1, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 192, 0, 0, - 85, 128, 1, 0, 0, 2, 0, 0, - 15, 224, 0, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 3, 224, 2, 0, -228, 144, 255, 255, 0, 0, 83, 72, - 68, 82, 124, 1, 0, 0, 64, 0, - 1, 0, 95, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 1, 0, 0, 0, 95, 0, - 0, 3, 50, 16, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 50, 32, 16, 0, 1, 0, - 0, 0, 103, 0, 0, 4, 242, 32, - 16, 0, 2, 0, 0, 0, 1, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 50, 32, 16, 0, 1, 0, - 0, 0, 70, 16, 16, 0, 2, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 54, 0, 0, 6, 34, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 128, 65, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 17, 0, 0, 8, 34, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 0, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, 2, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 66, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 0, 0, 0, 63, 17, 0, - 0, 8, 18, 32, 16, 0, 2, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 11, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 204, 0, 0, 0, 1, 0, - 0, 0, 72, 0, 0, 0, 1, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -254, 255, 0, 65, 0, 0, 152, 0, - 0, 0, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 1, 0, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, - 0, 0, 0, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 171, 171, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_6A3FEBEAD7E44B2380CD39CBDCFD1D3B046D8057[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 99, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 67, 67, 95, 77, - 86, 80, 77, 97, 116, 114, 105, 120, - 0, 0, 0, 0, 0, 0, 0, 0, - 16, 4, 0, 0, 48, 5, 0, 0, - 0, 0, 0, 0, 185, 153, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 88, 66, 67, - 79, 226, 72, 124, 94, 252, 37, 157, -186, 66, 253, 29, 176, 252, 8, 124, - 1, 0, 0, 0, 16, 4, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, - 28, 1, 0, 0, 116, 2, 0, 0, -240, 2, 0, 0, 72, 3, 0, 0, -148, 3, 0, 0, 65, 111, 110, 57, -220, 0, 0, 0, 220, 0, 0, 0, - 0, 2, 255, 255, 184, 0, 0, 0, - 36, 0, 0, 0, 0, 0, 36, 0, - 0, 0, 36, 0, 0, 0, 36, 0, - 0, 0, 36, 0, 0, 0, 36, 0, - 1, 2, 255, 255, 81, 0, 0, 5, - 0, 0, 15, 160, 0, 0, 0, 0, - 0, 0, 128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 0, 0, 0, 128, 0, 0, 15, 176, - 31, 0, 0, 2, 0, 0, 0, 128, - 1, 0, 3, 176, 90, 0, 0, 4, - 0, 0, 8, 128, 1, 0, 228, 176, - 1, 0, 228, 176, 0, 0, 0, 160, - 7, 0, 0, 2, 0, 0, 1, 128, - 0, 0, 255, 128, 6, 0, 0, 2, - 0, 0, 1, 128, 0, 0, 0, 128, - 2, 0, 0, 3, 0, 0, 1, 128, - 0, 0, 0, 129, 0, 0, 85, 160, - 88, 0, 0, 4, 0, 0, 15, 128, - 0, 0, 0, 128, 0, 0, 228, 176, - 0, 0, 0, 160, 1, 0, 0, 2, - 0, 8, 15, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 1, 8, 15, 128, - 0, 0, 228, 128, 1, 0, 0, 2, - 2, 8, 15, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 3, 8, 15, 128, - 0, 0, 228, 128, 255, 255, 0, 0, - 83, 72, 68, 82, 80, 1, 0, 0, - 64, 0, 0, 0, 84, 0, 0, 0, - 98, 16, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 98, 16, 0, 3, - 50, 16, 16, 0, 1, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 1, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 2, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 3, 0, 0, 0, -104, 0, 0, 2, 1, 0, 0, 0, - 15, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 16, 16, 0, - 1, 0, 0, 0, 70, 16, 16, 0, - 1, 0, 0, 0, 75, 0, 0, 5, - 18, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 128, - 65, 0, 0, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 128, 63, - 29, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 7, - 18, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 128, 63, - 56, 0, 0, 7, 242, 0, 16, 0, - 0, 0, 0, 0, 6, 0, 16, 0, - 0, 0, 0, 0, 70, 30, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 1, 0, 0, 0, 70, 14, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 2, 0, 0, 0, - 70, 14, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 3, 0, 0, 0, 70, 14, 16, 0, - 0, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 11, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, - 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 255, 255, - 0, 65, 0, 0, 28, 0, 0, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, 71, 78, - 68, 0, 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 56, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, 171, 171, - 79, 83, 71, 78, 116, 0, 0, 0, - 4, 0, 0, 0, 8, 0, 0, 0, -104, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 3, 0, 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, 103, 101, -116, 0, 171, 171, 68, 88, 66, 67, -171, 76, 90, 152, 95, 120, 80, 155, -185, 88, 30, 71, 14, 112, 82, 161, - 1, 0, 0, 0, 48, 5, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, -108, 1, 0, 0, 12, 3, 0, 0, -136, 3, 0, 0, 92, 4, 0, 0, -192, 4, 0, 0, 65, 111, 110, 57, - 44, 1, 0, 0, 44, 1, 0, 0, - 0, 2, 254, 255, 248, 0, 0, 0, - 52, 0, 0, 0, 1, 0, 36, 0, - 0, 0, 48, 0, 0, 0, 48, 0, - 0, 0, 36, 0, 1, 0, 48, 0, - 0, 0, 0, 0, 4, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 254, 255, 81, 0, 0, 5, - 5, 0, 15, 160, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 5, 0, 0, 128, 0, 0, 15, 144, - 31, 0, 0, 2, 5, 0, 1, 128, - 1, 0, 15, 144, 31, 0, 0, 2, - 5, 0, 2, 128, 2, 0, 15, 144, - 5, 0, 0, 3, 0, 0, 7, 224, - 0, 0, 255, 144, 0, 0, 228, 144, - 9, 0, 0, 3, 0, 0, 1, 128, - 3, 0, 228, 160, 1, 0, 228, 144, - 9, 0, 0, 3, 0, 0, 2, 128, - 4, 0, 228, 160, 1, 0, 228, 144, - 2, 0, 0, 3, 0, 0, 1, 128, - 0, 0, 85, 128, 0, 0, 0, 128, - 5, 0, 0, 3, 0, 0, 4, 192, - 0, 0, 0, 128, 5, 0, 0, 160, - 9, 0, 0, 3, 0, 0, 1, 128, - 2, 0, 228, 160, 1, 0, 228, 144, - 1, 0, 0, 2, 1, 0, 2, 128, - 0, 0, 0, 129, 9, 0, 0, 3, - 1, 0, 1, 128, 1, 0, 228, 160, - 1, 0, 228, 144, 4, 0, 0, 4, - 0, 0, 3, 192, 0, 0, 85, 128, - 0, 0, 228, 160, 1, 0, 228, 128, - 1, 0, 0, 2, 0, 0, 8, 192, - 0, 0, 85, 128, 1, 0, 0, 2, - 0, 0, 8, 224, 0, 0, 255, 144, - 1, 0, 0, 2, 1, 0, 3, 224, - 2, 0, 228, 144, 255, 255, 0, 0, - 83, 72, 68, 82, 152, 1, 0, 0, - 64, 0, 1, 0, 102, 0, 0, 0, - 89, 0, 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 95, 0, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 95, 0, 0, 3, -242, 16, 16, 0, 1, 0, 0, 0, - 95, 0, 0, 3, 50, 16, 16, 0, - 2, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 0, 0, 0, 0, -101, 0, 0, 3, 50, 32, 16, 0, - 1, 0, 0, 0, 103, 0, 0, 4, -242, 32, 16, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 104, 0, 0, 2, - 1, 0, 0, 0, 56, 0, 0, 7, -114, 32, 16, 0, 0, 0, 0, 0, -246, 31, 16, 0, 0, 0, 0, 0, - 70, 18, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 130, 32, 16, 0, - 0, 0, 0, 0, 58, 16, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, - 50, 32, 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 2, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 6, 34, 32, 16, 0, - 2, 0, 0, 0, 10, 0, 16, 128, - 65, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 2, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 17, 0, 0, 8, 34, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 0, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -130, 32, 16, 0, 2, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 66, 32, 16, 0, - 2, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 63, 17, 0, 0, 8, - 18, 32, 16, 0, 2, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 12, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, -204, 0, 0, 0, 1, 0, 0, 0, - 72, 0, 0, 0, 1, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 254, 255, - 0, 65, 0, 0, 152, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 36, 71, 108, 111, 98, 97, 108, 115, - 0, 171, 171, 171, 60, 0, 0, 0, - 1, 0, 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 120, 0, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, - 2, 0, 0, 0, 136, 0, 0, 0, - 0, 0, 0, 0, 95, 67, 67, 95, - 77, 86, 80, 77, 97, 116, 114, 105, -120, 0, 171, 171, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 105, 99, 114, -111, 115, 111, 102, 116, 32, 40, 82, - 41, 32, 72, 76, 83, 76, 32, 83, -104, 97, 100, 101, 114, 32, 67, 111, -109, 112, 105, 108, 101, 114, 32, 54, - 46, 51, 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, 171, 171, - 73, 83, 71, 78, 92, 0, 0, 0, - 3, 0, 0, 0, 8, 0, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 15, 0, 0, - 80, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 15, 0, 0, - 80, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 3, 3, 0, 0, - 84, 69, 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, 71, 78, -104, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 80, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 3, 12, 0, 0, 89, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 15, 0, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 83, 86, 95, - 80, 111, 115, 105, 116, 105, 111, 110, - 0, 171, 171, 171, -}; - -const unsigned char s_6C80A53170768A04FB4457D7203425EA3467E2E4[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 3, - 0, 0, 0, 92, 139, 0, 0, 242, -141, 0, 0, 12, 0, 0, 0, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 4, - 0, 0, 0, 82, 139, 0, 0, 242, -141, 0, 0, 7, 0, 0, 0, 117, - 95, 99, 111, 108, 111, 114, 0, 0, - 0, 0, 255, 255, 255, 255, 4, 0, - 0, 0, 1, 0, 0, 0, 6, 20, - 0, 0, 242, 141, 0, 0, 11, 0, - 0, 0, 117, 95, 112, 111, 105, 110, -116, 83, 105, 122, 101, 0, 0, 0, - 0, 255, 255, 255, 255, 5, 0, 0, - 0, 1, 0, 0, 0, 3, 0, 0, - 0, 12, 0, 0, 0, 67, 67, 95, - 77, 86, 80, 77, 97, 116, 114, 105, -120, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 0, 0, 0, 117, 95, 99, -111, 108, 111, 114, 0, 0, 0, 0, - 1, 0, 0, 0, 11, 0, 0, 0, -117, 95, 112, 111, 105, 110, 116, 83, -105, 122, 101, 0, 0, 0, 0, 2, - 0, 0, 0, 204, 2, 0, 0, 208, - 4, 0, 0, 0, 0, 0, 0, 185, -153, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 68, - 88, 66, 67, 127, 145, 81, 72, 216, -190, 16, 61, 245, 231, 235, 249, 125, -223, 218, 82, 1, 0, 0, 0, 204, - 2, 0, 0, 6, 0, 0, 0, 56, - 0, 0, 0, 168, 0, 0, 0, 72, - 1, 0, 0, 196, 1, 0, 0, 28, - 2, 0, 0, 80, 2, 0, 0, 65, -111, 110, 57, 104, 0, 0, 0, 104, - 0, 0, 0, 0, 2, 255, 255, 68, - 0, 0, 0, 36, 0, 0, 0, 0, - 0, 36, 0, 0, 0, 36, 0, 0, - 0, 36, 0, 0, 0, 36, 0, 0, - 0, 36, 0, 1, 2, 255, 255, 31, - 0, 0, 2, 0, 0, 0, 128, 0, - 0, 15, 176, 1, 0, 0, 2, 0, - 8, 15, 128, 0, 0, 228, 176, 1, - 0, 0, 2, 1, 8, 15, 128, 0, - 0, 228, 176, 1, 0, 0, 2, 2, - 8, 15, 128, 0, 0, 228, 176, 1, - 0, 0, 2, 3, 8, 15, 128, 0, - 0, 228, 176, 255, 255, 0, 0, 83, - 72, 68, 82, 152, 0, 0, 0, 64, - 0, 0, 0, 38, 0, 0, 0, 98, - 16, 0, 3, 242, 16, 16, 0, 0, - 0, 0, 0, 101, 0, 0, 3, 242, - 32, 16, 0, 0, 0, 0, 0, 101, - 0, 0, 3, 242, 32, 16, 0, 1, - 0, 0, 0, 101, 0, 0, 3, 242, - 32, 16, 0, 2, 0, 0, 0, 101, - 0, 0, 3, 242, 32, 16, 0, 3, - 0, 0, 0, 54, 0, 0, 5, 242, - 32, 16, 0, 0, 0, 0, 0, 70, - 30, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 242, 32, 16, 0, 1, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 54, 0, 0, 5, 242, - 32, 16, 0, 2, 0, 0, 0, 70, - 30, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 242, 32, 16, 0, 3, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 62, 0, 0, 1, 83, - 84, 65, 84, 116, 0, 0, 0, 5, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 5, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 82, 68, 69, 70, 80, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 28, - 0, 0, 0, 0, 4, 255, 255, 0, - 65, 0, 0, 28, 0, 0, 0, 77, -105, 99, 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, 101, 114, - 32, 67, 111, 109, 112, 105, 108, 101, -114, 32, 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, 56, 52, - 0, 171, 171, 73, 83, 71, 78, 44, - 0, 0, 0, 1, 0, 0, 0, 8, - 0, 0, 0, 32, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 15, - 15, 0, 0, 84, 69, 88, 67, 79, - 79, 82, 68, 0, 171, 171, 171, 79, - 83, 71, 78, 116, 0, 0, 0, 4, - 0, 0, 0, 8, 0, 0, 0, 104, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 104, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 1, - 0, 0, 0, 15, 0, 0, 0, 104, - 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 2, - 0, 0, 0, 15, 0, 0, 0, 104, - 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 3, - 0, 0, 0, 15, 0, 0, 0, 83, - 86, 95, 84, 97, 114, 103, 101, 116, - 0, 171, 171, 68, 88, 66, 67, 73, -129, 132, 250, 182, 151, 72, 83, 149, - 86, 107, 61, 98, 5, 216, 237, 1, - 0, 0, 0, 208, 4, 0, 0, 6, - 0, 0, 0, 56, 0, 0, 0, 56, - 1, 0, 0, 136, 2, 0, 0, 4, - 3, 0, 0, 68, 4, 0, 0, 120, - 4, 0, 0, 65, 111, 110, 57, 248, - 0, 0, 0, 248, 0, 0, 0, 0, - 2, 254, 255, 196, 0, 0, 0, 52, - 0, 0, 0, 1, 0, 36, 0, 0, - 0, 48, 0, 0, 0, 48, 0, 0, - 0, 36, 0, 1, 0, 48, 0, 0, - 0, 0, 0, 5, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 2, 254, 255, 81, 0, 0, 5, 6, - 0, 15, 160, 0, 0, 0, 63, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 31, 0, 0, 2, 5, - 0, 0, 128, 0, 0, 15, 144, 9, - 0, 0, 3, 0, 0, 1, 128, 3, - 0, 228, 160, 0, 0, 228, 144, 9, - 0, 0, 3, 0, 0, 2, 128, 4, - 0, 228, 160, 0, 0, 228, 144, 2, - 0, 0, 3, 0, 0, 1, 128, 0, - 0, 85, 128, 0, 0, 0, 128, 5, - 0, 0, 3, 0, 0, 4, 192, 0, - 0, 0, 128, 6, 0, 0, 160, 9, - 0, 0, 3, 0, 0, 1, 128, 2, - 0, 228, 160, 0, 0, 228, 144, 1, - 0, 0, 2, 1, 0, 2, 128, 0, - 0, 0, 129, 9, 0, 0, 3, 1, - 0, 1, 128, 1, 0, 228, 160, 0, - 0, 228, 144, 4, 0, 0, 4, 0, - 0, 3, 192, 0, 0, 85, 128, 0, - 0, 228, 160, 1, 0, 228, 128, 1, - 0, 0, 2, 0, 0, 8, 192, 0, - 0, 85, 128, 1, 0, 0, 2, 0, - 0, 15, 224, 5, 0, 228, 160, 255, -255, 0, 0, 83, 72, 68, 82, 72, - 1, 0, 0, 64, 0, 1, 0, 82, - 0, 0, 0, 89, 0, 0, 4, 70, -142, 32, 0, 0, 0, 0, 0, 5, - 0, 0, 0, 95, 0, 0, 3, 242, - 16, 16, 0, 0, 0, 0, 0, 101, - 0, 0, 3, 242, 32, 16, 0, 0, - 0, 0, 0, 103, 0, 0, 4, 242, - 32, 16, 0, 1, 0, 0, 0, 1, - 0, 0, 0, 104, 0, 0, 2, 1, - 0, 0, 0, 54, 0, 0, 6, 242, - 32, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 17, 0, 0, 8, 18, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 54, 0, 0, 6, 34, - 32, 16, 0, 1, 0, 0, 0, 10, - 0, 16, 128, 65, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 0, 8, 18, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 17, 0, 0, 8, 34, - 0, 16, 0, 0, 0, 0, 0, 70, -142, 32, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 70, 30, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 18, - 0, 16, 0, 0, 0, 0, 0, 26, - 0, 16, 0, 0, 0, 0, 0, 10, - 0, 16, 0, 0, 0, 0, 0, 54, - 0, 0, 5, 130, 32, 16, 0, 1, - 0, 0, 0, 26, 0, 16, 0, 0, - 0, 0, 0, 56, 0, 0, 7, 66, - 32, 16, 0, 1, 0, 0, 0, 10, - 0, 16, 0, 0, 0, 0, 0, 1, - 64, 0, 0, 0, 0, 0, 63, 17, - 0, 0, 8, 18, 32, 16, 0, 1, - 0, 0, 0, 70, 142, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 70, - 30, 16, 0, 0, 0, 0, 0, 62, - 0, 0, 1, 83, 84, 65, 84, 116, - 0, 0, 0, 10, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 82, - 68, 69, 70, 56, 1, 0, 0, 1, - 0, 0, 0, 72, 0, 0, 0, 1, - 0, 0, 0, 28, 0, 0, 0, 0, - 4, 254, 255, 0, 65, 0, 0, 4, - 1, 0, 0, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 36, 71, 108, 111, 98, - 97, 108, 115, 0, 171, 171, 171, 60, - 0, 0, 0, 3, 0, 0, 0, 96, - 0, 0, 0, 96, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 168, - 0, 0, 0, 0, 0, 0, 0, 64, - 0, 0, 0, 2, 0, 0, 0, 184, - 0, 0, 0, 0, 0, 0, 0, 200, - 0, 0, 0, 64, 0, 0, 0, 16, - 0, 0, 0, 2, 0, 0, 0, 212, - 0, 0, 0, 0, 0, 0, 0, 228, - 0, 0, 0, 80, 0, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 244, - 0, 0, 0, 0, 0, 0, 0, 95, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 171, 171, 3, - 0, 3, 0, 4, 0, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 95, -117, 95, 99, 111, 108, 111, 114, 0, -171, 171, 171, 1, 0, 3, 0, 1, - 0, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 95, 117, 95, 112, 111, -105, 110, 116, 83, 105, 122, 101, 0, -171, 171, 171, 0, 0, 3, 0, 1, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 77, 105, 99, 114, 111, -115, 111, 102, 116, 32, 40, 82, 41, - 32, 72, 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, 111, 109, -112, 105, 108, 101, 114, 32, 54, 46, - 51, 46, 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, 171, 73, - 83, 71, 78, 44, 0, 0, 0, 1, - 0, 0, 0, 8, 0, 0, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 0, 15, 15, 0, 0, 84, - 69, 88, 67, 79, 79, 82, 68, 0, -171, 171, 171, 79, 83, 71, 78, 80, - 0, 0, 0, 2, 0, 0, 0, 8, - 0, 0, 0, 56, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 65, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 3, - 0, 0, 0, 1, 0, 0, 0, 15, - 0, 0, 0, 84, 69, 88, 67, 79, - 79, 82, 68, 0, 83, 86, 95, 80, -111, 115, 105, 116, 105, 111, 110, 0, -171, 171, 171, -}; - -const unsigned char s_7845A827CC74A6ED188C81E590C16A4B394AF6EA[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, - 67, 67, 95, 80, 77, 97, 116, 114, -105, 120, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 4, 0, - 0, 0, 1, 0, 0, 0, 10, 0, - 0, 0, 67, 67, 95, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, - 0, 0, 0, 0, 204, 2, 0, 0, -164, 4, 0, 0, 0, 0, 0, 0, -185, 153, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 88, 66, 67, 127, 145, 81, 72, -216, 190, 16, 61, 245, 231, 235, 249, -125, 223, 218, 82, 1, 0, 0, 0, -204, 2, 0, 0, 6, 0, 0, 0, - 56, 0, 0, 0, 168, 0, 0, 0, - 72, 1, 0, 0, 196, 1, 0, 0, - 28, 2, 0, 0, 80, 2, 0, 0, - 65, 111, 110, 57, 104, 0, 0, 0, -104, 0, 0, 0, 0, 2, 255, 255, - 68, 0, 0, 0, 36, 0, 0, 0, - 0, 0, 36, 0, 0, 0, 36, 0, - 0, 0, 36, 0, 0, 0, 36, 0, - 0, 0, 36, 0, 1, 2, 255, 255, - 31, 0, 0, 2, 0, 0, 0, 128, - 0, 0, 15, 176, 1, 0, 0, 2, - 0, 8, 15, 128, 0, 0, 228, 176, - 1, 0, 0, 2, 1, 8, 15, 128, - 0, 0, 228, 176, 1, 0, 0, 2, - 2, 8, 15, 128, 0, 0, 228, 176, - 1, 0, 0, 2, 3, 8, 15, 128, - 0, 0, 228, 176, 255, 255, 0, 0, - 83, 72, 68, 82, 152, 0, 0, 0, - 64, 0, 0, 0, 38, 0, 0, 0, - 98, 16, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 0, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 1, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 2, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 3, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 0, 0, 0, 0, - 70, 30, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 1, 0, 0, 0, 70, 30, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 2, 0, 0, 0, - 70, 30, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 3, 0, 0, 0, 70, 30, 16, 0, - 0, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, - 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 255, 255, - 0, 65, 0, 0, 28, 0, 0, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, 71, 78, - 44, 0, 0, 0, 1, 0, 0, 0, - 8, 0, 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, 171, 171, - 79, 83, 71, 78, 116, 0, 0, 0, - 4, 0, 0, 0, 8, 0, 0, 0, -104, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 3, 0, 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, 103, 101, -116, 0, 171, 171, 68, 88, 66, 67, - 29, 56, 85, 83, 131, 253, 216, 133, -161, 187, 70, 220, 103, 188, 220, 164, - 1, 0, 0, 0, 164, 4, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, - 68, 1, 0, 0, 156, 2, 0, 0, - 24, 3, 0, 0, 232, 3, 0, 0, - 76, 4, 0, 0, 65, 111, 110, 57, - 4, 1, 0, 0, 4, 1, 0, 0, - 0, 2, 254, 255, 208, 0, 0, 0, - 52, 0, 0, 0, 1, 0, 36, 0, - 0, 0, 48, 0, 0, 0, 48, 0, - 0, 0, 36, 0, 1, 0, 48, 0, - 0, 0, 0, 0, 4, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 254, 255, 81, 0, 0, 5, - 5, 0, 15, 160, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 5, 0, 0, 128, 0, 0, 15, 144, - 31, 0, 0, 2, 5, 0, 1, 128, - 1, 0, 15, 144, 9, 0, 0, 3, - 0, 0, 1, 128, 3, 0, 228, 160, - 1, 0, 228, 144, 9, 0, 0, 3, - 0, 0, 2, 128, 4, 0, 228, 160, - 1, 0, 228, 144, 2, 0, 0, 3, - 0, 0, 1, 128, 0, 0, 85, 128, - 0, 0, 0, 128, 5, 0, 0, 3, - 0, 0, 4, 192, 0, 0, 0, 128, - 5, 0, 0, 160, 9, 0, 0, 3, - 0, 0, 1, 128, 2, 0, 228, 160, - 1, 0, 228, 144, 1, 0, 0, 2, - 1, 0, 2, 128, 0, 0, 0, 129, - 9, 0, 0, 3, 1, 0, 1, 128, - 1, 0, 228, 160, 1, 0, 228, 144, - 4, 0, 0, 4, 0, 0, 3, 192, - 0, 0, 85, 128, 0, 0, 228, 160, - 1, 0, 228, 128, 1, 0, 0, 2, - 0, 0, 8, 192, 0, 0, 85, 128, - 1, 0, 0, 2, 0, 0, 15, 224, - 0, 0, 228, 144, 255, 255, 0, 0, - 83, 72, 68, 82, 80, 1, 0, 0, - 64, 0, 1, 0, 84, 0, 0, 0, - 89, 0, 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 95, 0, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 95, 0, 0, 3, -242, 16, 16, 0, 1, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 103, 0, 0, 4, -242, 32, 16, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 104, 0, 0, 2, - 1, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 0, 0, 0, 0, - 70, 30, 16, 0, 0, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 6, 34, 32, 16, 0, - 1, 0, 0, 0, 10, 0, 16, 128, - 65, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 8, 18, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 2, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 17, 0, 0, 8, 34, 0, 16, 0, - 0, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 0, 0, 0, 7, 18, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -130, 32, 16, 0, 1, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 66, 32, 16, 0, - 1, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 1, 64, 0, 0, - 0, 0, 0, 63, 17, 0, 0, 8, - 18, 32, 16, 0, 1, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, 0, 0, - 10, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, 69, 70, -200, 0, 0, 0, 1, 0, 0, 0, - 72, 0, 0, 0, 1, 0, 0, 0, - 28, 0, 0, 0, 0, 4, 254, 255, - 0, 65, 0, 0, 148, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 36, 71, 108, 111, 98, 97, 108, 115, - 0, 171, 171, 171, 60, 0, 0, 0, - 1, 0, 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 120, 0, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, - 2, 0, 0, 0, 132, 0, 0, 0, - 0, 0, 0, 0, 95, 67, 67, 95, - 80, 77, 97, 116, 114, 105, 120, 0, - 3, 0, 3, 0, 4, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, 71, 78, - 92, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 80, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 15, 15, 0, 0, 80, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 3, 0, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, 171, 171, - 79, 83, 71, 78, 80, 0, 0, 0, - 2, 0, 0, 0, 8, 0, 0, 0, - 56, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, - 65, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 0, 0, 0, - 84, 69, 88, 67, 79, 79, 82, 68, - 0, 83, 86, 95, 80, 111, 115, 105, -116, 105, 111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_993D07D70C4AE9F39EAA9EBBDFD109681386920A[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 255, 255, 80, 139, - 0, 0, 10, 0, 0, 0, 97, 95, -116, 101, 120, 67, 111, 111, 114, 100, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 3, 0, 0, 0, 92, 139, 0, - 0, 242, 141, 0, 0, 12, 0, 0, - 0, 67, 67, 95, 77, 86, 80, 77, - 97, 116, 114, 105, 120, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 4, 0, 0, 0, 94, 139, 0, - 0, 0, 0, 0, 0, 11, 0, 0, - 0, 67, 67, 95, 84, 101, 120, 116, -117, 114, 101, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 82, 139, 0, 0, -240, 141, 0, 0, 7, 0, 0, 0, -117, 95, 99, 111, 108, 111, 114, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 1, 0, 0, 0, 3, - 0, 0, 0, 12, 0, 0, 0, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 0, 0, 0, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 0, 0, 0, 1, 0, - 0, 0, 7, 0, 0, 0, 117, 95, - 99, 111, 108, 111, 114, 0, 0, 0, - 0, 2, 0, 0, 0, 96, 4, 0, - 0, 144, 4, 0, 0, 0, 0, 0, - 0, 185, 153, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 68, 88, 66, 67, 157, 116, 105, - 89, 118, 135, 249, 239, 42, 226, 184, - 78, 220, 105, 236, 28, 1, 0, 0, - 0, 96, 4, 0, 0, 6, 0, 0, - 0, 56, 0, 0, 0, 228, 0, 0, - 0, 252, 1, 0, 0, 120, 2, 0, - 0, 176, 3, 0, 0, 228, 3, 0, - 0, 65, 111, 110, 57, 164, 0, 0, - 0, 164, 0, 0, 0, 0, 2, 255, -255, 112, 0, 0, 0, 52, 0, 0, - 0, 1, 0, 40, 0, 0, 0, 52, - 0, 0, 0, 52, 0, 1, 0, 36, - 0, 0, 0, 52, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 2, 255, -255, 31, 0, 0, 2, 0, 0, 0, -128, 0, 0, 3, 176, 31, 0, 0, - 2, 0, 0, 0, 144, 0, 8, 15, -160, 66, 0, 0, 3, 0, 0, 15, -128, 0, 0, 228, 176, 0, 8, 228, -160, 5, 0, 0, 3, 0, 0, 15, -128, 0, 0, 228, 128, 0, 0, 228, -160, 1, 0, 0, 2, 0, 8, 15, -128, 0, 0, 228, 128, 1, 0, 0, - 2, 1, 8, 15, 128, 0, 0, 228, -128, 1, 0, 0, 2, 2, 8, 15, -128, 0, 0, 228, 128, 1, 0, 0, - 2, 3, 8, 15, 128, 0, 0, 228, -128, 255, 255, 0, 0, 83, 72, 68, - 82, 16, 1, 0, 0, 64, 0, 0, - 0, 68, 0, 0, 0, 89, 0, 0, - 4, 70, 142, 32, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 90, 0, 0, - 3, 0, 96, 16, 0, 0, 0, 0, - 0, 88, 24, 0, 4, 0, 112, 16, - 0, 0, 0, 0, 0, 85, 85, 0, - 0, 98, 16, 0, 3, 50, 16, 16, - 0, 0, 0, 0, 0, 101, 0, 0, - 3, 242, 32, 16, 0, 0, 0, 0, - 0, 101, 0, 0, 3, 242, 32, 16, - 0, 1, 0, 0, 0, 101, 0, 0, - 3, 242, 32, 16, 0, 2, 0, 0, - 0, 101, 0, 0, 3, 242, 32, 16, - 0, 3, 0, 0, 0, 104, 0, 0, - 2, 1, 0, 0, 0, 69, 0, 0, - 9, 242, 0, 16, 0, 0, 0, 0, - 0, 70, 16, 16, 0, 0, 0, 0, - 0, 70, 126, 16, 0, 0, 0, 0, - 0, 0, 96, 16, 0, 0, 0, 0, - 0, 56, 0, 0, 8, 242, 0, 16, - 0, 0, 0, 0, 0, 70, 14, 16, - 0, 0, 0, 0, 0, 70, 142, 32, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 54, 0, 0, 5, 242, 32, 16, - 0, 0, 0, 0, 0, 70, 14, 16, - 0, 0, 0, 0, 0, 54, 0, 0, - 5, 242, 32, 16, 0, 1, 0, 0, - 0, 70, 14, 16, 0, 0, 0, 0, - 0, 54, 0, 0, 5, 242, 32, 16, - 0, 2, 0, 0, 0, 70, 14, 16, - 0, 0, 0, 0, 0, 54, 0, 0, - 5, 242, 32, 16, 0, 3, 0, 0, - 0, 70, 14, 16, 0, 0, 0, 0, - 0, 62, 0, 0, 1, 83, 84, 65, - 84, 116, 0, 0, 0, 7, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 82, 68, 69, 70, 48, 1, 0, - 0, 1, 0, 0, 0, 176, 0, 0, - 0, 3, 0, 0, 0, 28, 0, 0, - 0, 0, 4, 255, 255, 0, 65, 0, - 0, 252, 0, 0, 0, 124, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 145, 0, 0, - 0, 2, 0, 0, 0, 5, 0, 0, - 0, 4, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 1, 0, 0, - 0, 13, 0, 0, 0, 166, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 115, 97, 109, -112, 108, 101, 114, 95, 95, 67, 67, - 95, 84, 101, 120, 116, 117, 114, 101, - 48, 0, 116, 101, 120, 116, 117, 114, -101, 95, 95, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 36, - 71, 108, 111, 98, 97, 108, 115, 0, -171, 166, 0, 0, 0, 1, 0, 0, - 0, 200, 0, 0, 0, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 224, 0, 0, 0, 0, 0, 0, - 0, 16, 0, 0, 0, 2, 0, 0, - 0, 236, 0, 0, 0, 0, 0, 0, - 0, 95, 117, 95, 99, 111, 108, 111, -114, 0, 171, 171, 171, 1, 0, 3, - 0, 1, 0, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 77, 105, 99, -114, 111, 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, 76, 32, - 83, 104, 97, 100, 101, 114, 32, 67, -111, 109, 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, 48, 48, - 46, 49, 54, 51, 56, 52, 0, 171, -171, 73, 83, 71, 78, 44, 0, 0, - 0, 1, 0, 0, 0, 8, 0, 0, - 0, 32, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, - 0, 0, 0, 0, 0, 3, 3, 0, - 0, 84, 69, 88, 67, 79, 79, 82, - 68, 0, 171, 171, 171, 79, 83, 71, - 78, 116, 0, 0, 0, 4, 0, 0, - 0, 8, 0, 0, 0, 104, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 104, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 1, 0, 0, - 0, 15, 0, 0, 0, 104, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 2, 0, 0, - 0, 15, 0, 0, 0, 104, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 3, 0, 0, - 0, 15, 0, 0, 0, 83, 86, 95, - 84, 97, 114, 103, 101, 116, 0, 171, -171, 68, 88, 66, 67, 110, 14, 140, -120, 239, 110, 56, 78, 103, 37, 245, -162, 140, 151, 93, 223, 1, 0, 0, - 0, 144, 4, 0, 0, 6, 0, 0, - 0, 56, 0, 0, 0, 68, 1, 0, - 0, 156, 2, 0, 0, 24, 3, 0, - 0, 236, 3, 0, 0, 56, 4, 0, - 0, 65, 111, 110, 57, 4, 1, 0, - 0, 4, 1, 0, 0, 0, 2, 254, -255, 208, 0, 0, 0, 52, 0, 0, - 0, 1, 0, 36, 0, 0, 0, 48, - 0, 0, 0, 48, 0, 0, 0, 36, - 0, 1, 0, 48, 0, 0, 0, 0, - 0, 4, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 2, 254, -255, 81, 0, 0, 5, 5, 0, 15, -160, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 2, 5, 0, 0, -128, 0, 0, 15, 144, 31, 0, 0, - 2, 5, 0, 1, 128, 1, 0, 15, -144, 9, 0, 0, 3, 0, 0, 1, -128, 3, 0, 228, 160, 0, 0, 228, -144, 9, 0, 0, 3, 0, 0, 2, -128, 4, 0, 228, 160, 0, 0, 228, -144, 2, 0, 0, 3, 0, 0, 1, -128, 0, 0, 85, 128, 0, 0, 0, -128, 5, 0, 0, 3, 0, 0, 4, -192, 0, 0, 0, 128, 5, 0, 0, -160, 9, 0, 0, 3, 0, 0, 1, -128, 2, 0, 228, 160, 0, 0, 228, -144, 1, 0, 0, 2, 1, 0, 2, -128, 0, 0, 0, 129, 9, 0, 0, - 3, 1, 0, 1, 128, 1, 0, 228, -160, 0, 0, 228, 144, 4, 0, 0, - 4, 0, 0, 3, 192, 0, 0, 85, -128, 0, 0, 228, 160, 1, 0, 228, -128, 1, 0, 0, 2, 0, 0, 8, -192, 0, 0, 85, 128, 1, 0, 0, - 2, 0, 0, 3, 224, 1, 0, 228, -144, 255, 255, 0, 0, 83, 72, 68, - 82, 80, 1, 0, 0, 64, 0, 1, - 0, 84, 0, 0, 0, 89, 0, 0, - 4, 70, 142, 32, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 95, 0, 0, - 3, 242, 16, 16, 0, 0, 0, 0, - 0, 95, 0, 0, 3, 50, 16, 16, - 0, 1, 0, 0, 0, 101, 0, 0, - 3, 50, 32, 16, 0, 0, 0, 0, - 0, 103, 0, 0, 4, 242, 32, 16, - 0, 1, 0, 0, 0, 1, 0, 0, - 0, 104, 0, 0, 2, 1, 0, 0, - 0, 54, 0, 0, 5, 50, 32, 16, - 0, 0, 0, 0, 0, 70, 16, 16, - 0, 1, 0, 0, 0, 17, 0, 0, - 8, 18, 0, 16, 0, 0, 0, 0, - 0, 70, 142, 32, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 70, 30, 16, - 0, 0, 0, 0, 0, 54, 0, 0, - 6, 34, 32, 16, 0, 1, 0, 0, - 0, 10, 0, 16, 128, 65, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 0, - 8, 18, 0, 16, 0, 0, 0, 0, - 0, 70, 142, 32, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 70, 30, 16, - 0, 0, 0, 0, 0, 17, 0, 0, - 8, 34, 0, 16, 0, 0, 0, 0, - 0, 70, 142, 32, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 70, 30, 16, - 0, 0, 0, 0, 0, 0, 0, 0, - 7, 18, 0, 16, 0, 0, 0, 0, - 0, 26, 0, 16, 0, 0, 0, 0, - 0, 10, 0, 16, 0, 0, 0, 0, - 0, 54, 0, 0, 5, 130, 32, 16, - 0, 1, 0, 0, 0, 26, 0, 16, - 0, 0, 0, 0, 0, 56, 0, 0, - 7, 66, 32, 16, 0, 1, 0, 0, - 0, 10, 0, 16, 0, 0, 0, 0, - 0, 1, 64, 0, 0, 0, 0, 0, - 63, 17, 0, 0, 8, 18, 32, 16, - 0, 1, 0, 0, 0, 70, 142, 32, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 70, 30, 16, 0, 0, 0, 0, - 0, 62, 0, 0, 1, 83, 84, 65, - 84, 116, 0, 0, 0, 10, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 7, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 82, 68, 69, 70, 204, 0, 0, - 0, 1, 0, 0, 0, 72, 0, 0, - 0, 1, 0, 0, 0, 28, 0, 0, - 0, 0, 4, 254, 255, 0, 65, 0, - 0, 152, 0, 0, 0, 60, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 36, 71, 108, -111, 98, 97, 108, 115, 0, 171, 171, -171, 60, 0, 0, 0, 1, 0, 0, - 0, 96, 0, 0, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 120, 0, 0, 0, 0, 0, 0, - 0, 64, 0, 0, 0, 2, 0, 0, - 0, 136, 0, 0, 0, 0, 0, 0, - 0, 95, 67, 67, 95, 77, 86, 80, - 77, 97, 116, 114, 105, 120, 0, 171, -171, 3, 0, 3, 0, 4, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 77, 105, 99, 114, 111, 115, 111, -102, 116, 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, 97, 100, -101, 114, 32, 67, 111, 109, 112, 105, -108, 101, 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 171, 73, 83, 71, - 78, 68, 0, 0, 0, 2, 0, 0, - 0, 8, 0, 0, 0, 56, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 15, 15, 0, 0, 56, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 1, 0, 0, - 0, 3, 3, 0, 0, 84, 69, 88, - 67, 79, 79, 82, 68, 0, 171, 171, -171, 79, 83, 71, 78, 80, 0, 0, - 0, 2, 0, 0, 0, 8, 0, 0, - 0, 56, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, - 0, 0, 0, 0, 0, 3, 12, 0, - 0, 65, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 3, 0, 0, - 0, 1, 0, 0, 0, 15, 0, 0, - 0, 84, 69, 88, 67, 79, 79, 82, - 68, 0, 83, 86, 95, 80, 111, 115, -105, 116, 105, 111, 110, 0, 171, 171, -171, -}; - -const unsigned char s_BF0A97A7CDA97B6CD0F5D1455A170F32E2538AD6[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, -255, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 92, 139, 0, 0, 242, 141, - 0, 0, 12, 0, 0, 0, 67, 67, - 95, 77, 86, 80, 77, 97, 116, 114, -105, 120, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 4, 0, - 0, 0, 1, 0, 0, 0, 12, 0, - 0, 0, 67, 67, 95, 77, 86, 80, - 77, 97, 116, 114, 105, 120, 0, 0, - 0, 0, 0, 0, 0, 0, 204, 2, - 0, 0, 144, 4, 0, 0, 0, 0, - 0, 0, 185, 153, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 88, 66, 67, 127, 145, - 81, 72, 216, 190, 16, 61, 245, 231, -235, 249, 125, 223, 218, 82, 1, 0, - 0, 0, 204, 2, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 168, 0, - 0, 0, 72, 1, 0, 0, 196, 1, - 0, 0, 28, 2, 0, 0, 80, 2, - 0, 0, 65, 111, 110, 57, 104, 0, - 0, 0, 104, 0, 0, 0, 0, 2, -255, 255, 68, 0, 0, 0, 36, 0, - 0, 0, 0, 0, 36, 0, 0, 0, - 36, 0, 0, 0, 36, 0, 0, 0, - 36, 0, 0, 0, 36, 0, 1, 2, -255, 255, 31, 0, 0, 2, 0, 0, - 0, 128, 0, 0, 15, 176, 1, 0, - 0, 2, 0, 8, 15, 128, 0, 0, -228, 176, 1, 0, 0, 2, 1, 8, - 15, 128, 0, 0, 228, 176, 1, 0, - 0, 2, 2, 8, 15, 128, 0, 0, -228, 176, 1, 0, 0, 2, 3, 8, - 15, 128, 0, 0, 228, 176, 255, 255, - 0, 0, 83, 72, 68, 82, 152, 0, - 0, 0, 64, 0, 0, 0, 38, 0, - 0, 0, 98, 16, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 3, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 1, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 3, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -255, 255, 0, 65, 0, 0, 28, 0, - 0, 0, 77, 105, 99, 114, 111, 115, -111, 102, 116, 32, 40, 82, 41, 32, - 72, 76, 83, 76, 32, 83, 104, 97, -100, 101, 114, 32, 67, 111, 109, 112, -105, 108, 101, 114, 32, 54, 46, 51, - 46, 57, 54, 48, 48, 46, 49, 54, - 51, 56, 52, 0, 171, 171, 73, 83, - 71, 78, 44, 0, 0, 0, 1, 0, - 0, 0, 8, 0, 0, 0, 32, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 171, -171, 171, 79, 83, 71, 78, 116, 0, - 0, 0, 4, 0, 0, 0, 8, 0, - 0, 0, 104, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 3, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, 97, 114, -103, 101, 116, 0, 171, 171, 68, 88, - 66, 67, 117, 106, 232, 95, 24, 158, -125, 44, 227, 235, 60, 21, 223, 24, -110, 211, 1, 0, 0, 0, 144, 4, - 0, 0, 6, 0, 0, 0, 56, 0, - 0, 0, 68, 1, 0, 0, 156, 2, - 0, 0, 24, 3, 0, 0, 236, 3, - 0, 0, 56, 4, 0, 0, 65, 111, -110, 57, 4, 1, 0, 0, 4, 1, - 0, 0, 0, 2, 254, 255, 208, 0, - 0, 0, 52, 0, 0, 0, 1, 0, - 36, 0, 0, 0, 48, 0, 0, 0, - 48, 0, 0, 0, 36, 0, 1, 0, - 48, 0, 0, 0, 0, 0, 4, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 254, 255, 81, 0, - 0, 5, 5, 0, 15, 160, 0, 0, - 0, 63, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, - 0, 2, 5, 0, 0, 128, 0, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 1, 128, 1, 0, 15, 144, 9, 0, - 0, 3, 0, 0, 1, 128, 3, 0, -228, 160, 1, 0, 228, 144, 9, 0, - 0, 3, 0, 0, 2, 128, 4, 0, -228, 160, 1, 0, 228, 144, 2, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 85, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 4, 192, 0, 0, - 0, 128, 5, 0, 0, 160, 9, 0, - 0, 3, 0, 0, 1, 128, 2, 0, -228, 160, 1, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 2, 128, 0, 0, - 0, 129, 9, 0, 0, 3, 1, 0, - 1, 128, 1, 0, 228, 160, 1, 0, -228, 144, 4, 0, 0, 4, 0, 0, - 3, 192, 0, 0, 85, 128, 0, 0, -228, 160, 1, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 192, 0, 0, - 85, 128, 1, 0, 0, 2, 0, 0, - 15, 224, 0, 0, 228, 144, 255, 255, - 0, 0, 83, 72, 68, 82, 80, 1, - 0, 0, 64, 0, 1, 0, 84, 0, - 0, 0, 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 103, 0, - 0, 4, 242, 32, 16, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 54, 0, 0, 6, 34, 32, - 16, 0, 1, 0, 0, 0, 10, 0, - 16, 128, 65, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 17, 0, 0, 8, 34, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 0, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, 1, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 66, 32, - 16, 0, 1, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 0, 0, 0, 63, 17, 0, - 0, 8, 18, 32, 16, 0, 1, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 10, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 204, 0, 0, 0, 1, 0, - 0, 0, 72, 0, 0, 0, 1, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -254, 255, 0, 65, 0, 0, 152, 0, - 0, 0, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 1, 0, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, - 0, 0, 0, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 171, 171, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 68, 0, - 0, 0, 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 56, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 80, 0, 0, 0, 2, 0, - 0, 0, 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 65, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_CE141D74B59548C43E99D183312791C6F429C37D[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 2, 0, 0, 0, 12, - 0, 0, 0, 67, 67, 95, 77, 86, - 80, 77, 97, 116, 114, 105, 120, 0, - 0, 0, 0, 0, 0, 0, 0, 11, - 0, 0, 0, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 0, - 0, 0, 1, 0, 0, 0, 248, 3, - 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 185, 153, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 88, 66, 67, 11, 95, - 74, 206, 145, 124, 32, 219, 67, 19, - 26, 23, 189, 75, 35, 86, 1, 0, - 0, 0, 248, 3, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 228, 0, - 0, 0, 244, 1, 0, 0, 112, 2, - 0, 0, 48, 3, 0, 0, 124, 3, - 0, 0, 65, 111, 110, 57, 164, 0, - 0, 0, 164, 0, 0, 0, 0, 2, -255, 255, 124, 0, 0, 0, 40, 0, - 0, 0, 0, 0, 40, 0, 0, 0, - 40, 0, 0, 0, 40, 0, 1, 0, - 36, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 1, 2, 255, 255, 31, 0, - 0, 2, 0, 0, 0, 128, 0, 0, - 15, 176, 31, 0, 0, 2, 0, 0, - 0, 128, 1, 0, 3, 176, 31, 0, - 0, 2, 0, 0, 0, 144, 0, 8, - 15, 160, 66, 0, 0, 3, 0, 0, - 15, 128, 1, 0, 228, 176, 0, 8, -228, 160, 5, 0, 0, 3, 0, 0, - 15, 128, 0, 0, 228, 128, 0, 0, -228, 176, 1, 0, 0, 2, 0, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 1, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 2, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 3, 8, 15, 128, 0, 0, -228, 128, 255, 255, 0, 0, 83, 72, - 68, 82, 8, 1, 0, 0, 64, 0, - 0, 0, 66, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 0, 0, 0, 0, 85, 85, - 0, 0, 98, 16, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 3, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, 70, 16, - 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, 56, 0, - 0, 7, 242, 0, 16, 0, 0, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 1, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 2, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 3, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 7, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 184, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, 0, 65, - 0, 0, 134, 0, 0, 0, 92, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 113, 0, - 0, 0, 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 13, 0, 0, 0, 115, 97, -109, 112, 108, 101, 114, 95, 95, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 116, 101, 120, 116, 117, -114, 101, 95, 95, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 73, 83, 71, 78, 68, 0, - 0, 0, 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 56, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 116, 0, 0, 0, 4, 0, - 0, 0, 8, 0, 0, 0, 104, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 3, 0, - 0, 0, 15, 0, 0, 0, 83, 86, - 95, 84, 97, 114, 103, 101, 116, 0, -171, 171, 68, 88, 66, 67, 235, 56, -180, 223, 125, 231, 231, 218, 70, 75, - 12, 63, 200, 233, 69, 121, 1, 0, - 0, 0, 4, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 92, 1, - 0, 0, 224, 2, 0, 0, 92, 3, - 0, 0, 48, 4, 0, 0, 148, 4, - 0, 0, 65, 111, 110, 57, 28, 1, - 0, 0, 28, 1, 0, 0, 0, 2, -254, 255, 232, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 36, 0, 0, 0, - 48, 0, 0, 0, 48, 0, 0, 0, - 36, 0, 1, 0, 48, 0, 0, 0, - 0, 0, 4, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 2, -254, 255, 81, 0, 0, 5, 5, 0, - 15, 160, 0, 0, 0, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, 5, 0, - 0, 128, 0, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 1, 128, 1, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 2, 128, 2, 0, 15, 144, 9, 0, - 0, 3, 0, 0, 1, 128, 3, 0, -228, 160, 1, 0, 228, 144, 9, 0, - 0, 3, 0, 0, 2, 128, 4, 0, -228, 160, 1, 0, 228, 144, 2, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 85, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 4, 192, 0, 0, - 0, 128, 5, 0, 0, 160, 9, 0, - 0, 3, 0, 0, 1, 128, 2, 0, -228, 160, 1, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 2, 128, 0, 0, - 0, 129, 9, 0, 0, 3, 1, 0, - 1, 128, 1, 0, 228, 160, 1, 0, -228, 144, 4, 0, 0, 4, 0, 0, - 3, 192, 0, 0, 85, 128, 0, 0, -228, 160, 1, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 192, 0, 0, - 85, 128, 1, 0, 0, 2, 0, 0, - 15, 224, 0, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 3, 224, 2, 0, -228, 144, 255, 255, 0, 0, 83, 72, - 68, 82, 124, 1, 0, 0, 64, 0, - 1, 0, 95, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 1, 0, 0, 0, 95, 0, - 0, 3, 50, 16, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 50, 32, 16, 0, 1, 0, - 0, 0, 103, 0, 0, 4, 242, 32, - 16, 0, 2, 0, 0, 0, 1, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 50, 32, 16, 0, 1, 0, - 0, 0, 70, 16, 16, 0, 2, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 54, 0, 0, 6, 34, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 128, 65, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 17, 0, 0, 8, 34, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 0, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, 2, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 66, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 0, 0, 0, 63, 17, 0, - 0, 8, 18, 32, 16, 0, 2, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 11, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 204, 0, 0, 0, 1, 0, - 0, 0, 72, 0, 0, 0, 1, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -254, 255, 0, 65, 0, 0, 152, 0, - 0, 0, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 1, 0, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, - 0, 0, 0, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 171, 171, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_DB22823528A225B43DABEF012B299639D233D54C[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 10, 0, 0, 0, - 67, 67, 95, 80, 77, 97, 116, 114, -105, 120, 0, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 4, 0, - 0, 0, 94, 139, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 67, 67, - 95, 84, 101, 120, 116, 117, 114, 101, - 48, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 255, 255, 255, 1, 0, 0, - 0, 6, 20, 0, 0, 240, 141, 0, - 0, 14, 0, 0, 0, 67, 67, 95, - 97, 108, 112, 104, 97, 95, 118, 97, -108, 117, 101, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 3, 0, 0, 0, 10, - 0, 0, 0, 67, 67, 95, 80, 77, - 97, 116, 114, 105, 120, 0, 0, 0, - 0, 0, 0, 0, 0, 11, 0, 0, - 0, 67, 67, 95, 84, 101, 120, 116, -117, 114, 101, 48, 0, 0, 0, 0, - 1, 0, 0, 0, 14, 0, 0, 0, - 67, 67, 95, 97, 108, 112, 104, 97, - 95, 118, 97, 108, 117, 101, 0, 0, - 0, 0, 2, 0, 0, 0, 36, 5, - 0, 0, 0, 5, 0, 0, 0, 0, - 0, 0, 185, 153, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 88, 66, 67, 100, 113, -175, 29, 164, 71, 177, 78, 120, 99, -172, 209, 227, 249, 113, 132, 1, 0, - 0, 0, 36, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 88, 1, - 0, 0, 164, 2, 0, 0, 32, 3, - 0, 0, 92, 4, 0, 0, 168, 4, - 0, 0, 65, 111, 110, 57, 24, 1, - 0, 0, 24, 1, 0, 0, 0, 2, -255, 255, 228, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 40, 0, 0, 0, - 52, 0, 0, 0, 52, 0, 1, 0, - 36, 0, 0, 0, 52, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 2, -255, 255, 81, 0, 0, 5, 1, 0, - 15, 160, 0, 0, 128, 191, 0, 0, - 0, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, 0, 0, - 0, 128, 0, 0, 15, 176, 31, 0, - 0, 2, 0, 0, 0, 128, 1, 0, - 3, 176, 31, 0, 0, 2, 0, 0, - 0, 144, 0, 8, 15, 160, 66, 0, - 0, 3, 0, 0, 15, 128, 1, 0, -228, 176, 0, 8, 228, 160, 2, 0, - 0, 3, 1, 0, 8, 128, 0, 0, -255, 129, 0, 0, 0, 160, 88, 0, - 0, 4, 1, 0, 15, 128, 1, 0, -255, 128, 1, 0, 0, 160, 1, 0, - 85, 160, 65, 0, 0, 1, 1, 0, - 15, 128, 5, 0, 0, 3, 0, 0, - 15, 128, 0, 0, 228, 128, 0, 0, -228, 176, 1, 0, 0, 2, 1, 0, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 2, 0, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 3, 0, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 0, 8, 15, 128, 1, 0, -228, 128, 1, 0, 0, 2, 1, 8, - 15, 128, 2, 0, 228, 128, 1, 0, - 0, 2, 2, 8, 15, 128, 3, 0, -228, 128, 1, 0, 0, 2, 3, 8, - 15, 128, 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, 68, 1, - 0, 0, 64, 0, 0, 0, 81, 0, - 0, 0, 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 90, 0, 0, 3, 0, 96, - 16, 0, 0, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 98, 16, 0, 3, 50, 16, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 3, 0, 0, 0, 104, 0, - 0, 2, 2, 0, 0, 0, 69, 0, - 0, 9, 242, 0, 16, 0, 0, 0, - 0, 0, 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, 0, 0, - 0, 0, 0, 96, 16, 0, 0, 0, - 0, 0, 29, 0, 0, 8, 18, 0, - 16, 0, 1, 0, 0, 0, 10, 128, - 32, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 58, 0, 16, 0, 0, 0, - 0, 0, 13, 0, 4, 3, 10, 0, - 16, 0, 1, 0, 0, 0, 56, 0, - 0, 7, 242, 0, 16, 0, 0, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 1, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 2, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 3, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 9, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 52, 1, - 0, 0, 1, 0, 0, 0, 176, 0, - 0, 0, 3, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, 0, 65, - 0, 0, 0, 1, 0, 0, 124, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 145, 0, - 0, 0, 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 13, 0, 0, 0, 166, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 115, 97, -109, 112, 108, 101, 114, 95, 95, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 116, 101, 120, 116, 117, -114, 101, 95, 95, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 36, 71, 108, 111, 98, 97, 108, 115, - 0, 171, 166, 0, 0, 0, 1, 0, - 0, 0, 200, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 224, 0, 0, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 2, 0, - 0, 0, 240, 0, 0, 0, 0, 0, - 0, 0, 95, 67, 67, 95, 97, 108, -112, 104, 97, 95, 118, 97, 108, 117, -101, 0, 0, 0, 3, 0, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 77, 105, 99, 114, 111, 115, -111, 102, 116, 32, 40, 82, 41, 32, - 72, 76, 83, 76, 32, 83, 104, 97, -100, 101, 114, 32, 67, 111, 109, 112, -105, 108, 101, 114, 32, 54, 46, 51, - 46, 57, 54, 48, 48, 46, 49, 54, - 51, 56, 52, 0, 171, 171, 73, 83, - 71, 78, 68, 0, 0, 0, 2, 0, - 0, 0, 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 0, 0, 56, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 3, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 171, -171, 171, 79, 83, 71, 78, 116, 0, - 0, 0, 4, 0, 0, 0, 8, 0, - 0, 0, 104, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 15, 0, - 0, 0, 104, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 3, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, 97, 114, -103, 101, 116, 0, 171, 171, 68, 88, - 66, 67, 53, 89, 218, 251, 179, 193, -226, 187, 197, 89, 218, 37, 36, 176, -206, 80, 1, 0, 0, 0, 0, 5, - 0, 0, 6, 0, 0, 0, 56, 0, - 0, 0, 92, 1, 0, 0, 224, 2, - 0, 0, 92, 3, 0, 0, 44, 4, - 0, 0, 144, 4, 0, 0, 65, 111, -110, 57, 28, 1, 0, 0, 28, 1, - 0, 0, 0, 2, 254, 255, 232, 0, - 0, 0, 52, 0, 0, 0, 1, 0, - 36, 0, 0, 0, 48, 0, 0, 0, - 48, 0, 0, 0, 36, 0, 1, 0, - 48, 0, 0, 0, 0, 0, 4, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 254, 255, 81, 0, - 0, 5, 5, 0, 15, 160, 0, 0, - 0, 63, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, - 0, 2, 5, 0, 0, 128, 0, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 1, 128, 1, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 2, 128, 2, 0, - 15, 144, 9, 0, 0, 3, 0, 0, - 1, 128, 3, 0, 228, 160, 1, 0, -228, 144, 9, 0, 0, 3, 0, 0, - 2, 128, 4, 0, 228, 160, 1, 0, -228, 144, 2, 0, 0, 3, 0, 0, - 1, 128, 0, 0, 85, 128, 0, 0, - 0, 128, 5, 0, 0, 3, 0, 0, - 4, 192, 0, 0, 0, 128, 5, 0, - 0, 160, 9, 0, 0, 3, 0, 0, - 1, 128, 2, 0, 228, 160, 1, 0, -228, 144, 1, 0, 0, 2, 1, 0, - 2, 128, 0, 0, 0, 129, 9, 0, - 0, 3, 1, 0, 1, 128, 1, 0, -228, 160, 1, 0, 228, 144, 4, 0, - 0, 4, 0, 0, 3, 192, 0, 0, - 85, 128, 0, 0, 228, 160, 1, 0, -228, 128, 1, 0, 0, 2, 0, 0, - 8, 192, 0, 0, 85, 128, 1, 0, - 0, 2, 0, 0, 15, 224, 0, 0, -228, 144, 1, 0, 0, 2, 1, 0, - 3, 224, 2, 0, 228, 144, 255, 255, - 0, 0, 83, 72, 68, 82, 124, 1, - 0, 0, 64, 0, 1, 0, 95, 0, - 0, 0, 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 1, 0, - 0, 0, 95, 0, 0, 3, 50, 16, - 16, 0, 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 50, 32, - 16, 0, 1, 0, 0, 0, 103, 0, - 0, 4, 242, 32, 16, 0, 2, 0, - 0, 0, 1, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 50, 32, - 16, 0, 1, 0, 0, 0, 70, 16, - 16, 0, 2, 0, 0, 0, 17, 0, - 0, 8, 18, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 54, 0, - 0, 6, 34, 32, 16, 0, 2, 0, - 0, 0, 10, 0, 16, 128, 65, 0, - 0, 0, 0, 0, 0, 0, 17, 0, - 0, 8, 18, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 17, 0, - 0, 8, 34, 0, 16, 0, 0, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 0, 0, - 0, 7, 18, 0, 16, 0, 0, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 130, 32, - 16, 0, 2, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 56, 0, - 0, 7, 66, 32, 16, 0, 2, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 1, 64, 0, 0, 0, 0, - 0, 63, 17, 0, 0, 8, 18, 32, - 16, 0, 2, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 11, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 200, 0, - 0, 0, 1, 0, 0, 0, 72, 0, - 0, 0, 1, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 254, 255, 0, 65, - 0, 0, 148, 0, 0, 0, 60, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 36, 71, -108, 111, 98, 97, 108, 115, 0, 171, -171, 171, 60, 0, 0, 0, 1, 0, - 0, 0, 96, 0, 0, 0, 64, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 120, 0, 0, 0, 0, 0, - 0, 0, 64, 0, 0, 0, 2, 0, - 0, 0, 132, 0, 0, 0, 0, 0, - 0, 0, 95, 67, 67, 95, 80, 77, - 97, 116, 114, 105, 120, 0, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_E878895044FDA49FE4D8202CE20AF49CC01A8FA9[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 2, 0, 0, 0, 12, - 0, 0, 0, 67, 67, 95, 77, 86, - 80, 77, 97, 116, 114, 105, 120, 0, - 0, 0, 0, 0, 0, 0, 0, 11, - 0, 0, 0, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 0, - 0, 0, 1, 0, 0, 0, 24, 4, - 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 185, 153, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 88, 66, 67, 200, 5, -103, 205, 248, 30, 69, 65, 32, 117, - 98, 148, 123, 240, 193, 101, 1, 0, - 0, 0, 24, 4, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 240, 0, - 0, 0, 20, 2, 0, 0, 144, 2, - 0, 0, 80, 3, 0, 0, 156, 3, - 0, 0, 65, 111, 110, 57, 176, 0, - 0, 0, 176, 0, 0, 0, 0, 2, -255, 255, 136, 0, 0, 0, 40, 0, - 0, 0, 0, 0, 40, 0, 0, 0, - 40, 0, 0, 0, 40, 0, 1, 0, - 36, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 1, 2, 255, 255, 31, 0, - 0, 2, 0, 0, 0, 128, 0, 0, - 15, 176, 31, 0, 0, 2, 0, 0, - 0, 128, 1, 0, 3, 176, 31, 0, - 0, 2, 0, 0, 0, 144, 0, 8, - 15, 160, 66, 0, 0, 3, 0, 0, - 15, 128, 1, 0, 228, 176, 0, 8, -228, 160, 5, 0, 0, 3, 0, 0, - 8, 128, 0, 0, 255, 128, 0, 0, -255, 176, 1, 0, 0, 2, 0, 0, - 7, 128, 0, 0, 228, 176, 1, 0, - 0, 2, 0, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 1, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 2, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 3, 8, - 15, 128, 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, 28, 1, - 0, 0, 64, 0, 0, 0, 71, 0, - 0, 0, 90, 0, 0, 3, 0, 96, - 16, 0, 0, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, 98, 16, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 98, 16, 0, 3, 50, 16, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 0, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 3, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, 69, 0, - 0, 9, 242, 0, 16, 0, 0, 0, - 0, 0, 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, 0, 0, - 0, 0, 0, 96, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 130, 0, - 16, 0, 0, 0, 0, 0, 58, 0, - 16, 0, 0, 0, 0, 0, 58, 16, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 114, 0, 16, 0, 0, 0, - 0, 0, 70, 18, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 1, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 2, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 3, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 8, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 184, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, 0, 65, - 0, 0, 134, 0, 0, 0, 92, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 113, 0, - 0, 0, 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 13, 0, 0, 0, 115, 97, -109, 112, 108, 101, 114, 95, 95, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 116, 101, 120, 116, 117, -114, 101, 95, 95, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 73, 83, 71, 78, 68, 0, - 0, 0, 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 56, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 116, 0, 0, 0, 4, 0, - 0, 0, 8, 0, 0, 0, 104, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 3, 0, - 0, 0, 15, 0, 0, 0, 83, 86, - 95, 84, 97, 114, 103, 101, 116, 0, -171, 171, 68, 88, 66, 67, 235, 56, -180, 223, 125, 231, 231, 218, 70, 75, - 12, 63, 200, 233, 69, 121, 1, 0, - 0, 0, 4, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 92, 1, - 0, 0, 224, 2, 0, 0, 92, 3, - 0, 0, 48, 4, 0, 0, 148, 4, - 0, 0, 65, 111, 110, 57, 28, 1, - 0, 0, 28, 1, 0, 0, 0, 2, -254, 255, 232, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 36, 0, 0, 0, - 48, 0, 0, 0, 48, 0, 0, 0, - 36, 0, 1, 0, 48, 0, 0, 0, - 0, 0, 4, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 2, -254, 255, 81, 0, 0, 5, 5, 0, - 15, 160, 0, 0, 0, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, 5, 0, - 0, 128, 0, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 1, 128, 1, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 2, 128, 2, 0, 15, 144, 9, 0, - 0, 3, 0, 0, 1, 128, 3, 0, -228, 160, 1, 0, 228, 144, 9, 0, - 0, 3, 0, 0, 2, 128, 4, 0, -228, 160, 1, 0, 228, 144, 2, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 85, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 4, 192, 0, 0, - 0, 128, 5, 0, 0, 160, 9, 0, - 0, 3, 0, 0, 1, 128, 2, 0, -228, 160, 1, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 2, 128, 0, 0, - 0, 129, 9, 0, 0, 3, 1, 0, - 1, 128, 1, 0, 228, 160, 1, 0, -228, 144, 4, 0, 0, 4, 0, 0, - 3, 192, 0, 0, 85, 128, 0, 0, -228, 160, 1, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 192, 0, 0, - 85, 128, 1, 0, 0, 2, 0, 0, - 15, 224, 0, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 3, 224, 2, 0, -228, 144, 255, 255, 0, 0, 83, 72, - 68, 82, 124, 1, 0, 0, 64, 0, - 1, 0, 95, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 1, 0, 0, 0, 95, 0, - 0, 3, 50, 16, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 50, 32, 16, 0, 1, 0, - 0, 0, 103, 0, 0, 4, 242, 32, - 16, 0, 2, 0, 0, 0, 1, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 50, 32, 16, 0, 1, 0, - 0, 0, 70, 16, 16, 0, 2, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 54, 0, 0, 6, 34, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 128, 65, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 17, 0, 0, 8, 34, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 0, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, 2, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 66, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 0, 0, 0, 63, 17, 0, - 0, 8, 18, 32, 16, 0, 2, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 11, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 204, 0, 0, 0, 1, 0, - 0, 0, 72, 0, 0, 0, 1, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -254, 255, 0, 65, 0, 0, 152, 0, - 0, 0, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 1, 0, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, - 0, 0, 0, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 171, 171, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_EE3D1B2155C6B54D29BFC9FACB7A83A83EC3847B[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 2, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 2, 0, 0, 0, 12, - 0, 0, 0, 67, 67, 95, 77, 86, - 80, 77, 97, 116, 114, 105, 120, 0, - 0, 0, 0, 0, 0, 0, 0, 11, - 0, 0, 0, 67, 67, 95, 84, 101, -120, 116, 117, 114, 101, 48, 0, 0, - 0, 0, 1, 0, 0, 0, 24, 5, - 0, 0, 4, 5, 0, 0, 0, 0, - 0, 0, 185, 153, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 88, 66, 67, 226, 171, -253, 248, 210, 31, 210, 164, 38, 67, -101, 24, 147, 152, 164, 65, 1, 0, - 0, 0, 24, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 92, 1, - 0, 0, 20, 3, 0, 0, 144, 3, - 0, 0, 80, 4, 0, 0, 156, 4, - 0, 0, 65, 111, 110, 57, 28, 1, - 0, 0, 28, 1, 0, 0, 0, 2, -255, 255, 244, 0, 0, 0, 40, 0, - 0, 0, 0, 0, 40, 0, 0, 0, - 40, 0, 0, 0, 40, 0, 1, 0, - 36, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 1, 2, 255, 255, 81, 0, - 0, 5, 0, 0, 15, 160, 31, 133, -235, 190, 254, 255, 71, 65, 0, 0, - 0, 192, 0, 0, 64, 64, 31, 0, - 0, 2, 0, 0, 0, 128, 0, 0, - 15, 176, 31, 0, 0, 2, 0, 0, - 0, 128, 1, 0, 3, 176, 31, 0, - 0, 2, 0, 0, 0, 144, 0, 8, - 15, 160, 66, 0, 0, 3, 0, 0, - 15, 128, 1, 0, 228, 176, 0, 8, -228, 160, 2, 0, 0, 3, 0, 0, - 1, 128, 0, 0, 255, 128, 0, 0, - 0, 160, 5, 0, 0, 3, 0, 0, - 17, 128, 0, 0, 0, 128, 0, 0, - 85, 160, 4, 0, 0, 4, 0, 0, - 2, 128, 0, 0, 0, 128, 0, 0, -170, 160, 0, 0, 255, 160, 5, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 0, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 0, 128, 0, 0, 85, 128, 5, 0, - 0, 3, 0, 0, 8, 128, 0, 0, - 0, 128, 0, 0, 255, 176, 1, 0, - 0, 2, 0, 0, 7, 128, 0, 0, -228, 176, 1, 0, 0, 2, 0, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 1, 8, 15, 128, 0, 0, -228, 128, 1, 0, 0, 2, 2, 8, - 15, 128, 0, 0, 228, 128, 1, 0, - 0, 2, 3, 8, 15, 128, 0, 0, -228, 128, 255, 255, 0, 0, 83, 72, - 68, 82, 176, 1, 0, 0, 64, 0, - 0, 0, 108, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 0, 0, 0, 0, 85, 85, - 0, 0, 98, 16, 0, 3, 242, 16, - 16, 0, 0, 0, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 2, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, 3, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, 70, 16, - 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, 0, 0, - 0, 7, 18, 0, 16, 0, 0, 0, - 0, 0, 58, 0, 16, 0, 0, 0, - 0, 0, 1, 64, 0, 0, 31, 133, -235, 190, 56, 32, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 254, 255, 71, 65, 50, 0, - 0, 9, 34, 0, 16, 0, 0, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 1, 64, 0, 0, 0, 0, - 0, 192, 1, 64, 0, 0, 0, 0, - 64, 64, 56, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 56, 0, - 0, 7, 18, 0, 16, 0, 0, 0, - 0, 0, 10, 0, 16, 0, 0, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 130, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 58, 16, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 114, 0, 16, 0, 0, 0, - 0, 0, 70, 18, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 1, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 2, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 242, 32, 16, 0, 3, 0, - 0, 0, 70, 14, 16, 0, 0, 0, - 0, 0, 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, 13, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 0, 0, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, 184, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, 0, 65, - 0, 0, 134, 0, 0, 0, 92, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, 113, 0, - 0, 0, 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, 255, 255, -255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 13, 0, 0, 0, 115, 97, -109, 112, 108, 101, 114, 95, 95, 67, - 67, 95, 84, 101, 120, 116, 117, 114, -101, 48, 0, 116, 101, 120, 116, 117, -114, 101, 95, 95, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 73, 83, 71, 78, 68, 0, - 0, 0, 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 56, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 116, 0, 0, 0, 4, 0, - 0, 0, 8, 0, 0, 0, 104, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 104, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 3, 0, - 0, 0, 15, 0, 0, 0, 83, 86, - 95, 84, 97, 114, 103, 101, 116, 0, -171, 171, 68, 88, 66, 67, 235, 56, -180, 223, 125, 231, 231, 218, 70, 75, - 12, 63, 200, 233, 69, 121, 1, 0, - 0, 0, 4, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, 92, 1, - 0, 0, 224, 2, 0, 0, 92, 3, - 0, 0, 48, 4, 0, 0, 148, 4, - 0, 0, 65, 111, 110, 57, 28, 1, - 0, 0, 28, 1, 0, 0, 0, 2, -254, 255, 232, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 36, 0, 0, 0, - 48, 0, 0, 0, 48, 0, 0, 0, - 36, 0, 1, 0, 48, 0, 0, 0, - 0, 0, 4, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 2, -254, 255, 81, 0, 0, 5, 5, 0, - 15, 160, 0, 0, 0, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 2, 5, 0, - 0, 128, 0, 0, 15, 144, 31, 0, - 0, 2, 5, 0, 1, 128, 1, 0, - 15, 144, 31, 0, 0, 2, 5, 0, - 2, 128, 2, 0, 15, 144, 9, 0, - 0, 3, 0, 0, 1, 128, 3, 0, -228, 160, 1, 0, 228, 144, 9, 0, - 0, 3, 0, 0, 2, 128, 4, 0, -228, 160, 1, 0, 228, 144, 2, 0, - 0, 3, 0, 0, 1, 128, 0, 0, - 85, 128, 0, 0, 0, 128, 5, 0, - 0, 3, 0, 0, 4, 192, 0, 0, - 0, 128, 5, 0, 0, 160, 9, 0, - 0, 3, 0, 0, 1, 128, 2, 0, -228, 160, 1, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 2, 128, 0, 0, - 0, 129, 9, 0, 0, 3, 1, 0, - 1, 128, 1, 0, 228, 160, 1, 0, -228, 144, 4, 0, 0, 4, 0, 0, - 3, 192, 0, 0, 85, 128, 0, 0, -228, 160, 1, 0, 228, 128, 1, 0, - 0, 2, 0, 0, 8, 192, 0, 0, - 85, 128, 1, 0, 0, 2, 0, 0, - 15, 224, 0, 0, 228, 144, 1, 0, - 0, 2, 1, 0, 3, 224, 2, 0, -228, 144, 255, 255, 0, 0, 83, 72, - 68, 82, 124, 1, 0, 0, 64, 0, - 1, 0, 95, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 95, 0, - 0, 3, 242, 16, 16, 0, 0, 0, - 0, 0, 95, 0, 0, 3, 242, 16, - 16, 0, 1, 0, 0, 0, 95, 0, - 0, 3, 50, 16, 16, 0, 2, 0, - 0, 0, 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, 101, 0, - 0, 3, 50, 32, 16, 0, 1, 0, - 0, 0, 103, 0, 0, 4, 242, 32, - 16, 0, 2, 0, 0, 0, 1, 0, - 0, 0, 104, 0, 0, 2, 1, 0, - 0, 0, 54, 0, 0, 5, 242, 32, - 16, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 50, 32, 16, 0, 1, 0, - 0, 0, 70, 16, 16, 0, 2, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 54, 0, 0, 6, 34, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 128, 65, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 0, 8, 18, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 17, 0, 0, 8, 34, 0, - 16, 0, 0, 0, 0, 0, 70, 142, - 32, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 70, 30, 16, 0, 1, 0, - 0, 0, 0, 0, 0, 7, 18, 0, - 16, 0, 0, 0, 0, 0, 26, 0, - 16, 0, 0, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, 2, 0, - 0, 0, 26, 0, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, 66, 32, - 16, 0, 2, 0, 0, 0, 10, 0, - 16, 0, 0, 0, 0, 0, 1, 64, - 0, 0, 0, 0, 0, 63, 17, 0, - 0, 8, 18, 32, 16, 0, 2, 0, - 0, 0, 70, 142, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 30, - 16, 0, 1, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, 116, 0, - 0, 0, 11, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 6, 0, - 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 204, 0, 0, 0, 1, 0, - 0, 0, 72, 0, 0, 0, 1, 0, - 0, 0, 28, 0, 0, 0, 0, 4, -254, 255, 0, 65, 0, 0, 152, 0, - 0, 0, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 36, 71, 108, 111, 98, 97, -108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 1, 0, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, - 0, 0, 0, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, 136, 0, - 0, 0, 0, 0, 0, 0, 95, 67, - 67, 95, 77, 86, 80, 77, 97, 116, -114, 105, 120, 0, 171, 171, 3, 0, - 3, 0, 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, 116, 32, - 40, 82, 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, 101, 114, - 32, 54, 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, 52, 0, -171, 171, 73, 83, 71, 78, 92, 0, - 0, 0, 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, 15, 15, - 0, 0, 80, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 3, 3, - 0, 0, 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171, 79, 83, - 71, 78, 104, 0, 0, 0, 3, 0, - 0, 0, 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, 80, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, 89, 0, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, 2, 0, - 0, 0, 15, 0, 0, 0, 84, 69, - 88, 67, 79, 79, 82, 68, 0, 83, - 86, 95, 80, 111, 115, 105, 116, 105, -111, 110, 0, 171, 171, 171, -}; - -const unsigned char s_F24D6A4F46E684E38E16A586E913369B6E02E595[] = { - -166, 147, 0, 0, 142, 9, 2, 1, - 0, 128, 0, 0, 82, 139, 0, 0, - 10, 0, 0, 0, 97, 95, 112, 111, -115, 105, 116, 105, 111, 110, 1, 0, - 0, 0, 82, 139, 0, 0, 7, 0, - 0, 0, 97, 95, 99, 111, 108, 111, -114, 0, 0, 0, 0, 80, 139, 0, - 0, 10, 0, 0, 0, 97, 95, 116, -101, 120, 67, 111, 111, 114, 100, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 255, -255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 92, 139, 0, 0, -242, 141, 0, 0, 12, 0, 0, 0, - 67, 67, 95, 77, 86, 80, 77, 97, -116, 114, 105, 120, 0, 0, 0, 0, -255, 255, 255, 255, 0, 0, 0, 0, - 4, 0, 0, 0, 94, 139, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 0, - 67, 67, 95, 84, 101, 120, 116, 117, -114, 101, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 255, 255, 255, 1, - 0, 0, 0, 82, 139, 0, 0, 240, -141, 0, 0, 13, 0, 0, 0, 118, - 95, 101, 102, 102, 101, 99, 116, 67, -111, 108, 111, 114, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 3, 0, 0, 0, - 12, 0, 0, 0, 67, 67, 95, 77, - 86, 80, 77, 97, 116, 114, 105, 120, - 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 67, 67, 95, 84, -101, 120, 116, 117, 114, 101, 48, 0, - 0, 0, 0, 1, 0, 0, 0, 13, - 0, 0, 0, 118, 95, 101, 102, 102, -101, 99, 116, 67, 111, 108, 111, 114, - 0, 0, 0, 0, 2, 0, 0, 0, -248, 5, 0, 0, 4, 5, 0, 0, - 0, 0, 0, 0, 185, 153, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 88, 66, 67, - 96, 44, 85, 169, 144, 78, 197, 165, -246, 37, 113, 96, 91, 225, 82, 101, - 1, 0, 0, 0, 248, 5, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, -128, 1, 0, 0, 120, 3, 0, 0, -244, 3, 0, 0, 48, 5, 0, 0, -124, 5, 0, 0, 65, 111, 110, 57, - 64, 1, 0, 0, 64, 1, 0, 0, - 0, 2, 255, 255, 12, 1, 0, 0, - 52, 0, 0, 0, 1, 0, 40, 0, - 0, 0, 52, 0, 0, 0, 52, 0, - 1, 0, 36, 0, 0, 0, 52, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 255, 255, 81, 0, 0, 5, - 1, 0, 15, 160, 0, 0, 128, 191, - 0, 0, 0, 128, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 0, 0, 0, 128, 0, 0, 15, 176, - 31, 0, 0, 2, 0, 0, 0, 128, - 1, 0, 3, 176, 31, 0, 0, 2, - 0, 0, 0, 144, 0, 8, 15, 160, - 66, 0, 0, 3, 0, 0, 15, 128, - 1, 0, 228, 176, 0, 8, 228, 160, - 88, 0, 0, 4, 1, 0, 15, 128, - 0, 0, 0, 129, 1, 0, 0, 160, - 1, 0, 85, 160, 65, 0, 0, 1, - 1, 0, 15, 128, 18, 0, 0, 4, - 1, 0, 7, 128, 0, 0, 255, 128, - 0, 0, 228, 176, 0, 0, 228, 160, - 11, 0, 0, 3, 2, 0, 8, 128, - 0, 0, 255, 128, 0, 0, 0, 128, - 5, 0, 0, 3, 1, 0, 8, 128, - 2, 0, 255, 128, 0, 0, 255, 176, - 88, 0, 0, 4, 0, 0, 15, 128, - 0, 0, 0, 129, 1, 0, 170, 160, - 1, 0, 228, 128, 1, 0, 0, 2, - 1, 0, 15, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 2, 0, 15, 128, - 0, 0, 228, 128, 1, 0, 0, 2, - 3, 0, 15, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 0, 8, 15, 128, - 1, 0, 228, 128, 1, 0, 0, 2, - 1, 8, 15, 128, 2, 0, 228, 128, - 1, 0, 0, 2, 2, 8, 15, 128, - 3, 0, 228, 128, 1, 0, 0, 2, - 3, 8, 15, 128, 0, 0, 228, 128, -255, 255, 0, 0, 83, 72, 68, 82, -240, 1, 0, 0, 64, 0, 0, 0, -124, 0, 0, 0, 89, 0, 0, 4, - 70, 142, 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 90, 0, 0, 3, - 0, 96, 16, 0, 0, 0, 0, 0, - 88, 24, 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, 0, 0, - 98, 16, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 98, 16, 0, 3, - 50, 16, 16, 0, 1, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 1, 0, 0, 0, -101, 0, 0, 3, 242, 32, 16, 0, - 2, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 3, 0, 0, 0, -104, 0, 0, 2, 2, 0, 0, 0, - 69, 0, 0, 9, 242, 0, 16, 0, - 0, 0, 0, 0, 70, 16, 16, 0, - 1, 0, 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, 16, 0, - 0, 0, 0, 0, 49, 0, 0, 7, - 34, 0, 16, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 59, 0, 0, 5, 66, 0, 16, 0, - 0, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 13, 0, 4, 3, - 42, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 66, 0, 16, 0, - 0, 0, 0, 0, 58, 0, 16, 128, - 65, 0, 0, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 128, 63, - 56, 0, 0, 8, 114, 0, 16, 0, - 1, 0, 0, 0, 166, 10, 16, 0, - 0, 0, 0, 0, 70, 130, 32, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 50, 0, 0, 9, 114, 0, 16, 0, - 1, 0, 0, 0, 70, 18, 16, 0, - 0, 0, 0, 0, 246, 15, 16, 0, - 0, 0, 0, 0, 70, 2, 16, 0, - 1, 0, 0, 0, 52, 0, 0, 7, - 18, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 58, 0, 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 130, 0, 16, 0, - 1, 0, 0, 0, 10, 0, 16, 0, - 0, 0, 0, 0, 58, 16, 16, 0, - 0, 0, 0, 0, 1, 0, 0, 7, -242, 0, 16, 0, 0, 0, 0, 0, - 86, 5, 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 1, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 0, 0, 0, 0, 70, 14, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 1, 0, 0, 0, - 70, 14, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 242, 32, 16, 0, - 2, 0, 0, 0, 70, 14, 16, 0, - 0, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 3, 0, 0, 0, - 70, 14, 16, 0, 0, 0, 0, 0, - 62, 0, 0, 1, 83, 84, 65, 84, -116, 0, 0, 0, 15, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 52, 1, 0, 0, - 1, 0, 0, 0, 176, 0, 0, 0, - 3, 0, 0, 0, 28, 0, 0, 0, - 0, 4, 255, 255, 0, 65, 0, 0, - 0, 1, 0, 0, 124, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 145, 0, 0, 0, - 2, 0, 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 1, 0, 0, 0, - 13, 0, 0, 0, 166, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 115, 97, 109, 112, -108, 101, 114, 95, 95, 67, 67, 95, - 84, 101, 120, 116, 117, 114, 101, 48, - 0, 116, 101, 120, 116, 117, 114, 101, - 95, 95, 67, 67, 95, 84, 101, 120, -116, 117, 114, 101, 48, 0, 36, 71, -108, 111, 98, 97, 108, 115, 0, 171, -166, 0, 0, 0, 1, 0, 0, 0, -200, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -224, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 2, 0, 0, 0, -240, 0, 0, 0, 0, 0, 0, 0, - 95, 118, 95, 101, 102, 102, 101, 99, -116, 67, 111, 108, 111, 114, 0, 171, - 1, 0, 3, 0, 1, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, 71, 78, - 68, 0, 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 56, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, 171, 171, - 79, 83, 71, 78, 116, 0, 0, 0, - 4, 0, 0, 0, 8, 0, 0, 0, -104, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 15, 0, 0, 0, -104, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 3, 0, 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, 103, 101, -116, 0, 171, 171, 68, 88, 66, 67, -235, 56, 180, 223, 125, 231, 231, 218, - 70, 75, 12, 63, 200, 233, 69, 121, - 1, 0, 0, 0, 4, 5, 0, 0, - 6, 0, 0, 0, 56, 0, 0, 0, - 92, 1, 0, 0, 224, 2, 0, 0, - 92, 3, 0, 0, 48, 4, 0, 0, -148, 4, 0, 0, 65, 111, 110, 57, - 28, 1, 0, 0, 28, 1, 0, 0, - 0, 2, 254, 255, 232, 0, 0, 0, - 52, 0, 0, 0, 1, 0, 36, 0, - 0, 0, 48, 0, 0, 0, 48, 0, - 0, 0, 36, 0, 1, 0, 48, 0, - 0, 0, 0, 0, 4, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 254, 255, 81, 0, 0, 5, - 5, 0, 15, 160, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 2, - 5, 0, 0, 128, 0, 0, 15, 144, - 31, 0, 0, 2, 5, 0, 1, 128, - 1, 0, 15, 144, 31, 0, 0, 2, - 5, 0, 2, 128, 2, 0, 15, 144, - 9, 0, 0, 3, 0, 0, 1, 128, - 3, 0, 228, 160, 1, 0, 228, 144, - 9, 0, 0, 3, 0, 0, 2, 128, - 4, 0, 228, 160, 1, 0, 228, 144, - 2, 0, 0, 3, 0, 0, 1, 128, - 0, 0, 85, 128, 0, 0, 0, 128, - 5, 0, 0, 3, 0, 0, 4, 192, - 0, 0, 0, 128, 5, 0, 0, 160, - 9, 0, 0, 3, 0, 0, 1, 128, - 2, 0, 228, 160, 1, 0, 228, 144, - 1, 0, 0, 2, 1, 0, 2, 128, - 0, 0, 0, 129, 9, 0, 0, 3, - 1, 0, 1, 128, 1, 0, 228, 160, - 1, 0, 228, 144, 4, 0, 0, 4, - 0, 0, 3, 192, 0, 0, 85, 128, - 0, 0, 228, 160, 1, 0, 228, 128, - 1, 0, 0, 2, 0, 0, 8, 192, - 0, 0, 85, 128, 1, 0, 0, 2, - 0, 0, 15, 224, 0, 0, 228, 144, - 1, 0, 0, 2, 1, 0, 3, 224, - 2, 0, 228, 144, 255, 255, 0, 0, - 83, 72, 68, 82, 124, 1, 0, 0, - 64, 0, 1, 0, 95, 0, 0, 0, - 89, 0, 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 95, 0, 0, 3, 242, 16, 16, 0, - 0, 0, 0, 0, 95, 0, 0, 3, -242, 16, 16, 0, 1, 0, 0, 0, - 95, 0, 0, 3, 50, 16, 16, 0, - 2, 0, 0, 0, 101, 0, 0, 3, -242, 32, 16, 0, 0, 0, 0, 0, -101, 0, 0, 3, 50, 32, 16, 0, - 1, 0, 0, 0, 103, 0, 0, 4, -242, 32, 16, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 104, 0, 0, 2, - 1, 0, 0, 0, 54, 0, 0, 5, -242, 32, 16, 0, 0, 0, 0, 0, - 70, 30, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 50, 32, 16, 0, - 1, 0, 0, 0, 70, 16, 16, 0, - 2, 0, 0, 0, 17, 0, 0, 8, - 18, 0, 16, 0, 0, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 54, 0, 0, 6, - 34, 32, 16, 0, 2, 0, 0, 0, - 10, 0, 16, 128, 65, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 8, - 18, 0, 16, 0, 0, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 17, 0, 0, 8, - 34, 0, 16, 0, 0, 0, 0, 0, - 70, 142, 32, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 70, 30, 16, 0, - 1, 0, 0, 0, 0, 0, 0, 7, - 18, 0, 16, 0, 0, 0, 0, 0, - 26, 0, 16, 0, 0, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 130, 32, 16, 0, - 2, 0, 0, 0, 26, 0, 16, 0, - 0, 0, 0, 0, 56, 0, 0, 7, - 66, 32, 16, 0, 2, 0, 0, 0, - 10, 0, 16, 0, 0, 0, 0, 0, - 1, 64, 0, 0, 0, 0, 0, 63, - 17, 0, 0, 8, 18, 32, 16, 0, - 2, 0, 0, 0, 70, 142, 32, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 70, 30, 16, 0, 1, 0, 0, 0, - 62, 0, 0, 1, 83, 84, 65, 84, -116, 0, 0, 0, 11, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 204, 0, 0, 0, - 1, 0, 0, 0, 72, 0, 0, 0, - 1, 0, 0, 0, 28, 0, 0, 0, - 0, 4, 254, 255, 0, 65, 0, 0, -152, 0, 0, 0, 60, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 36, 71, 108, 111, - 98, 97, 108, 115, 0, 171, 171, 171, - 60, 0, 0, 0, 1, 0, 0, 0, - 96, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -120, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 2, 0, 0, 0, -136, 0, 0, 0, 0, 0, 0, 0, - 95, 67, 67, 95, 77, 86, 80, 77, - 97, 116, 114, 105, 120, 0, 171, 171, - 3, 0, 3, 0, 4, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 77, 105, 99, 114, 111, 115, 111, 102, -116, 32, 40, 82, 41, 32, 72, 76, - 83, 76, 32, 83, 104, 97, 100, 101, -114, 32, 67, 111, 109, 112, 105, 108, -101, 114, 32, 54, 46, 51, 46, 57, - 54, 48, 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, 71, 78, - 92, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 15, 15, 0, 0, 80, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, 0, 0, - 15, 15, 0, 0, 80, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, - 3, 3, 0, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, 171, 171, - 79, 83, 71, 78, 104, 0, 0, 0, - 3, 0, 0, 0, 8, 0, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, 0, 0, - 80, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 3, 12, 0, 0, - 89, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 15, 0, 0, 0, - 84, 69, 88, 67, 79, 79, 82, 68, - 0, 83, 86, 95, 80, 111, 115, 105, -116, 105, 111, 110, 0, 171, 171, 171, -}; - -const int s_numPrograms = 14; -const int s_programLengths[] = {2982,3876,2775,3358,2996,2675,2528,3025,2502,2990,3350,3022,3278,3568}; -const unsigned char* s_programs[] = {s_2140AC5CB6D3788EBF81062827FA30CB4E9DB1BA,s_42003E3EDB1E484A842EB95165D48A439ED6AAE8,s_5132957B676AE174BDF34524AE4A80338F866279,s_61ACD51E94A6AA8035DE722FB113F24350C0D113,s_6A3FEBEAD7E44B2380CD39CBDCFD1D3B046D8057,s_6C80A53170768A04FB4457D7203425EA3467E2E4,s_7845A827CC74A6ED188C81E590C16A4B394AF6EA,s_993D07D70C4AE9F39EAA9EBBDFD109681386920A,s_BF0A97A7CDA97B6CD0F5D1455A170F32E2538AD6,s_CE141D74B59548C43E99D183312791C6F429C37D,s_DB22823528A225B43DABEF012B299639D233D54C,s_E878895044FDA49FE4D8202CE20AF49CC01A8FA9,s_EE3D1B2155C6B54D29BFC9FACB7A83A83EC3847B,s_F24D6A4F46E684E38E16A586E913369B6E02E595}; -const char* s_programKeys[] = {"2140AC5CB6D3788EBF81062827FA30CB4E9DB1BA","42003E3EDB1E484A842EB95165D48A439ED6AAE8","5132957B676AE174BDF34524AE4A80338F866279","61ACD51E94A6AA8035DE722FB113F24350C0D113","6A3FEBEAD7E44B2380CD39CBDCFD1D3B046D8057","6C80A53170768A04FB4457D7203425EA3467E2E4","7845A827CC74A6ED188C81E590C16A4B394AF6EA","993D07D70C4AE9F39EAA9EBBDFD109681386920A","BF0A97A7CDA97B6CD0F5D1455A170F32E2538AD6","CE141D74B59548C43E99D183312791C6F429C37D","DB22823528A225B43DABEF012B299639D233D54C","E878895044FDA49FE4D8202CE20AF49CC01A8FA9","EE3D1B2155C6B54D29BFC9FACB7A83A83EC3847B","F24D6A4F46E684E38E16A586E913369B6E02E595"}; diff --git a/cocos/platform/winrt/targetver.h b/cocos/platform/winrt/targetver.h deleted file mode 100644 index 9b10cecdf039..000000000000 --- a/cocos/platform/winrt/targetver.h +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include diff --git a/cocos/renderer/CCBatchCommand.cpp b/cocos/renderer/CCBatchCommand.cpp index 852e626abe41..840819d51430 100644 --- a/cocos/renderer/CCBatchCommand.cpp +++ b/cocos/renderer/CCBatchCommand.cpp @@ -25,10 +25,10 @@ #include "renderer/CCBatchCommand.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCTextureAtlas.h" #include "renderer/CCTexture2D.h" #include "renderer/CCGLProgram.h" -#include "base/ccUtils.h" NS_CC_BEGIN @@ -70,9 +70,8 @@ void BatchCommand::execute() // Set material _shader->use(); _shader->setUniformsForBuiltins(_mv); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _textureID); - utils::setBlending(_blendType.src, _blendType.dst); + GL::bindTexture2D(_textureID); + GL::blendFunc(_blendType.src, _blendType.dst); // Draw _textureAtlas->drawQuads(); diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index e0a27900f6d9..e6257de367bc 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -35,6 +35,7 @@ THE SOFTWARE. #include "base/CCDirector.h" #include "base/ccUTF8.h" +#include "renderer/ccGLStateCache.h" #include "platform/CCFileUtils.h" // helper functions @@ -232,7 +233,7 @@ GLProgram::~GLProgram() if (_program) { - glDeleteProgram(_program); + GL::deleteProgram(_program); } @@ -617,7 +618,7 @@ bool GLProgram::link() if (status == GL_FALSE) { CCLOG("cocos2d: ERROR: Failed to link program: %i", _program); - glDeleteProgram(_program); + GL::deleteProgram(_program); _program = 0; } else @@ -633,7 +634,7 @@ bool GLProgram::link() void GLProgram::use() { - glUseProgram(_program); + GL::useProgram(_program); } static std::string logForOpenGLShader(GLuint shader) diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 0de3707608b1..2ff33790efb1 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -32,6 +32,7 @@ THE SOFTWARE. #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramStateCache.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCTexture2D.h" #include "base/CCEventCustom.h" #include "base/CCEventListenerCustom.h" @@ -116,14 +117,12 @@ void UniformValue::apply() switch (_uniform->type) { case GL_SAMPLER_2D: _glprogram->setUniformLocationWith1i(_uniform->location, _value.tex.textureUnit); - glActiveTexture(GL_TEXTURE0 + _value.tex.textureUnit); - glBindTexture(GL_TEXTURE_2D, _value.tex.textureId); + GL::bindTexture2DN(_value.tex.textureUnit, _value.tex.textureId); break; case GL_SAMPLER_CUBE: _glprogram->setUniformLocationWith1i(_uniform->location, _value.tex.textureUnit); - glActiveTexture(GL_TEXTURE0 + _value.tex.textureUnit); - glBindTexture(GL_TEXTURE_CUBE_MAP, _value.tex.textureId); + GL::bindTextureN(_value.tex.textureUnit, _value.tex.textureId, GL_TEXTURE_CUBE_MAP); break; case GL_INT: @@ -572,17 +571,7 @@ void GLProgramState::applyAttributes(bool applyAttribFlags) if(_vertexAttribsFlags) { // enable/disable vertex attribs if (applyAttribFlags) - { - auto flags = _vertexAttribsFlags; - for (int i = 0; flags > 0; i++) - { - int flag = 1 << i; - if (flag & flags) - glEnableVertexAttribArray(i); - - flags &= ~flag; - } - } + GL::enableVertexAttribs(_vertexAttribsFlags); // set attributes for(auto &attribute : _attributes) { diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index b2b873851ea5..9d0261e2ccd3 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -32,6 +32,7 @@ #include "base/CCEventDispatcher.h" #include "base/CCEventType.h" #include "2d/CCLight.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" #include "renderer/CCTextureAtlas.h" @@ -166,8 +167,7 @@ void MeshCommand::applyRenderState() CCASSERT(_stateBlock, "StateBlock must be non null"); // blend and texture - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _textureID); + GL::bindTexture2D(_textureID); _stateBlock->bind(); } @@ -198,7 +198,7 @@ void MeshCommand::preBatchDraw() buildVAO(); if (_vao) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { @@ -247,7 +247,7 @@ void MeshCommand::postBatchDraw() { if (_vao) { - glBindVertexArray(0); + GL::bindVAO(0); } else { @@ -305,7 +305,7 @@ void MeshCommand::buildVAO() releaseVAO(); glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); auto flags = programState->getVertexAttribsFlags(); for (int i = 0; flags > 0; i++) { @@ -318,7 +318,7 @@ void MeshCommand::buildVAO() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } @@ -328,7 +328,7 @@ void MeshCommand::releaseVAO() { glDeleteVertexArrays(1, &_vao); _vao = 0; - glBindVertexArray(0); + GL::bindVAO(0); } } diff --git a/cocos/renderer/CCPass.cpp b/cocos/renderer/CCPass.cpp index 6b8165917ee4..d25224001278 100644 --- a/cocos/renderer/CCPass.cpp +++ b/cocos/renderer/CCPass.cpp @@ -32,6 +32,7 @@ #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" #include "renderer/CCTexture2D.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCTechnique.h" #include "renderer/CCMaterial.h" #include "renderer/CCVertexAttribBinding.h" diff --git a/cocos/renderer/CCPrimitiveCommand.cpp b/cocos/renderer/CCPrimitiveCommand.cpp index 7fda32a31608..25606e4a68b7 100644 --- a/cocos/renderer/CCPrimitiveCommand.cpp +++ b/cocos/renderer/CCPrimitiveCommand.cpp @@ -25,10 +25,10 @@ #include "renderer/CCPrimitiveCommand.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" -#include "base/ccUtils.h" #include "base/CCDirector.h" @@ -77,11 +77,10 @@ void PrimitiveCommand::init(float globalOrder, GLuint textureID, GLProgramState* void PrimitiveCommand::execute() const { //Set texture - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _textureID); + GL::bindTexture2D(_textureID); //set blend mode - utils::setBlending(_blendType.src, _blendType.dst); + GL::blendFunc(_blendType.src, _blendType.dst); _glProgramState->apply(_mv); diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index 21d15420a972..678c96bb5d82 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -26,6 +26,7 @@ #include "renderer/CCQuadCommand.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCMaterial.h" #include "renderer/CCTechnique.h" @@ -115,4 +116,4 @@ void QuadCommand::init(float globalOrder, Texture2D* texture, GLProgramState* gl _alphaTextureID = texture->getAlphaTextureName(); } -NS_CC_END +NS_CC_END \ No newline at end of file diff --git a/cocos/renderer/CCRenderState.cpp b/cocos/renderer/CCRenderState.cpp index e1a8b148d426..bd02d53ed465 100644 --- a/cocos/renderer/CCRenderState.cpp +++ b/cocos/renderer/CCRenderState.cpp @@ -31,7 +31,8 @@ #include "renderer/CCTexture2D.h" #include "renderer/CCPass.h" -#include "base/ccUtils.h" +#include "renderer/ccGLStateCache.h" + NS_CC_BEGIN @@ -104,11 +105,7 @@ void RenderState::bind(Pass* pass) CC_ASSERT(pass); if (_texture) - { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); - } - + GL::bindTexture2D(_texture->getName()); // Get the combined modified state bits for our RenderState hierarchy. long stateOverrideBits = _state ? _state->_bits : 0; @@ -249,7 +246,7 @@ void RenderState::StateBlock::bindNoRestore() } if ((_bits & RS_BLEND_FUNC) && (_blendSrc != _defaultState->_blendSrc || _blendDst != _defaultState->_blendDst)) { - utils::setBlending((GLenum)_blendSrc, (GLenum)_blendDst); + GL::blendFunc((GLenum)_blendSrc, (GLenum)_blendDst); _defaultState->_blendSrc = _blendSrc; _defaultState->_blendDst = _blendDst; } @@ -344,7 +341,7 @@ void RenderState::StateBlock::restore(long stateOverrideBits) } if (!(stateOverrideBits & RS_BLEND_FUNC) && (_defaultState->_bits & RS_BLEND_FUNC)) { - utils::setBlending(GL_ONE, GL_ZERO); + GL::blendFunc(GL_ONE, GL_ZERO); _defaultState->_bits &= ~RS_BLEND_FUNC; _defaultState->_blendSrc = RenderState::BLEND_ONE; _defaultState->_blendDst = RenderState::BLEND_ZERO; diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index f08fef3af4cf..8d7a231482df 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -38,6 +38,7 @@ #include "renderer/CCTechnique.h" #include "renderer/CCPass.h" #include "renderer/CCRenderState.h" +#include "renderer/ccGLStateCache.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" @@ -237,7 +238,7 @@ Renderer::~Renderer() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_buffersVAO); - glBindVertexArray(0); + GL::bindVAO(0); } #if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_cacheTextureListener); @@ -276,7 +277,7 @@ void Renderer::setupVBOAndVAO() { //generate vbo and vao for trianglesCommand glGenVertexArrays(1, &_buffersVAO); - glBindVertexArray(_buffersVAO); + GL::bindVAO(_buffersVAO); glGenBuffers(2, &_buffersVBO[0]); @@ -306,7 +307,7 @@ void Renderer::setupVBOAndVAO() glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * INDEX_VBO_SIZE, _indices, GL_STATIC_DRAW); // Must unbind the VAO before changing the element buffer. - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -329,7 +330,7 @@ void Renderer::setupVBO() void Renderer::mapBuffers() { // Avoid changing the element buffer for whatever VAO might be bound. - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * VBO_SIZE, _verts, GL_DYNAMIC_DRAW); @@ -793,7 +794,7 @@ void Renderer::drawBatchedTriangles() if (conf->supportsShareableVAO() && conf->supportsMapBuffer()) { //Bind VAO - glBindVertexArray(_buffersVAO); + GL::bindVAO(_buffersVAO); //Set VBO data glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); @@ -825,9 +826,7 @@ void Renderer::drawBatchedTriangles() glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex , _verts, GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); // vertices glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices)); @@ -856,7 +855,7 @@ void Renderer::drawBatchedTriangles() if (conf->supportsShareableVAO() && conf->supportsMapBuffer()) { //Unbind VAO - glBindVertexArray(0); + GL::bindVAO(0); } else { diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index 89c6095896d3..54d39bc902d7 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -183,6 +183,8 @@ class CC_DLL Renderer /** set color for clear screen */ void setClearColor(const Color4F& clearColor); + /** get color for clear screen */ + const Color4F& getClearColor() const { return _clearColor; }; /* returns the number of drawn batches in the last frame */ ssize_t getDrawnBatches() const { return _drawnBatches; } /* RenderCommands (except) TrianglesCommand should update this value */ diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 7934e620ebf4..218c85ebd8ff 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -45,6 +45,7 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include "base/CCDirector.h" #include "renderer/CCGLProgram.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramCache.h" #include "base/CCNinePatchImageParser.h" @@ -463,7 +464,7 @@ Texture2D::~Texture2D() if(_name) { - glDeleteTextures(1, &_name); + GL::deleteTexture(_name); } } @@ -471,7 +472,7 @@ void Texture2D::releaseGLTexture() { if(_name) { - glDeleteTextures(1, &_name); + GL::deleteTexture(_name); } _name = 0; } @@ -625,13 +626,12 @@ bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat if(_name != 0) { - glDeleteTextures(1, &_name); + GL::deleteTexture(_name); _name = 0; } glGenTextures(1, &_name); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D(_name); if (mipmapsNum == 1) { @@ -718,8 +718,7 @@ bool Texture2D::updateWithData(const void *data,int offsetX,int offsetY,int widt { if (_name) { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D(_name); const PixelFormatInfo& info = _pixelFormatInfoTables.at(_pixelFormat); glTexSubImage2D(GL_TEXTURE_2D,0,offsetX,offsetY,width,height,info.format, info.type,data); @@ -1144,6 +1143,7 @@ bool Texture2D::initWithString(const char *text, const FontDefinition& textDefin auto textDef = textDefinition; auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); textDef._fontSize *= contentScaleFactor; + textDef._lineSpacing *= contentScaleFactor; textDef._dimensions.width *= contentScaleFactor; textDef._dimensions.height *= contentScaleFactor; textDef._stroke._strokeSize *= contentScaleFactor; @@ -1190,13 +1190,12 @@ void Texture2D::drawAtPoint(const Vec2& point) point.x, height + point.y, width + point.x, height + point.y }; - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORD ); _shaderProgram->use(); _shaderProgram->setUniformsForBuiltins(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, coordinates); @@ -1217,13 +1216,11 @@ void Texture2D::drawInRect(const Rect& rect) rect.origin.x, rect.origin.y + rect.size.height, /*0.0f,*/ rect.origin.x + rect.size.width, rect.origin.y + rect.size.height, /*0.0f*/ }; - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORD ); _shaderProgram->use(); _shaderProgram->setUniformsForBuiltins(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, coordinates); @@ -1244,8 +1241,7 @@ void Texture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) void Texture2D::generateMipmap() { CCASSERT(_pixelsWide == ccNextPOT(_pixelsWide) && _pixelsHigh == ccNextPOT(_pixelsHigh), "Mipmap texture only works in POT textures"); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); glGenerateMipmap(GL_TEXTURE_2D); _hasMipmaps = true; #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -1264,8 +1260,7 @@ void Texture2D::setTexParameters(const TexParams &texParams) (_pixelsHigh == ccNextPOT(_pixelsHigh) || texParams.wrapT == GL_CLAMP_TO_EDGE), "GL_CLAMP_TO_EDGE should be used in NPOT dimensions"); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texParams.minFilter ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texParams.magFilter ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texParams.wrapS ); @@ -1290,8 +1285,7 @@ void Texture2D::setAliasTexParameters() return; } - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); if( ! _hasMipmaps ) { @@ -1323,8 +1317,7 @@ void Texture2D::setAntiAliasTexParameters() return; } - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _name); + GL::bindTexture2D( _name ); if( ! _hasMipmaps ) { @@ -1506,10 +1499,12 @@ void Texture2D::removeSpriteFrameCapInset(SpriteFrame* spriteFrame) /// halx99 spec, ANDROID ETC1 ALPHA supports. void Texture2D::setAlphaTexture(Texture2D* alphaTexture) { - if (alphaTexture != nullptr) { - this->_alphaTexture = alphaTexture; - this->_alphaTexture->retain(); - this->_hasPremultipliedAlpha = true; // PremultipliedAlpha should be true. + if (alphaTexture != nullptr) + { + alphaTexture->retain(); + CC_SAFE_RELEASE(_alphaTexture); + _alphaTexture = alphaTexture; + _hasPremultipliedAlpha = true; // PremultipliedAlpha should be true. } } diff --git a/cocos/renderer/CCTextureAtlas.cpp b/cocos/renderer/CCTextureAtlas.cpp index 2bf88e598d68..750d1fa48c4b 100644 --- a/cocos/renderer/CCTextureAtlas.cpp +++ b/cocos/renderer/CCTextureAtlas.cpp @@ -39,6 +39,7 @@ THE SOFTWARE. #include "base/CCEventListenerCustom.h" #include "renderer/CCTextureCache.h" #include "renderer/CCGLProgram.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCTexture2D.h" #include "platform/CCGL.h" @@ -71,7 +72,7 @@ TextureAtlas::~TextureAtlas() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_VAOname); - glBindVertexArray(0); + GL::bindVAO(0); } CC_SAFE_RELEASE(_texture); @@ -255,7 +256,7 @@ void TextureAtlas::setupIndices() void TextureAtlas::setupVBOandVAO() { glGenVertexArrays(1, &_VAOname); - glBindVertexArray(_VAOname); + GL::bindVAO(_VAOname); #define kQuadSize sizeof(_quads[0].bl) @@ -280,7 +281,7 @@ void TextureAtlas::setupVBOandVAO() glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _capacity * 6, _indices, GL_STATIC_DRAW); // Must unbind the VAO before changing the element buffer. - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -297,7 +298,7 @@ void TextureAtlas::setupVBO() void TextureAtlas::mapBuffers() { // Avoid changing the element buffer for whatever VAO might be bound. - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _capacity, _quads, GL_DYNAMIC_DRAW); @@ -612,8 +613,7 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) if(!numberOfQuads) return; - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); + GL::bindTexture2D(_texture); auto conf = Configuration::getInstance(); if (conf->supportsShareableVAO() && conf->supportsMapBuffer()) @@ -643,7 +643,7 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) _dirty = false; } - glBindVertexArray(_VAOname); + GL::bindVAO(_VAOname); #if CC_REBIND_INDICES_BUFFER glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); @@ -651,7 +651,7 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) glDrawElements(GL_TRIANGLES, (GLsizei) numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) ); - glBindVertexArray(0); + GL::bindVAO(0); #if CC_REBIND_INDICES_BUFFER glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); @@ -675,9 +675,7 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) _dirty = false; } - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); // vertices glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices)); diff --git a/cocos/renderer/CCTextureCube.cpp b/cocos/renderer/CCTextureCube.cpp index d4dc61131bda..0e8c82379350 100644 --- a/cocos/renderer/CCTextureCube.cpp +++ b/cocos/renderer/CCTextureCube.cpp @@ -27,6 +27,8 @@ #include "platform/CCImage.h" #include "platform/CCFileUtils.h" +#include "renderer/ccGLStateCache.h" + NS_CC_BEGIN unsigned char* getImageData(Image* img, Texture2D::PixelFormat& ePixFmt) @@ -191,8 +193,7 @@ bool TextureCube::init(const std::string& positive_x, const std::string& negativ GLuint handle; glGenTextures(1, &handle); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, handle); + GL::bindTextureN(0, handle, GL_TEXTURE_CUBE_MAP); for (int i = 0; i < 6; i++) { @@ -236,8 +237,7 @@ bool TextureCube::init(const std::string& positive_x, const std::string& negativ _name = handle; - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, 0); + GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP); for (auto img: images) { @@ -251,16 +251,14 @@ void TextureCube::setTexParameters(const TexParams& texParams) { CCASSERT(_name != 0, __FUNCTION__); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, _name); + GL::bindTextureN(0, _name, GL_TEXTURE_CUBE_MAP); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, texParams.minFilter); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, texParams.magFilter); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, texParams.wrapS); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, texParams.wrapT); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_CUBE_MAP, 0); + GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP); } bool TextureCube::reloadTexture() diff --git a/cocos/renderer/CCTrianglesCommand.cpp b/cocos/renderer/CCTrianglesCommand.cpp index 8638716f37b6..bff6b7f92b2b 100644 --- a/cocos/renderer/CCTrianglesCommand.cpp +++ b/cocos/renderer/CCTrianglesCommand.cpp @@ -24,12 +24,12 @@ ****************************************************************************/ #include "renderer/CCTrianglesCommand.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" #include "xxhash.h" #include "renderer/CCRenderer.h" #include "renderer/CCTexture2D.h" -#include "base//ccUtils.h" NS_CC_BEGIN @@ -116,16 +116,14 @@ void TrianglesCommand::generateMaterialID() void TrianglesCommand::useMaterial() const { //Set texture - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _textureID); + GL::bindTexture2D(_textureID); if (_alphaTextureID > 0) { // ANDROID ETC1 ALPHA supports. - glActiveTexture(GL_TEXTURE0 + 1); - glBindTexture(GL_TEXTURE_2D, _alphaTextureID); + GL::bindTexture2DN(1, _alphaTextureID); } //set blend mode - utils::setBlending(_blendType.src, _blendType.dst); + GL::blendFunc(_blendType.src, _blendType.dst); _glProgramState->apply(_mv); } diff --git a/cocos/renderer/CCVertexAttribBinding.cpp b/cocos/renderer/CCVertexAttribBinding.cpp index f3f296e16689..48f4a5dd5f34 100644 --- a/cocos/renderer/CCVertexAttribBinding.cpp +++ b/cocos/renderer/CCVertexAttribBinding.cpp @@ -22,6 +22,7 @@ #include "renderer/CCVertexAttribBinding.h" #include "renderer/CCGLProgramState.h" +#include "renderer/ccGLStateCache.h" #include "platform/CCGL.h" #include "base/CCConfiguration.h" #include "3d/CCMeshVertexIndexData.h" @@ -144,10 +145,16 @@ bool VertexAttribBinding::init(MeshIndexData* meshIndexData, GLProgramState* glP if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_handle); - glBindVertexArray(_handle); + GL::bindVAO(_handle); glBindBuffer(GL_ARRAY_BUFFER, meshVertexData->getVertexBuffer()->getVBO()); - enableVertexAttributes(_vertexAttribsFlags); + auto flags = _vertexAttribsFlags; + for (int i = 0; flags > 0; i++) { + int flag = 1 << i; + if (flag & flags) + glEnableVertexAttribArray(i); + flags &= ~flag; + } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, meshIndexData->getIndexBuffer()->getVBO()); @@ -156,7 +163,7 @@ bool VertexAttribBinding::init(MeshIndexData* meshIndexData, GLProgramState* glP attribute.second.apply(); } - glBindVertexArray(0); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } @@ -170,7 +177,7 @@ void VertexAttribBinding::bind() if (_handle) { // hardware - glBindVertexArray(_handle); + GL::bindVAO(_handle); } else { @@ -180,7 +187,7 @@ void VertexAttribBinding::bind() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _meshIndexData->getIndexBuffer()->getVBO()); // Software mode - enableVertexAttributes(_vertexAttribsFlags); + GL::enableVertexAttribs(_vertexAttribsFlags); // set attributes for(auto &attribute : _attributes) { @@ -195,7 +202,7 @@ void VertexAttribBinding::unbind() if (_handle) { // Hardware - glBindVertexArray(0); + GL::bindVAO(0); } else { @@ -226,19 +233,6 @@ void VertexAttribBinding::parseAttributes() } } -void VertexAttribBinding::enableVertexAttributes(uint32_t flags) const -{ - auto tmpFlags = flags; - for (int i = 0; tmpFlags > 0; i++) - { - int flag = 1 << i; - if (flag & tmpFlags) - glEnableVertexAttribArray(i); - - tmpFlags &= ~flag; - } -} - VertexAttribValue* VertexAttribBinding::getVertexAttribValue(const std::string& name) { const auto itr = _attributes.find(name); diff --git a/cocos/renderer/CCVertexAttribBinding.h b/cocos/renderer/CCVertexAttribBinding.h index 5a6b60508950..4325089192c4 100644 --- a/cocos/renderer/CCVertexAttribBinding.h +++ b/cocos/renderer/CCVertexAttribBinding.h @@ -89,6 +89,9 @@ class CC_DLL VertexAttribBinding : public Ref private: + + bool init(MeshIndexData* meshIndexData, GLProgramState* glProgramState); + /** * Constructor. */ @@ -103,12 +106,10 @@ class CC_DLL VertexAttribBinding : public Ref * Hidden copy assignment operator. */ VertexAttribBinding& operator=(const VertexAttribBinding&); - - bool init(MeshIndexData* meshIndexData, GLProgramState* glProgramState); + void setVertexAttribPointer(const std::string& name, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid* pointer); VertexAttribValue* getVertexAttribValue(const std::string &name); void parseAttributes(); - void enableVertexAttributes(uint32_t flags) const; GLuint _handle; diff --git a/cocos/renderer/CCVertexIndexData.cpp b/cocos/renderer/CCVertexIndexData.cpp index e8e3b79f1bc0..4a69bdd699f2 100644 --- a/cocos/renderer/CCVertexIndexData.cpp +++ b/cocos/renderer/CCVertexIndexData.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "renderer/CCVertexIndexData.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCVertexIndexBuffer.h" NS_CC_BEGIN @@ -115,12 +116,13 @@ VertexData::~VertexData() void VertexData::use() { - + uint32_t flags(0); for(auto& element : _vertexStreams) { - glEnableVertexAttribArray(element.second._stream._semantic); + flags = flags | (1 << element.second._stream._semantic); } + GL::enableVertexAttribs(flags); int lastVBO = -1; for(auto& element : _vertexStreams) diff --git a/cocos/renderer/CMakeLists.txt b/cocos/renderer/CMakeLists.txt index 269ae867dc98..a6ce84ec4423 100644 --- a/cocos/renderer/CMakeLists.txt +++ b/cocos/renderer/CMakeLists.txt @@ -2,6 +2,7 @@ set(COCOS_RENDERER_HEADER renderer/CCTextureCache.h renderer/CCRenderer.h renderer/CCMaterial.h + renderer/ccGLStateCache.h renderer/CCRenderCommandPool.h renderer/ccShaders.h renderer/CCMeshCommand.h @@ -55,6 +56,7 @@ set(COCOS_RENDERER_SRC renderer/CCVertexAttribBinding.cpp renderer/CCVertexIndexBuffer.cpp renderer/CCVertexIndexData.cpp + renderer/ccGLStateCache.cpp renderer/ccShaders.cpp renderer/CCFrameBuffer.cpp ) diff --git a/cocos/renderer/ccGLStateCache.cpp b/cocos/renderer/ccGLStateCache.cpp new file mode 100644 index 000000000000..cd8f520fee30 --- /dev/null +++ b/cocos/renderer/ccGLStateCache.cpp @@ -0,0 +1,280 @@ +/**************************************************************************** +Copyright (c) 2011 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2016 Chukong Technologies Inc. +Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +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 "renderer/ccGLStateCache.h" + +#include "renderer/CCGLProgram.h" +#include "renderer/CCRenderState.h" +#include "base/CCDirector.h" +#include "base/ccConfig.h" +#include "base/CCConfiguration.h" + +NS_CC_BEGIN + +static const int MAX_ATTRIBUTES = 16; +static const int MAX_ACTIVE_TEXTURE = 16; + +namespace +{ + static GLuint s_currentProjectionMatrix = -1; + static uint32_t s_attributeFlags = 0; // 32 attributes max + +#if CC_ENABLE_GL_STATE_CACHE + + static GLuint s_currentShaderProgram = -1; + static GLuint s_currentBoundTexture[MAX_ACTIVE_TEXTURE] = {(GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, }; + static GLenum s_blendingSource = -1; + static GLenum s_blendingDest = -1; + static int s_GLServerState = 0; + static GLuint s_VAO = 0; + static GLenum s_activeTexture = -1; + +#endif // CC_ENABLE_GL_STATE_CACHE +} + +// GL State Cache functions + +namespace GL { + +void invalidateStateCache( void ) +{ + Director::getInstance()->resetMatrixStack(); + s_currentProjectionMatrix = -1; + s_attributeFlags = 0; + +#if CC_ENABLE_GL_STATE_CACHE + s_currentShaderProgram = -1; + for( int i=0; i < MAX_ACTIVE_TEXTURE; i++ ) + { + s_currentBoundTexture[i] = -1; + } + + s_blendingSource = -1; + s_blendingDest = -1; + s_GLServerState = 0; + s_VAO = 0; + +#endif // CC_ENABLE_GL_STATE_CACHE +} + +void deleteProgram( GLuint program ) +{ +#if CC_ENABLE_GL_STATE_CACHE + if(program == s_currentShaderProgram) + { + s_currentShaderProgram = -1; + } +#endif // CC_ENABLE_GL_STATE_CACHE + + glDeleteProgram( program ); +} + +void useProgram( GLuint program ) +{ +#if CC_ENABLE_GL_STATE_CACHE + if( program != s_currentShaderProgram ) { + s_currentShaderProgram = program; + glUseProgram(program); + } +#else + glUseProgram(program); +#endif // CC_ENABLE_GL_STATE_CACHE +} + +static void SetBlending(GLenum sfactor, GLenum dfactor) +{ + if (sfactor == GL_ONE && dfactor == GL_ZERO) + { + glDisable(GL_BLEND); + RenderState::StateBlock::_defaultState->setBlend(false); + } + else + { + glEnable(GL_BLEND); + glBlendFunc(sfactor, dfactor); + + RenderState::StateBlock::_defaultState->setBlend(true); + RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)sfactor); + RenderState::StateBlock::_defaultState->setBlendDst((RenderState::Blend)dfactor); + } +} + +void blendFunc(GLenum sfactor, GLenum dfactor) +{ +#if CC_ENABLE_GL_STATE_CACHE + if (sfactor != s_blendingSource || dfactor != s_blendingDest) + { + s_blendingSource = sfactor; + s_blendingDest = dfactor; + SetBlending(sfactor, dfactor); + } +#else + SetBlending( sfactor, dfactor ); +#endif // CC_ENABLE_GL_STATE_CACHE +} + +void blendResetToCache(void) +{ + glBlendEquation(GL_FUNC_ADD); +#if CC_ENABLE_GL_STATE_CACHE + SetBlending(s_blendingSource, s_blendingDest); +#else + SetBlending(CC_BLEND_SRC, CC_BLEND_DST); +#endif // CC_ENABLE_GL_STATE_CACHE +} + +void bindTexture2D(GLuint textureId) +{ + GL::bindTexture2DN(0, textureId); +} + +void bindTexture2D(Texture2D* texture) +{ + GL::bindTexture2DN(0, texture->getName()); + auto alphaTexID = texture->getAlphaTextureName(); + if (alphaTexID > 0) { + GL::bindTexture2DN(1, alphaTexID); + } +} + +void bindTexture2DN(GLuint textureUnit, GLuint textureId) +{ +#if CC_ENABLE_GL_STATE_CACHE + CCASSERT(textureUnit < MAX_ACTIVE_TEXTURE, "textureUnit is too big"); + if (s_currentBoundTexture[textureUnit] != textureId) + { + s_currentBoundTexture[textureUnit] = textureId; + activeTexture(GL_TEXTURE0 + textureUnit); + glBindTexture(GL_TEXTURE_2D, textureId); + } +#else + glActiveTexture(GL_TEXTURE0 + textureUnit); + glBindTexture(GL_TEXTURE_2D, textureId); +#endif +} + +void bindTextureN(GLuint textureUnit, GLuint textureId, GLuint textureType/* = GL_TEXTURE_2D*/) +{ +#if CC_ENABLE_GL_STATE_CACHE + CCASSERT(textureUnit < MAX_ACTIVE_TEXTURE, "textureUnit is too big"); + if (s_currentBoundTexture[textureUnit] != textureId) + { + s_currentBoundTexture[textureUnit] = textureId; + activeTexture(GL_TEXTURE0 + textureUnit); + glBindTexture(textureType, textureId); + } +#else + glActiveTexture(GL_TEXTURE0 + textureUnit); + glBindTexture(textureType, textureId); +#endif +} + + +void deleteTexture(GLuint textureId) +{ +#if CC_ENABLE_GL_STATE_CACHE + for (size_t i = 0; i < MAX_ACTIVE_TEXTURE; ++i) + { + if (s_currentBoundTexture[i] == textureId) + { + s_currentBoundTexture[i] = -1; + } + } +#endif // CC_ENABLE_GL_STATE_CACHE + + glDeleteTextures(1, &textureId); +} + +void deleteTextureN(GLuint /*textureUnit*/, GLuint textureId) +{ + deleteTexture(textureId); +} + +void activeTexture(GLenum texture) +{ +#if CC_ENABLE_GL_STATE_CACHE + if(s_activeTexture != texture) { + s_activeTexture = texture; + glActiveTexture(s_activeTexture); + } +#else + glActiveTexture(texture); +#endif +} + +void bindVAO(GLuint vaoId) +{ + if (Configuration::getInstance()->supportsShareableVAO()) + { + +#if CC_ENABLE_GL_STATE_CACHE + if (s_VAO != vaoId) + { + s_VAO = vaoId; + glBindVertexArray(vaoId); + } +#else + glBindVertexArray(vaoId); +#endif // CC_ENABLE_GL_STATE_CACHE + + } +} + +// GL Vertex Attrib functions + +void enableVertexAttribs(uint32_t flags) +{ + bindVAO(0); + + // hardcoded! + for(int i=0; i < MAX_ATTRIBUTES; i++) { + unsigned int bit = 1 << i; + //FIXME:Cache is disabled, try to enable cache as before + bool enabled = (flags & bit) != 0; + bool enabledBefore = (s_attributeFlags & bit) != 0; + if(enabled != enabledBefore) + { + if( enabled ) + glEnableVertexAttribArray(i); + else + glDisableVertexAttribArray(i); + } + } + s_attributeFlags = flags; +} + +// GL Uniforms functions + +void setProjectionMatrixDirty( void ) +{ + s_currentProjectionMatrix = -1; +} + +} // Namespace GL + +NS_CC_END diff --git a/cocos/renderer/ccGLStateCache.h b/cocos/renderer/ccGLStateCache.h new file mode 100644 index 000000000000..115a5a0857db --- /dev/null +++ b/cocos/renderer/ccGLStateCache.h @@ -0,0 +1,193 @@ +/**************************************************************************** + Copyright (c) 2011 Ricardo Quesada + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2011 Zynga Inc. + Copyright (c) 2013-2016 Chukong Technologies Inc. + Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +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 __CCGLSTATE_H__ +#define __CCGLSTATE_H__ + +#include + +#include "platform/CCGL.h" +#include "platform/CCPlatformMacros.h" + +NS_CC_BEGIN + +/** + * @addtogroup renderer + * @{ + */ + +class GLProgram; +class Texture2D; +namespace GL { + +/** Vertex attrib flags. */ +enum { + VERTEX_ATTRIB_FLAG_NONE = 0, + + VERTEX_ATTRIB_FLAG_POSITION = 1 << 0, + VERTEX_ATTRIB_FLAG_COLOR = 1 << 1, + VERTEX_ATTRIB_FLAG_TEX_COORD = 1 << 2, + VERTEX_ATTRIB_FLAG_NORMAL = 1 << 3, + VERTEX_ATTRIB_FLAG_BLEND_WEIGHT = 1 << 4, + VERTEX_ATTRIB_FLAG_BLEND_INDEX = 1 << 5, + + VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = (VERTEX_ATTRIB_FLAG_POSITION | VERTEX_ATTRIB_FLAG_COLOR | VERTEX_ATTRIB_FLAG_TEX_COORD), +}; + +/** + * Invalidates the GL state cache. + * + * If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache. + * @since v2.0.0 + */ +void CC_DLL invalidateStateCache(void); + +/** + * Uses the GL program in case program is different than the current one. + + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly. + * @since v2.0.0 + */ +void CC_DLL useProgram(GLuint program); + +/** + * Deletes the GL program. If it is the one that is being used, it invalidates it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly. + * @since v2.0.0 + */ +void CC_DLL deleteProgram(GLuint program); + +/** + * Uses a blending function in case it not already used. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly. + * @since v2.0.0 + */ +void CC_DLL blendFunc(GLenum sfactor, GLenum dfactor); + +/** + * Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation(). + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD. + * @since v2.0.0 + */ +void CC_DLL blendResetToCache(void); + +/** + * Sets the projection matrix as dirty. + * @since v2.0.0 + */ +void CC_DLL setProjectionMatrixDirty(void); + +/** + * Will enable the vertex attribs that are passed as flags. + * Possible flags: + * + * * VERTEX_ATTRIB_FLAG_POSITION + * * VERTEX_ATTRIB_FLAG_COLOR + * * VERTEX_ATTRIB_FLAG_TEX_COORDS + * + * These flags can be ORed. The flags that are not present, will be disabled. + * + * @since v2.0.0 + */ +void CC_DLL enableVertexAttribs(uint32_t flags); + +/** + * If the texture is not already bound to texture unit 0, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + * @since v2.0.0 + */ +void CC_DLL bindTexture2D(GLuint textureId); + +/** +* If the texture is not already bound to texture unit 0, it binds it. +* +* If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. +* +* @remark: It will bind alpha texture to support ETC1 alpha channel. +* @since v3.13 +*/ +void CC_DLL bindTexture2D(Texture2D* texture); + +/** + * If the texture is not already bound to a given unit, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + * @since v2.1.0 + */ +void CC_DLL bindTexture2DN(GLuint textureUnit, GLuint textureId); + +/** If the texture is not already bound to a given unit, it binds it. + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + * @since v3.6 + */ +void CC_DLL bindTextureN(GLuint textureUnit, GLuint textureId, GLuint textureType = GL_TEXTURE_2D); + +/** + * It will delete a given texture. If the texture was bound, it will invalidate the cached. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + * @since v2.0.0 + */ +void CC_DLL deleteTexture(GLuint textureId); + +/** + * It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + * @since v2.1.0 + */ +CC_DEPRECATED_ATTRIBUTE void CC_DLL deleteTextureN(GLuint textureUnit, GLuint textureId); + +/** + * Select active texture unit. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly. + * @since v3.0 + */ +void CC_DLL activeTexture(GLenum texture); + +/** + * If the vertex array is not already bound, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly. + * @since v2.0.0 + */ +void CC_DLL bindVAO(GLuint vaoId); + +// end of support group +/// @} + +} // Namespace GL +NS_CC_END + + +#endif /* __CCGLSTATE_H__ */ diff --git a/cocos/scripting/js-bindings/CMakeLists.txt b/cocos/scripting/js-bindings/CMakeLists.txt index 0345172f539f..93ffbedbe4b1 100644 --- a/cocos/scripting/js-bindings/CMakeLists.txt +++ b/cocos/scripting/js-bindings/CMakeLists.txt @@ -165,14 +165,8 @@ target_include_directories(jscocos2d INTERFACE ${cocos_root}/cocos/scripting/js-bindings/manual ) -# ignore part warnings on binding codes. tocheck: not take effect? - if(WINDOWS) target_compile_definitions(jscocos2d PRIVATE _USRJSSTATIC) -else() - target_compile_options(jscocos2d PRIVATE - -Wno-deprecated - ) endif() set_target_properties(jscocos2d @@ -184,4 +178,11 @@ set_target_properties(jscocos2d if(XCODE OR VS) cocos_mark_code_files("jscocos2d") -endif() \ No newline at end of file +endif() + +if(WINDOWS) + # precompiled header + target_sources(jscocos2d PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp") + set_target_properties(jscocos2d PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") + set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") +endif() diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index 72882a7ad456..8c2e831da9b7 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -2400,6 +2400,16 @@ float return false; }, +/** + * @method getVR + * @return {cc.VRIRenderer} + */ +getVR : function ( +) +{ + return cc.VRIRenderer; +}, + /** * @method getContentScaleFactor * @return {float} @@ -2431,13 +2441,19 @@ getSafeAreaRect : function ( }, /** - * @method getVR - * @return {cc.VRIRenderer} + * @method setViewPortInPoints + * @param {float} arg0 + * @param {float} arg1 + * @param {float} arg2 + * @param {float} arg3 */ -getVR : function ( +setViewPortInPoints : function ( +float, +float, +float, +float ) { - return cc.VRIRenderer; }, /** @@ -2514,16 +2530,6 @@ getVisibleOrigin : function ( return cc.Vec2; }, -/** - * @method getFrameSize - * @return {size_object} - */ -getFrameSize : function ( -) -{ - return cc.Size; -}, - /** * @method setFrameZoomFactor * @param {float} arg0 @@ -2564,6 +2570,14 @@ str { }, +/** + * @method setDefaultCursor + */ +setDefaultCursor : function ( +) +{ +}, + /** * @method windowShouldClose * @return {bool} @@ -2631,19 +2645,13 @@ vrirenderer }, /** - * @method setViewPortInPoints - * @param {float} arg0 - * @param {float} arg1 - * @param {float} arg2 - * @param {float} arg3 + * @method getFrameSize + * @return {size_object} */ -setViewPortInPoints : function ( -float, -float, -float, -float +getFrameSize : function ( ) { + return cc.Size; }, /** @@ -2656,6 +2664,18 @@ getScissorRect : function ( return cc.Rect; }, +/** + * @method setCursor + * @param {String} arg0 + * @param {vec2_object} arg1 + */ +setCursor : function ( +str, +vec2 +) +{ +}, + /** * @method getRetinaFactor * @return {int} @@ -3377,6 +3397,16 @@ getAnimationInterval : function ( return 0; }, +/** + * @method getClearColor + * @return {color4f_object} + */ +getClearColor : function ( +) +{ + return cc.Color4F; +}, + /** * @method isPaused * @return {bool} @@ -6713,6 +6743,16 @@ supportsMapBuffer : function ( return false; }, +/** + * @method getInfoAsMap + * @return {map_object} + */ +getInfoAsMap : function ( +) +{ + return map_object; +}, + /** * @method destroyInstance */ diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js index 1751546076b1..dfa20a6088c0 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js @@ -36,6 +36,16 @@ play : function ( { }, +/** + * @method isUserInputEnabled + * @return {bool} + */ +isUserInputEnabled : function ( +) +{ + return false; +}, + /** * @method setKeepAspectRatioEnabled * @param {bool} arg0 @@ -84,6 +94,26 @@ str { }, +/** + * @method setStyle + * @param {cc.experimental::ui::VideoPlayer::StyleType} arg0 + */ +setStyle : function ( +styletype +) +{ +}, + +/** + * @method seekTo + * @param {float} arg0 + */ +seekTo : function ( +float +) +{ +}, + /** * @method isKeepAspectRatioEnabled * @return {bool} @@ -114,6 +144,16 @@ isFullScreenEnabled : function ( return false; }, +/** + * @method isLooping + * @return {bool} + */ +isLooping : function ( +) +{ + return false; +}, + /** * @method isPlaying * @return {bool} @@ -125,11 +165,21 @@ isPlaying : function ( }, /** - * @method seekTo - * @param {float} arg0 + * @method setLooping + * @param {bool} arg0 */ -seekTo : function ( -float +setLooping : function ( +bool +) +{ +}, + +/** + * @method setUserInputEnabled + * @param {bool} arg0 + */ +setUserInputEnabled : function ( +bool ) { }, diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js index fd44e2737df7..10dc94b06f7b 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js @@ -4293,6 +4293,14 @@ getCapInsetsBarRenderer : function ( return cc.Rect; }, +/** + * @method updateVisualSlider + */ +updateVisualSlider : function ( +) +{ +}, + /** * @method getCapInsetsProgressBarRenderer * @return {rect_object} diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 957ad77f5ba6..b152e1fc1755 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -6065,6 +6065,28 @@ bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsva JS_ReportError(cx, "js_cocos2dx_GLView_setContentScaleFactor : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getVR : Invalid Native Object"); + if (argc == 0) { + cocos2d::VRIRenderer* ret = cobj->getVR(); + JS::RootedValue jsret(cx); + if (ret) { + jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::VRIRenderer*)ret)); + } else { + jsret = JSVAL_NULL; + }; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLView_getVR : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_GLView_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6121,26 +6143,30 @@ bool js_cocos2dx_GLView_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_GLView_getSafeAreaRect : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_GLView_setViewPortInPoints(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getVR : Invalid Native Object"); - if (argc == 0) { - cocos2d::VRIRenderer* ret = cobj->getVR(); - JS::RootedValue jsret(cx); - if (ret) { - jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, (cocos2d::VRIRenderer*)ret)); - } else { - jsret = JSVAL_NULL; - }; - args.rval().set(jsret); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setViewPortInPoints : Invalid Native Object"); + if (argc == 4) { + double arg0 = 0; + double arg1 = 0; + double arg2 = 0; + double arg3 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setViewPortInPoints : Error processing arguments"); + cobj->setViewPortInPoints(arg0, arg1, arg2, arg3); + args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_GLView_getVR : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_GLView_setViewPortInPoints : wrong number of arguments: %d, was expecting %d", argc, 4); return false; } bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval *vp) @@ -6277,24 +6303,6 @@ bool js_cocos2dx_GLView_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp JS_ReportError(cx, "js_cocos2dx_GLView_getVisibleOrigin : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_GLView_getFrameSize(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getFrameSize : Invalid Native Object"); - if (argc == 0) { - cocos2d::Size ret = cobj->getFrameSize(); - JS::RootedValue jsret(cx); - jsret = ccsize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLView_getFrameSize : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} bool js_cocos2dx_GLView_setFrameZoomFactor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6387,6 +6395,22 @@ bool js_cocos2dx_GLView_setIcon(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_GLView_setIcon : wrong number of arguments"); return false; } +bool js_cocos2dx_GLView_setDefaultCursor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setDefaultCursor : Invalid Native Object"); + if (argc == 0) { + cobj->setDefaultCursor(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLView_setDefaultCursor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_GLView_windowShouldClose(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6531,30 +6555,22 @@ bool js_cocos2dx_GLView_setVR(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_GLView_setVR : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_GLView_setViewPortInPoints(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_GLView_getFrameSize(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setViewPortInPoints : Invalid Native Object"); - if (argc == 4) { - double arg0 = 0; - double arg1 = 0; - double arg2 = 0; - double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setViewPortInPoints : Error processing arguments"); - cobj->setViewPortInPoints(arg0, arg1, arg2, arg3); - args.rval().setUndefined(); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getFrameSize : Invalid Native Object"); + if (argc == 0) { + cocos2d::Size ret = cobj->getFrameSize(); + JS::RootedValue jsret(cx); + jsret = ccsize_to_jsval(cx, ret); + args.rval().set(jsret); return true; } - JS_ReportError(cx, "js_cocos2dx_GLView_setViewPortInPoints : wrong number of arguments: %d, was expecting %d", argc, 4); + JS_ReportError(cx, "js_cocos2dx_GLView_getFrameSize : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_GLView_getScissorRect(JSContext *cx, uint32_t argc, jsval *vp) @@ -6575,6 +6591,36 @@ bool js_cocos2dx_GLView_getScissorRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_GLView_getScissorRect : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_GLView_setCursor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setCursor : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setCursor : Error processing arguments"); + cobj->setCursor(arg0); + args.rval().setUndefined(); + return true; + } + if (argc == 2) { + std::string arg0; + cocos2d::Vec2 arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_vector2(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setCursor : Error processing arguments"); + cobj->setCursor(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLView_setCursor : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_GLView_getRetinaFactor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6737,10 +6783,11 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global) { JS_FN("getViewPortRect", js_cocos2dx_GLView_getViewPortRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScaleY", js_cocos2dx_GLView_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setContentScaleFactor", js_cocos2dx_GLView_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVR", js_cocos2dx_GLView_getVR, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getContentScaleFactor", js_cocos2dx_GLView_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIMEKeyboardState", js_cocos2dx_GLView_setIMEKeyboardState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getSafeAreaRect", js_cocos2dx_GLView_getSafeAreaRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getVR", js_cocos2dx_GLView_getVR, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setViewPortInPoints", js_cocos2dx_GLView_setViewPortInPoints, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScissorInPoints", js_cocos2dx_GLView_setScissorInPoints, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getViewName", js_cocos2dx_GLView_getViewName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isOpenGLReady", js_cocos2dx_GLView_isOpenGLReady, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -6748,19 +6795,20 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global) { JS_FN("setDefaultIcon", js_cocos2dx_GLView_setDefaultIcon, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScaleX", js_cocos2dx_GLView_getScaleX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getVisibleOrigin", js_cocos2dx_GLView_getVisibleOrigin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getFrameSize", js_cocos2dx_GLView_getFrameSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setFrameZoomFactor", js_cocos2dx_GLView_setFrameZoomFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getFrameZoomFactor", js_cocos2dx_GLView_getFrameZoomFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDesignResolutionSize", js_cocos2dx_GLView_getDesignResolutionSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIcon", js_cocos2dx_GLView_setIcon, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setDefaultCursor", js_cocos2dx_GLView_setDefaultCursor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("windowShouldClose", js_cocos2dx_GLView_windowShouldClose, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setDesignResolutionSize", js_cocos2dx_GLView_setDesignResolutionSize, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getResolutionPolicy", js_cocos2dx_GLView_getResolutionPolicy, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isRetinaDisplay", js_cocos2dx_GLView_isRetinaDisplay, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("renderScene", js_cocos2dx_GLView_renderScene, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setVR", js_cocos2dx_GLView_setVR, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setViewPortInPoints", js_cocos2dx_GLView_setViewPortInPoints, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getFrameSize", js_cocos2dx_GLView_getFrameSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScissorRect", js_cocos2dx_GLView_getScissorRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setCursor", js_cocos2dx_GLView_setCursor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getRetinaFactor", js_cocos2dx_GLView_getRetinaFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setViewName", js_cocos2dx_GLView_setViewName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getVisibleRect", js_cocos2dx_GLView_getVisibleRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -8101,6 +8149,24 @@ bool js_cocos2dx_Director_getAnimationInterval(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_Director_getAnimationInterval : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Director_getClearColor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_getClearColor : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Color4F& ret = cobj->getClearColor(); + JS::RootedValue jsret(cx); + jsret = cccolor4f_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Director_getClearColor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Director_isPaused(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -8329,6 +8395,7 @@ void js_register_cocos2dx_Director(JSContext *cx, JS::HandleObject global) { JS_FN("getScheduler", js_cocos2dx_Director_getScheduler, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("pushScene", js_cocos2dx_Director_pushScene, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getAnimationInterval", js_cocos2dx_Director_getAnimationInterval, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getClearColor", js_cocos2dx_Director_getClearColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isPaused", js_cocos2dx_Director_isPaused, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setDisplayStats", js_cocos2dx_Director_setDisplayStats, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getEventDispatcher", js_cocos2dx_Director_getEventDispatcher, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -17849,6 +17916,24 @@ bool js_cocos2dx_Configuration_supportsMapBuffer(JSContext *cx, uint32_t argc, j JS_ReportError(cx, "js_cocos2dx_Configuration_supportsMapBuffer : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Configuration_getInfoAsMap(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Configuration* cobj = (cocos2d::Configuration *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Configuration_getInfoAsMap : Invalid Native Object"); + if (argc == 0) { + const cocos2d::ValueMap& ret = cobj->getInfoAsMap(); + JS::RootedValue jsret(cx); + jsret = ccvaluemap_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Configuration_getInfoAsMap : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Configuration_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -17919,6 +18004,7 @@ void js_register_cocos2dx_Configuration(JSContext *cx, JS::HandleObject global) JS_FN("getValue", js_cocos2dx_Configuration_getValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("gatherGPUInfo", js_cocos2dx_Configuration_gatherGPUInfo, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("supportsMapBuffer", js_cocos2dx_Configuration_supportsMapBuffer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getInfoAsMap", js_cocos2dx_Configuration_getInfoAsMap, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index a2eb31b3753e..699ae481122c 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -308,10 +308,11 @@ bool js_cocos2dx_GLView_setFrameSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getViewPortRect(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getScaleY(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLView_setViewPortInPoints(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getViewName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_isOpenGLReady(JSContext *cx, uint32_t argc, jsval *vp); @@ -319,19 +320,20 @@ bool js_cocos2dx_GLView_setCursorVisible(JSContext *cx, uint32_t argc, jsval *vp bool js_cocos2dx_GLView_setDefaultIcon(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getScaleX(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLView_getFrameSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setFrameZoomFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getFrameZoomFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setIcon(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLView_setDefaultCursor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_windowShouldClose(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getResolutionPolicy(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_isRetinaDisplay(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_renderScene(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setVR(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLView_setViewPortInPoints(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLView_getFrameSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getScissorRect(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLView_setCursor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getRetinaFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setViewName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getVisibleRect(JSContext *cx, uint32_t argc, jsval *vp); @@ -413,6 +415,7 @@ bool js_cocos2dx_Director_initProjectionMatrixStack(JSContext *cx, uint32_t argc bool js_cocos2dx_Director_getScheduler(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_pushScene(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Director_getClearColor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_isPaused(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setDisplayStats(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp); @@ -1002,6 +1005,7 @@ bool js_cocos2dx_Configuration_getMaxTextureUnits(JSContext *cx, uint32_t argc, bool js_cocos2dx_Configuration_getValue(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Configuration_gatherGPUInfo(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Configuration_supportsMapBuffer(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Configuration_getInfoAsMap(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Configuration_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Configuration_getInstance(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp index a5e43599af82..731dfe314f09 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp @@ -75,6 +75,24 @@ bool js_cocos2dx_experimental_video_VideoPlayer_play(JSContext *cx, uint32_t arg JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_play : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isUserInputEnabled(); + JS::RootedValue jsret(cx); + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -171,6 +189,46 @@ bool js_cocos2dx_experimental_video_VideoPlayer_setURL(JSContext *cx, uint32_t a JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setURL : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_experimental_video_VideoPlayer_setStyle(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setStyle : Invalid Native Object"); + if (argc == 1) { + cocos2d::experimental::ui::VideoPlayer::StyleType arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setStyle : Error processing arguments"); + cobj->setStyle(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setStyle : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Error processing arguments"); + cobj->seekTo(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -227,6 +285,24 @@ bool js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(JSContext *c JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_experimental_video_VideoPlayer_isLooping(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_isLooping : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isLooping(); + JS::RootedValue jsret(cx); + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isLooping : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_experimental_video_VideoPlayer_isPlaying(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -245,24 +321,44 @@ bool js_cocos2dx_experimental_video_VideoPlayer_isPlaying(JSContext *cx, uint32_ JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isPlaying : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_experimental_video_VideoPlayer_setLooping(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setLooping : Invalid Native Object"); if (argc == 1) { - double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Error processing arguments"); - cobj->seekTo(arg0); + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setLooping : Error processing arguments"); + cobj->setLooping(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setLooping : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled : Error processing arguments"); + cobj->setUserInputEnabled(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t argc, jsval *vp) @@ -319,16 +415,21 @@ void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::Hand JS_FN("getFileName", js_cocos2dx_experimental_video_VideoPlayer_getFileName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getURL", js_cocos2dx_experimental_video_VideoPlayer_getURL, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("play", js_cocos2dx_experimental_video_VideoPlayer_play, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isUserInputEnabled", js_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setKeepAspectRatioEnabled", js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("stop", js_cocos2dx_experimental_video_VideoPlayer_stop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setFullScreenEnabled", js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setFileName", js_cocos2dx_experimental_video_VideoPlayer_setFileName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setURL", js_cocos2dx_experimental_video_VideoPlayer_setURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setStyle", js_cocos2dx_experimental_video_VideoPlayer_setStyle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("seekTo", js_cocos2dx_experimental_video_VideoPlayer_seekTo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isKeepAspectRatioEnabled", js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("onPlayEvent", js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isFullScreenEnabled", js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isLooping", js_cocos2dx_experimental_video_VideoPlayer_isLooping, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isPlaying", js_cocos2dx_experimental_video_VideoPlayer_isPlaying, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("seekTo", js_cocos2dx_experimental_video_VideoPlayer_seekTo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLooping", js_cocos2dx_experimental_video_VideoPlayer_setLooping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUserInputEnabled", js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp index 495809b7598c..13fa506ef0a3 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp @@ -16,16 +16,21 @@ void register_all_cocos2dx_experimental_video(JSContext* cx, JS::HandleObject ob bool js_cocos2dx_experimental_video_VideoPlayer_getFileName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_getURL(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_play(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_stop(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_setFileName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_setURL(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setStyle(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_isLooping(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_isPlaying(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setLooping(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_video_VideoPlayer_VideoPlayer(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index 19c8d6c384e1..c557720c8634 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -10416,6 +10416,22 @@ bool js_cocos2dx_ui_Slider_getCapInsetsBarRenderer(JSContext *cx, uint32_t argc, JS_ReportError(cx, "js_cocos2dx_ui_Slider_getCapInsetsBarRenderer : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_Slider_updateVisualSlider(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::Slider* cobj = (cocos2d::ui::Slider *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Slider_updateVisualSlider : Invalid Native Object"); + if (argc == 0) { + cobj->updateVisualSlider(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_Slider_updateVisualSlider : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_Slider_getCapInsetsProgressBarRenderer(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -10800,6 +10816,7 @@ void js_register_cocos2dx_ui_Slider(JSContext *cx, JS::HandleObject global) { JS_FN("loadBarTexture", js_cocos2dx_ui_Slider_loadBarTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getProgressBarFile", js_cocos2dx_ui_Slider_getProgressBarFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getCapInsetsBarRenderer", js_cocos2dx_ui_Slider_getCapInsetsBarRenderer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("updateVisualSlider", js_cocos2dx_ui_Slider_updateVisualSlider, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getCapInsetsProgressBarRenderer", js_cocos2dx_ui_Slider_getCapInsetsProgressBarRenderer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getSlidBallPressedRenderer", js_cocos2dx_ui_Slider_getSlidBallPressedRenderer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("loadSlidBallTexturePressed", js_cocos2dx_ui_Slider_loadSlidBallTexturePressed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp index 3552a9a4507e..d24fd1775fe1 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp @@ -540,6 +540,7 @@ bool js_cocos2dx_ui_Slider_setMaxPercent(JSContext *cx, uint32_t argc, jsval *vp bool js_cocos2dx_ui_Slider_loadBarTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_getProgressBarFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_getCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_Slider_updateVisualSlider(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_getCapInsetsProgressBarRenderer(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_getSlidBallPressedRenderer(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_loadSlidBallTexturePressed(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index f3fbd9a82fc6..fe2a0a2dbbf0 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -396,17 +396,7 @@ bool JSB_core_restartVM(JSContext *cx, uint32_t argc, jsval *vp) bool JSB_closeWindow(JSContext *cx, uint32_t argc, jsval *vp) { - EventListenerCustom* _event = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_DRAW, [&](EventCustom *event) { - Director::getInstance()->getEventDispatcher()->removeEventListener(_event); - CC_SAFE_RELEASE(_event); - - ScriptingCore::getInstance()->cleanup(); - }); - _event->retain(); Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif return true; }; @@ -1427,7 +1417,7 @@ bool ScriptingCore::handleTouchesEvent(void* nativeObj, cocos2d::EventTouch::Eve for (const auto& touch : touches) { - JS::RootedValue jsret(_cx, OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(_cx, touch, typeClassTouch))); + JS::RootedValue jsret(_cx, OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(_cx, touch, typeClassTouch, "cocos2d::Touch"))); if (!JS_SetElement(_cx, jsretArr, count, jsret)) { break; @@ -1440,7 +1430,7 @@ bool ScriptingCore::handleTouchesEvent(void* nativeObj, cocos2d::EventTouch::Eve { jsval dataVal[2]; dataVal[0] = OBJECT_TO_JSVAL(jsretArr); - dataVal[1] = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(_cx, event, typeClassEvent)); + dataVal[1] = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(_cx, event, typeClassEvent, "cocos2d::EventTouch")); ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), funcName.c_str(), 2, dataVal, jsvalRet); // event is created on the heap and its destructor won't be invoked, so we need to remove JS object manually removeJSObject(_cx, event); @@ -1467,8 +1457,8 @@ bool ScriptingCore::handleTouchEvent(void* nativeObj, cocos2d::EventTouch::Event js_type_class_t *typeClassEvent = js_get_type_from_native((cocos2d::EventTouch*)event); jsval dataVal[2]; - dataVal[0] = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(_cx, touch, typeClassTouch)); - dataVal[1] = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(_cx, event, typeClassEvent)); + dataVal[0] = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(_cx, touch, typeClassTouch, "cocos2d::Touch")); + dataVal[1] = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(_cx, event, typeClassEvent, "cocos2d::Touch")); ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), funcName.c_str(), 2, dataVal, jsvalRet); // event is created on the heap and its destructor won't be invoked, so we need to remove JS object manually @@ -1493,7 +1483,7 @@ bool ScriptingCore::handleMouseEvent(void* nativeObj, cocos2d::EventMouse::Mouse if (p) { js_type_class_t *typeClass = js_get_type_from_native((cocos2d::EventMouse*)event); - jsval dataVal = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(_cx, event, typeClass)); + jsval dataVal = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(_cx, event, typeClass, "cocos2d::EventMouse")); ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), funcName.c_str(), 1, &dataVal, jsvalRet); // event is created on the heap and its destructor won't be invoked, so we need to remove JS object manually removeJSObject(_cx, event); @@ -1632,7 +1622,7 @@ int ScriptingCore::executeCustomTouchesEvent(EventTouch::EventCode eventType, { js_type_class_t *typeClass = js_get_type_from_native(touch); - jsval jsret = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(this->_cx, touch, typeClass)); + jsval jsret = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(this->_cx, touch, typeClass, "cocos2d::Touch")); JS::RootedValue jsval(_cx, jsret); if (!JS_SetElement(this->_cx, jsretArr, count, jsval)) { break; @@ -1653,7 +1643,7 @@ int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, Touc std::string funcName = getTouchFuncName(eventType); js_type_class_t *typeClass = js_get_type_from_native(touch); - jsval jsTouch = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(this->_cx, touch, typeClass)); + jsval jsTouch = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(this->_cx, touch, typeClass, "cocos2d::Touch")); executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, &retval); @@ -1670,7 +1660,7 @@ int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType, std::string funcName = getTouchFuncName(eventType); js_type_class_t *typeClass = js_get_type_from_native(touch); - jsval jsTouch = OBJECT_TO_JSVAL(jsb_get_or_create_weak_jsobject(this->_cx, touch, typeClass)); + jsval jsTouch = OBJECT_TO_JSVAL(jsb_ref_get_or_create_jsobject(this->_cx, touch, typeClass, "cocos2d::Touch")); executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, retval); diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 451d3dd8eda4..c5c0a5c9a621 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -43,6 +43,7 @@ #include "base/CCEventDispatcher.h" #include "base/CCScheduler.h" #include "platform/CCFileUtils.h" +#include "renderer/ccGLStateCache.h" #include "scripting/js-bindings/manual/js_bindings_config.h" #include "scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp" #include "scripting/js-bindings/manual/jsb_event_dispatcher_manual.h" @@ -3253,7 +3254,7 @@ bool js_cocos2dx_ccGLEnableVertexAttribs(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint32(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - glEnableVertexAttribArray(arg0); + GL::enableVertexAttribs(arg0); args.rval().setUndefined(); return true; } @@ -5254,7 +5255,7 @@ void get_or_create_js_obj(const std::string &name, JS::MutableHandleObject jsObj JS::RootedObject prop(cx); size_t start = 0; - size_t found = name.find_first_of(".", start); + size_t found = name.find_first_of('.', start); std::string subProp; while (found != std::string::npos) @@ -5267,7 +5268,7 @@ void get_or_create_js_obj(const std::string &name, JS::MutableHandleObject jsObj } start = found+1; - found = name.find_first_of(".", start); + found = name.find_first_of('.', start); } if (start < name.length()) { diff --git a/cocos/scripting/js-bindings/manual/cocosbuilder/js_bindings_ccbreader.cpp b/cocos/scripting/js-bindings/manual/cocosbuilder/js_bindings_ccbreader.cpp index b7c7da5f73d6..1545f13eab5d 100644 --- a/cocos/scripting/js-bindings/manual/cocosbuilder/js_bindings_ccbreader.cpp +++ b/cocos/scripting/js-bindings/manual/cocosbuilder/js_bindings_ccbreader.cpp @@ -33,10 +33,10 @@ using namespace cocosbuilder; static void removeSelector(std::string &str) { size_t found; - found = str.find(":"); + found = str.find(':'); while (found!=std::string::npos){ str.replace(found, found+1, ""); - found = str.find(":"); + found = str.find(':'); } } diff --git a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp index 5695c0fc1757..b855f60bea1d 100644 --- a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp +++ b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.cpp @@ -29,14 +29,37 @@ #include "scripting/js-bindings/manual/network/XMLHTTPRequest.h" #include +#include #include #include #include "base/CCDirector.h" +#include "base/ZipUtils.h" #include "scripting/js-bindings/manual/cocos2d_specifics.hpp" using namespace std; +// trim from start (in place) +static inline void ltrim(std::string &s) { + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { + return !std::isspace(ch); + })); +} + +// trim from end (in place) +static inline void rtrim(std::string &s) { + s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { + return !std::isspace(ch); + }).base(), s.end()); +} + +// trim from both ends (in place) +static inline void trim(std::string &s) { + ltrim(s); + rtrim(s); +} + + //#pragma mark - MinXmlHttpRequest /** @@ -50,7 +73,7 @@ void MinXmlHttpRequest::_gotHeader(string& header) char * cstr = new (std::nothrow) char [header.length()+1]; // check for colon. - size_t found_header_field = header.find_first_of(":"); + size_t found_header_field = header.find_first_of(':'); if (found_header_field != std::string::npos) { @@ -186,6 +209,41 @@ void MinXmlHttpRequest::_setHttpRequestData(const char *data, size_t len) } } +MinXmlHttpRequest::EncodingType MinXmlHttpRequest::_getEncodingType() const +{ + auto it = _httpHeader.find("content-encoding"); + if (it == _httpHeader.end()) { + return EncodingType::IDENTITY; + } + + std::string encodingTypeStr = it->second; + trim(encodingTypeStr); + if (encodingTypeStr.empty()) + { + return EncodingType::IDENTITY; + } + else if (encodingTypeStr == "gzip") + { + return EncodingType::GZIP; + } + else if (encodingTypeStr == "deflate") + { + return EncodingType::DEFLATE; + } + else if (encodingTypeStr == "br") + { + return EncodingType::BR; + } + else if (encodingTypeStr == "compress") + { + return EncodingType::COMPRESS; + } + else + { + CCLOG("[error] bad unrecongized Content-Encoding value ", encodingTypeStr.c_str(), ", use \"identity\" as default"); + return EncodingType::IDENTITY; + } +} /** * @brief Callback for HTTPRequest. Handles the response and invokes Callback. * @param sender Object which initialized callback @@ -271,11 +329,37 @@ void MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sen _status = statusCode; _readyState = DONE; + const auto encodingType = _getEncodingType(); + +#if ( CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 ) + if (encodingType == EncodingType::GZIP && + cocos2d::ZipUtils::ccIsGZipBuffer((unsigned char *)buffer->data(), buffer->size())) + { + unsigned char *deflatedBuffer = nullptr; + auto deflatedSize = cocos2d::ZipUtils::ccInflateMemory((unsigned char *)buffer->data(), buffer->size(), &deflatedBuffer); + CCASSERT(deflatedSize > 0, "ZipUtils::ccInflateMemory error"); + CC_SAFE_DELETE(_data); + _dataSize = deflatedSize; + _data = (char*)malloc(_dataSize + 1); + _data[_dataSize] = 0; + memcpy((void*)_data, (const void*)deflatedBuffer, _dataSize); + free(deflatedBuffer); + } + else + { + _dataSize = static_cast(buffer->size()); + CC_SAFE_FREE(_data); + _data = (char*) malloc(_dataSize + 1); + _data[_dataSize] = 0; + memcpy((void*)_data, (const void*)buffer->data(), _dataSize); + } +#else _dataSize = static_cast(buffer->size()); CC_SAFE_FREE(_data); - _data = (char*) malloc(_dataSize + 1); - _data[_dataSize] = '\0'; + _data = (char*)malloc(_dataSize + 1); + _data[_dataSize] = 0; memcpy((void*)_data, (const void*)buffer->data(), _dataSize); +#endif JS::RootedObject callback(_cx); if (_onreadystateCallback) diff --git a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.h b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.h index fa959712b6b8..20d1805a4306 100644 --- a/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.h +++ b/cocos/scripting/js-bindings/manual/network/XMLHTTPRequest.h @@ -49,6 +49,15 @@ class MinXmlHttpRequest : public cocos2d::Ref JSON }; + enum class EncodingType + { + GZIP, + COMPRESS, + DEFLATE, + BR, + IDENTITY + }; + // Ready States (http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest) static const unsigned short UNSENT = 0; static const unsigned short OPENED = 1; @@ -94,6 +103,7 @@ class MinXmlHttpRequest : public cocos2d::Ref void _gotHeader(std::string& header); void _setRequestHeader(const char* field, const char* value); void _setHttpRequestHeader(); + EncodingType _getEncodingType() const; void _setHttpRequestData(const char *data, size_t len); void _sendRequest(JSContext *cx); void _notify(JS::HandleObject callback, JS::HandleValueArray args); diff --git a/cocos/scripting/js-bindings/proj.android/CMakeLists.txt b/cocos/scripting/js-bindings/proj.android/CMakeLists.txt index 29bbcb8357fe..60f2a9b82b85 100644 --- a/cocos/scripting/js-bindings/proj.android/CMakeLists.txt +++ b/cocos/scripting/js-bindings/proj.android/CMakeLists.txt @@ -13,6 +13,9 @@ add_library(${target_name} STATIC ${${target_name}_src} ) +# WARN, CCJavascriptJavaBridge.h:51 char TypeInvalid = -1 [-Wc++11-narrowing] +target_compile_options(${target_name} PUBLIC -Wno-c++11-narrowing) + get_target_property(spiderm_header ext_spidermonkey INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(${target_name} PRIVATE ../../.. diff --git a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj index b3a6fdf23a5a..0b2d8e3f0495 100644 --- a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj @@ -475,6 +475,7 @@ 1A5410A418B785A10016A3AF /* libjscocos2d Mac.a */, 1A119E4118BDF19200352BAA /* manual */, 507B427D1C31DCC60067B53E /* libjscocos2d tvOS.a */, + 46AF3B3822154F3100D5AFCD /* Recovered References */, ); sourceTree = ""; }; @@ -716,6 +717,14 @@ name = experimental; sourceTree = ""; }; + 46AF3B3822154F3100D5AFCD /* Recovered References */ = { + isa = PBXGroup; + children = ( + 4BE089EA1ADF967400D65D4B /* jsb_cocos2dx_experimental_webView_manual.h */, + ); + name = "Recovered References"; + sourceTree = ""; + }; BA9FD5CF1BAC0A4600996C85 /* component */ = { isa = PBXGroup; children = ( @@ -1171,7 +1180,7 @@ 1551A34A158F2AB200E66CFE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; @@ -1208,7 +1217,7 @@ 1551A34B158F2AB200E66CFE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; diff --git a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj index d1a41f005c7c..afd746795a84 100644 --- a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj +++ b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj @@ -124,6 +124,7 @@ {39379840-825A-45A0-B363-C09FFEF864BD} Win32Proj libjscocos2d + 10.0.17134.0 diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 1128bf93edee..06fbe5b9bddd 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -179,7 +179,7 @@ target_include_directories(luacocos2d ) if(WINDOWS) - target_compile_definitions(luacocos2d PRIVATE _USRLUASTATIC) + target_compile_definitions(luacocos2d PUBLIC _USRLUASTATIC) endif() diff --git a/cocos/scripting/lua-bindings/auto/api/Application.lua b/cocos/scripting/lua-bindings/auto/api/Application.lua index c6ddb743d6da..1b14874a9cd7 100644 --- a/cocos/scripting/lua-bindings/auto/api/Application.lua +++ b/cocos/scripting/lua-bindings/auto/api/Application.lua @@ -39,14 +39,13 @@ -- @return string#string ret (return value: string) -------------------------------- --- @overload self, float, int --- @overload self, float --- @function [parent=#Application] setAnimationInterval +-- brief Callback by Director to limit FPS.
+-- param interval The time, expressed in seconds, between current frame and next. +-- @function [parent=#Application] setAnimationInterval -- @param self -- @param #float interval --- @param #int reason -- @return Application#Application self (return value: cc.Application) - + -------------------------------- -- brief Get current application instance.
-- return Current application instance pointer. diff --git a/cocos/scripting/lua-bindings/auto/api/Director.lua b/cocos/scripting/lua-bindings/auto/api/Director.lua index f62adda80020..1470ed6a6591 100644 --- a/cocos/scripting/lua-bindings/auto/api/Director.lua +++ b/cocos/scripting/lua-bindings/auto/api/Director.lua @@ -515,6 +515,13 @@ -- @param self -- @return float#float ret (return value: float) +-------------------------------- +-- Gets clear values for the color buffers.
+-- js NA +-- @function [parent=#Director] getClearColor +-- @param self +-- @return color4f_table#color4f_table ret (return value: color4f_table) + -------------------------------- -- Whether or not the Director is paused. -- @function [parent=#Director] isPaused diff --git a/cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua b/cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua index fb8b038269b1..050c2633562f 100644 --- a/cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua +++ b/cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua @@ -94,18 +94,6 @@ -- @param #int fixedPriority -- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher) --------------------------------- --- Adds a Custom event listener.
--- It will use a fixed priority of 1.
--- param eventName A given name of the event.
--- param callback A given callback method that associated the event name.
--- return the generated event. Needed in order to remove the event from the dispatcher --- @function [parent=#EventDispatcher] addCustomEventListener --- @param self --- @param #string eventName --- @param #function callback --- @return EventListenerCustom#EventListenerCustom ret (return value: cc.EventListenerCustom) - -------------------------------- -- Dispatches the event.
-- Also removes all EventListeners marked for deletion from the
diff --git a/cocos/scripting/lua-bindings/auto/api/GLView.lua b/cocos/scripting/lua-bindings/auto/api/GLView.lua index a3a087536cde..6ad0dbb7844d 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLView.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLView.lua @@ -159,6 +159,12 @@ -- @param #string filename -- @return GLView#GLView self (return value: cc.GLView) +-------------------------------- +-- Sets the cursor for the window back to default. +-- @function [parent=#GLView] setDefaultCursor +-- @param self +-- @return GLView#GLView self (return value: cc.GLView) + -------------------------------- -- When the window is closed, it will return false if the platforms is Ios or Android.
-- If the platforms is windows or Mac,it will return true.
@@ -247,6 +253,16 @@ -- @param self -- @return rect_table#rect_table ret (return value: rect_table) +-------------------------------- +-- Sets the cursor for the window with custom image.
+-- param filename A path to image file, e.g., "cursors/custom.png".
+-- param hotspot Cursor hotspot, as a anchor point, default is top left (0, 1) +-- @function [parent=#GLView] setCursor +-- @param self +-- @param #string filename +-- @param #vec2_table hotspot +-- @return GLView#GLView self (return value: cc.GLView) + -------------------------------- -- Get retina factor.
-- return The retina factor. diff --git a/cocos/scripting/lua-bindings/auto/api/Label.lua b/cocos/scripting/lua-bindings/auto/api/Label.lua index 376b5b84d464..661c76e410a9 100644 --- a/cocos/scripting/lua-bindings/auto/api/Label.lua +++ b/cocos/scripting/lua-bindings/auto/api/Label.lua @@ -63,7 +63,7 @@ -- Returns type of label
-- warning Not support system font.
-- return the type of label
--- since v3.18.0 +-- since v3.17.1 -- @function [parent=#Label] getLabelType -- @param self -- @return int#int ret (return value: int) diff --git a/cocos/scripting/lua-bindings/auto/api/Slider.lua b/cocos/scripting/lua-bindings/auto/api/Slider.lua index d3b7a4d4a7c3..c1b2ca8a909b 100644 --- a/cocos/scripting/lua-bindings/auto/api/Slider.lua +++ b/cocos/scripting/lua-bindings/auto/api/Slider.lua @@ -142,6 +142,12 @@ -- @param self -- @return rect_table#rect_table ret (return value: rect_table) +-------------------------------- +-- Updates the visual elements of the slider. +-- @function [parent=#Slider] updateVisualSlider +-- @param self +-- @return Slider#Slider self (return value: ccui.Slider) + -------------------------------- -- Gets capinsets for progress bar slider, if slider is using scale9 renderer.
-- return Capinsets for progress bar slider.
diff --git a/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua index b229a0e7e6d3..846a8af89bf6 100644 --- a/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua +++ b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua @@ -24,6 +24,13 @@ -- @param self -- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) +-------------------------------- +-- Checks whether the VideoPlayer is set to listen user input to resume and pause the video
+-- return true if the videoplayer user input is set, false otherwise. +-- @function [parent=#VideoPlayer] isUserInputEnabled +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Causes the video player to keep aspect ratio or no when displaying the video.
-- param enable Specify true to keep aspect ratio or false to scale the video until
@@ -61,6 +68,22 @@ -- @param #string _videoURL -- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) +-------------------------------- +-- Set the style of the player
+-- param style The corresponding style +-- @function [parent=#VideoPlayer] setStyle +-- @param self +-- @param #int style +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) + +-------------------------------- +-- Seeks to specified time position.
+-- param sec The offset in seconds from the start to seek to. +-- @function [parent=#VideoPlayer] seekTo +-- @param self +-- @param #float sec +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) + -------------------------------- -- Indicates whether the video player keep aspect ratio when displaying the video. -- @function [parent=#VideoPlayer] isKeepAspectRatioEnabled @@ -82,6 +105,13 @@ -- @param self -- @return bool#bool ret (return value: bool) +-------------------------------- +-- Checks whether the VideoPlayer is set with looping mode.
+-- return true if the videoplayer is set to loop, false otherwise. +-- @function [parent=#VideoPlayer] isLooping +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Checks whether the VideoPlayer is playing.
-- return True if currently playing, false otherwise. @@ -90,11 +120,19 @@ -- @return bool#bool ret (return value: bool) -------------------------------- --- Seeks to specified time position.
--- param sec The offset in seconds from the start to seek to. --- @function [parent=#VideoPlayer] seekTo +-- brief Set if playback is done in loop mode
+-- param looping the video will or not automatically restart at the end +-- @function [parent=#VideoPlayer] setLooping -- @param self --- @param #float sec +-- @param #bool looping +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) + +-------------------------------- +-- Set if the player will enable user input for basic pause and resume of video
+-- param enableInput If true, input will be handled for basic functionality (pause/resume) +-- @function [parent=#VideoPlayer] setUserInputEnabled +-- @param self +-- @param #bool enableInput -- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index d3520ecdf7e4..ed33ed98faea 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -12698,6 +12698,53 @@ int lua_cocos2dx_GLView_setIcon(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLView_setDefaultCursor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_setDefaultCursor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_setDefaultCursor'", nullptr); + return 0; + } + cobj->setDefaultCursor(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:setDefaultCursor",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_setDefaultCursor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLView_windowShouldClose(lua_State* tolua_S) { int argc = 0; @@ -13198,6 +13245,73 @@ int lua_cocos2dx_GLView_getScissorRect(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLView_setCursor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_setCursor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLView:setCursor"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_setCursor'", nullptr); + return 0; + } + cobj->setCursor(arg0); + lua_settop(tolua_S, 1); + return 1; + } + if (argc == 2) + { + std::string arg0; + cocos2d::Vec2 arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLView:setCursor"); + + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLView:setCursor"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_setCursor'", nullptr); + return 0; + } + cobj->setCursor(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:setCursor",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_setCursor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLView_getRetinaFactor(lua_State* tolua_S) { int argc = 0; @@ -13586,6 +13700,7 @@ int lua_register_cocos2dx_GLView(lua_State* tolua_S) tolua_function(tolua_S,"getFrameZoomFactor",lua_cocos2dx_GLView_getFrameZoomFactor); tolua_function(tolua_S,"getDesignResolutionSize",lua_cocos2dx_GLView_getDesignResolutionSize); tolua_function(tolua_S,"setIcon",lua_cocos2dx_GLView_setIcon); + tolua_function(tolua_S,"setDefaultCursor",lua_cocos2dx_GLView_setDefaultCursor); tolua_function(tolua_S,"windowShouldClose",lua_cocos2dx_GLView_windowShouldClose); tolua_function(tolua_S,"swapBuffers",lua_cocos2dx_GLView_swapBuffers); tolua_function(tolua_S,"setDesignResolutionSize",lua_cocos2dx_GLView_setDesignResolutionSize); @@ -13596,6 +13711,7 @@ int lua_register_cocos2dx_GLView(lua_State* tolua_S) tolua_function(tolua_S,"setVR",lua_cocos2dx_GLView_setVR); tolua_function(tolua_S,"setViewPortInPoints",lua_cocos2dx_GLView_setViewPortInPoints); tolua_function(tolua_S,"getScissorRect",lua_cocos2dx_GLView_getScissorRect); + tolua_function(tolua_S,"setCursor",lua_cocos2dx_GLView_setCursor); tolua_function(tolua_S,"getRetinaFactor",lua_cocos2dx_GLView_getRetinaFactor); tolua_function(tolua_S,"setViewName",lua_cocos2dx_GLView_setViewName); tolua_function(tolua_S,"getVisibleRect",lua_cocos2dx_GLView_getVisibleRect); @@ -16813,6 +16929,53 @@ int lua_cocos2dx_Director_getAnimationInterval(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Director_getClearColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Director* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getClearColor'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_getClearColor'", nullptr); + return 0; + } + const cocos2d::Color4F& ret = cobj->getClearColor(); + color4f_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getClearColor",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getClearColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Director_isPaused(lua_State* tolua_S) { int argc = 0; @@ -17216,6 +17379,7 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S) tolua_function(tolua_S,"getScheduler",lua_cocos2dx_Director_getScheduler); tolua_function(tolua_S,"pushScene",lua_cocos2dx_Director_pushScene); tolua_function(tolua_S,"getAnimationInterval",lua_cocos2dx_Director_getAnimationInterval); + tolua_function(tolua_S,"getClearColor",lua_cocos2dx_Director_getClearColor); tolua_function(tolua_S,"isPaused",lua_cocos2dx_Director_isPaused); tolua_function(tolua_S,"setDisplayStats",lua_cocos2dx_Director_setDisplayStats); tolua_function(tolua_S,"getEventDispatcher",lua_cocos2dx_Director_getEventDispatcher); @@ -36126,63 +36290,6 @@ int lua_cocos2dx_EventDispatcher_setPriority(lua_State* tolua_S) return 0; } -int lua_cocos2dx_EventDispatcher_addCustomEventListener(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventDispatcher* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventDispatcher",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - std::function arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventDispatcher:addCustomEventListener"); - - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'", nullptr); - return 0; - } - cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, arg1); - object_to_luaval(tolua_S, "cc.EventListenerCustom",(cocos2d::EventListenerCustom*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventDispatcher:addCustomEventListener",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_EventDispatcher_dispatchEvent(lua_State* tolua_S) { int argc = 0; @@ -36536,7 +36643,6 @@ int lua_register_cocos2dx_EventDispatcher(lua_State* tolua_S) tolua_function(tolua_S,"resumeEventListenersForTarget",lua_cocos2dx_EventDispatcher_resumeEventListenersForTarget); tolua_function(tolua_S,"removeEventListenersForTarget",lua_cocos2dx_EventDispatcher_removeEventListenersForTarget); tolua_function(tolua_S,"setPriority",lua_cocos2dx_EventDispatcher_setPriority); - tolua_function(tolua_S,"addCustomEventListener",lua_cocos2dx_EventDispatcher_addCustomEventListener); tolua_function(tolua_S,"dispatchEvent",lua_cocos2dx_EventDispatcher_dispatchEvent); tolua_function(tolua_S,"hasEventListener",lua_cocos2dx_EventDispatcher_hasEventListener); tolua_function(tolua_S,"removeAllEventListeners",lua_cocos2dx_EventDispatcher_removeAllEventListeners); @@ -95034,51 +95140,42 @@ int lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S) int argc = 0; cocos2d::Application* cobj = nullptr; bool ok = true; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif + #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.Application",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_setAnimationInterval'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Application:setAnimationInterval"); - - if (!ok) { break; } - cocos2d::SetIntervalReason arg1; - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.Application:setAnimationInterval"); - if (!ok) { break; } - cobj->setAnimationInterval(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Application:setAnimationInterval"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; - if (!ok) { break; } - cobj->setAnimationInterval(arg0); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Application:setAnimationInterval"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_setAnimationInterval'", nullptr); + return 0; } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:setAnimationInterval",argc, 1); + cobj->setAnimationInterval(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:setAnimationInterval",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index e0fe55df478b..5a4c8cc2dceb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2293,6 +2293,8 @@ int register_all_cocos2dx(lua_State* tolua_S); + + diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp index 6529911d2b8b..57860b50561f 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp @@ -145,6 +145,53 @@ int lua_cocos2dx_experimental_video_VideoPlayer_play(lua_State* tolua_S) return 0; } +int lua_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled'", nullptr); + return 0; + } + bool ret = cobj->isUserInputEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:isUserInputEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(lua_State* tolua_S) { int argc = 0; @@ -392,6 +439,106 @@ int lua_cocos2dx_experimental_video_VideoPlayer_setURL(lua_State* tolua_S) return 0; } +int lua_cocos2dx_experimental_video_VideoPlayer_setStyle(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setStyle'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::experimental::ui::VideoPlayer::StyleType arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccexp.VideoPlayer:setStyle"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_setStyle'", nullptr); + return 0; + } + cobj->setStyle(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:setStyle",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setStyle'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_seekTo(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccexp.VideoPlayer:seekTo"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'", nullptr); + return 0; + } + cobj->seekTo(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:seekTo",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(lua_State* tolua_S) { int argc = 0; @@ -536,6 +683,53 @@ int lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(lua_State* t return 0; } +int lua_cocos2dx_experimental_video_VideoPlayer_isLooping(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_isLooping'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_isLooping'", nullptr); + return 0; + } + bool ret = cobj->isLooping(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:isLooping",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_isLooping'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_experimental_video_VideoPlayer_isPlaying(lua_State* tolua_S) { int argc = 0; @@ -583,7 +777,7 @@ int lua_cocos2dx_experimental_video_VideoPlayer_isPlaying(lua_State* tolua_S) return 0; } -int lua_cocos2dx_experimental_video_VideoPlayer_seekTo(lua_State* tolua_S) +int lua_cocos2dx_experimental_video_VideoPlayer_setLooping(lua_State* tolua_S) { int argc = 0; cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; @@ -603,7 +797,7 @@ int lua_cocos2dx_experimental_video_VideoPlayer_seekTo(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setLooping'", nullptr); return 0; } #endif @@ -611,24 +805,74 @@ int lua_cocos2dx_experimental_video_VideoPlayer_seekTo(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; + bool arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "ccexp.VideoPlayer:seekTo"); + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccexp.VideoPlayer:setLooping"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_setLooping'", nullptr); return 0; } - cobj->seekTo(arg0); + cobj->setLooping(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:seekTo",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:setLooping",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setLooping'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccexp.VideoPlayer:setUserInputEnabled"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled'", nullptr); + return 0; + } + cobj->setUserInputEnabled(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.VideoPlayer:setUserInputEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled'.",&tolua_err); #endif return 0; @@ -720,16 +964,21 @@ int lua_register_cocos2dx_experimental_video_VideoPlayer(lua_State* tolua_S) tolua_function(tolua_S,"getFileName",lua_cocos2dx_experimental_video_VideoPlayer_getFileName); tolua_function(tolua_S,"getURL",lua_cocos2dx_experimental_video_VideoPlayer_getURL); tolua_function(tolua_S,"play",lua_cocos2dx_experimental_video_VideoPlayer_play); + tolua_function(tolua_S,"isUserInputEnabled",lua_cocos2dx_experimental_video_VideoPlayer_isUserInputEnabled); tolua_function(tolua_S,"setKeepAspectRatioEnabled",lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled); tolua_function(tolua_S,"stop",lua_cocos2dx_experimental_video_VideoPlayer_stop); tolua_function(tolua_S,"setFullScreenEnabled",lua_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled); tolua_function(tolua_S,"setFileName",lua_cocos2dx_experimental_video_VideoPlayer_setFileName); tolua_function(tolua_S,"setURL",lua_cocos2dx_experimental_video_VideoPlayer_setURL); + tolua_function(tolua_S,"setStyle",lua_cocos2dx_experimental_video_VideoPlayer_setStyle); + tolua_function(tolua_S,"seekTo",lua_cocos2dx_experimental_video_VideoPlayer_seekTo); tolua_function(tolua_S,"isKeepAspectRatioEnabled",lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled); tolua_function(tolua_S,"onPlayEvent",lua_cocos2dx_experimental_video_VideoPlayer_onPlayEvent); tolua_function(tolua_S,"isFullScreenEnabled",lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled); + tolua_function(tolua_S,"isLooping",lua_cocos2dx_experimental_video_VideoPlayer_isLooping); tolua_function(tolua_S,"isPlaying",lua_cocos2dx_experimental_video_VideoPlayer_isPlaying); - tolua_function(tolua_S,"seekTo",lua_cocos2dx_experimental_video_VideoPlayer_seekTo); + tolua_function(tolua_S,"setLooping",lua_cocos2dx_experimental_video_VideoPlayer_setLooping); + tolua_function(tolua_S,"setUserInputEnabled",lua_cocos2dx_experimental_video_VideoPlayer_setUserInputEnabled); tolua_function(tolua_S,"create", lua_cocos2dx_experimental_video_VideoPlayer_create); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::experimental::ui::VideoPlayer).name(); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp index 0892c03b49ae..eb3ac2043d8a 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp @@ -27,6 +27,11 @@ int register_all_cocos2dx_experimental_video(lua_State* tolua_S); + + + + + #endif // __cocos2dx_experimental_video_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 97e1137c79d6..63014509af99 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -20931,6 +20931,53 @@ int lua_cocos2dx_ui_Slider_getCapInsetsBarRenderer(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Slider_updateVisualSlider(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Slider* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_updateVisualSlider'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_updateVisualSlider'", nullptr); + return 0; + } + cobj->updateVisualSlider(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:updateVisualSlider",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_updateVisualSlider'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Slider_getCapInsetsProgressBarRenderer(lua_State* tolua_S) { int argc = 0; @@ -21712,6 +21759,7 @@ int lua_register_cocos2dx_ui_Slider(lua_State* tolua_S) tolua_function(tolua_S,"loadBarTexture",lua_cocos2dx_ui_Slider_loadBarTexture); tolua_function(tolua_S,"getProgressBarFile",lua_cocos2dx_ui_Slider_getProgressBarFile); tolua_function(tolua_S,"getCapInsetsBarRenderer",lua_cocos2dx_ui_Slider_getCapInsetsBarRenderer); + tolua_function(tolua_S,"updateVisualSlider",lua_cocos2dx_ui_Slider_updateVisualSlider); tolua_function(tolua_S,"getCapInsetsProgressBarRenderer",lua_cocos2dx_ui_Slider_getCapInsetsProgressBarRenderer); tolua_function(tolua_S,"getSlidBallPressedRenderer",lua_cocos2dx_ui_Slider_getSlidBallPressedRenderer); tolua_function(tolua_S,"loadSlidBallTexturePressed",lua_cocos2dx_ui_Slider_loadSlidBallTexturePressed); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 10228fbb759b..0a0f20bde6e2 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -807,6 +807,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index 72768d22001f..dd31b21dc650 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -136,7 +136,7 @@ bool LuaStack::init(void) toluafix_open(_state); // Register our version of the global "print" function - const luaL_reg global_functions [] = { + const luaL_Reg global_functions [] = { {"print", lua_print}, {"release_print",lua_release_print}, {nullptr, nullptr} diff --git a/cocos/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp index 0574a046091c..5e1a50de6af4 100644 --- a/cocos/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp +++ b/cocos/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp @@ -51,11 +51,11 @@ extern "C" filename = filename.substr(0, pos); } - pos = filename.find_first_of("."); + pos = filename.find_first_of('.'); while (pos != std::string::npos) { filename.replace(pos, 1, "/"); - pos = filename.find_first_of("."); + pos = filename.find_first_of('.'); } // search file in package.path @@ -68,7 +68,7 @@ extern "C" std::string searchpath(lua_tostring(L, -1)); lua_pop(L, 1); size_t begin = 0; - size_t next = searchpath.find_first_of(";", 0); + size_t next = searchpath.find_first_of(';', 0); do { @@ -89,14 +89,14 @@ extern "C" if (pos != std::string::npos && pos == prefix.length() - NOT_BYTECODE_FILE_EXT.length()) prefix = prefix.substr(0, pos); } - pos = prefix.find_first_of("?", 0); + pos = prefix.find_first_of('?', 0); while (pos != std::string::npos) { prefix.replace(pos, 1, filename); - pos = prefix.find_first_of("?", pos + filename.length() + 1); + pos = prefix.find_first_of('?', pos + filename.length() + 1); } chunkName = prefix + BYTECODE_FILE_EXT; - if (utils->isFileExist(chunkName) && !utils->isDirectoryExist(chunkName)) + if (utils->isFileExist(chunkName)) // && !utils->isDirectoryExist(chunkName)) { chunk = utils->getDataFromFile(chunkName); break; @@ -104,7 +104,7 @@ extern "C" else { chunkName = prefix + NOT_BYTECODE_FILE_EXT; - if (utils->isFileExist(chunkName) && !utils->isDirectoryExist(chunkName)) + if (utils->isFileExist(chunkName) ) //&& !utils->isDirectoryExist(chunkName)) { chunk = utils->getDataFromFile(chunkName); break; @@ -112,7 +112,7 @@ extern "C" else { chunkName = prefix; - if (utils->isFileExist(chunkName) && !utils->isDirectoryExist(chunkName)) + if (utils->isFileExist(chunkName)) // && !utils->isDirectoryExist(chunkName)) { chunk = utils->getDataFromFile(chunkName); break; @@ -121,7 +121,7 @@ extern "C" } begin = next + 1; - next = searchpath.find_first_of(";", begin); + next = searchpath.find_first_of(';', begin); } while (begin < searchpath.length()); if (chunk.getSize() > 0) { diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/LuaOpengl.cpp index 48bfb261ab46..066872377e3d 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/LuaOpengl.cpp @@ -35,7 +35,7 @@ #include "2d/CCActionCatmullRom.h" #include "2d/CCDrawingPrimitives.h" #include "renderer/CCRenderer.h" -#include "platform/CCGL.h" +#include "renderer/ccGLStateCache.h" using namespace cocos2d; @@ -4405,7 +4405,7 @@ static int tolua_Cocos2d_glEnableVertexAttribs00(lua_State* tolua_S) #endif { int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - glEnableVertexAttribArray(arg0); + GL::enableVertexAttribs(arg0); } return 0; #ifndef TOLUA_RELEASE diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index 79ace8196d50..b5e8976da5fd 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -64,6 +64,123 @@ #include "platform/CCGLView.h" #include "renderer/CCTextureCache.h" +struct LuaCustomEventListener { + LuaCustomEventListener(lua_State* state, int index): L(state), ref(LUA_NOREF) + { + luaL_checktype(L, index, LUA_TFUNCTION); + lua_pushvalue(L, index); + ref = luaL_ref(L, LUA_REGISTRYINDEX); + } + ~LuaCustomEventListener() + { + unref(); + } + + void operator()(cocos2d::EventCustom* e) + { + lua_rawgeti(L, LUA_REGISTRYINDEX, ref); + + object_to_luaval(L, "cc.EventCustom", e); + lua_call(L, 1, 0); + } + + LuaCustomEventListener(const LuaCustomEventListener& other): L(nullptr), ref(LUA_NOREF) + { + *this = other; + } + LuaCustomEventListener& operator=(const LuaCustomEventListener& rhs) + { + if (this != &rhs) + { + unref(); + L = rhs.L; + lua_rawgeti(L, LUA_REGISTRYINDEX, rhs.ref); + ref = luaL_ref(L, LUA_REGISTRYINDEX); + } + return *this; + } + + LuaCustomEventListener(LuaCustomEventListener&& other): L(nullptr), ref(LUA_NOREF) + { + *this = std::move(other); + } + + LuaCustomEventListener& operator=(LuaCustomEventListener&& rhs) + { + if (this != &rhs) + { + unref(); + + L = rhs.L; + ref = rhs.ref; + + rhs.L = nullptr; + rhs.ref = LUA_NOREF; + } + return *this; + } +private: + inline void unref() { + if (L && ref != LUA_NOREF && ref != LUA_REFNIL) + luaL_unref(L, LUA_REGISTRYINDEX, ref); + } + + lua_State* L; + int ref; +}; +int lua_cocos2dx_EventDispatcher_addCustomEventListener(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventDispatcher* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventDispatcher",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.EventDispatcher:addCustomEventListener"); + auto callback = LuaCustomEventListener(tolua_S, 3); + + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'", nullptr); + return 0; + } + cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, std::function(std::move(callback))); + object_to_luaval(tolua_S, "cc.EventListenerCustom",(cocos2d::EventListenerCustom*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventDispatcher:addCustomEventListener",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'.",&tolua_err); +#endif + + return 0; +} + static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S) { if (nullptr == tolua_S) @@ -8126,6 +8243,12 @@ int register_all_cocos2dx_module_manual(lua_State* tolua_S) tolua_function(tolua_S, "findChildren", tolua_cocos2d_utils_findChildren); tolua_function(tolua_S, "findChild", tolua_cocos2d_utils_findChild); tolua_endmodule(tolua_S); + + tolua_module(tolua_S, "EventDispatcher", 0); + tolua_beginmodule(tolua_S,"EventDispatcher"); + tolua_function(tolua_S,"addCustomEventListener",lua_cocos2dx_EventDispatcher_addCustomEventListener); + tolua_endmodule(tolua_S); + tolua_endmodule(tolua_S); return 0; @@ -8540,6 +8663,75 @@ static int tolua_cocos2d_Vec3_cross(lua_State* tolua_S) #endif } +static int tolua_cocos2d_random01(lua_State* tolua_S) +{ + lua_pushnumber(tolua_S, CCRANDOM_0_1()); + return 1; +} + +static int tolua_cocos2d_Vec2_isLineIntersect(lua_State* tolua_S) +{ + int argc = lua_gettop(tolua_S); + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + if (4 == argc) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_istable(tolua_S, 2, 0, &tolua_err) || + !tolua_istable(tolua_S, 3, 0, &tolua_err)|| + !tolua_istable(tolua_S, 4, 0, &tolua_err)) + goto tolua_lerror; + else +#endif + { + cocos2d::Vec2 x1,y1; + cocos2d::Vec2 x2,y2; + + float s =0.0f, t = 0.0f; + + bool ok = true; + + ok &= luaval_to_vec2(tolua_S, 1, &x1); + if (!ok) + return 0; + + ok &= luaval_to_vec2(tolua_S, 2, &y1); + if (!ok) + return 0; + + ok &= luaval_to_vec2(tolua_S, 3, &x2); + if (!ok) + return 0; + + ok &= luaval_to_vec2(tolua_S, 4, &y2); + if (!ok) + return 0; + + bool intersects = Vec2::isLineIntersect(x1, y1, x2, y2, &s, &t); + + lua_pushboolean(tolua_S, intersects); + lua_pushnumber(tolua_S, s); + lua_pushnumber(tolua_S, t); + return 3; + } + }else + { + lua_pushboolean(tolua_S, false); + lua_pushnumber(tolua_S, 0); + lua_pushnumber(tolua_S, 0); + return 3; + } +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'vec2_isLineIntersect'.",&tolua_err); + return 0; +#endif +} + static int tolua_cocos2d_Mat4_multiply(lua_State* tolua_S) { #if COCOS2D_DEBUG >= 1 @@ -8825,6 +9017,8 @@ int register_all_cocos2dx_math_manual(lua_State* tolua_S) tolua_function(tolua_S, "mat4_createTranslation", tolua_cocos2d_Mat4_createTranslation); tolua_function(tolua_S, "mat4_createRotation", tolua_cocos2d_Mat4_createRotation); tolua_function(tolua_S, "vec3_cross", tolua_cocos2d_Vec3_cross); + tolua_function(tolua_S, "vec2_isLineIntersect", tolua_cocos2d_Vec2_isLineIntersect); + tolua_function(tolua_S, "cc_mathutils_random", tolua_cocos2d_random01); tolua_endmodule(tolua_S); return 0; } diff --git a/cocos/scripting/lua-bindings/manual/network/lua_downloader.cpp b/cocos/scripting/lua-bindings/manual/network/lua_downloader.cpp index e987d20484fc..ca26d0e0fd33 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_downloader.cpp +++ b/cocos/scripting/lua-bindings/manual/network/lua_downloader.cpp @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "lua_downloader.h" +#include "cocos2d.h" #include "network/CCDownloader.h" #include "lua_extensions.h" #include @@ -42,6 +43,7 @@ static int get_field_int(lua_State *L, const char *field, int def) if (lua_isnil(L, -1)) { //luaL_error(L, "get_field_int: field '%s' no exists.", field); + lua_pop(L, 1); return ret; } ret = (int)lua_tointeger(L, -1); @@ -56,7 +58,8 @@ static std::string get_field_string(lua_State *L, const char *field, const char lua_gettable(L, -2); if (lua_isnil(L, -1)) { - //luaL_error(L, "get_field_string: field '%s' no exists.", field); + //CCLOGERROR("get_field_string: field '%s' no exists.", field); + lua_pop(L, 1); return ret; } ret = std::string(lua_tostring(L, -1)); @@ -115,7 +118,7 @@ static int lua_downloader_new(lua_State *L) if (argc >= 1) { //parse DownloaderHints if (!lua_istable(L, -1)) { - luaL_error(L, "cc.Downloader.new: first argument should be table if set"); + CCLOGERROR("cc.Downloader.new: first argument should be table if set"); return 0; } DownloaderHints hints; @@ -132,13 +135,13 @@ static int lua_downloader_new(lua_State *L) downloader = new (ptr) Downloader(); } - luaL_getmetatable(L, "cc.Downloader"); - lua_setmetatable(L, -2); + luaL_getmetatable(L, "cc.Downloader"); //stack downloader, cc.Downloader + lua_setmetatable(L, -2); //stack downloader //register callback table - lua_pushlightuserdata(L, (void*)downloader); - lua_newtable(L); - lua_settable(L, LUA_REGISTRYINDEX); + lua_pushlightuserdata(L, (void*)downloader); //stack downloader, key[*downloader] + lua_newtable(L); //stack downloader, key[*downloader], {} + lua_settable(L, LUA_REGISTRYINDEX); //stack downloaders return 1; } @@ -153,7 +156,7 @@ static int lua_downloader_createDownloadDataTask(lua_State *L) if (argc == 0) { - luaL_error(L, "cc.Downloader.createDownloadDataTask parameter error"); + CCLOGERROR("cc.Downloader.createDownloadDataTask parameter error"); return 0; } @@ -175,7 +178,7 @@ static int lua_downloader_createDownloadFileTask(lua_State *L) if (argc < 2) { - luaL_error(L, "cc.Downloader.createDownloadFileTask parameter error!"); + CCLOGERROR("cc.Downloader.createDownloadFileTask parameter error!"); return 0; } @@ -193,7 +196,7 @@ static int lua_downloader_setOnFileTaskSuccess(lua_State *L) int argc = lua_gettop(L) - 1; Downloader *d = checkDownloader(L); if (argc != 1) { - luaL_error(L, "cc.Downloader.setOnFileTaskSuccess parameter error!"); + CCLOGERROR("cc.Downloader.setOnFileTaskSuccess parameter error!"); return 0; } luaL_argcheck(L, lua_isfunction(L, 2), 2, "should be a function"); @@ -207,7 +210,7 @@ static int lua_downloader_setOnFileTaskSuccess(lua_State *L) if (lua_pcall(L, 1, 0, 0) != 0) { lua_pop(L, 1); // remove callback or nil - luaL_error(L, "cc.Downloader.setOnFileTaskSuccess invoke callback error!"); + CCLOGERROR("cc.Downloader.setOnFileTaskSuccess invoke callback error!"); return; } } @@ -223,7 +226,7 @@ static int lua_downloader_setOnTaskProgress(lua_State *L) Downloader *d = checkDownloader(L); int argc = lua_gettop(L) - 1; if (argc != 1) { - luaL_error(L, "cc.Downloader.setOnTaskProgress parameter error!"); + CCLOGERROR("cc.Downloader.setOnTaskProgress parameter error!"); return 0; } luaL_argcheck(L, lua_isfunction(L, 2), 2, "should be a function"); @@ -243,7 +246,7 @@ static int lua_downloader_setOnTaskProgress(lua_State *L) if (lua_pcall(L, 4, 0, 0) != 0) { lua_pop(L, 1); // remove callback or nil - luaL_error(L, "cc.Downloader.setOnTaskProgress invoke callback error!"); + CCLOGERROR("cc.Downloader.setOnTaskProgress invoke callback error!"); return; } } @@ -259,7 +262,7 @@ static int lua_downloader_setOnTaskError(lua_State *L) Downloader *d = checkDownloader(L); int argc = lua_gettop(L) - 1; if (argc != 1) { - luaL_error(L, "cc.Downloader.setOnTaskError parameter error!"); + CCLOGERROR("cc.Downloader.setOnTaskError parameter error!"); return 0; } luaL_argcheck(L, lua_isfunction(L, 2), 2, "should be a function"); @@ -279,7 +282,7 @@ static int lua_downloader_setOnTaskError(lua_State *L) if (lua_pcall(L, 4, 0, 0) != 0) { lua_pop(L, 1); // remove callback or nil - luaL_error(L, "cc.Downloader.setOnTaskError invoke callback error!"); + CCLOGERROR("cc.Downloader.setOnTaskError invoke callback error!"); return; } } @@ -311,7 +314,7 @@ static int lua_downloader_tostring(lua_State *L) return 1; } -static const struct luaL_reg downloaderStaticFns[] = { +static const struct luaL_Reg downloaderStaticFns[] = { { "new", lua_downloader_new }, /* * cocos2d::Downloader is not a subclass of cocos2d::Ref, @@ -322,7 +325,7 @@ static const struct luaL_reg downloaderStaticFns[] = { }; -static const struct luaL_reg downloaderMemberFns[] = { +static const struct luaL_Reg downloaderMemberFns[] = { { "createDownloadDataTask", lua_downloader_createDownloadDataTask }, { "createDownloadFileTask", lua_downloader_createDownloadFileTask }, { "setOnFileTaskSuccess", lua_downloader_setOnFileTaskSuccess }, @@ -335,13 +338,16 @@ static const struct luaL_reg downloaderMemberFns[] = { int register_downloader(lua_State* L) { - luaL_newmetatable(L, "cc.Downloader"); - lua_pushstring(L, "__index"); - lua_pushvalue(L, -2); /* pushes the metatable */ - lua_settable(L, -3); /* metatable.__index = metatable */ - - luaL_openlib(L, nullptr, downloaderMemberFns, 0); - luaL_openlib(L, "cc.Downloader", downloaderStaticFns, 0); + int stackSize = lua_gettop(L); + luaL_newmetatable(L, "cc.Downloader"); //stack metatable(cc.Downloader) + lua_pushstring(L, "__index"); //stack metatable(*), __index + lua_pushvalue(L, -2); //stack metatable(*), __index, metatable(*) + lua_settable(L, -3); //stack metatable(*) + luaL_register(L, nullptr, downloaderMemberFns); //stack metatable(*) + lua_pop(L, 1); //stack *empty* + luaL_register(L, "cc.Downloader", downloaderStaticFns); //stack *empty* + lua_pop(L, 1); + assert(stackSize == lua_gettop(L)); return 1; } diff --git a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index c15bfdfc1ae7..457ec3b1dfc4 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -168,7 +168,7 @@ void LuaMinXmlHttpRequest::_gotHeader(const std::string& header) char * cstr = new (std::nothrow) char [header.length()+1]; // check for colon. - size_t found_header_field = header.find_first_of(":"); + size_t found_header_field = header.find_first_of(':'); if (found_header_field != std::string::npos) { diff --git a/cocos/scripting/lua-bindings/proj.android/CMakeLists.txt b/cocos/scripting/lua-bindings/proj.android/CMakeLists.txt index 298bf5b06cdc..5206af046cdf 100644 --- a/cocos/scripting/lua-bindings/proj.android/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/proj.android/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(${target_name} STATIC ${${target_name}_src} ) -get_target_property(lua_header ext_lua INTERFACE_INCLUDE_DIRECTORIES) +get_target_property(lua_header ext_luajit INTERFACE_INCLUDE_DIRECTORIES) get_target_property(tolua_header ext_tolua INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(${target_name} PRIVATE ../../.. diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index 4d40a4e945ab..8d014a79eae3 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -1647,7 +1647,7 @@ 15C1C2CA198748D200A46ACC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1672,7 +1672,7 @@ 15C1C2CB198748D200A46ACC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -1698,7 +1698,7 @@ 15EFA614198B2DAA000C57D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; ENABLE_BITCODE = NO; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1719,7 +1719,7 @@ 15EFA615198B2DAA000C57D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; ENABLE_BITCODE = NO; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -1741,7 +1741,7 @@ 507B43511C31FA0C0067B53E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; EXECUTABLE_PREFIX = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; @@ -1759,7 +1759,7 @@ 507B43521C31FA0C0067B53E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; + ALWAYS_SEARCH_USER_PATHS = NO; EXECUTABLE_PREFIX = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj index 462c1092e4cc..e1e807d99163 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj @@ -234,6 +234,7 @@ {9F2D6CE6-C893-4400-B50C-6DB70CC2562F} libluacocos2d Win32Proj + 10.0.17134.0
diff --git a/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua b/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua index 89cca9e91843..27d306e54934 100644 --- a/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua +++ b/cocos/scripting/lua-bindings/script/cocos2d/Cocos2d.lua @@ -1,6 +1,11 @@ cc = cc or {} + +function cc.random() + return cc_mathutils_random() +end + function cc.clampf(value, min_inclusive, max_inclusive) -- body local temp = 0 @@ -89,33 +94,7 @@ function cc.pGetDistance(startP,endP) end function cc.pIsLineIntersect(A, B, C, D, s, t) - if ((A.x == B.x) and (A.y == B.y)) or ((C.x == D.x) and (C.y == D.y))then - return false, s, t - end - - local BAx = B.x - A.x - local BAy = B.y - A.y - local DCx = D.x - C.x - local DCy = D.y - C.y - local ACx = A.x - C.x - local ACy = A.y - C.y - - local denom = DCy * BAx - DCx * BAy - s = DCx * ACy - DCy * ACx - t = BAx * ACy - BAy * ACx - - if (denom == 0) then - if (s == 0 or t == 0) then - return true, s , t - end - - return false, s, t - end - - s = s / denom - t = t / denom - - return true,s,t + return vec2_isLineIntersect(A, B, C, D) end function cc.pPerp(pt) diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt index cd635d6b9615..28b2bbdce5a5 100644 --- a/cocos/ui/CMakeLists.txt +++ b/cocos/ui/CMakeLists.txt @@ -1,8 +1,3 @@ - -if(WINDOWS AND BUILD_SHARED_LIBS) - add_definitions(-D_USEGUIDLL) -endif() - if(WINDOWS) set(COCOS_UI_SPECIFIC_HEADER ui/UIEditBox/UIEditBoxImpl-win32.h diff --git a/cocos/ui/UIAbstractCheckButton.h b/cocos/ui/UIAbstractCheckButton.h index e3376dc93802..3237af15c416 100644 --- a/cocos/ui/UIAbstractCheckButton.h +++ b/cocos/ui/UIAbstractCheckButton.h @@ -115,7 +115,7 @@ class CC_GUI_DLL AbstractCheckButton : public Widget * Set to true will cause the CheckBox's state to "selected", false otherwise. *@param selected Set to true will change CheckBox to selected state, false otherwise. */ - void setSelected(bool selected); + virtual void setSelected(bool selected); //override functions virtual Size getVirtualRendererSize() const override; @@ -196,22 +196,22 @@ class CC_GUI_DLL AbstractCheckButton : public Widget virtual void onPressStateChangedToPressed() override; virtual void onPressStateChangedToDisabled() override; - void setupBackgroundTexture(); + virtual void setupBackgroundTexture(); void loadTextureBackGround(SpriteFrame* spriteFrame); - void setupBackgroundSelectedTexture(); + virtual void setupBackgroundSelectedTexture(); void loadTextureBackGroundSelected(SpriteFrame* spriteFrame); - void setupFrontCrossTexture(); + virtual void setupFrontCrossTexture(); void loadTextureFrontCross(SpriteFrame* spriteframe); - void setupBackgroundDisable(); + virtual void setupBackgroundDisable(); void loadTextureBackGroundDisabled(SpriteFrame* spriteframe); - void setupFrontCrossDisableTexture(); + virtual void setupFrontCrossDisableTexture(); void loadTextureFrontCrossDisabled(SpriteFrame* spriteframe); virtual void dispatchSelectChangedEvent(bool selected) = 0; virtual void onSizeChanged() override; - void backGroundTextureScaleChangedWithSize(); + virtual void backGroundTextureScaleChangedWithSize(); void backGroundSelectedTextureScaleChangedWithSize(); void frontCrossTextureScaleChangedWithSize(); void backGroundDisabledTextureScaleChangedWithSize(); diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 2e69dd117d66..b3eae8e99475 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -158,19 +158,17 @@ bool Button::createTitleRendererIfNull() { void Button::createTitleRenderer() { - _titleRenderer = Label::create(); - _titleRenderer->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1); + setTitleLabel(Label::create()); } /** replaces the current Label node with a new one */ void Button::setTitleLabel(Label* label) { - if (_titleRenderer != label) { - CC_SAFE_RELEASE(_titleRenderer); - _titleRenderer = label; - CC_SAFE_RETAIN(_titleRenderer); + if (label && _titleRenderer != label) { + + if (_titleRenderer) removeProtectedChild(_titleRenderer); + _titleRenderer = label; addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1); updateTitleLocation(); } diff --git a/cocos/ui/UIButton.h b/cocos/ui/UIButton.h index 3d097cf55cb4..04a8a6542529 100644 --- a/cocos/ui/UIButton.h +++ b/cocos/ui/UIButton.h @@ -341,7 +341,7 @@ class CC_GUI_DLL Button : public Widget void disabledTextureScaleChangedWithSize(); virtual void adaptRenderers() override; - void updateTitleLocation(); + virtual void updateTitleLocation(); void updateContentSize(); virtual void createTitleRenderer(); bool createTitleRendererIfNull(); diff --git a/cocos/ui/UIDeprecated.cpp b/cocos/ui/UIDeprecated.cpp index 1821e3d5ee93..e384985b183e 100644 --- a/cocos/ui/UIDeprecated.cpp +++ b/cocos/ui/UIDeprecated.cpp @@ -31,4 +31,6 @@ namespace ui { const Margin MarginZero = Margin::ZERO ; -}} +} + +NS_CC_END diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index c89bf152232f..7144a92f0be1 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -28,6 +28,7 @@ THE SOFTWARE. #include "ui/UIScale9Sprite.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" +#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderState.h" #include "base/CCDirector.h" #include "2d/CCDrawingPrimitives.h" diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 272a5817f893..297c25c60fb1 100755 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -1472,7 +1472,7 @@ void RichText::formatText() case RichElement::Type::IMAGE: { RichElementImage* elmtImage = static_cast(element); - handleImageRenderer(elmtImage->_filePath, elmtImage->_color, elmtImage->_opacity, elmtImage->_width, elmtImage->_height, elmtImage->_url); + handleImageRenderer(elmtImage->_filePath, elmtImage->_textureType, elmtImage->_color, elmtImage->_opacity, elmtImage->_width, elmtImage->_height, elmtImage->_url); break; } case RichElement::Type::CUSTOM: @@ -1740,9 +1740,14 @@ void RichText::handleTextRenderer(const std::string& text, const std::string& fo } } -void RichText::handleImageRenderer(const std::string& filePath, const Color3B &/*color*/, GLubyte /*opacity*/, int width, int height, const std::string& url) +void RichText::handleImageRenderer(const std::string& filePath, Widget::TextureResType textureType, const Color3B &/*color*/, GLubyte /*opacity*/, int width, int height, const std::string& url) { - Sprite* imageRenderer = Sprite::create(filePath); + Sprite* imageRenderer; + if (textureType == Widget::TextureResType::LOCAL) + imageRenderer = Sprite::create(filePath); + else + imageRenderer = Sprite::createWithSpriteFrameName(filePath); + if (imageRenderer) { auto currentSize = imageRenderer->getContentSize(); diff --git a/cocos/ui/UIRichText.h b/cocos/ui/UIRichText.h index 4a119c2a9398..39270fccbe46 100644 --- a/cocos/ui/UIRichText.h +++ b/cocos/ui/UIRichText.h @@ -565,7 +565,7 @@ class CC_GUI_DLL RichText : public Widget const Color3B& outlineColor = Color3B::WHITE, int outlineSize = -1, const Color3B& shadowColor = Color3B::BLACK, const Size& shadowOffset = Size(2.0, -2.0), int shadowBlurRadius = 0, const Color3B& glowColor = Color3B::WHITE); - void handleImageRenderer(const std::string& filePath, const Color3B& color, GLubyte opacity, int width, int height, const std::string& url); + void handleImageRenderer(const std::string& filePath, Widget::TextureResType textureType, const Color3B& color, GLubyte opacity, int width, int height, const std::string& url); void handleCustomRenderer(Node* renderer); void formatRenderers(); void addNewLine(); diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 2b9455e934f1..5a5e7e37a115 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -455,13 +455,24 @@ void Slider::setPercent(int percent) { percent = 0; } - _percent = percent; - float res = 1.0 * percent / _maxPercent; + + // Only send event if value has changed + if (_percent != percent) + { + _percent = percent; + updateVisualSlider(); + percentChangedEvent(EventType::ON_PERCENTAGE_CHANGED); + } +} + +void Slider::updateVisualSlider() +{ + float res = 1.0 * _percent / _maxPercent; float dis = _barLength * res; _slidBallRenderer->setPosition(dis, _contentSize.height / 2.0f); if (_scale9Enabled) { - _progressBarRenderer->setPreferredSize(Size(dis,_contentSize.height)); + _progressBarRenderer->setPreferredSize(Size(dis, _contentSize.height)); } else { @@ -498,13 +509,11 @@ void Slider::onTouchMoved(Touch *touch, Event* /*unusedEvent*/) { _touchMovePosition = touch->getLocation(); setPercent(getPercentWithBallPos(_touchMovePosition)); - percentChangedEvent(EventType::ON_PERCENTAGE_CHANGED); } void Slider::onTouchEnded(Touch *touch, Event *unusedEvent) { Widget::onTouchEnded(touch, unusedEvent); - percentChangedEvent(EventType::ON_PERCENTAGE_CHANGED); percentChangedEvent(EventType::ON_SLIDEBALL_UP); } @@ -624,7 +633,7 @@ void Slider::barRendererScaleChangedWithSize() } } _barRenderer->setPosition(_contentSize.width / 2.0f, _contentSize.height / 2.0f); - setPercent(_percent); + updateVisualSlider(); } void Slider::progressBarRendererScaleChangedWithSize() @@ -666,7 +675,7 @@ void Slider::progressBarRendererScaleChangedWithSize() } } _progressBarRenderer->setPosition(0.0f, _contentSize.height / 2.0f); - setPercent(_percent); + updateVisualSlider(); } void Slider::onPressStateChangedToNormal() diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index cd9c8d0e7f59..8170a4c9aeb3 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -204,6 +204,11 @@ class CC_GUI_DLL Slider : public Widget */ void setPercent(int percent); + /** + * Updates the visual elements of the slider. + */ + void updateVisualSlider(); + /** * Gets the progress direction of slider. * diff --git a/cocos/ui/UIVideoPlayer-android.cpp b/cocos/ui/UIVideoPlayer-android.cpp index f0ad1199f6a8..344f7960ad6f 100644 --- a/cocos/ui/UIVideoPlayer-android.cpp +++ b/cocos/ui/UIVideoPlayer-android.cpp @@ -65,6 +65,26 @@ int createVideoWidgetJNI() return ret; } +void setLoopingJNI(int index, bool looping) +{ + JniMethodInfo t; + if (JniHelper::getStaticMethodInfo(t, videoHelperClassName.c_str(), "setLooping", "(IZ)V")) { + t.env->CallStaticVoidMethod(t.classID, t.methodID, index, looping); + + t.env->DeleteLocalRef(t.classID); + } +} + +void setUserInputEnabledJNI(int index, bool enableInput) +{ + JniMethodInfo t; + if (JniHelper::getStaticMethodInfo(t, videoHelperClassName.c_str(), "setUserInputEnabled", "(IZ)V")) { + t.env->CallStaticVoidMethod(t.classID, t.methodID, index, enableInput); + + t.env->DeleteLocalRef(t.classID); + } +} + //----------------------------------------------------------------------------------------------------------- using namespace cocos2d::experimental::ui; @@ -77,6 +97,10 @@ VideoPlayer::VideoPlayer() , _keepAspectRatioEnabled(false) , _videoPlayerIndex(-1) , _eventCallback(nullptr) +, _isPlaying(false) +, _isLooping(false) +, _isUserInputEnabled(true) +, _styleType(StyleType::DEFAULT) { _videoPlayerIndex = createVideoWidgetJNI(); s_allVideoPlayers[_videoPlayerIndex] = this; @@ -109,6 +133,23 @@ void VideoPlayer::setURL(const std::string& videoUrl) (int)Source::URL,_videoURL); } +void VideoPlayer::setLooping(bool looping) +{ + _isLooping = looping; + setLoopingJNI(_videoPlayerIndex, _isLooping); +} + +void VideoPlayer::setUserInputEnabled(bool enableInput) +{ + _isUserInputEnabled = enableInput; + setUserInputEnabledJNI(_videoPlayerIndex, enableInput); +} + +void VideoPlayer::setStyle(StyleType style) +{ + _styleType = style; +} + void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags) { cocos2d::ui::Widget::draw(renderer,transform,flags); @@ -231,6 +272,16 @@ bool VideoPlayer::isPlaying() const return _isPlaying; } +bool VideoPlayer::isLooping() const +{ + return _isLooping; +} + +bool VideoPlayer::isUserInputEnabled() const +{ + return _isUserInputEnabled; +} + void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); @@ -294,6 +345,9 @@ void VideoPlayer::copySpecialProperties(Widget *widget) if (videoPlayer) { _isPlaying = videoPlayer->_isPlaying; + _isLooping = videoPlayer->_isLooping; + _isUserInputEnabled = videoPlayer->_isUserInputEnabled; + _styleType = videoPlayer->_styleType; _fullScreenEnabled = videoPlayer->_fullScreenEnabled; _fullScreenDirty = videoPlayer->_fullScreenDirty; _videoURL = videoPlayer->_videoURL; diff --git a/cocos/ui/UIVideoPlayer-ios.mm b/cocos/ui/UIVideoPlayer-ios.mm index 9b9b0867d31b..b6c871298ada 100644 --- a/cocos/ui/UIVideoPlayer-ios.mm +++ b/cocos/ui/UIVideoPlayer-ios.mm @@ -51,6 +51,10 @@ - (void) setVisible:(BOOL) visible; - (void) setKeepRatioEnabled:(BOOL) enabled; - (void) setFullScreenEnabled:(BOOL) enabled; - (BOOL) isFullScreenEnabled; +- (void) setRepeatMode:(MPMovieRepeatMode)repeatMode; +- (void) setControlStyle:(MPMovieControlStyle)controlStyle; +- (void) setUserInteractionEnabled:(BOOL)userInteractionEnabled; + -(id) init:(void*) videoPlayer; @@ -67,7 +71,9 @@ @implementation UIVideoViewWrapperIos int _width; int _height; bool _keepRatioEnabled; - + MPMovieRepeatMode _repeatMode; + MPMovieControlStyle _controlStyle; + BOOL _userInteractionEnabled; VideoPlayer* _videoPlayer; } @@ -75,6 +81,11 @@ -(id)init:(void*)videoPlayer { if (self = [super init]) { self.moviePlayer = nullptr; + + _repeatMode = MPMovieRepeatModeNone; + _controlStyle = MPMovieControlStyleEmbedded; + _userInteractionEnabled = YES; + _videoPlayer = (VideoPlayer*)videoPlayer; _keepRatioEnabled = false; } @@ -123,6 +134,31 @@ -(BOOL) isFullScreenEnabled return false; } + +-(void) setControlStyle:(MPMovieControlStyle)controlStyle +{ + _controlStyle = controlStyle; + if (self.moviePlayer != nullptr) { + self.moviePlayer.controlStyle = _controlStyle; + } +} + +-(void) setRepeatMode:(MPMovieRepeatMode)repeatMode +{ + _repeatMode = repeatMode; + if (self.moviePlayer != nullptr) { + self.moviePlayer.repeatMode = _repeatMode; + } +} + +-(void) setUserInteractionEnabled:(BOOL)userInteractionEnabled +{ + _userInteractionEnabled = userInteractionEnabled; + if (self.moviePlayer != nullptr) { + self.moviePlayer.view.userInteractionEnabled = _userInteractionEnabled; + } +} + -(void) setURL:(int)videoSource :(std::string &)videoUrl { if (self.moviePlayer != nullptr) { @@ -143,14 +179,17 @@ -(void) setURL:(int)videoSource :(std::string &)videoUrl self.moviePlayer.movieSourceType = MPMovieSourceTypeFile; } self.moviePlayer.allowsAirPlay = false; - self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded; - self.moviePlayer.view.userInteractionEnabled = true; + + self.moviePlayer.controlStyle = _controlStyle; + self.moviePlayer.repeatMode = _repeatMode; auto clearColor = [UIColor clearColor]; self.moviePlayer.backgroundView.backgroundColor = clearColor; self.moviePlayer.view.backgroundColor = clearColor; + self.moviePlayer.view.userInteractionEnabled = _userInteractionEnabled; for (UIView * subView in self.moviePlayer.view.subviews) { subView.backgroundColor = clearColor; + subView.userInteractionEnabled = _userInteractionEnabled; } if (_keepRatioEnabled) { @@ -233,6 +272,8 @@ -(void) play if (self.moviePlayer != NULL) { [self.moviePlayer.view setFrame:CGRectMake(_left, _top, _width, _height)]; [self.moviePlayer play]; + self.moviePlayer.view.userInteractionEnabled = _userInteractionEnabled; + self.moviePlayer.repeatMode = _repeatMode; } } @@ -270,6 +311,9 @@ -(void) stop , _keepAspectRatioEnabled(false) , _videoPlayerIndex(-1) , _eventCallback(nullptr) +, _isLooping(false) +, _isUserInputEnabled(true) +, _styleType(StyleType::DEFAULT) { _videoView = [[UIVideoViewWrapperIos alloc] init:this]; @@ -301,6 +345,33 @@ -(void) stop [((UIVideoViewWrapperIos*)_videoView) setURL:(int)_videoSource :_videoURL]; } +void VideoPlayer::setLooping(bool looping) +{ + _isLooping = looping; + [((UIVideoViewWrapperIos*)_videoView) setRepeatMode:_isLooping ? MPMovieRepeatModeOne : MPMovieRepeatModeNone]; +} + +void VideoPlayer::setUserInputEnabled(bool enableInput) +{ + _isUserInputEnabled = enableInput; + [((UIVideoViewWrapperIos*)_videoView) setUserInteractionEnabled:enableInput]; +} + +void VideoPlayer::setStyle(StyleType style) +{ + _styleType = style; + + switch (style) { + case StyleType::DEFAULT: + [((UIVideoViewWrapperIos*)_videoView) setControlStyle:MPMovieControlStyleEmbedded]; + break; + + case StyleType::NONE: + [((UIVideoViewWrapperIos*)_videoView) setControlStyle:MPMovieControlStyleNone]; + break; + } +} + void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags) { cocos2d::ui::Widget::draw(renderer,transform,flags); @@ -403,6 +474,16 @@ -(void) stop return _isPlaying; } +bool VideoPlayer::isLooping() const +{ + return _isLooping; +} + +bool VideoPlayer::isUserInputEnabled() const +{ + return _isUserInputEnabled; +} + void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); @@ -462,6 +543,9 @@ -(void) stop if (videoPlayer) { _isPlaying = videoPlayer->_isPlaying; + _isLooping = videoPlayer->_isLooping; + _isUserInputEnabled = videoPlayer->_isUserInputEnabled; + _styleType = videoPlayer->_styleType; _fullScreenEnabled = videoPlayer->_fullScreenEnabled; _fullScreenDirty = videoPlayer->_fullScreenDirty; _videoURL = videoPlayer->_videoURL; diff --git a/cocos/ui/UIVideoPlayer-tizen.cpp b/cocos/ui/UIVideoPlayer-tizen.cpp index 132fad543b12..ee9480fa35fd 100644 --- a/cocos/ui/UIVideoPlayer-tizen.cpp +++ b/cocos/ui/UIVideoPlayer-tizen.cpp @@ -60,6 +60,7 @@ class _VideoPlayerTizen _image = evas_object_image_filled_add(evas); evas_object_show(_image); player_create(&_player); + player_set_looping(_player, videoPlayer->isLooping() ); evas_object_event_callback_add(_image, EVAS_CALLBACK_MOUSE_UP, _VideoPlayerTizen::mouse_up_cb, this); eext_object_event_callback_add(app->_win, EEXT_CALLBACK_BACK, _VideoPlayerTizen::win_back_cb, this); @@ -80,14 +81,17 @@ class _VideoPlayerTizen static void mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { - _VideoPlayerTizen* videoPlayerTizen = (_VideoPlayerTizen*)data; - if (videoPlayerTizen->_videoPlayer->isPlaying()) - { - videoPlayerTizen->_videoPlayer->pause(); - } - else + if (_videoPlayer->_isUserInputEnabled()) { - videoPlayerTizen->_videoPlayer->resume(); + _VideoPlayerTizen* videoPlayerTizen = (_VideoPlayerTizen*)data; + if (videoPlayerTizen->_videoPlayer->isPlaying()) + { + videoPlayerTizen->_videoPlayer->pause(); + } + else + { + videoPlayerTizen->_videoPlayer->resume(); + } } } @@ -122,6 +126,9 @@ VideoPlayer::VideoPlayer() , _fullScreenEnabled(false) , _fullScreenDirty(false) , _keepAspectRatioEnabled(false) +, _isLooping(false) +, _isUserInputEnabled(true) +, _styleType(StyleType::DEFAULT) { _videoView = (void*) new (std::nothrow) _VideoPlayerTizen(this); @@ -159,6 +166,24 @@ void VideoPlayer::setURL(const std::string& videoUrl) player_set_uri(impl->_player, videoUrl.c_str()); } +void VideoPlayer::setLooping(bool looping) +{ + _isLooping = looping; + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_looping(impl->_player, looping ); +} + +void VideoPlayer::setUserInputEnabled(bool enableInput) +{ + _isUserInputEnabled = enableInput + +} + +void VideoPlayer::setStyle(StyleType style) +{ + _styleType = style; +} + void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags) { cocos2d::ui::Widget::draw(renderer,transform,flags); @@ -436,6 +461,9 @@ void VideoPlayer::copySpecialProperties(Widget *widget) if (videoPlayer) { _isPlaying = videoPlayer->_isPlaying; + _isLooping = videoPlayer->_isLooping; + _isUserInputEnabled = videoPlayer->_isUserInputEnabled; + _styleType = videoPlayer->_styleType; _fullScreenEnabled = videoPlayer->_fullScreenEnabled; _fullScreenDirty = videoPlayer->_fullScreenDirty; _videoURL = videoPlayer->_videoURL; diff --git a/cocos/ui/UIVideoPlayer.h b/cocos/ui/UIVideoPlayer.h index 71bc51b7026e..4e8be1c9c5c9 100644 --- a/cocos/ui/UIVideoPlayer.h +++ b/cocos/ui/UIVideoPlayer.h @@ -58,7 +58,19 @@ namespace experimental{ PLAYING = 0, PAUSED, STOPPED, - COMPLETED + COMPLETED, + ERROR + }; + + /** + * Styles of how the the video player is presented + * For now only used on iOS to use either MPMovieControlStyleEmbedded (DEFAULT) or + * MPMovieControlStyleNone (NONE) + */ + enum class StyleType + { + DEFAULT = 0, + NONE }; /** @@ -95,6 +107,27 @@ namespace experimental{ * @return A remoting URL address. */ virtual const std::string& getURL() const { return _videoURL;} + + /** + * @brief Set if playback is done in loop mode + * + * @param looping the video will or not automatically restart at the end + */ + virtual void setLooping(bool looping); + + /** + * Set if the player will enable user input for basic pause and resume of video + * + * @param enableInput If true, input will be handled for basic functionality (pause/resume) + */ + virtual void setUserInputEnabled(bool enableInput); + + /** + * Set the style of the player + * + * @param style The corresponding style + */ + virtual void setStyle(StyleType style); /** * Starts playback. @@ -129,6 +162,22 @@ namespace experimental{ * @return True if currently playing, false otherwise. */ virtual bool isPlaying() const; + + /** + * Checks whether the VideoPlayer is set with looping mode. + * + * @return true if the videoplayer is set to loop, false otherwise. + */ + virtual bool isLooping() const; + + + /** + * Checks whether the VideoPlayer is set to listen user input to resume and pause the video + * + * @return true if the videoplayer user input is set, false otherwise. + */ + virtual bool isUserInputEnabled() const; + /** * Causes the video player to keep aspect ratio or no when displaying the video. @@ -196,16 +245,20 @@ namespace experimental{ }; bool _isPlaying; + bool _isLooping; + bool _isUserInputEnabled; bool _fullScreenDirty; bool _fullScreenEnabled; bool _keepAspectRatioEnabled; + StyleType _styleType; + std::string _videoURL; Source _videoSource; int _videoPlayerIndex; ccVideoPlayerCallback _eventCallback; - + void* _videoView; }; } diff --git a/cocos/vr/CCVRGenericRenderer.cpp b/cocos/vr/CCVRGenericRenderer.cpp index 8d10af437135..c67bb3b9cb9d 100644 --- a/cocos/vr/CCVRGenericRenderer.cpp +++ b/cocos/vr/CCVRGenericRenderer.cpp @@ -30,6 +30,7 @@ #include "vr/CCVRGenericHeadTracker.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramState.h" +#include "renderer/ccGLStateCache.h" #include "base/CCDirector.h" #include "2d/CCScene.h" #include "2d/CCCamera.h" @@ -125,8 +126,7 @@ void VRGenericRenderer::render(Scene* scene, Renderer* renderer) _fb->restoreFBO(); auto texture = _fb->getRenderTarget()->getTexture(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texture->getName()); + GL::bindTexture2D(texture->getName()); _glProgramState->apply(Mat4::IDENTITY); GLint origViewport[4]; diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index da4ca4b8055f..d9ae53f2ea88 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,69 +2,26 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [Cocos2d-x 3.17 Release Notes](#cocos2d-x-317-release-notes) - - [Android requirements](#android-requirements) +- [Cocos2d-x 3.17.1 Release Notes](#cocos2d-x-3171-release-notes) - [Highlights](#highlights) - - [added support for iPhone X](#added-support-for-iphone-x) - - [added support Android Studio 3.0+](#added-support-android-studio-30) - - [CMake is now supported on all platforms](#cmake-is-now-supported-on-all-platforms) - - [upgrade 3rd-party libraries](#upgrade-3rd-party-libraries) - - [remove outdated](#remove-outdated) - - [misc bugs fix and stability improvements](#misc-bugs-fix-and-stability-improvements) -# Cocos2d-x 3.17 Release Notes # -The 3.17 release focuses on stability and increased performance with some under the hood enhancements that will make cross-platform development easier. +# Cocos2d-x 3.17.1 Release Notes # -## Android requirements - -v3.17 has been tested using Android Studio (3.0, 3.1, 3.1.1) with NDK r16 +The 3.17.1 release focuses on bug fixing. ## Highlights -- added support for iPhone X -- added support Android Studio 3.0+ -- CMake is now supported on all platforms -- upgraded Spine runtime to v3.6.39 -- upgraded GLFW to 3.2.1 -- misc bugs fix and stability improvements - -### added support for iPhone X - -3.17 brings support for iPhone X including supporting full screen mode, using Storyboards for launch images, __safe area__ API and support for auto hiding the Home indicator. It is important to note exactly what and where the safe area is: - -

- -

- -Developers can get the safe area easily by calling: `Director::getSafeAreaRect()`. - -### added support Android Studio 3.0+ - -Android Studio is the only official IDE for Google's Android operating system. -Cocos2d-x supports Android Studio using NDK version r16 to r16. Gradle configurations have been updated, including simplifying Gradle PROP_* values, changing the deprecated `compile` to the new `implementation`in dependency declaration, and added Proguard configuration to reduce Release package size. - -### CMake is now supported on all platforms - -CMake is now supported on all platforms, including Android(NDK), iOS, macOS, Windows (VC++ compiler), Linux. Supports precompile libraries for engine, and reusing precompiled libraries in the new build process. Your projects build time will be greatly reduced. For detailed usage, please refer to [CMake Doc](https://github.com/cocos2d/cocos2d-x/blob/v3/cmake/README.md) - -### upgrade 3rd-party libraries - -Spine skeleton animation is widely used in games developed by Cocos2d-x. Spine runtime has been upgraded to 3.6.39 to keep current. - -GLFW has been upgraded to 3.2.1 to help fix joystick issues. You can also now use GLFW as a precompiled library. - -Box2D hasn't been updated in quite some time. A new production version has yet to be released so far in 2018. We felt GitHub commit f655c603ba9d83 was stable. You can also now use Box2D as a precompiled library. - -Each Cocos2d-x release comes with a specific version of third-party libraries. If you want to upgrade third-party libraries due to your projects needs, please refer to: [3rd-party Doc](https://github.com/cocos2d/cocos2d-x-3rd-party-libs-src/blob/v3/README.md) - -### remove outdated - -Google officially deprecated ant build support starting in [Android SDK Tools 25.3.0](http://tools.android.com/recent/androidsdktoolsrevision2530feb2017). The old ant based `proj.android` and been dropped and now `proj.android` is an Android Studio project. The default architecture is changed from `armeabi` to `armeabi-v7a`. - -Visual Studio 2013 support has been dropped. Visual Studio 2015/2017 are still currently supported. The existing win32 project files is quite suitable for 2015. To use 2017, you can open a 2015 project file, modify the configuration to suit your needs, or use CMake (See above). - -### misc bugs fix and stability improvements - -This release contains more than 51 bugs fixed and 33 misc improvements, please refer to [Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG) +- Fix Lua loading performance drop bug introduced in 3.17 +- Renderer limit glClear invoke times, reduce power consuming +- optimize CMake script,fix some linking issues +- Android use CMake as default PROP_BUILD_TYPE value +- Android upgrade Gradle to 4.6, SDK 28, android gradle plugin 3.1.0 +- upgrade LuaJIT to 2.1.0-beta3, fix random crash in 3.17 Lua release mode +- upgrade libwebsockets to 2.4.2 +- FileUtils provide thread-safe implementation and add missing cross-platform interfaces +- limit Labels text length to fix render error +- add Downloader binding to Lua + +This release contains more than 45 bugs fixed and 34 misc improvements, please refer to [ChangeLog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG) diff --git a/docs/RELEASE_NOTES_CN.md b/docs/RELEASE_NOTES_CN.md index e8cb6991cca5..eef109506d61 100644 --- a/docs/RELEASE_NOTES_CN.md +++ b/docs/RELEASE_NOTES_CN.md @@ -2,79 +2,26 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [Cocos2d-x 3.17 Release Notes](#cocos2d-x-317-release-notes) - - [测试环境](#%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83) - - [版本特性](#%E7%89%88%E6%9C%AC%E7%89%B9%E6%80%A7) - - [详细介绍](#%E8%AF%A6%E7%BB%86%E4%BB%8B%E7%BB%8D) - - [支持 iPhone X](#%E6%94%AF%E6%8C%81-iphone-x) - - [支持 Android Studio 3.0+](#%E6%94%AF%E6%8C%81-android-studio-30) - - [CMake 支持全平台](#cmake-%E6%94%AF%E6%8C%81%E5%85%A8%E5%B9%B3%E5%8F%B0) - - [升级第三方库](#%E5%8D%87%E7%BA%A7%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93) - - [移除过时的内容](#%E7%A7%BB%E9%99%A4%E8%BF%87%E6%97%B6%E7%9A%84%E5%86%85%E5%AE%B9) - - [Bugs 修复,提高稳定性](#bugs-%E4%BF%AE%E5%A4%8D%E6%8F%90%E9%AB%98%E7%A8%B3%E5%AE%9A%E6%80%A7) +- [Cocos2d-x 3.17.1 Release Notes](#cocos2d-x-3171-release-notes) + - [版本变动](#%E7%89%88%E6%9C%AC%E5%8F%98%E5%8A%A8) -# Cocos2d-x 3.17 Release Notes # +# Cocos2d-x 3.17.1 Release Notes # -Cocos2d-x 3.17 版本着重于工具链的更新,和稳定性的增强。 +Cocos2d-x 3.17.1 侧重于稳定性的提升, 已有问题的修复。 -## 测试环境 +## 版本变动 - Android 平台使用 Android Studio (3.0, 3.1, 3.1.1) 和 NDK r16 进行测试。 - -## 版本特性 - -- 支持 iPhone X -- 支持 Android Studio 3.0+ -- CMake 支持全平台,支持预编译引擎库 -- 升级 Spine runtime 至 v3.6.39 -- 升级 GLFW 至 3.2.1,并提供预编译库 -- 更新 Box2D,并提供预编译库 -- 去除 Android 的 ant 工程 -- 去除 Visual Studio 2013 的支持 - -## 详细介绍 - -### 支持 iPhone X - -3.17 带来对 iPhone X 的支持,包含支持全屏模式,支持自动隐藏 Home 指示器,改用 Storyboard 作为启动屏幕,和增加获取 Safe Area 的接口。在开发支持 iPhone X 的应用时,最需要了解清楚的就是 Safe Area: - -

- -

- -开发者可以通过调用 `Director::getSafeAreaRect()` 来获取 Safe Area 区域。 - -### 支持 Android Studio 3.0+ - -Android Studio 是 Google 官方唯一支持的 Android 开发 IDE。 - -该版本增加了对 Android Studio 3.0+ 的支持。在支持的过程中,同时将 NDK 版本从 r14 升级到 r16。对 Gradle 工程配置也进行了诸多改进,包括简化 Gradle 变量 PROP_*,将依赖声明中弃用的 `compile` 改为新的 `implementation`,增加用以削减 Release 包体积的 Proguard 文件。 - -### CMake 支持全平台 - -扩展 CMake 构建支持至全平台,包括 Android (NDK)、iOS、macOS、Linux、Windows(VC++ compiler)。支持将引擎部分进行预编译,并在新的构建过程中重用预编译的引擎库。通过使用预编译库,可以极大的缩短工程构建时间。 - -详细的使用方法请参考 [CMake 文档](https://github.com/cocos2d/cocos2d-x/blob/v3/cmake/README.md) - -### 升级第三方库 - -Spine 骨骼动画广泛用于 Cocos2d-x 开发的游戏,引擎跟进 Spine 的升级,升级 Runtime 至 3.6.39。 - -升级 GLFW 至 3.2.1 以修复支持游戏手柄时存在的问题,同时提供 GLFW 预编译库。 - -社区希望引擎升级 Box2D,可 Box2D 的新版本迟迟未发布,根据反馈 GitHub 提交 f655c603ba9d83 是稳定的,升级 Box2D 至该提交,同时提供 Box2D 的预编译库。 - -每一次版本发布,都会附带特定版本的第三方预编译库,如果由于项目需要想对第三方库进行定制,请参考: [第三方库文档](https://github.com/cocos2d/cocos2d-x-3rd-party-libs-src/blob/v3/README.md) - -### 移除过时的内容 - -由于 Google 官方自 [Android SDK Tools 25.3.0](http://tools.android.com/recent/androidsdktoolsrevision2530feb2017) 就已放弃 ant 支持。移除旧有的 `proj.android` ant 工程,新的 `proj.android` 是 Android Studio 工程。[NDK r16](https://developer.android.com/ndk/guides/abis) 弃用了 armeabi,引擎调整默认的编译架构从 armeabi 为 armeabi-v7a。 - -在 win32 平台,越来越多的开发者已经使用 Visual Studio 2015/2017 进行开发,移除对年代久远的 2013 的支持。现存的工程配置适合于 2015 ,如果需要使用 2017,可打开现有的 sln 文件,调整配置,或使用 CMake。 - -### Bugs 修复,提高稳定性 - -改版本包含 51 项 bugs 修复和 33 项小改进,不再列举,请参考 [Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)。 +- 修复 3.17 引入的 Lua 加载性能下降的 BUG +- 减少渲染中 glClear 的调用次数,降低电量消耗 +- CMake 脚本优化,解决存在的链接问题 +- Android 默认启用 CMake 方式编译 +- Android 升级 Gradle 到 4.6, SDK 28, plugin 3.1.0 +- 升级 LuaJIT 到 2.1.0-beta3,修复 3.17 Lua 项目的闪退问题 +- 升级 libwebsockets 到 2.4.2 +- FileUtils 内部加锁,增加线程安全,完善接口实现 +- 限制 Label 长度,避免绘制错误 +- 增加 Downloader 的 Lua 绑定 +当前版本包含 45 项 bugs 修复和 34 项小改进,不再列举,请参考 [ChangeLog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)。 diff --git a/docs/cocos2dx_portrait.png b/docs/cocos2dx_portrait.png index 8f17d0ec8d8f..977637ede5c3 100644 Binary files a/docs/cocos2dx_portrait.png and b/docs/cocos2dx_portrait.png differ diff --git a/docs/doxygen.config b/docs/doxygen.config index 05acd8e65f76..11b8260a254d 100644 --- a/docs/doxygen.config +++ b/docs/doxygen.config @@ -38,7 +38,7 @@ PROJECT_NAME = Cocos2d-x # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v3.16 +PROJECT_NUMBER = v3.17.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index f14a89327780..f50b92fe22c2 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -1,7 +1,3 @@ -if(WINDOWS AND BUILD_SHARED_LIBS) - add_definitions(-D_USREXDLL) -endif() - set(COCOS_EXTENSIONS_HEADER ../extensions/ExtensionMacros.h ../extensions/assets-manager/AssetsManagerEx.h diff --git a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp index d557f49b0090..8a3bd3ae6cbf 100755 --- a/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp +++ b/extensions/Particle3D/PU/CCPUParticleSystem3D.cpp @@ -277,11 +277,11 @@ bool PUParticleSystem3D::initWithFilePath( const std::string &filePath ) { std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); convertToUnixStylePath(fullPath); - std::string::size_type pos = fullPath.find_last_of("/"); + std::string::size_type pos = fullPath.find_last_of('/'); std::string materialFolder = "materials"; if (pos != std::string::npos){ std::string temp = fullPath.substr(0, pos); - pos = temp.find_last_of("/"); + pos = temp.find_last_of('/'); if (pos != std::string::npos){ materialFolder = temp.substr(0, pos + 1) + materialFolder; } diff --git a/extensions/Particle3D/PU/CCPURendererTranslator.cpp b/extensions/Particle3D/PU/CCPURendererTranslator.cpp index a99648959bd3..5d2168ec3ab5 100644 --- a/extensions/Particle3D/PU/CCPURendererTranslator.cpp +++ b/extensions/Particle3D/PU/CCPURendererTranslator.cpp @@ -74,12 +74,12 @@ void PURendererTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode PUMaterial *material = PUMaterialCache::Instance()->getMaterial(system->getMaterialName()); std::string texFolder = "textures/"; if (material){ - std::string::size_type pos = obj->file.find_last_of("/"); + std::string::size_type pos = obj->file.find_last_of('/'); //if (pos != std::string::npos) // texFolder = obj->file.substr(0, pos + 1) + texFolder; if (pos != std::string::npos){ std::string temp = obj->file.substr(0, pos); - pos = temp.find_last_of("/"); + pos = temp.find_last_of('/'); if (pos != std::string::npos){ texFolder = temp.substr(0, pos + 1) + texFolder; } @@ -261,7 +261,7 @@ void PURendererTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode std::string val; if(getString(*prop->values.front(), &val)) { - std::string::size_type pos = val.find_last_of("."); + std::string::size_type pos = val.find_last_of('.'); val = val.substr(0, pos + 1) + std::string("c3b"); if (material) _renderer = PUParticle3DModelRender::create(val, texFolder + material->textureFile); diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.cpp b/extensions/Particle3D/PU/CCPUScriptTranslator.cpp index 19b0d25039f2..0879eeff5ce6 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.cpp +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.cpp @@ -28,6 +28,600 @@ #include "extensions/Particle3D/PU/CCPUTranslateManager.h" NS_CC_BEGIN + +const std::string token[1000] = +{ + // Generic + "group_mask", + "acceleration", + "max_increment", + "min_increment", + "number_of_iterations", + "colour_change", + "initial_colour", + "random_initial_colour", + "use_vertex_colours", + "use_own_rotation", + "max_deviation", + "time_step", + "box_width", + "box_height", + "box_depth", + "velocity", + "speed", + "rotation_speed", + "rotation", + "rotation_axis", + "normal", + "step", + "number_of_segments", + "max_elements", + "update_interval", + "distance_threshold", + "material", + "mesh_name", + "radius", + "enabled", + "position", + "keep_local", + "less_than", + "greater_than", + "equals", + "visual_particle", + "emitter_particle", + "affector_particle", + "technique_particle", + "system_particle", + "point", + "vertex", + "increase", + "alias", + "use_alias", + "since_start_system", + + // Particle System + "system", + "iteration_interval", + "nonvisible_update_timeout", + "fixed_timeout", + "lod_distances", + "main_camera_name", + "smooth_lod", + "fast_forward", + "scale", + "scale_velocity", + "scale_time", + "tight_bounding_box", + "category", + + // Particle Technique + "technique", + "visual_particle_quota", + "emitted_emitter_quota", + "emitted_affector_quota", + "emitted_technique_quota", + "emitted_system_quota", + "lod_index", + "default_particle_width", + "default_particle_height", + "default_particle_depth", + "spatial_hashing_cell_dimension", + "spatial_hashing_cell_overlap", + "spatial_hashtable_size", + "spatial_hashing_update_interval", + "max_velocity", + + // Particle Renderer + "renderer", + "render_queue_group", + "sorting", + "texture_coords_define", + "texture_coords_rows", + "texture_coords_set", + "texture_coords_columns", + "use_soft_particles", + "soft_particles_contrast_power", + "soft_particles_scale", + "soft_particles_delta", + + // Particle Emitter + "emitter", + "direction", + "orientation", + "range_start_orientation", + "range_end_orientation", + "start_orientation_range", + "end_orientation_range", + "duration", + "repeat_delay", + "emits", + "angle", + "emission_rate", + "time_to_live", + "mass", + "start_texture_coords", + "end_texture_coords", + "start_texture_coords_range", + "end_texture_coords_range", + "texture_coords", + "start_colour_range", + "end_colour_range", + "colour", + "all_particle_dimensions", + "particle_width", + "particle_height", + "particle_depth", + "auto_direction", + "force_emission", + + // Particle Affector + "affector", + "mass_affector", + "exclude_emitter", + "affect_specialisation", + "special_default", + "special_ttl_increase", + "special_ttl_decrease", + + // Particle Observer + "observer", + "observe_particle_type", + "observe_interval", + "observe_until_event", + + // Particle Event Handler + "handler", + + // Particle Behaviour + "behaviour", + + // Extern + "extern", + "attachable_distance_threshold", + + // Dynamic Attribute + "control_point", + "min", + "max", + "oscillate_frequency", + "oscillate_phase", + "oscillate_base", + "oscillate_amplitude", + "oscillate_type", + "dyn_oscillate", + "dyn_random", + "dyn_curved_linear", + "dyn_curved_spline", + "sine", + "square", + + // CameraDependency (unused) + "camera_dependency", + + // ------------------------- Renderers ------------------------- + // BeamRenderer + "beam_update_interval", + "beam_max_elements", + "beam_deviation", + "beam_number_segments", + "beam_jump_segments", + "beam_texcoord_direction", + "beam_vertex_colours", + "tcd_u", + "tcd_v", + + // BillboardRenderer + "billboard_type", + "billboard_origin", + "billboard_rotation_type", + "common_direction", + "common_up_vector", + "point_rendering", + "accurate_facing", + "oriented_common", + "oriented_self", + "oriented_shape", + "perpendicular_common", + "perpendicular_self", + "top_left", + "top_center", + "top_right", + "center_left", + "center_right", + "center", + "bottom_left", + "bottom_center", + "bottom_right", + "texcoord", + + // BoxRenderer: No properties itself + + // EntityRenderer + "entity_renderer_mesh_name", + "entity_orientation_type", + "ent_oriented_self", + "ent_oriented_self_mirrored", + "ent_oriented_shape", + + // LightRenderer + "light_renderer_light_type", + "light_renderer_queue_group", + "light_renderer_specular", + "light_renderer_att_range", + "light_renderer_att_constant", + "light_renderer_att_linear", + "light_renderer_att_quadratic", + "light_renderer_spot_inner", + "light_renderer_spot_outer", + "light_renderer_falloff", + "light_renderer_powerscale", + "spot", + "flash_frequency", + "flash_length", + "flash_random", + + // RibbonTrailRenderer + "ribbontrail_vertex_colours", + "ribbontrail_max_elements", + "ribbontrail_length", + "ribbontrail_width", + "ribbontrail_random_initial_colour", + "ribbontrail_initial_colour", + "ribbontrail_colour_change", + + // SphereRenderer: No properties itself + + // ------------------------- Emitters ------------------------- + // BoxEmitter + "box_em_width", + "box_em_height", + "box_em_depth", + + // CircleEmitter + "circle_em_radius", + "circle_em_step", + "circle_em_angle", + "circle_em_random", + "emit_random", + "circle_em_normal", + + // LineEmitter + "line_em_end", + "line_em_max_increment", + "line_em_min_increment", + "line_em_max_deviation", + + // MeshSurfaceEmitter + "mesh_surface_mesh_name", + "mesh_surface_distribution", + "mesh_surface_scale", + "edge", + "heterogeneous_1", + "heterogeneous_2", + "homogeneous", + + // PointEmitter: No properties itself + + // PositionEmitter + "add_position", + "random_position", + + // SlaveEmitter + "master_technique_name", + "master_emitter_name", + + // SphereSurfaceEmitter + "sphere_surface_em_radius", + + // VertexEmitter + "vertex_em_step", + "vertex_em_segments", + "vertex_em_iterations", + "vertex_em_mesh_name", + + // ------------------------- Affectors ------------------------- + // AlignAffector + "align_aff_resize", + "resize", + + // BoxCollider + "box_collider_width", + "box_collider_height", + "box_collider_depth", + + // BaseCollider + "friction", + "bouncyness", + "intersection", + "collision_friction", + "collision_bouncyness", + "collision_intersection", + "collision_type", + "bounce", + "flow", + "none", + "point", + "box", + "inner_collision", + + // CollisionAvoidanceAffector + "avoidance_radius", + + // ColourAffector + "time_colour", + "colour_aff_time_colour", + "colour_operation", + "multiply", + "set", + + // FlockCenteringAffector: No properties itself + + // BaseForceAffector + "force_vector", + "force_application", + "force_aff_vector", + "force_aff_application", + "add", + "average", + + // ForceFieldAffector + "forcefield_type", + "realtime", + "matrix", + "delta", + "force", + "octaves", + "frequency", + "amplitude", + "persistence", + "forcefield_size", + "worldsize", + "ignore_negative_x", + "ignore_negative_y", + "ignore_negative_z", + "movement", + "movement_frequency", + + // GeometryRotator + "geom_rot_use_own_rotation", + "geom_rot_rotation_speed", + "geom_rot_axis", + + // GravityAffector + "gravity", + + // InterParticleCollider + "adjustment", + "collision_response", + "ip_adjustment", + "ip_collision_response", + "average_velocity", + "angle_based_velocity", + + // JetAffector + "jet_aff_accel", + + // LineAffector + "end", + "drift", + "line_aff_max_deviation", + "line_aff_time_step", + "line_aff_end", + "line_aff_drift", + + // LinearForceAffector: No properties itself + + // ParticleFollower + "follower_max_distance", + "follower_min_distance", + "max_distance", + "min_distance", + + // PathFollower + "path_follower_point", + + // PlaneCollider + "plane_collider_normal", + + // Randomiser + "rand_aff_max_deviation_x", + "rand_aff_max_deviation_y", + "rand_aff_max_deviation_z", + "max_deviation_x", + "max_deviation_y", + "max_deviation_z", + "rand_aff_time_step", + "rand_aff_direction", + "use_direction", + + // ScaleAffector + "xyz_scale", + "x_scale", + "y_scale", + "z_scale", + + // ScaleVelocityAffector + "velocity_scale", + "stop_at_flip", + + // SineForceAffector + "sinef_aff_frequency_min", + "sinef_aff_frequency_max", + "min_frequency", + "max_frequency", + + // SphereCollider + "sphere_collider_radius", + + // TextureAnimator + "time_step_animation", + "texture_coords_start", + "texture_coords_end", + "start_texture_coords_range", + "end_texture_coords_range", + "texture_animation_type", + "texture_start_random", + "loop", + "up_down", + "random", + + // TextureRotator + "tex_rot_use_own_rotation", + "tex_rot_speed", + "tex_rot_rotation", + + // VelocityMatchingAffector + "velocity_matching_radius", + + // VortexAffector + "vortex_aff_vector", + "vortex_aff_speed", + + // ------------------------- Observers ------------------------- + // OnClearObserver: No properties itself + + // OnCollisionObserver: No properties itself + + // OnCountObserver + "count_threshold", + + // OnEmissionObserver: No properties itself + + // OnEventFlagObserver + "event_flag", + + // OnExpireObserver: No properties itself + + // OnPositionObserver + "position_x", + "position_y", + "position_z", + + // OnQuotaObserver: No properties itself + + // OnRandomObserver + "random_threshold", + + // OnTimeObserver + "on_time", + + // OnVelocityObserver + "velocity_threshold", + + // ------------------------- Event Handlers ------------------------- + // DoAffectorEventHandler + "force_affector", + "pre_post", + + // DoEnableComponentEventHandler + "enable_component", + "emitter_component", + "affector_component", + "technique_component", + "observer_component", + + // DoExpireEventHandler: No properties itself + + // DoFreezeEventHandler: No properties itself + + // DoPlacementParticleEventHandler + "force_emitter", + "number_of_particles", + "inherit_position", + "inherit_direction", + "inherit_orientation", + "inherit_time_to_live", + "inherit_mass", + "inherit_texture_coord", + "inherit_colour", + "inherit_width", + "inherit_height", + "inherit_depth", + + // DoScaleEventHandler + "scale_fraction", + "scale_type", + "st_time_to_live", + "st_velocity", + + // DoStopSystemEventHandler: No properties itself + + // ------------------------- Behaviours ------------------------- + // SlaveBehaviour: No properties itself + + // ------------------------- Externs ------------------------- + // BoxColliderExtern: Defined in BoxCollider + + // GravityExtern: Defined in GravityAffector + + // PhysXActorExtern + "physx_shape", + "physx_actor_group", + "physx_shape_group", + "physx_group_mask", + "physx_angular_velocity", + "physx_angular_damping", + "physx_material_index", + "shape", + "actor_group", + "shape_group", + "angular_velocity", + "angular_damping", + "material_index", + "Box", + "Sphere", + "Capsule", + + // PhysXFluidExtern + "rest_particles_per_meter", + "rest_density", + "kernel_radius_multiplier", + "motion_limit_multiplier", + "collision_distance_multiplier", + "packet_size_multiplier", + "stiffness", + "viscosity", + "surface_tension", + "damping", + "external_acceleration", + "restitution_for_static_shapes", + "dynamic_friction_for_static_shapes", + "static_friction_for_static_shapes", + "attraction_for_static_shapes", + "restitution_for_dynamic_shapes", + "dynamic_friction_for_dynamic_shapes", + "static_friction_for_dynamic_shapes", + "attraction_for_dynamic_shapes", + "collision_response_coefficient", + "collision_group", + "simulation_method", + "collision_method", + "flags", + "visualization", + "disable_gravity", + "collision_twoway", + "fluid_enabled", + "hardware", + "priority_mode", + "project_to_plane", + "strict_cooking_format", + "intercollision", + "no_intercollision", + "mix_intercollision", + "static", + "dynamic", + + // SceneDecoratorExtern + "scene_mesh_name", + "scene_material_name", + "scene_node_scale", + "scene_node_position", + + // SphereColliderExtern: Defined in SphereCollider + + // VortexExtern: Defined in VortexAffector +}; + PUScriptTranslator::PUScriptTranslator(void) { } diff --git a/extensions/Particle3D/PU/CCPUScriptTranslator.h b/extensions/Particle3D/PU/CCPUScriptTranslator.h index b90c64e2ddd5..4655c4cc4b0e 100644 --- a/extensions/Particle3D/PU/CCPUScriptTranslator.h +++ b/extensions/Particle3D/PU/CCPUScriptTranslator.h @@ -589,600 +589,8 @@ enum eDefineStaticToken TOKEN_SCENE_POSITION }; -// Static tokens: Note, that the order must be the same as the enum -static const std::string token[1000] = -{ - // Generic - "group_mask", - "acceleration", - "max_increment", - "min_increment", - "number_of_iterations", - "colour_change", - "initial_colour", - "random_initial_colour", - "use_vertex_colours", - "use_own_rotation", - "max_deviation", - "time_step", - "box_width", - "box_height", - "box_depth", - "velocity", - "speed", - "rotation_speed", - "rotation", - "rotation_axis", - "normal", - "step", - "number_of_segments", - "max_elements", - "update_interval", - "distance_threshold", - "material", - "mesh_name", - "radius", - "enabled", - "position", - "keep_local", - "less_than", - "greater_than", - "equals", - "visual_particle", - "emitter_particle", - "affector_particle", - "technique_particle", - "system_particle", - "point", - "vertex", - "increase", - "alias", - "use_alias", - "since_start_system", - - // Particle System - "system", - "iteration_interval", - "nonvisible_update_timeout", - "fixed_timeout", - "lod_distances", - "main_camera_name", - "smooth_lod", - "fast_forward", - "scale", - "scale_velocity", - "scale_time", - "tight_bounding_box", - "category", - - // Particle Technique - "technique", - "visual_particle_quota", - "emitted_emitter_quota", - "emitted_affector_quota", - "emitted_technique_quota", - "emitted_system_quota", - "lod_index", - "default_particle_width", - "default_particle_height", - "default_particle_depth", - "spatial_hashing_cell_dimension", - "spatial_hashing_cell_overlap", - "spatial_hashtable_size", - "spatial_hashing_update_interval", - "max_velocity", - - // Particle Renderer - "renderer", - "render_queue_group", - "sorting", - "texture_coords_define", - "texture_coords_rows", - "texture_coords_set", - "texture_coords_columns", - "use_soft_particles", - "soft_particles_contrast_power", - "soft_particles_scale", - "soft_particles_delta", - - // Particle Emitter - "emitter", - "direction", - "orientation", - "range_start_orientation", - "range_end_orientation", - "start_orientation_range", - "end_orientation_range", - "duration", - "repeat_delay", - "emits", - "angle", - "emission_rate", - "time_to_live", - "mass", - "start_texture_coords", - "end_texture_coords", - "start_texture_coords_range", - "end_texture_coords_range", - "texture_coords", - "start_colour_range", - "end_colour_range", - "colour", - "all_particle_dimensions", - "particle_width", - "particle_height", - "particle_depth", - "auto_direction", - "force_emission", - - // Particle Affector - "affector", - "mass_affector", - "exclude_emitter", - "affect_specialisation", - "special_default", - "special_ttl_increase", - "special_ttl_decrease", - - // Particle Observer - "observer", - "observe_particle_type", - "observe_interval", - "observe_until_event", - - // Particle Event Handler - "handler", - - // Particle Behaviour - "behaviour", - - // Extern - "extern", - "attachable_distance_threshold", - - // Dynamic Attribute - "control_point", - "min", - "max", - "oscillate_frequency", - "oscillate_phase", - "oscillate_base", - "oscillate_amplitude", - "oscillate_type", - "dyn_oscillate", - "dyn_random", - "dyn_curved_linear", - "dyn_curved_spline", - "sine", - "square", - - // CameraDependency (unused) - "camera_dependency", - - // ------------------------- Renderers ------------------------- - // BeamRenderer - "beam_update_interval", - "beam_max_elements", - "beam_deviation", - "beam_number_segments", - "beam_jump_segments", - "beam_texcoord_direction", - "beam_vertex_colours", - "tcd_u", - "tcd_v", - - // BillboardRenderer - "billboard_type", - "billboard_origin", - "billboard_rotation_type", - "common_direction", - "common_up_vector", - "point_rendering", - "accurate_facing", - "oriented_common", - "oriented_self", - "oriented_shape", - "perpendicular_common", - "perpendicular_self", - "top_left", - "top_center", - "top_right", - "center_left", - "center_right", - "center", - "bottom_left", - "bottom_center", - "bottom_right", - "texcoord", - - // BoxRenderer: No properties itself - - // EntityRenderer - "entity_renderer_mesh_name", - "entity_orientation_type", - "ent_oriented_self", - "ent_oriented_self_mirrored", - "ent_oriented_shape", - - // LightRenderer - "light_renderer_light_type", - "light_renderer_queue_group", - "light_renderer_specular", - "light_renderer_att_range", - "light_renderer_att_constant", - "light_renderer_att_linear", - "light_renderer_att_quadratic", - "light_renderer_spot_inner", - "light_renderer_spot_outer", - "light_renderer_falloff", - "light_renderer_powerscale", - "spot", - "flash_frequency", - "flash_length", - "flash_random", - - // RibbonTrailRenderer - "ribbontrail_vertex_colours", - "ribbontrail_max_elements", - "ribbontrail_length", - "ribbontrail_width", - "ribbontrail_random_initial_colour", - "ribbontrail_initial_colour", - "ribbontrail_colour_change", - - // SphereRenderer: No properties itself - - // ------------------------- Emitters ------------------------- - // BoxEmitter - "box_em_width", - "box_em_height", - "box_em_depth", - - // CircleEmitter - "circle_em_radius", - "circle_em_step", - "circle_em_angle", - "circle_em_random", - "emit_random", - "circle_em_normal", - - // LineEmitter - "line_em_end", - "line_em_max_increment", - "line_em_min_increment", - "line_em_max_deviation", - - // MeshSurfaceEmitter - "mesh_surface_mesh_name", - "mesh_surface_distribution", - "mesh_surface_scale", - "edge", - "heterogeneous_1", - "heterogeneous_2", - "homogeneous", - - // PointEmitter: No properties itself - - // PositionEmitter - "add_position", - "random_position", - - // SlaveEmitter - "master_technique_name", - "master_emitter_name", - - // SphereSurfaceEmitter - "sphere_surface_em_radius", - - // VertexEmitter - "vertex_em_step", - "vertex_em_segments", - "vertex_em_iterations", - "vertex_em_mesh_name", - - // ------------------------- Affectors ------------------------- - // AlignAffector - "align_aff_resize", - "resize", - - // BoxCollider - "box_collider_width", - "box_collider_height", - "box_collider_depth", - - // BaseCollider - "friction", - "bouncyness", - "intersection", - "collision_friction", - "collision_bouncyness", - "collision_intersection", - "collision_type", - "bounce", - "flow", - "none", - "point", - "box", - "inner_collision", - - // CollisionAvoidanceAffector - "avoidance_radius", - - // ColourAffector - "time_colour", - "colour_aff_time_colour", - "colour_operation", - "multiply", - "set", - - // FlockCenteringAffector: No properties itself - - // BaseForceAffector - "force_vector", - "force_application", - "force_aff_vector", - "force_aff_application", - "add", - "average", - - // ForceFieldAffector - "forcefield_type", - "realtime", - "matrix", - "delta", - "force", - "octaves", - "frequency", - "amplitude", - "persistence", - "forcefield_size", - "worldsize", - "ignore_negative_x", - "ignore_negative_y", - "ignore_negative_z", - "movement", - "movement_frequency", - - // GeometryRotator - "geom_rot_use_own_rotation", - "geom_rot_rotation_speed", - "geom_rot_axis", - - // GravityAffector - "gravity", - - // InterParticleCollider - "adjustment", - "collision_response", - "ip_adjustment", - "ip_collision_response", - "average_velocity", - "angle_based_velocity", - - // JetAffector - "jet_aff_accel", - - // LineAffector - "end", - "drift", - "line_aff_max_deviation", - "line_aff_time_step", - "line_aff_end", - "line_aff_drift", - - // LinearForceAffector: No properties itself - - // ParticleFollower - "follower_max_distance", - "follower_min_distance", - "max_distance", - "min_distance", - - // PathFollower - "path_follower_point", - - // PlaneCollider - "plane_collider_normal", - - // Randomiser - "rand_aff_max_deviation_x", - "rand_aff_max_deviation_y", - "rand_aff_max_deviation_z", - "max_deviation_x", - "max_deviation_y", - "max_deviation_z", - "rand_aff_time_step", - "rand_aff_direction", - "use_direction", - - // ScaleAffector - "xyz_scale", - "x_scale", - "y_scale", - "z_scale", - - // ScaleVelocityAffector - "velocity_scale", - "stop_at_flip", - - // SineForceAffector - "sinef_aff_frequency_min", - "sinef_aff_frequency_max", - "min_frequency", - "max_frequency", - - // SphereCollider - "sphere_collider_radius", - - // TextureAnimator - "time_step_animation", - "texture_coords_start", - "texture_coords_end", - "start_texture_coords_range", - "end_texture_coords_range", - "texture_animation_type", - "texture_start_random", - "loop", - "up_down", - "random", - - // TextureRotator - "tex_rot_use_own_rotation", - "tex_rot_speed", - "tex_rot_rotation", - - // VelocityMatchingAffector - "velocity_matching_radius", - - // VortexAffector - "vortex_aff_vector", - "vortex_aff_speed", - - // ------------------------- Observers ------------------------- - // OnClearObserver: No properties itself - - // OnCollisionObserver: No properties itself - - // OnCountObserver - "count_threshold", - - // OnEmissionObserver: No properties itself - - // OnEventFlagObserver - "event_flag", - - // OnExpireObserver: No properties itself - - // OnPositionObserver - "position_x", - "position_y", - "position_z", - - // OnQuotaObserver: No properties itself - - // OnRandomObserver - "random_threshold", - - // OnTimeObserver - "on_time", - - // OnVelocityObserver - "velocity_threshold", - - // ------------------------- Event Handlers ------------------------- - // DoAffectorEventHandler - "force_affector", - "pre_post", - - // DoEnableComponentEventHandler - "enable_component", - "emitter_component", - "affector_component", - "technique_component", - "observer_component", - - // DoExpireEventHandler: No properties itself - - // DoFreezeEventHandler: No properties itself - - // DoPlacementParticleEventHandler - "force_emitter", - "number_of_particles", - "inherit_position", - "inherit_direction", - "inherit_orientation", - "inherit_time_to_live", - "inherit_mass", - "inherit_texture_coord", - "inherit_colour", - "inherit_width", - "inherit_height", - "inherit_depth", - - // DoScaleEventHandler - "scale_fraction", - "scale_type", - "st_time_to_live", - "st_velocity", - - // DoStopSystemEventHandler: No properties itself - - // ------------------------- Behaviours ------------------------- - // SlaveBehaviour: No properties itself - - // ------------------------- Externs ------------------------- - // BoxColliderExtern: Defined in BoxCollider - - // GravityExtern: Defined in GravityAffector - - // PhysXActorExtern - "physx_shape", - "physx_actor_group", - "physx_shape_group", - "physx_group_mask", - "physx_angular_velocity", - "physx_angular_damping", - "physx_material_index", - "shape", - "actor_group", - "shape_group", - "angular_velocity", - "angular_damping", - "material_index", - "Box", - "Sphere", - "Capsule", - - // PhysXFluidExtern - "rest_particles_per_meter", - "rest_density", - "kernel_radius_multiplier", - "motion_limit_multiplier", - "collision_distance_multiplier", - "packet_size_multiplier", - "stiffness", - "viscosity", - "surface_tension", - "damping", - "external_acceleration", - "restitution_for_static_shapes", - "dynamic_friction_for_static_shapes", - "static_friction_for_static_shapes", - "attraction_for_static_shapes", - "restitution_for_dynamic_shapes", - "dynamic_friction_for_dynamic_shapes", - "static_friction_for_dynamic_shapes", - "attraction_for_dynamic_shapes", - "collision_response_coefficient", - "collision_group", - "simulation_method", - "collision_method", - "flags", - "visualization", - "disable_gravity", - "collision_twoway", - "fluid_enabled", - "hardware", - "priority_mode", - "project_to_plane", - "strict_cooking_format", - "intercollision", - "no_intercollision", - "mix_intercollision", - "static", - "dynamic", - - // SceneDecoratorExtern - "scene_mesh_name", - "scene_material_name", - "scene_node_scale", - "scene_node_position", - - // SphereColliderExtern: Defined in SphereCollider - - // VortexExtern: Defined in VortexAffector -}; - +// tokens: Note, that the order must be the same as the enum +extern const std::string token[]; /**script translator*/ class PUScriptTranslator diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index c8c4468ee791..488a043470a1 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -328,7 +328,7 @@ bool AssetsManager::uncompress() size_t startIndex=0; - size_t index=fileNameStr.find("/",startIndex); + size_t index=fileNameStr.find('/',startIndex); while(index != std::string::npos) { @@ -356,7 +356,7 @@ bool AssetsManager::uncompress() startIndex=index+1; - index=fileNameStr.find("/",startIndex); + index=fileNameStr.find('/',startIndex); } diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 381686bace6a..42f6117b896b 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -989,7 +989,7 @@ void AssetsManagerEx::fileSuccess(const std::string &customId, const std::string // Reduce count only when unit found in _downloadUnits _totalWaitToDownload--; - _percentByFile = 100 * (float)(_totalToDownload - _totalWaitToDownload) / _totalToDownload; + _percent = _percentByFile = 100 * (float)(_totalToDownload - _totalWaitToDownload) / _totalToDownload; // Notify progression event dispatchUpdateEvent(EventAssetsManagerEx::EventCode::UPDATE_PROGRESSION, ""); } diff --git a/external/config.json b/external/config.json index 397689bc81d4..9e9530494269 100644 --- a/external/config.json +++ b/external/config.json @@ -1,6 +1,6 @@ { - "version": "v3-deps-145", - "zip_file_size": "146254799", + "version": "v3-deps-158", + "zip_file_size": "141265643", "repo_name": "cocos2d-x-3rd-party-libs-bin", "repo_parent": "https://github.com/cocos2d/", "move_dirs": { diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 2942d19e6a68..fbd3ab59bba6 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -13,9 +13,8 @@ "build/install-deps-linux.sh", "cmake/Modules/CocosBuildHelpers.cmake", "cmake/Modules/CocosBuildSet.cmake", - "cmake/Modules/CocosCompileOptions.cmake", + "cmake/Modules/CocosConfigDefine.cmake", "cmake/Modules/CocosConfigDepend.cmake", - "cmake/Modules/CocosSelectModule.cmake", "cmake/Modules/FindChipmunk.cmake", "cmake/Modules/FindFMOD.cmake", "cmake/Modules/FindFontconfig.cmake", @@ -32,6 +31,7 @@ "cmake/Modules/FindWebP.cmake", "cmake/Modules/Findflatbuffers.cmake", "cmake/Modules/Findxxhash.cmake", + "cmake/Modules/PreventInSourceBuilds.cmake", "cmake/Modules/iOSBundleInfo.plist.in", "cmake/README.md", "cmake/ios.toolchain.cmake", @@ -1033,7 +1033,6 @@ "cocos/platform/android/java/ant.properties", "cocos/platform/android/java/build.xml", "cocos/platform/android/java/libs/", - "cocos/platform/android/java/libs/EngineDataManager.jar", "cocos/platform/android/java/libs/android-async-http-1.4.9.jar", "cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar", "cocos/platform/android/java/libs/httpclient-4.4.1.1.jar", @@ -1048,7 +1047,6 @@ "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBox.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEngineDataManager.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java", @@ -1074,15 +1072,11 @@ "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp", "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp", "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h", - "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.cpp", - "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxEngineDataManager.h", "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp", "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h", "cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp", "cocos/platform/android/jni/JniHelper.cpp", "cocos/platform/android/jni/JniHelper.h", - "cocos/platform/android/jni/ProcessCpuTracker.cpp", - "cocos/platform/android/jni/ProcessCpuTracker.h", "cocos/platform/android/jni/TouchesJni.cpp", "cocos/platform/android/libcocos2dx-with-controller/AndroidManifest.xml", "cocos/platform/android/libcocos2dx-with-controller/build.gradle", @@ -1136,18 +1130,6 @@ "cocos/platform/mac/CCPlatformDefine-mac.h", "cocos/platform/mac/CCStdC-mac.h", "cocos/platform/mac/cocos2d-prefix.pch", - "cocos/platform/tizen/CCApplication-tizen.cpp", - "cocos/platform/tizen/CCApplication-tizen.h", - "cocos/platform/tizen/CCCommon-tizen.cpp", - "cocos/platform/tizen/CCDevice-tizen.cpp", - "cocos/platform/tizen/CCFileUtils-tizen.cpp", - "cocos/platform/tizen/CCFileUtils-tizen.h", - "cocos/platform/tizen/CCGL-tizen.h", - "cocos/platform/tizen/CCGLViewImpl-tizen.cpp", - "cocos/platform/tizen/CCGLViewImpl-tizen.h", - "cocos/platform/tizen/CCPlatformDefine-tizen.h", - "cocos/platform/tizen/CCStdC-tizen.cpp", - "cocos/platform/tizen/CCStdC-tizen.h", "cocos/platform/win32/CCApplication-win32.cpp", "cocos/platform/win32/CCApplication-win32.h", "cocos/platform/win32/CCCommon-win32.cpp", @@ -1163,55 +1145,6 @@ "cocos/platform/win32/compat/stdint.h", "cocos/platform/win32/inet_pton_mingw.cpp", "cocos/platform/win32/inet_pton_mingw.h", - "cocos/platform/win8.1-universal/Cocos2dRenderer.cpp", - "cocos/platform/win8.1-universal/Cocos2dRenderer.h", - "cocos/platform/win8.1-universal/OpenGLES.cpp", - "cocos/platform/win8.1-universal/OpenGLES.h", - "cocos/platform/win8.1-universal/OpenGLESPage.xaml", - "cocos/platform/win8.1-universal/OpenGLESPage.xaml.cpp", - "cocos/platform/win8.1-universal/OpenGLESPage.xaml.h", - "cocos/platform/win8.1-universal/cocos2d-js/pch.h", - "cocos/platform/win8.1-universal/pch.cpp", - "cocos/platform/win8.1-universal/pch.h", - "cocos/platform/winrt/CCApplication.cpp", - "cocos/platform/winrt/CCApplication.h", - "cocos/platform/winrt/CCCommon.cpp", - "cocos/platform/winrt/CCDevice.cpp", - "cocos/platform/winrt/CCFileUtilsWinRT.cpp", - "cocos/platform/winrt/CCFileUtilsWinRT.h", - "cocos/platform/winrt/CCFreeTypeFont.cpp", - "cocos/platform/winrt/CCFreeTypeFont.h", - "cocos/platform/winrt/CCGL.h", - "cocos/platform/winrt/CCGLViewImpl-winrt.cpp", - "cocos/platform/winrt/CCGLViewImpl-winrt.h", - "cocos/platform/winrt/CCGLViewImpl.cpp", - "cocos/platform/winrt/CCGLViewImpl.h", - "cocos/platform/winrt/CCPThreadWinRT.cpp", - "cocos/platform/winrt/CCPThreadWinRT.h", - "cocos/platform/winrt/CCPlatformDefine-winrt.h", - "cocos/platform/winrt/CCPrecompiledShaders.cpp", - "cocos/platform/winrt/CCPrecompiledShaders.h", - "cocos/platform/winrt/CCStdC.cpp", - "cocos/platform/winrt/CCStdC.h", - "cocos/platform/winrt/CCWinRTUtils.cpp", - "cocos/platform/winrt/CCWinRTUtils.h", - "cocos/platform/winrt/InputEvent.cpp", - "cocos/platform/winrt/InputEvent.h", - "cocos/platform/winrt/InputEventTypes.h", - "cocos/platform/winrt/Keyboard-winrt.cpp", - "cocos/platform/winrt/Keyboard-winrt.h", - "cocos/platform/winrt/WICImageLoader-winrt.cpp", - "cocos/platform/winrt/WICImageLoader-winrt.h", - "cocos/platform/winrt/inet_ntop_winrt.cpp", - "cocos/platform/winrt/inet_ntop_winrt.h", - "cocos/platform/winrt/inet_pton_winrt.cpp", - "cocos/platform/winrt/inet_pton_winrt.h", - "cocos/platform/winrt/pch.cpp", - "cocos/platform/winrt/pch.h", - "cocos/platform/winrt/sha1.cpp", - "cocos/platform/winrt/sha1.h", - "cocos/platform/winrt/shaders/precompiledshaders.h", - "cocos/platform/winrt/targetver.h", "cocos/precheader.cpp", "cocos/precheader.h", "cocos/renderer/CCBatchCommand.cpp", @@ -1268,6 +1201,8 @@ "cocos/renderer/CCVertexIndexData.cpp", "cocos/renderer/CCVertexIndexData.h", "cocos/renderer/CMakeLists.txt", + "cocos/renderer/ccGLStateCache.cpp", + "cocos/renderer/ccGLStateCache.h", "cocos/renderer/ccShader_3D_Color.frag", "cocos/renderer/ccShader_3D_ColorNormal.frag", "cocos/renderer/ccShader_3D_ColorNormalTex.frag", @@ -2344,9 +2279,6 @@ "external/chipmunk/prebuilt/tizen/arm/libchipmunk.a", "external/chipmunk/prebuilt/tizen/x86/libchipmunk.a", "external/chipmunk/prebuilt/tvos/libchipmunk.a", - "external/chipmunk/prebuilt/win10/arm/chipmunk.lib", - "external/chipmunk/prebuilt/win10/win32/chipmunk.lib", - "external/chipmunk/prebuilt/win10/x64/chipmunk.lib", "external/chipmunk/prebuilt/win32/debug-lib/libchipmunk.lib", "external/chipmunk/prebuilt/win32/release-lib/libchipmunk.lib", "external/clipper/CMakeLists.txt", diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index 5375c9488e29..bbe2df49532e 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -33,9 +33,7 @@ set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cocos2d) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) -if(NOT USE_COCOS_PREBUILT) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) -endif() +add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) # record sources, headers, resources... set(GAME_SOURCE) @@ -140,11 +138,14 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) endif() diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index fd2d4484ffc2..5737362918fb 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -124,11 +124,7 @@ void HelloWorld::menuCloseCallback(Ref* pSender) //Close the cocos2d-x game scene and quit the application Director::getInstance()->end(); - #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif - - /*To navigate back to native iOS screen(if present) without quitting the application ,do not use Director::getInstance()->end() and exit(0) as given above,instead trigger a custom event created in RootViewController.mm as below*/ + /*To navigate back to native iOS screen(if present) without quitting the application ,do not use Director::getInstance()->end() as given above,instead trigger a custom event created in RootViewController.mm as below*/ //EventCustom customEndEvent("game_scene_close_event"); //_eventDispatcher->dispatchEvent(&customEndEvent); diff --git a/templates/cpp-template-default/Resources/CloseNormal.png b/templates/cpp-template-default/Resources/CloseNormal.png index b45c89c56b57..b65498c94159 100644 Binary files a/templates/cpp-template-default/Resources/CloseNormal.png and b/templates/cpp-template-default/Resources/CloseNormal.png differ diff --git a/templates/cpp-template-default/Resources/CloseSelected.png b/templates/cpp-template-default/Resources/CloseSelected.png index cbb2549eb391..306749ecd20d 100644 Binary files a/templates/cpp-template-default/Resources/CloseSelected.png and b/templates/cpp-template-default/Resources/CloseSelected.png differ diff --git a/templates/cpp-template-default/Resources/HelloWorld.png b/templates/cpp-template-default/Resources/HelloWorld.png index 7b9c94cdf1f9..21d4326855d2 100644 Binary files a/templates/cpp-template-default/Resources/HelloWorld.png and b/templates/cpp-template-default/Resources/HelloWorld.png differ diff --git a/templates/cpp-template-default/proj.android/app/build.gradle b/templates/cpp-template-default/proj.android/app/build.gradle index 853e2a298a47..89de232b5cd2 100644 --- a/templates/cpp-template-default/proj.android/app/build.gradle +++ b/templates/cpp-template-default/proj.android/app/build.gradle @@ -34,9 +34,8 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { targets 'MyGame' - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/templates/cpp-template-default/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/templates/cpp-template-default/proj.android/app/res/mipmap-hdpi/ic_launcher.png index bfaa190919f6..45ee51d15f96 100644 Binary files a/templates/cpp-template-default/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/templates/cpp-template-default/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/templates/cpp-template-default/proj.android/app/res/mipmap-mdpi/ic_launcher.png index a645020762e3..0dd2a608998e 100644 Binary files a/templates/cpp-template-default/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/templates/cpp-template-default/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/templates/cpp-template-default/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index fe20b650dd25..a32f16f930b3 100644 Binary files a/templates/cpp-template-default/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/templates/cpp-template-default/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/cpp-template-default/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 2c741020fbfc..332f268edc46 100644 Binary files a/templates/cpp-template-default/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/templates/cpp-template-default/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/cpp-template-default/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java b/templates/cpp-template-default/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java index 3164b839ae0a..661fe75fda9b 100644 --- a/templates/cpp-template-default/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java +++ b/templates/cpp-template-default/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java @@ -26,6 +26,9 @@ of this software and associated documentation files (the "Software"), to deal import android.os.Bundle; import org.cocos2dx.lib.Cocos2dxActivity; +import android.os.Build; +import android.view.WindowManager; +import android.view.WindowManager.LayoutParams; public class AppActivity extends Cocos2dxActivity { @@ -41,6 +44,13 @@ protected void onCreate(Bundle savedInstanceState) { // Don't need to finish it again since it's finished in super.onCreate . return; } + // Make sure we're running on Pie or higher to change cutout mode + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + // Enable rendering into the cutout area + WindowManager.LayoutParams lp = getWindow().getAttributes(); + lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + getWindow().setAttributes(lp); + } // DO OTHER INITIALIZATION BELOW } diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png index 8e39c19f8ce9..8ead23e36507 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png index 2057b64dc0e1..775685daca94 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png index e2a06e67e7ed..0500184c869c 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png index 05edea8beaa6..f0f8b7fe9833 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png index 4c2e5218109a..5287e50a7986 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png index 2057b64dc0e1..775685daca94 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png index eac54d0dd34d..d9c7ab446bb7 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png index 4064e72d9c59..ac381bc20e85 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png index 6462379729d3..ef38d4500a80 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png index 9fdebe2d4fb4..4fcc6fddffe1 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png index 621a5ef39632..c3807861ad29 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png index db78708ef41d..d4bc53132ce3 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png index faf1ddab0f65..2c573c8df4c3 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png index 79157e79f86f..1526615c02d1 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png index ef5c3ada3a3a..8a1fa1850c03 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png index ba865da88d1d..8aa82506d0d1 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png index 32451e130ccd..6bf801d17507 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and b/templates/cpp-template-default/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/LaunchScreenBackground.png b/templates/cpp-template-default/proj.ios_mac/ios/LaunchScreenBackground.png index 167cdcb73ed6..dadccee68624 100644 Binary files a/templates/cpp-template-default/proj.ios_mac/ios/LaunchScreenBackground.png and b/templates/cpp-template-default/proj.ios_mac/ios/LaunchScreenBackground.png differ diff --git a/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm b/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm index a4c37af784ab..7f5ca28f740f 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm +++ b/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm @@ -107,8 +107,15 @@ - (BOOL)prefersStatusBarHidden { } // Controls the application's preferred home indicator auto-hiding when this view controller is shown. +// (better use preferredScreenEdgesDeferringSystemGestures for controlling the home indicator) - (BOOL)prefersHomeIndicatorAutoHidden { - return YES; + return NO; +} + +// HOME Indicator need to be tapped twice +-(UIRectEdge)preferredScreenEdgesDeferringSystemGestures +{ + return UIRectEdgeBottom; } - (void)didReceiveMemoryWarning { diff --git a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj index bedc593a5e6c..957b98e9746f 100644 --- a/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj +++ b/templates/cpp-template-default/proj.win32/HelloCpp.vcxproj @@ -106,7 +106,7 @@ if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y +xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y $(TargetName).cab $(TargetFileName) @@ -164,9 +164,6 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y {b7c2a162-dec9-4418-972e-240ab3cbfcae} - - {929480e7-23c0-4df6-8456-096d71547116} -
diff --git a/templates/js-template-default/CMakeLists.txt b/templates/js-template-default/CMakeLists.txt index 6b5928698bdc..6210b1a97eb5 100644 --- a/templates/js-template-default/CMakeLists.txt +++ b/templates/js-template-default/CMakeLists.txt @@ -35,10 +35,8 @@ set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/cocos2d-x) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) -if(NOT USE_COCOS_PREBUILT) - set(BUILD_JS_LIBS ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) -endif() +set(BUILD_JS_LIBS ON) +add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) # script and source files info, not need to compile set(res_main_files @@ -121,6 +119,8 @@ else() add_library(${APP_NAME} SHARED ${APP_SRC}) add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform) target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/scripting/js-bindings/proj.android ${ENGINE_BINARY_PATH}/cocos/js-android) + target_link_libraries(${APP_NAME} -Wl,--whole-archive js_android_spec -Wl,--no-whole-archive) endif() target_link_libraries(${APP_NAME} jscocos2d) @@ -137,15 +137,18 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() # copy resource on linux or WINDOWS if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR} FILES ${res_main_files}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/script FOLDERS ${res_script_folders}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FILES ${res_main_files}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/script FOLDERS ${res_script_folders}) endif() diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 35bd4b2aee30..31af380fb11a 100644 --- a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -95,7 +95,6 @@ AppDelegate::~AppDelegate() #elif USE_SIMPLE_AUDIO_ENGINE SimpleAudioEngine::end(); #endif - ScriptEngineManager::destroyInstance(); } void AppDelegate::initGLContextAttrs() diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle b/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle index 6e9be754e89b..bc6dd4474644 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/app/build.gradle @@ -33,9 +33,8 @@ android { } else if (PROP_BUILD_TYPE == 'cmake') { cmake { - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_JS_LIBS=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk b/templates/js-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk index 1a2a6f9dfefb..88eba2f5e707 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := cocos2djs_shared -LOCAL_MODULE_FILENAME := libccjs +LOCAL_MODULE_FILENAME := libcocos2djs LOCAL_SRC_FILES := hellojavascript/main.cpp \ ../../../Classes/AppDelegate.cpp diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png index bfaa190919f6..45ee51d15f96 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png index a645020762e3..0dd2a608998e 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index fe20b650dd25..a32f16f930b3 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 2c741020fbfc..332f268edc46 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/templates/js-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png index 8e39c19f8ce9..8ead23e36507 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png index 2057b64dc0e1..775685daca94 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png index e2a06e67e7ed..0500184c869c 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png index 05edea8beaa6..f0f8b7fe9833 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png index 4c2e5218109a..5287e50a7986 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png index 2057b64dc0e1..775685daca94 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png index eac54d0dd34d..d9c7ab446bb7 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png index 4064e72d9c59..ac381bc20e85 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png index 6462379729d3..ef38d4500a80 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png index 9fdebe2d4fb4..4fcc6fddffe1 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png index 621a5ef39632..c3807861ad29 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png index b92db3c69211..a5b49ccbb199 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png index db78708ef41d..d4bc53132ce3 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png index faf1ddab0f65..2c573c8df4c3 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png index 79157e79f86f..1526615c02d1 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png index ef5c3ada3a3a..8a1fa1850c03 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png index ba865da88d1d..8aa82506d0d1 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png index 32451e130ccd..6bf801d17507 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png index 0fc9c728be92..dadccee68624 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm index 37144e420fce..8c6969f1619b 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm @@ -107,8 +107,15 @@ - (BOOL)prefersStatusBarHidden { } // Controls the application's preferred home indicator auto-hiding when this view controller is shown. +// (better use preferredScreenEdgesDeferringSystemGestures for controlling the home indicator) - (BOOL)prefersHomeIndicatorAutoHidden { - return YES; + return NO; +} + +// HOME Indicator need to be tapped twice +-(UIRectEdge)preferredScreenEdgesDeferringSystemGestures +{ + return UIRectEdgeBottom; } - (void)didReceiveMemoryWarning { diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln index eeea8258df5d..8486def35509 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln @@ -13,8 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{8C EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\cocos2d-x\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d", "..\..\cocos2d-x\cocos\scripting\js-bindings\proj.win32\libjscocos2d.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj index 7f85742ed92c..f9bc5d6374b5 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -121,11 +121,11 @@ - xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\js-bindings\script" "$(OutDir)\script" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\src" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\res" /D /E /I /F /Y -copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\" /Y -copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y + xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\js-bindings\script" "$(OutDir)\Resources\script\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resources\src\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resources\res\" /D /E /I /F /Y +copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\Resources\" /Y +copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\Resources\" /Y $(TargetName).cab $(TargetFileName) diff --git a/templates/js-template-default/res/HelloWorld.png b/templates/js-template-default/res/HelloWorld.png index 663b27026c3c..21d4326855d2 100644 Binary files a/templates/js-template-default/res/HelloWorld.png and b/templates/js-template-default/res/HelloWorld.png differ diff --git a/templates/lua-template-default/CMakeLists.txt b/templates/lua-template-default/CMakeLists.txt index 60fe55257a4c..bccaa3385157 100644 --- a/templates/lua-template-default/CMakeLists.txt +++ b/templates/lua-template-default/CMakeLists.txt @@ -32,11 +32,8 @@ set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/cocos2d-x) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) -if(NOT USE_COCOS_PREBUILT) - set(BUILD_LUA_LIBS ON) - set(BUILD_SIMU_LIB ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) -endif() +set(BUILD_LUA_LIBS ON) +add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) # script and source files info, not need to compile set(res_res_folders @@ -74,7 +71,6 @@ if(ANDROID) elseif(LINUX) list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp) elseif(WINDOWS) - add_definitions(-D_USRLUASTATIC -D_USRLIBSIMSTATIC) list(APPEND GAME_HEADER ${RUNTIME_SRC_ROOT}/proj.win32/main.h ${RUNTIME_SRC_ROOT}/proj.win32/stdafx.h @@ -141,11 +137,18 @@ else() add_library(${APP_NAME} SHARED ${APP_SRC}) add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform) target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/scripting/lua-bindings/proj.android ${ENGINE_BINARY_PATH}/cocos/lua-android) + target_link_libraries(${APP_NAME} -Wl,--whole-archive lua_android_spec -Wl,--no-whole-archive) endif() target_link_libraries(${APP_NAME} luacocos2d) target_include_directories(${APP_NAME} PRIVATE ${RUNTIME_SRC_ROOT}/Classes) +if(WINDOWS OR MACOSX) + add_subdirectory(${COCOS2DX_ROOT_PATH}/tools/simulator/libsimulator ${ENGINE_BINARY_PATH}/cocos/simulatorlib) + target_link_libraries(${APP_NAME} simulatorlib) +endif() + # mark app resources, resource will be copy auto after mark setup_cocos_app_config(${APP_NAME}) if(APPLE) @@ -157,13 +160,16 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() # copy resource on linux or WINDOWS if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) endif() diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle index 8ee0ea73bab2..74af86252b87 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/build.gradle @@ -33,9 +33,8 @@ android { } else if (PROP_BUILD_TYPE == 'cmake') { cmake { - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk index cbaf6fa7572e..ac8ad7b13703 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/jni/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := cocos2dlua_shared -LOCAL_MODULE_FILENAME := libcclua +LOCAL_MODULE_FILENAME := libcocos2dlua LOCAL_SRC_FILES := \ ../../../Classes/AppDelegate.cpp \ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png index f1ad748a1788..45ee51d15f96 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png index 547cbba56958..0dd2a608998e 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index b27bce848462..a32f16f930b3 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 723f6a591ece..332f268edc46 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/templates/lua-template-default/frameworks/runtime-src/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png index e145d5ccdbfa..8ead23e36507 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png index 85aaa6bfc533..775685daca94 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png index 7b71cd5b0417..0500184c869c 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png index 16ae2c0dfc7c..f0f8b7fe9833 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png index c46164f01ea9..5287e50a7986 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png index 85aaa6bfc533..775685daca94 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png index 5b417a417f87..d9c7ab446bb7 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png index 779f80324838..ac381bc20e85 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png index 0a6c82fd7f22..ef38d4500a80 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png index eb544d174e08..4fcc6fddffe1 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png index 76122a30e30d..c3807861ad29 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png index 6eb8b498ac3f..d4bc53132ce3 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png index 49860ebe26eb..2c573c8df4c3 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png index e45b9f953c23..1526615c02d1 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png index 3ca6ce50acb9..8a1fa1850c03 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png index 87d9c02800da..8aa82506d0d1 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png index 2635200ed976..6bf801d17507 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png index 0fc9c728be92..dadccee68624 100644 Binary files a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png and b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/LaunchScreenBackground.png differ diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm index 37144e420fce..8c6969f1619b 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm @@ -107,8 +107,15 @@ - (BOOL)prefersStatusBarHidden { } // Controls the application's preferred home indicator auto-hiding when this view controller is shown. +// (better use preferredScreenEdgesDeferringSystemGestures for controlling the home indicator) - (BOOL)prefersHomeIndicatorAutoHidden { - return YES; + return NO; +} + +// HOME Indicator need to be tapped twice +-(UIRectEdge)preferredScreenEdgesDeferringSystemGestures +{ + return UIRectEdgeBottom; } - (void)didReceiveMemoryWarning { diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln index a542ebadb134..a8e7d19348ee 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.sln @@ -12,8 +12,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\cocos2d EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\..\cocos2d-x\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj", "{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsimulator", "..\..\cocos2d-x\tools\simulator\libsimulator\proj.win32\libsimulator.vcxproj", "{001B324A-BB91-4E83-875C-C92F75C40857}" diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj index 2e2bd30b3d9e..4b715d11cb5b 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/HelloLua.vcxproj @@ -130,8 +130,8 @@ if not exist "$(LocalDebuggerWorkingDirectory)" mkdir "$(LocalDebuggerWorkingDirectory)" xcopy /Y /Q "$(OutDir)*.dll" "$(LocalDebuggerWorkingDirectory)" -xcopy "$(ProjectDir)..\..\..\res" "$(LocalDebuggerWorkingDirectory)\res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\src" "$(LocalDebuggerWorkingDirectory)\src" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(LocalDebuggerWorkingDirectory)\Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(LocalDebuggerWorkingDirectory)\Resources\src\" /D /E /I /F /Y $(TargetName).cab $(TargetFileName) diff --git a/templates/lua-template-default/res/HelloWorld.png b/templates/lua-template-default/res/HelloWorld.png index 663b27026c3c..21d4326855d2 100644 Binary files a/templates/lua-template-default/res/HelloWorld.png and b/templates/lua-template-default/res/HelloWorld.png differ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index bc896b1791c8..000000000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -#/**************************************************************************** -# Copyright (c) 2013 cocos2d-x.org -# Copyright (c) 2014 martell malone -# Copyright (c) 2015-2017 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. -# ****************************************************************************/ - -# build all test projects, it need the engine library - -# library have been build, on ../CMakeLists.txt, uesed to prevent tests project build engine lib again -set(BUILD_ENGINE_DONE ON) - -# add engine all tests project -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-empty-test ${ENGINE_BINARY_PATH}/tests/cpp-empty-test) - -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/cpp-tests ${ENGINE_BINARY_PATH}/tests/cpp-tests) - -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/js-tests/project ${ENGINE_BINARY_PATH}/tests/js-tests) - -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-empty-test/project ${ENGINE_BINARY_PATH}/tests/lua-empty-test) - -add_subdirectory(${COCOS2DX_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test) diff --git a/tests/cpp-empty-test/CMakeLists.txt b/tests/cpp-empty-test/CMakeLists.txt index f94ed7618007..73e203a5391f 100644 --- a/tests/cpp-empty-test/CMakeLists.txt +++ b/tests/cpp-empty-test/CMakeLists.txt @@ -32,9 +32,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) - if(NOT USE_COCOS_PREBUILT) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - endif() + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() # record sources, headers, resources... @@ -137,11 +135,15 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) endif() diff --git a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp index d8376ddb67b8..7da1770e334d 100644 --- a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp +++ b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp @@ -100,8 +100,4 @@ bool HelloWorld::init() void HelloWorld::menuCloseCallback(Ref* sender) { Director::getInstance()->end(); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif } diff --git a/tests/cpp-empty-test/Resources/bang.png b/tests/cpp-empty-test/Resources/bang.png index e834f4e6b284..a966d03612e3 100644 Binary files a/tests/cpp-empty-test/Resources/bang.png and b/tests/cpp-empty-test/Resources/bang.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20.png b/tests/cpp-empty-test/Resources/icons/Icon-20.png index e145d5ccdbfa..8ead23e36507 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20.png and b/tests/cpp-empty-test/Resources/icons/Icon-20.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png index 85aaa6bfc533..775685daca94 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-20@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png and b/tests/cpp-empty-test/Resources/icons/Icon-20@3x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29.png b/tests/cpp-empty-test/Resources/icons/Icon-29.png index 7b71cd5b0417..0500184c869c 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29.png and b/tests/cpp-empty-test/Resources/icons/Icon-29.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png index 16ae2c0dfc7c..f0f8b7fe9833 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-29@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png index c46164f01ea9..5287e50a7986 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png and b/tests/cpp-empty-test/Resources/icons/Icon-29@3x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40.png b/tests/cpp-empty-test/Resources/icons/Icon-40.png index 85aaa6bfc533..775685daca94 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40.png and b/tests/cpp-empty-test/Resources/icons/Icon-40.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png index 5b417a417f87..d9c7ab446bb7 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-40@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png and b/tests/cpp-empty-test/Resources/icons/Icon-40@3x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-50.png b/tests/cpp-empty-test/Resources/icons/Icon-50.png index 779f80324838..ac381bc20e85 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-50.png and b/tests/cpp-empty-test/Resources/icons/Icon-50.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png index 0a6c82fd7f22..ef38d4500a80 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-50@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-57.png b/tests/cpp-empty-test/Resources/icons/Icon-57.png index eb544d174e08..4fcc6fddffe1 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-57.png and b/tests/cpp-empty-test/Resources/icons/Icon-57.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png index 76122a30e30d..c3807861ad29 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-57@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png index bff5912dd6c2..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-60@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png b/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png index 6eb8b498ac3f..d4bc53132ce3 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png and b/tests/cpp-empty-test/Resources/icons/Icon-60@3x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-72.png b/tests/cpp-empty-test/Resources/icons/Icon-72.png index 49860ebe26eb..2c573c8df4c3 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-72.png and b/tests/cpp-empty-test/Resources/icons/Icon-72.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png index e45b9f953c23..1526615c02d1 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-72@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-76.png b/tests/cpp-empty-test/Resources/icons/Icon-76.png index 3ca6ce50acb9..8a1fa1850c03 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-76.png and b/tests/cpp-empty-test/Resources/icons/Icon-76.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png index 87d9c02800da..8aa82506d0d1 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-76@2x.png differ diff --git a/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png b/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png index 2635200ed976..6bf801d17507 100644 Binary files a/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png and b/tests/cpp-empty-test/Resources/icons/Icon-83.5@2x.png differ diff --git a/tests/cpp-empty-test/Resources/ipad/CloseNormal.png b/tests/cpp-empty-test/Resources/ipad/CloseNormal.png index d78b8473400b..70030ec75a39 100644 Binary files a/tests/cpp-empty-test/Resources/ipad/CloseNormal.png and b/tests/cpp-empty-test/Resources/ipad/CloseNormal.png differ diff --git a/tests/cpp-empty-test/Resources/ipad/CloseSelected.png b/tests/cpp-empty-test/Resources/ipad/CloseSelected.png index 1bc76293e9c8..2227e6e17532 100644 Binary files a/tests/cpp-empty-test/Resources/ipad/CloseSelected.png and b/tests/cpp-empty-test/Resources/ipad/CloseSelected.png differ diff --git a/tests/cpp-empty-test/Resources/ipad/HelloWorld.png b/tests/cpp-empty-test/Resources/ipad/HelloWorld.png index 1f51700601bf..52f4a6a30002 100644 Binary files a/tests/cpp-empty-test/Resources/ipad/HelloWorld.png and b/tests/cpp-empty-test/Resources/ipad/HelloWorld.png differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png b/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png index 49c2fd70fd85..bee9c18843d7 100644 Binary files a/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png and b/tests/cpp-empty-test/Resources/ipadhd/CloseNormal.png differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png b/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png index 9afc31ac8260..311603fed616 100644 Binary files a/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png and b/tests/cpp-empty-test/Resources/ipadhd/CloseSelected.png differ diff --git a/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png b/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png index 6024db93c6fe..6775fb99f1fb 100644 Binary files a/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png and b/tests/cpp-empty-test/Resources/ipadhd/HelloWorld.png differ diff --git a/tests/cpp-empty-test/Resources/iphone/CloseNormal.png b/tests/cpp-empty-test/Resources/iphone/CloseNormal.png index d251e8debda5..a52fde01ea66 100644 Binary files a/tests/cpp-empty-test/Resources/iphone/CloseNormal.png and b/tests/cpp-empty-test/Resources/iphone/CloseNormal.png differ diff --git a/tests/cpp-empty-test/Resources/iphone/CloseSelected.png b/tests/cpp-empty-test/Resources/iphone/CloseSelected.png index 73aa2f96c306..c6527a903f83 100644 Binary files a/tests/cpp-empty-test/Resources/iphone/CloseSelected.png and b/tests/cpp-empty-test/Resources/iphone/CloseSelected.png differ diff --git a/tests/cpp-empty-test/Resources/iphone/HelloWorld.png b/tests/cpp-empty-test/Resources/iphone/HelloWorld.png index 7f5283a35244..ccb48aad5e26 100644 Binary files a/tests/cpp-empty-test/Resources/iphone/HelloWorld.png and b/tests/cpp-empty-test/Resources/iphone/HelloWorld.png differ diff --git a/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml b/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml index a6e5fd179905..9814b1058063 100644 --- a/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml +++ b/tests/cpp-empty-test/proj.android/app/AndroidManifest.xml @@ -6,6 +6,7 @@ diff --git a/tests/cpp-empty-test/proj.android/app/build.gradle b/tests/cpp-empty-test/proj.android/app/build.gradle index 31c4a615c361..f8c1496294ba 100644 --- a/tests/cpp-empty-test/proj.android/app/build.gradle +++ b/tests/cpp-empty-test/proj.android/app/build.gradle @@ -36,7 +36,7 @@ android { targets "cpp_empty_test" arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" - cppFlags "-frtti -fexceptions" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png index 238793cc136a..45ee51d15f96 100644 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/cpp-empty-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png index 4c4e63b86d7c..0dd2a608998e 100644 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/cpp-empty-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index c2d496db60ea..a32f16f930b3 100644 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/cpp-empty-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index a122b9079e73..332f268edc46 100644 Binary files a/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/cpp-empty-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/cpp-empty-test/proj.android/settings.gradle b/tests/cpp-empty-test/proj.android/settings.gradle index 6d8165edecd8..9b2b1a1b72b0 100644 --- a/tests/cpp-empty-test/proj.android/settings.gradle +++ b/tests/cpp-empty-test/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') include ':CppEmptyTest' project(':CppEmptyTest').projectDir = new File(settingsDir, 'app') +rootProject.name = "cpp-empty-test" \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png index 30bbcb86413f..8ead23e36507 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png index 711efd064543..775685daca94 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png index 5ae561463249..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-20@3x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png index 7e23f539fbae..0500184c869c 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png index 49b927749a69..f0f8b7fe9833 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png index 0d82366854e9..5287e50a7986 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-29@3x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png index 711efd064543..775685daca94 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png index 5145c41ac9f3..d9c7ab446bb7 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png index 5ae561463249..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-40@3x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png index 71d2f3f9198c..ac381bc20e85 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png index eba74b036d8d..ef38d4500a80 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-50@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png index 5141e3a7809f..4fcc6fddffe1 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png index 9ed3105bda85..c3807861ad29 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-57@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png index 5ae561463249..a5b49ccbb199 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png index c6c09c213bad..d4bc53132ce3 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-60@3x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png index 3decaa7b4703..2c573c8df4c3 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png index 08adc5b690a7..1526615c02d1 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-72@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png index 5401e968756c..8a1fa1850c03 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png index 5666f790797e..8aa82506d0d1 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-76@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png index 6e3af96874cc..6bf801d17507 100644 Binary files a/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png and b/tests/cpp-empty-test/proj.ios/Images.xcassets/AppIcon-cpp-empty-test.appiconset/Icon-83.5@2x.png differ diff --git a/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png b/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png index 6015b9ac5616..dadccee68624 100644 Binary files a/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png and b/tests/cpp-empty-test/proj.ios/LaunchScreenBackground.png differ diff --git a/tests/cpp-empty-test/proj.win10/App.xaml b/tests/cpp-empty-test/proj.win10/App.xaml deleted file mode 100644 index 4851359f9ef2..000000000000 --- a/tests/cpp-empty-test/proj.win10/App.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - HelloCpp - - - diff --git a/tests/cpp-empty-test/proj.win10/App.xaml.cpp b/tests/cpp-empty-test/proj.win10/App.xaml.cpp deleted file mode 100644 index ca656b80e740..000000000000 --- a/tests/cpp-empty-test/proj.win10/App.xaml.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "App.xaml.h" -#include "OpenGLESPage.xaml.h" - -using namespace Platform; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Activation; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::UI::Xaml::Media::Animation; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Interop; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; -using namespace cocos2d; -using namespace CocosAppWinRT; - -App::App() -{ - InitializeComponent(); - Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); - Resuming += ref new EventHandler(this, &App::OnResuming); -} - -/// -/// Invoked when the application is launched normally by the end user. Other entry points -/// will be used such as when the application is launched to open a specific file. -/// -/// Details about the launch request and process. -void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) -{ - // if our app is prelaunched do nothing - // see https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/handle-app-prelaunch - if (e->PrelaunchActivated) - { - return; - } - - auto rootFrame = dynamic_cast(Window::Current->Content); - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == nullptr) - { - // Create a Frame to act as the navigation context and associate it with - // a SuspensionManager key - rootFrame = ref new Frame(); - - rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); - - if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) - { - // TODO: Restore the saved session state only when appropriate, scheduling the - // final launch steps after the restore is complete - - } - - // Place the frame in the current Window - Window::Current->Content = rootFrame; - // Ensure the current window is active - } - - if (rootFrame->Content == nullptr) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame->Content = mPage = ref new OpenGLESPage(&mOpenGLES); - } - // Ensure the current window is active - Window::Current->Activate(); -} - - -/// -/// Invoked when application execution is being suspended. Application state is saved -/// without knowing whether the application will be terminated or resumed with the contents -/// of memory still intact. -/// -void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) -{ - (void)sender; // Unused parameter - (void)e; // Unused parameter - - if (mPage) - { - mPage->SetVisibility(false); - } -} - -/// -/// Invoked when application execution is being resumed. -/// -/// The source of the resume request. -/// Details about the resume request. -void App::OnResuming(Object ^sender, Object ^args) -{ - (void)sender; // Unused parameter - (void)args; // Unused parameter - - if (mPage) - { - mPage->SetVisibility(true); - } -} - -/// -/// Invoked when Navigation to a certain page fails -/// -/// The Frame which failed navigation -/// Details about the navigation failure -void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) -{ - throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); -} - - - - diff --git a/tests/cpp-empty-test/proj.win10/App.xaml.h b/tests/cpp-empty-test/proj.win10/App.xaml.h deleted file mode 100644 index 57c7f8d8c1ab..000000000000 --- a/tests/cpp-empty-test/proj.win10/App.xaml.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#pragma once - -#include "app.g.h" -#include "OpenGLES.h" -#include "OpenGLESPage.xaml.h" - -namespace CocosAppWinRT -{ - ref class App sealed - { - public: - App(); - virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; - - private: - void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); - void OnResuming(Platform::Object ^sender, Platform::Object ^args); - void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); - - OpenGLESPage^ mPage; - OpenGLES mOpenGLES; - }; -} diff --git a/tests/cpp-empty-test/proj.win10/Assets/LockScreenLogo.scale-200.png b/tests/cpp-empty-test/proj.win10/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 055398215c83..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/SplashScreen.scale-200.png b/tests/cpp-empty-test/proj.win10/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 45b53284c7fb..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/Square150x150Logo.scale-200.png b/tests/cpp-empty-test/proj.win10/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index b1fb1b20f2ef..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.scale-200.png b/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index 0bec8473566f..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index e46502e90b57..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/StoreLogo.png b/tests/cpp-empty-test/proj.win10/Assets/StoreLogo.png deleted file mode 100644 index b225f8df5956..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/StoreLogo.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Assets/Wide310x150Logo.scale-200.png b/tests/cpp-empty-test/proj.win10/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 1f86329a66b6..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/Package.appxmanifest b/tests/cpp-empty-test/proj.win10/Package.appxmanifest deleted file mode 100644 index faf45568f3ec..000000000000 --- a/tests/cpp-empty-test/proj.win10/Package.appxmanifest +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - cpp-empty-test - Microsoft Open Technologies, Inc. - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj b/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj deleted file mode 100644 index 149228aed759..000000000000 --- a/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj +++ /dev/null @@ -1,381 +0,0 @@ - - - - {87ed86e7-a850-433f-88d5-d5f65cff7bf5} - CocosAppWinRT - en-US - 14.0 - true - Windows Store - 8.2 - 10.0.10240.0 - 10.0.10240.0 - - - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - Win32 - - - Release - x64 - - - - Application - true - v141 - - - Application - true - v141 - - - Application - true - v141 - - - Application - false - true - v141 - - - Application - false - true - v141 - - - Application - false - true - v141 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cpp-empty-test_TemporaryKey.pfx - EC3927E758F5E53DC59521EED57869F363F39357 - - - false - - - false - - - false - - - false - - - false - - - false - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - false - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - ProgramDatabase - - - echo "Copying Windows 10.0 Universal App CPP template files" -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)tests\cpp-empty-test\proj.win10\App.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLESPage.xaml.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\OpenGLES.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\Cocos2dRenderer.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\Cocos2dEngine\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.cpp" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq -xcopy "$(EngineRoot)cocos\platform\win8.1-universal\pch.h" "$(EngineRoot)templates\cpp-template-default\proj.win10\App\*" /iycq - - - - - - - ..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml - - - - - - - App.xaml - - - - - Designer - - - - - Designer - - - - - - - - ..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml - - - Create - Create - Create - Create - Create - Create - - - - - App.xaml - - - - - {07c2895d-720c-487d-b7b4-12c293ea533f} - - - {4b3ba10a-941f-4e08-8a50-8a7fcb822bb8} - - - {0c32d479-46d5-46c3-9aa9-0a8ff8320516} - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj.filters b/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj.filters deleted file mode 100644 index ae117eac6baf..000000000000 --- a/tests/cpp-empty-test/proj.win10/cpp-empty-test.vcxproj.filters +++ /dev/null @@ -1,86 +0,0 @@ - - - - - 3d6eacf1-453c-497e-abc1-ba958539b0a5 - bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png - - - {482632c3-0bc4-4037-b656-2646b14d761f} - - - - - - - - - Classes - - - Classes - - - - - - - - - - Classes - - - Classes - - - Classes - - - - - - - - - - - - - - - - - - - - - - - - - - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - \ No newline at end of file diff --git a/tests/cpp-empty-test/proj.win10/cpp-empty-test_TemporaryKey.pfx b/tests/cpp-empty-test/proj.win10/cpp-empty-test_TemporaryKey.pfx deleted file mode 100644 index 8275f7ebd84c..000000000000 Binary files a/tests/cpp-empty-test/proj.win10/cpp-empty-test_TemporaryKey.pfx and /dev/null differ diff --git a/tests/cpp-empty-test/proj.win10/resources.props b/tests/cpp-empty-test/proj.win10/resources.props deleted file mode 100644 index 27ed6639498e..000000000000 --- a/tests/cpp-empty-test/proj.win10/resources.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - <_CustomResource Include="..\Resources\**\*"> - Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) - true - - - - - - - - - - - diff --git a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj index afc79623470e..6222d48ce909 100644 --- a/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj +++ b/tests/cpp-empty-test/proj.win32/cpp-empty-test.vcxproj @@ -14,6 +14,7 @@ {B8BF9E81-35FD-4582-BA1C-B85FA365BABB} cpp-empty-test-win32 Win32Proj + 10.0.17134.0
@@ -99,7 +100,7 @@ -xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y +xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y @@ -136,7 +137,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y -xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y +xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 621adf33110e..f1f5db6b15b6 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -9,9 +9,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) - if(NOT USE_COCOS_PREBUILT) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - endif() + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() # record sources, headers, resources... @@ -347,7 +345,7 @@ if(ANDROID OR IOS) ) endif() -if(WIN32 OR MACOSX OR LINUX) +if(WINDOWS OR MACOSX OR LINUX) list(APPEND GAME_HEADER Classes/WindowTest/WindowTest.h Classes/BugsTest/Bug-14327.h @@ -358,97 +356,86 @@ if(WIN32 OR MACOSX OR LINUX) ) endif() -if(USE_BOX2D) - list(APPEND GAME_HEADER - Classes/Box2DTest/Box2dTest.cpp - Classes/Box2DTestBed/Test.h - Classes/Box2DTestBed/Tests/Chain.h - Classes/Box2DTestBed/Tests/Confined.h - Classes/Box2DTestBed/Tests/PolyCollision.h - Classes/Box2DTestBed/Tests/EdgeTest.h - Classes/Box2DTestBed/Tests/ApplyForce.h - Classes/Box2DTestBed/Tests/Gears.h - Classes/Box2DTestBed/Tests/SliderCrank.h - Classes/Box2DTestBed/Tests/ContinuousTest.h - Classes/Box2DTestBed/Tests/Revolute.h - Classes/Box2DTestBed/Tests/TheoJansen.h - Classes/Box2DTestBed/Tests/Bridge.h - Classes/Box2DTestBed/Tests/CollisionProcessing.h - Classes/Box2DTestBed/Tests/DistanceTest.h - Classes/Box2DTestBed/Tests/PolyShapes.h - Classes/Box2DTestBed/Tests/TimeOfImpact.h - Classes/Box2DTestBed/Tests/ConveyorBelt.h - Classes/Box2DTestBed/Tests/Tiles.h - Classes/Box2DTestBed/Tests/BulletTest.h - Classes/Box2DTestBed/Tests/MotorJoint.h - Classes/Box2DTestBed/Tests/Car.h - Classes/Box2DTestBed/Tests/Mobile.h - Classes/Box2DTestBed/Tests/VaryingFriction.h - Classes/Box2DTestBed/Tests/Rope.h - Classes/Box2DTestBed/Tests/SensorTest.h - Classes/Box2DTestBed/Tests/Pyramid.h - Classes/Box2DTestBed/Tests/VaryingRestitution.h - Classes/Box2DTestBed/Tests/RopeJoint.h - Classes/Box2DTestBed/Tests/VerticalStack.h - Classes/Box2DTestBed/Tests/MobileBalanced.h - Classes/Box2DTestBed/Tests/CompoundShapes.h - Classes/Box2DTestBed/Tests/CollisionFiltering.h - Classes/Box2DTestBed/Tests/Pulleys.h - Classes/Box2DTestBed/Tests/Breakable.h - Classes/Box2DTestBed/Tests/BodyTypes.h - Classes/Box2DTestBed/Tests/DumpShell.h - Classes/Box2DTestBed/Tests/ShapeEditing.h - Classes/Box2DTestBed/Tests/SphereStack.h - Classes/Box2DTestBed/Tests/OneSidedPlatform.h - Classes/Box2DTestBed/Tests/AddPair.h - Classes/Box2DTestBed/Tests/Pinball.h - Classes/Box2DTestBed/Tests/Tumbler.h - Classes/Box2DTestBed/Tests/RayCast.h - Classes/Box2DTestBed/Tests/ConvexHull.h - Classes/Box2DTestBed/Tests/EdgeShapes.h - Classes/Box2DTestBed/Tests/Prismatic.h - Classes/Box2DTestBed/Tests/Dominos.h - Classes/Box2DTestBed/Tests/Web.h - Classes/Box2DTestBed/Tests/CharacterCollision.h - Classes/Box2DTestBed/Tests/DynamicTreeTest.h - Classes/Box2DTestBed/Tests/Cantilever.h - Classes/Box2DTestBed/Box2dView.h - Classes/Box2DTestBed/GLES-Render.h - ) - list(APPEND GAME_SOURCE - Classes/Box2DTest/Box2dTest.cpp - Classes/Box2DTestBed/Box2dView.cpp - Classes/Box2DTestBed/GLES-Render.cpp - Classes/Box2DTestBed/Test.cpp - Classes/Box2DTestBed/TestEntries.cpp - ) - include_directories(${Box2D_INCLUDE_DIRS}) -endif() - -if(USE_BULLET) - list(APPEND GAME_HEADER - Classes/Physics3DTest/Physics3DTest.h - Classes/NavMeshTest/NavMeshTest.h - ) - list(APPEND GAME_SOURCE - Classes/Physics3DTest/Physics3DTest.cpp - Classes/NavMeshTest/NavMeshTest.cpp - ) - include_directories(${BULLET_INCLUDE_DIRS}) -endif() - +list(APPEND GAME_HEADER + Classes/Box2DTest/Box2dTest.cpp + Classes/Box2DTestBed/Test.h + Classes/Box2DTestBed/Tests/Chain.h + Classes/Box2DTestBed/Tests/Confined.h + Classes/Box2DTestBed/Tests/PolyCollision.h + Classes/Box2DTestBed/Tests/EdgeTest.h + Classes/Box2DTestBed/Tests/ApplyForce.h + Classes/Box2DTestBed/Tests/Gears.h + Classes/Box2DTestBed/Tests/SliderCrank.h + Classes/Box2DTestBed/Tests/ContinuousTest.h + Classes/Box2DTestBed/Tests/Revolute.h + Classes/Box2DTestBed/Tests/TheoJansen.h + Classes/Box2DTestBed/Tests/Bridge.h + Classes/Box2DTestBed/Tests/CollisionProcessing.h + Classes/Box2DTestBed/Tests/DistanceTest.h + Classes/Box2DTestBed/Tests/PolyShapes.h + Classes/Box2DTestBed/Tests/TimeOfImpact.h + Classes/Box2DTestBed/Tests/ConveyorBelt.h + Classes/Box2DTestBed/Tests/Tiles.h + Classes/Box2DTestBed/Tests/BulletTest.h + Classes/Box2DTestBed/Tests/MotorJoint.h + Classes/Box2DTestBed/Tests/Car.h + Classes/Box2DTestBed/Tests/Mobile.h + Classes/Box2DTestBed/Tests/VaryingFriction.h + Classes/Box2DTestBed/Tests/Rope.h + Classes/Box2DTestBed/Tests/SensorTest.h + Classes/Box2DTestBed/Tests/Pyramid.h + Classes/Box2DTestBed/Tests/VaryingRestitution.h + Classes/Box2DTestBed/Tests/RopeJoint.h + Classes/Box2DTestBed/Tests/VerticalStack.h + Classes/Box2DTestBed/Tests/MobileBalanced.h + Classes/Box2DTestBed/Tests/CompoundShapes.h + Classes/Box2DTestBed/Tests/CollisionFiltering.h + Classes/Box2DTestBed/Tests/Pulleys.h + Classes/Box2DTestBed/Tests/Breakable.h + Classes/Box2DTestBed/Tests/BodyTypes.h + Classes/Box2DTestBed/Tests/DumpShell.h + Classes/Box2DTestBed/Tests/ShapeEditing.h + Classes/Box2DTestBed/Tests/SphereStack.h + Classes/Box2DTestBed/Tests/OneSidedPlatform.h + Classes/Box2DTestBed/Tests/AddPair.h + Classes/Box2DTestBed/Tests/Pinball.h + Classes/Box2DTestBed/Tests/Tumbler.h + Classes/Box2DTestBed/Tests/RayCast.h + Classes/Box2DTestBed/Tests/ConvexHull.h + Classes/Box2DTestBed/Tests/EdgeShapes.h + Classes/Box2DTestBed/Tests/Prismatic.h + Classes/Box2DTestBed/Tests/Dominos.h + Classes/Box2DTestBed/Tests/Web.h + Classes/Box2DTestBed/Tests/CharacterCollision.h + Classes/Box2DTestBed/Tests/DynamicTreeTest.h + Classes/Box2DTestBed/Tests/Cantilever.h + Classes/Box2DTestBed/Box2dView.h + Classes/Box2DTestBed/GLES-Render.h + ) +list(APPEND GAME_SOURCE + Classes/Box2DTest/Box2dTest.cpp + Classes/Box2DTestBed/Box2dView.cpp + Classes/Box2DTestBed/GLES-Render.cpp + Classes/Box2DTestBed/Test.cpp + Classes/Box2DTestBed/TestEntries.cpp + ) -if(USE_CHIPMUNK) - include_directories(${CHIPMUNK_INCLUDE_DIRS}) - list(APPEND GAME_HEADER - Classes/PhysicsTest/PhysicsTest.h - Classes/ChipmunkTest/ChipmunkTest.h - ) - list(APPEND GAME_SOURCE - Classes/PhysicsTest/PhysicsTest.cpp - Classes/ChipmunkTest/ChipmunkTest.cpp - ) -endif() +list(APPEND GAME_HEADER + Classes/Physics3DTest/Physics3DTest.h + Classes/NavMeshTest/NavMeshTest.h + ) +list(APPEND GAME_SOURCE + Classes/Physics3DTest/Physics3DTest.cpp + Classes/NavMeshTest/NavMeshTest.cpp + ) +list(APPEND GAME_HEADER + Classes/PhysicsTest/PhysicsTest.h + Classes/ChipmunkTest/ChipmunkTest.h + ) +list(APPEND GAME_SOURCE + Classes/PhysicsTest/PhysicsTest.cpp + Classes/ChipmunkTest/ChipmunkTest.cpp + ) if(NOT LINUX) list(APPEND GAME_SOURCE @@ -486,11 +473,23 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + # "too large PDB" error often occurs in cpp-tests when using default "/Zi" + target_compile_options(${APP_NAME} PRIVATE /Z7) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) endif() + +if(WINDOWS) + # precompiled header. Compilation time speedup ~4x. + target_sources(${APP_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/Classes/precheader.cpp") + set_target_properties(${APP_NAME} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") + set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/Classes/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") +endif() \ No newline at end of file diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index 39aa1f96e0f6..9000a5c9418c 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -184,9 +184,6 @@ void TestList::runThisTest() TestController::getInstance()->stopAutoTest(); TestController::destroyInstance(); Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif }); closeItem->setPosition(VisibleRect::right().x - 30, VisibleRect::top().y - 30); @@ -194,7 +191,7 @@ void TestList::runThisTest() auto autoTestItem = MenuItemLabel::create(autoTestLabel, [&](Ref* sender){ TestController::getInstance()->startAutoTest(); }); - autoTestItem->setPosition(Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + 50)); + autoTestItem->setPosition(Vec2(VisibleRect::right().x - 60, VisibleRect::bottom().y + 50)); auto menu = Menu::create(closeItem, autoTestItem, nullptr); menu->setPosition(Vec2::ZERO); @@ -487,4 +484,4 @@ void TestCase::onBackCallback(Ref* sender) { _testSuite->backsUpOneLevel(); } -} \ No newline at end of file +} diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp index e4e2ff688a2f..f192e9b697f8 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp @@ -188,7 +188,7 @@ void Box2DView::onDraw(const Mat4 &transform, uint32_t flags) director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION ); m_test->Step(&settings); m_test->m_world->DrawDebugData(); CHECK_GL_ERROR_DEBUG(); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Test.h b/tests/cpp-tests/Classes/Box2DTestBed/Test.h index 7ec5b1c9f551..e34cfeb1fa25 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Test.h +++ b/tests/cpp-tests/Classes/Box2DTestBed/Test.h @@ -19,7 +19,7 @@ #ifndef TEST_H #define TEST_H -#include +#include "Box2D/Box2D.h" #include "GLES-Render.h" #include diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.h b/tests/cpp-tests/Classes/BugsTest/Bug-1159.h index 01495fa91673..1a0e5a6a4998 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.h @@ -32,6 +32,7 @@ class Bug1159Layer : public BugsTestBase public: virtual bool init() override; virtual void onExit() override; + virtual std::string title() const override { return "Bug1159";} void callBack(cocos2d::Ref* sender); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1174.h b/tests/cpp-tests/Classes/BugsTest/Bug-1174.h index d3d54537f6b3..0e01cc1db96e 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1174.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1174.h @@ -31,7 +31,8 @@ class Bug1174Layer : public BugsTestBase { public: CREATE_FUNC(Bug1174Layer); - + virtual std::string title() const override { return "Bug1174";} + virtual std::string subtitle() const override {return "view console output";} virtual bool init() override; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-12847.h b/tests/cpp-tests/Classes/BugsTest/Bug-12847.h index 6322ab05f761..8516ca5432e4 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-12847.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-12847.h @@ -34,6 +34,7 @@ class Bug12847Layer : public BugsTestBase virtual bool init() override; + virtual std::string title() const override { return "12874";} protected: virtual void update(float dt) override; virtual void onEnter() override; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h index 95ed5fecdcc9..b3777cc27e72 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-14327.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-14327.h @@ -35,6 +35,7 @@ class Bug14327Layer : public BugsTestBase, public cocos2d::ui::EditBoxDelegate CREATE_FUNC(Bug14327Layer); virtual bool init() override; + virtual std::string title() const override { return "Bug14327";} virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox) override; virtual void editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox) override; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-15594.h b/tests/cpp-tests/Classes/BugsTest/Bug-15594.h index c0ac4f5327b5..c1613dd717a0 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-15594.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-15594.h @@ -32,6 +32,7 @@ class Bug15594Layer : public BugsTestBase { public: CREATE_FUNC(Bug15594Layer); + virtual std::string title() const override { return "Bug15594";} virtual bool init() override; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-15776.h b/tests/cpp-tests/Classes/BugsTest/Bug-15776.h index 97d21f907cb7..a033b8d6438e 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-15776.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-15776.h @@ -41,7 +41,6 @@ class Bug15776Layer : public BugsTestBase CREATE_FUNC(Bug15776Layer); virtual bool init() override; - virtual std::string title() const override; virtual std::string subtitle() const override; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-350.h b/tests/cpp-tests/Classes/BugsTest/Bug-350.h index 553fc4cee496..4e8982f70e34 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-350.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-350.h @@ -33,6 +33,7 @@ class Bug350Layer : public BugsTestBase CREATE_FUNC(Bug350Layer); virtual bool init() override; + virtual std::string title() const override { return "Bug350";} }; #endif // __BUG_350_H__ diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.h b/tests/cpp-tests/Classes/BugsTest/Bug-422.h index 928f225db1ce..d89182e2589f 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.h @@ -34,6 +34,7 @@ class Bug422Layer : public BugsTestBase virtual bool init() override; + virtual std::string title() const override { return "Bug422";} void reset(); void check(Node* target); void menuCallback(cocos2d::Ref* sender); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.h b/tests/cpp-tests/Classes/BugsTest/Bug-624.h index a921a089950e..6f6b4c8e2c4b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.h @@ -35,6 +35,7 @@ class Bug624Layer : public BugsTestBase void switchLayer(float dt); virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event); + virtual std::string title() const override { return "Bug624";} CREATE_FUNC(Bug624Layer); }; @@ -44,6 +45,8 @@ class Bug624Layer2 : public BugsTestBase virtual ~Bug624Layer2(); virtual bool init() override; void switchLayer(float dt); + virtual std::string title() const override { return "Bug624-2";} + virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event); CREATE_FUNC(Bug624Layer2); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-886.h b/tests/cpp-tests/Classes/BugsTest/Bug-886.h index 0407bd552280..99f27e56ea77 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-886.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-886.h @@ -32,6 +32,7 @@ class Bug886Layer : public BugsTestBase public: CREATE_FUNC(Bug886Layer); + virtual std::string title() const override { return "Bug886";} virtual bool init() override; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-899.h b/tests/cpp-tests/Classes/BugsTest/Bug-899.h index 1077ab6f4a84..f92d91228970 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-899.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-899.h @@ -32,6 +32,7 @@ class Bug899Layer : public BugsTestBase public: CREATE_FUNC(Bug899Layer); + virtual std::string title() const override { return "Bug899";} virtual bool init() override; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.h b/tests/cpp-tests/Classes/BugsTest/Bug-914.h index 1a9df9133e59..498acaaed85b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.h @@ -32,6 +32,7 @@ class Bug914Layer : public BugsTestBase public: virtual bool init() override; + virtual std::string title() const override { return "Bug914";} void onTouchesMoved(const std::vector& touches, cocos2d::Event* event); void onTouchesBegan(const std::vector& touches, cocos2d::Event* event); void restart(cocos2d::Ref* sender); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h index ff8b5ec376a5..3f67901e0d60 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h @@ -32,7 +32,8 @@ class BugDrawNodeLayer : public BugsTestBase public: CREATE_FUNC(BugDrawNodeLayer); + virtual std::string title() const override { return "BugDrawNode";} virtual bool init() override; }; -#endif \ No newline at end of file +#endif diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h index 5d1ff7d23bc0..118a325c0cdd 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h @@ -41,6 +41,7 @@ class BugChild : public BugsTestBase CREATE_FUNC(BugChild); virtual bool init() override; + virtual std::string title() const override { return "BugChild";} void switchChild(cocos2d::Ref* sender); @@ -61,6 +62,7 @@ class BugCameraMask : public BugsTestBase virtual bool init() override; + virtual std::string title() const override { return "BugCameraMask";} void switchSpriteFlag(cocos2d::Ref* sender); void updateSpriteMaskLabel(); Node* _sprite; diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.h b/tests/cpp-tests/Classes/BugsTest/BugsTest.h index 6cf71dbc7728..d06a1cc9c7d4 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.h +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.h @@ -30,7 +30,7 @@ class BugsTestBase : public TestCase { public: - + virtual std::string title() const override {return "No Test Title set";} }; DEFINE_TEST_SUITE(BugsTests); diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 6a7eddb8c259..de8516826565 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -663,7 +663,8 @@ void RawStencilBufferTest::onBeforeDrawClip(int planeIndex, const Vec2& pt) glProgram->setUniformsForBuiltins(); glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); @@ -692,7 +693,8 @@ void RawStencilBufferTest::onBeforeDrawSprite(int planeIndex, const Vec2& pt) glProgram->setUniformsForBuiltins(); glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); @@ -892,7 +894,8 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane) glProgram->setUniformsForBuiltins(); glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); + glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); diff --git a/tests/cpp-tests/Classes/DownloaderTest/DownloaderTest.cpp b/tests/cpp-tests/Classes/DownloaderTest/DownloaderTest.cpp index 46c6c3586e0f..475741af7fee 100644 --- a/tests/cpp-tests/Classes/DownloaderTest/DownloaderTest.cpp +++ b/tests/cpp-tests/Classes/DownloaderTest/DownloaderTest.cpp @@ -37,15 +37,15 @@ USING_NS_CC; static const char* sURLList[] = { "http://www.cocos2d-x.org/attachments/802/cocos2dx_landscape.png", - "http://www.cocos2d-x.org/docs/manual/framework/native/wiki/logo-resources-of-cocos2d-x/res/2dx_icon_512_rounded.png", + "http://cocos2d-x.org/images/logo.png", "http://www.cocos2d-x.org/attachments/1503/no_exist.txt", // try to download no exist file - "http://download.sdkbox.com/installer/v1/sdkbox-iap_v2.3.6.1.tar.gz", + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.zip", }; const static int sListSize = (sizeof(sURLList)/sizeof(sURLList[0])); static const char* sNameList[sListSize] = { "cocos2dx_landscape.png", - "2dx_icon_512_rounded.png", + "logo.png", "inexist file", "big file", }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 6a73ca2cacbd..0e2e4cbdc81e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -33,6 +33,7 @@ using namespace cocos2d::network; HttpClientTests::HttpClientTests() { ADD_TEST_CASE(HttpClientTest); + ADD_TEST_CASE(HttpClientClearRequestsTest); } HttpClientTest::HttpClientTest() @@ -398,3 +399,149 @@ void HttpClientTest::onHttpRequestCompleted(HttpClient *sender, HttpResponse *re log("request ref count not 2, is %d", response->getHttpRequest()->getReferenceCount()); } } + + + + +HttpClientClearRequestsTest::HttpClientClearRequestsTest() +: _labelStatusCode(nullptr) +{ + auto winSize = Director::getInstance()->getWinSize(); + + const int MARGIN = 40; + const int SPACE = 35; + + const int CENTER = winSize.width / 2; + + auto menuRequest = Menu::create(); + menuRequest->setPosition(Vec2::ZERO); + addChild(menuRequest); + + // Get + auto labelGet = Label::createWithTTF("Test Clear all Get", "fonts/arial.ttf", 22); + auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelAllClicked, this)); + itemGet->setPosition(CENTER, winSize.height - MARGIN - SPACE); + menuRequest->addChild(itemGet); + + // Post + auto labelPost = Label::createWithTTF("Test Clear but only with the tag DELETE", "fonts/arial.ttf", 22); + auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientClearRequestsTest::onMenuCancelSomeClicked, this)); + itemPost->setPosition(CENTER, winSize.height - MARGIN - 2 * SPACE); + menuRequest->addChild(itemPost); + + // Response Code Label + _labelStatusCode = Label::createWithTTF("HTTP Status Code", "fonts/arial.ttf", 18); + _labelStatusCode->setPosition(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE); + addChild(_labelStatusCode); + + // Tracking Data Label + _labelTrakingData = Label::createWithTTF("Got 0 of 0 expected http requests", "fonts/arial.ttf", 16); + _labelTrakingData->setPosition(CENTER, winSize.height - MARGIN - 5 * SPACE); + addChild(_labelTrakingData); + + _totalExpectedRequests = 0; + _totalProcessedRequests = 0; +} + +HttpClientClearRequestsTest::~HttpClientClearRequestsTest() +{ + HttpClient::destroyInstance(); +} + +void HttpClientClearRequestsTest::onMenuCancelAllClicked(cocos2d::Ref *sender) +{ + for (int i=0; i < 10; i++) + { + HttpRequest* request = new (std::nothrow) HttpRequest(); + std::stringstream url; + url << "http://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); + request->setUrl(url.str()); + request->setRequestType(HttpRequest::Type::GET); + request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + + url.str(""); + url << "TEST_" << std::to_string(i); + request->setTag(url.str()); + HttpClient::getInstance()->send(request); + request->release(); + } + + _totalProcessedRequests = 0; + _totalExpectedRequests = 1; + + HttpClient::getInstance()->setClearRequestPredicate(nullptr); + HttpClient::getInstance()->setClearResponsePredicate(nullptr); + HttpClient::getInstance()->clearResponseAndRequestQueue(); + + // waiting + _labelStatusCode->setString("waiting..."); +} + +void HttpClientClearRequestsTest::onMenuCancelSomeClicked(cocos2d::Ref *sender) +{ + // test 1 + for (int i=0; i < 10; i++) + { + HttpRequest* request = new (std::nothrow) HttpRequest(); + std::stringstream url; + url << "http://cocos2d-x.org/images/logo.png?id=" << std::to_string(i); + request->setUrl(url.str()); + request->setRequestType(HttpRequest::Type::GET); + request->setResponseCallback(CC_CALLBACK_2(HttpClientClearRequestsTest::onHttpRequestCompleted, this)); + + url.str(""); + if (i < 5) { + url << "TEST_" << std::to_string(i); + _totalExpectedRequests++; + } + else { + url << "DELETE_" << std::to_string(i); + } + request->setTag(url.str()); + HttpClient::getInstance()->send(request); + request->release(); + } + + HttpClient::getInstance()->setClearRequestPredicate([&](HttpRequest* req) + { + auto r = !!strstr(req->getTag(), "DELETE_"); + return r; + }); + HttpClient::getInstance()->setClearResponsePredicate(nullptr); + HttpClient::getInstance()->clearResponseAndRequestQueue(); + + + // waiting + _labelStatusCode->setString("waiting..."); + +} + +void HttpClientClearRequestsTest::onHttpRequestCompleted(HttpClient *sender, HttpResponse *response) +{ + if (!response) + { + return; + } + + // You can get original request type from: response->request->reqType + if (0 != strlen(response->getHttpRequest()->getTag())) + { + log("%s completed", response->getHttpRequest()->getTag()); + } + + long statusCode = response->getResponseCode(); + char statusString[64] = {}; + sprintf(statusString, "HTTP Status Code: %ld, tag = %s", statusCode, response->getHttpRequest()->getTag()); + _labelStatusCode->setString(statusString); + log("response code: %ld", statusCode); + + _totalProcessedRequests++; + sprintf(statusString, "Got %d of %d expected http requests", _totalProcessedRequests, _totalExpectedRequests); + _labelTrakingData->setString(statusString); + + if (!response->isSucceed()) + { + log("response failed"); + log("error buffer: %s", response->getErrorBuffer()); + } +} diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index 6605ff3b6038..72f88b23575f 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -56,4 +56,28 @@ class HttpClientTest : public TestCase cocos2d::Label* _labelStatusCode; }; +class HttpClientClearRequestsTest : public TestCase +{ +public: + CREATE_FUNC(HttpClientClearRequestsTest); + + HttpClientClearRequestsTest(); + virtual ~HttpClientClearRequestsTest(); + + //Menu Callbacks + void onMenuCancelAllClicked(cocos2d::Ref *sender); + void onMenuCancelSomeClicked(cocos2d::Ref *sender); + + //Http Response Callback + void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response); + + virtual std::string title() const override { return "Http Request Test"; } + +private: + int _totalExpectedRequests; + int _totalProcessedRequests; + cocos2d::Label* _labelTrakingData; + cocos2d::Label* _labelStatusCode; +}; + #endif //__HTTPREQUESTHTTP_H diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index 71177832cee0..39eade755380 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -147,7 +147,7 @@ void WebSocketTest::startTestCallback(Ref* sender) } protocols.erase(protocols.begin()); - if (!_wsiSendBinary->init(*this, "wss://echo.websocket.org", &protocols)) + if (!_wsiSendBinary->init(*this, "wss://echo.websocket.org", &protocols, "cacert.pem")) { CC_SAFE_DELETE(_wsiSendBinary); } @@ -346,9 +346,6 @@ WebSocketCloseTest::WebSocketCloseTest() auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, [](Ref* sender){ Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif }); closeItem->setPosition(VisibleRect::right().x / 2, VisibleRect::top().y * 2 / 3); diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index 187dfe4a8fd7..7384d1c4b8ef 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -47,6 +47,8 @@ FileUtilsTests::FileUtilsTests() ADD_TEST_CASE(TestFileFuncsAsync); ADD_TEST_CASE(TestWriteStringAsync); ADD_TEST_CASE(TestWriteDataAsync); + ADD_TEST_CASE(TestListFiles); + ADD_TEST_CASE(TestIsFileExistRejectFolder); } // TestResolutionDirectories @@ -202,7 +204,7 @@ std::string TestSearchPath::title() const std::string TestSearchPath::subtitle() const { - return "See the console, can see a orange box and a 'about' picture"; + return "See the console, can see a orange box and a 'about' picture, except Android"; } // TestFilenameLookup @@ -1391,3 +1393,94 @@ std::string TestWriteDataAsync::subtitle() const { return ""; } + +void TestListFiles::onEnter() +{ + FileUtilsDemo::onEnter(); + + auto winSize = Director::getInstance()->getWinSize(); + + auto infoLabel = Label::createWithTTF("show file count, should not be 0", "fonts/Thonburi.ttf", 18); + this->addChild(infoLabel); + infoLabel->setPosition(winSize.width / 2, winSize.height * 3 / 4); + + auto cntLabel = Label::createWithTTF("show readResult", "fonts/Thonburi.ttf", 18); + this->addChild(cntLabel); + cntLabel->setPosition(winSize.width / 2, winSize.height / 3); + // writeTest + std::vector listFonts = FileUtils::getInstance()->listFiles("fonts"); + auto defaultPath = FileUtils::getInstance()->getDefaultResourceRootPath(); + std::vector list = FileUtils::getInstance()->listFiles (defaultPath); + + char cntBuffer[200] = { 0 }; + snprintf(cntBuffer, 200, "'fonts/' %d, $defaultResourceRootPath %d",listFonts.size(), list.size()); + + for(int i=0;isetString(cntBuffer); + +} + +void TestListFiles::onExit() +{ + FileUtilsDemo::onExit(); +} + +std::string TestListFiles::title() const +{ + return "FileUtils: list files of directory"; +} + +std::string TestListFiles::subtitle() const +{ + return ""; +} + + + +void TestIsFileExistRejectFolder::onEnter() +{ + FileUtilsDemo::onEnter(); + + auto winSize = Director::getInstance()->getWinSize(); + + auto infoLabel = Label::createWithTTF("tests folder 'NavMesh/maps', expect to be false", "fonts/Thonburi.ttf", 18); + this->addChild(infoLabel); + infoLabel->setPosition(winSize.width / 2, winSize.height * 3 / 4); + + auto cntLabel = Label::createWithTTF("waiting...", "fonts/Thonburi.ttf", 18); + this->addChild(cntLabel); + cntLabel->setPosition(winSize.width / 2, winSize.height / 3); + + auto exists = FileUtils::getInstance()->isFileExist("NavMesh/maps"); + auto isDirectory = FileUtils::getInstance()->isDirectoryExist("NavMesh/maps"); + + char cntBuffer[200] = { 0 }; + snprintf(cntBuffer, 200, "isDir: %s, isFile: %s, %s", isDirectory ? "true": "false" , exists ? "true" : "false", exists ? "failure!" : "ok!" ); + cntLabel->setString(cntBuffer); + +} + +void TestIsFileExistRejectFolder::onExit() +{ + FileUtilsDemo::onExit(); +} + +std::string TestIsFileExistRejectFolder::title() const +{ + return "FileUtils: isFileExist(direname)"; +} + +std::string TestIsFileExistRejectFolder::subtitle() const +{ + return ""; +} diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h index 3706ebc80019..34b8915dbc91 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h @@ -258,4 +258,26 @@ class TestWriteDataAsync : public FileUtilsDemo virtual std::string subtitle() const override; }; +class TestListFiles : public FileUtilsDemo +{ +public: + CREATE_FUNC(TestListFiles); + + virtual void onEnter() override; + virtual void onExit() override; + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; + +class TestIsFileExistRejectFolder : public FileUtilsDemo +{ +public: + CREATE_FUNC(TestIsFileExistRejectFolder); + + virtual void onEnter() override; + virtual void onExit() override; + virtual std::string title() const override; + virtual std::string subtitle() const override; +}; + #endif /* __FILEUTILSTEST_H__ */ diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp index c810030515bd..eebe58113603 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp @@ -32,6 +32,7 @@ MouseTests::MouseTests() { ADD_TEST_CASE(MouseEventTest); ADD_TEST_CASE(HideMouseTest); + ADD_TEST_CASE(CursorTest); } //------------------------------------------------------------------ @@ -146,3 +147,46 @@ std::string HideMouseTest::subtitle() const return "Click to hide mouse"; } +//------------------------------------------------------------------ +// +// CursorTest +// +//------------------------------------------------------------------ + +CursorTest::CursorTest() +{ + _cursor = 0; + _lis = EventListenerMouse::create(); + _lis->onMouseDown = [this](Event* e){ + _cursor = (_cursor + 1) % 3; + switch (_cursor) { + case 1: + Director::getInstance()->getOpenGLView()->setCursor("InputTest/cursor1.png"); + break; + case 2: + Director::getInstance()->getOpenGLView()->setCursor("InputTest/cursor2.png", Point::ANCHOR_MIDDLE); + break; + default: + Director::getInstance()->getOpenGLView()->setDefaultCursor(); + break; + } + }; + + _eventDispatcher->addEventListenerWithSceneGraphPriority(_lis, this); +} + +CursorTest::~CursorTest() +{ + _eventDispatcher->removeEventListener(_lis); +} + +std::string CursorTest::title() const +{ + return "Custom Mouse Cursor"; +} + +std::string CursorTest::subtitle() const +{ + return "Click to change cursor"; +} + diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.h b/tests/cpp-tests/Classes/InputTest/MouseTest.h index cc2162dad881..73e191f94539 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.h +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.h @@ -71,4 +71,19 @@ class HideMouseTest : public BaseMouseTest cocos2d::EventListenerMouse* _lis; }; +class CursorTest : public BaseMouseTest +{ +public: + CREATE_FUNC(CursorTest); + CursorTest(); + ~CursorTest(); + + virtual std::string title() const override; + virtual std::string subtitle() const override; + +private: + int _cursor; + cocos2d::EventListenerMouse* _lis; +}; + #endif diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 9d3bdaa8b8d4..551e99ef913e 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -605,7 +605,7 @@ bool LabelFNTMultiLineAlignment::init() this->_arrowsBar = Sprite::create("Images/arrowsBar.png"); this->_arrows = Sprite::create("Images/arrows.png"); - MenuItemFont::setFontSize(20); + MenuItemFont::setFontSize(15); auto longSentences = MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); @@ -620,7 +620,7 @@ bool LabelFNTMultiLineAlignment::init() _menuItems.push_back(lineBreaks); _menuItems.push_back(mixed); - MenuItemFont::setFontSize(30); + MenuItemFont::setFontSize(20); auto left = MenuItemFont::create("Left", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); auto center = MenuItemFont::create("Center", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); @@ -642,8 +642,8 @@ bool LabelFNTMultiLineAlignment::init() this->_arrowsBar->setScaleX(arrowsWidth / this->_arrowsBar->getContentSize().width); this->_arrowsBar->setPosition(Vec2(((ArrowsMax + ArrowsMin) / 2) * size.width, this->_label->getPosition().y)); - stringMenu->setPosition(Vec2(size.width/2, size.height - menuItemPaddingCenter)); - alignmentMenu->setPosition(Vec2(size.width/2, menuItemPaddingCenter+15)); + stringMenu->setPosition(VisibleRect::top() + Vec2(0, - menuItemPaddingCenter)); + alignmentMenu->setPosition(VisibleRect::bottom() + Vec2(0, menuItemPaddingCenter + 15)); this->selectSentenceItem(longSentences); this->selectAlignmentItem(center); @@ -1062,12 +1062,12 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() Vec2(size.width * 0.85, size.height * 0.8), Vec2(size.width * 0.85, 0), 1, Color4F(1, 0, 0, 1)); - TTFConfig ttfConfig("fonts/HKYuanMini.ttf", 25, GlyphCollection::DYNAMIC); + TTFConfig ttfConfig("fonts/HKYuanMini.ttf", 20, GlyphCollection::DYNAMIC); auto label1 = Label::createWithTTF(ttfConfig, "你好,Cocos2d-x v3的New Label.", TextHAlignment::LEFT, size.width * 0.75); if(label1) { label1->setTextColor(Color4B(128, 255, 255, 255)); - label1->setPosition(Vec2(size.width * 0.1, size.height * 0.6)); + label1->setPosition(Vec2(size.width * 0.1, VisibleRect::top().y * 0.7)); label1->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label1); // Demo for unloadFontAtlasTTF function, after it been called, all UI widget @@ -1080,7 +1080,7 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() "早上好,Cocos2d-x v3的New Label.", TextHAlignment::LEFT, size.width * 0.75); if(label2) { label2->setTextColor(Color4B(255, 128, 255, 255)); - label2->setPosition(Vec2(size.width * 0.1, size.height * 0.4)); + label2->setPosition(Vec2(size.width * 0.1, VisibleRect::top().y * 0.5)); label2->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label2); } @@ -1089,7 +1089,7 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() "美好的一天啊美好的一天啊美好的一天啊", TextHAlignment::LEFT, size.width * 0.75); if(label3) { label3->setTextColor(Color4B(255, 255, 128, 255)); - label3->setPosition(Vec2(size.width * 0.1, size.height * 0.2)); + label3->setPosition(Vec2(size.width * 0.1, VisibleRect::top().y * 0.3)); label3->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label3); } diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index 721fcd0a3357..e04940124a76 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -27,7 +27,7 @@ #include "MaterialSystemTest.h" #include -#include +#include "spine/spine-cocos2dx.h" #include "../testResource.h" #include "cocos2d.h" diff --git a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp index 45c2d785acd2..f6fd931e2c0a 100644 --- a/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -852,7 +852,7 @@ bool AudioSwitchStateTest::init() AudioEngine::play2d("audio/SoundEffectsFX009/FX082.mp3"); AudioEngine::play2d("audio/LuckyDay.mp3"); - }, 0.1f, "AudioSwitchStateTest"); + }, 0.01f, "AudioSwitchStateTest"); return true; } diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index d2efb8f5111d..fbbffc5b6dda 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -356,7 +356,7 @@ void RemoveListenerWhenDispatching::onEnter() } }, MenuItemFont::create("Enabled"), MenuItemFont::create("Disabled"), nullptr); - toggleItem->setPosition(origin + Vec2(size.width/2, 80)); + toggleItem->setPosition(origin + Vec2(size.width * 0.8, 80)); auto menu = Menu::create(toggleItem, nullptr); menu->setPosition(Vec2(0, 0)); menu->setAnchorPoint(Vec2(0, 0)); @@ -650,7 +650,7 @@ void RemoveListenerAfterAddingTest::onEnter() _eventDispatcher->removeEventListener(listener); }); - item1->setPosition(VisibleRect::center() + Vec2(0, 80)); + item1->setPosition(VisibleRect::leftBottom() + Vec2(0, 80)); auto addNextButton = [this](){ auto next = MenuItemFont::create("Please Click Me To Reset!", [this](Ref* sender){ @@ -677,7 +677,7 @@ void RemoveListenerAfterAddingTest::onEnter() addNextButton(); }); - item2->setPosition(VisibleRect::center() + Vec2(0, 40)); + item2->setPosition(VisibleRect::leftBottom() + Vec2(0, 40)); auto item3 = MenuItemFont::create("Click Me 3", [=](Ref* sender){ auto listener = EventListenerTouchOneByOne::create(); @@ -692,10 +692,10 @@ void RemoveListenerAfterAddingTest::onEnter() addNextButton(); }); - item3->setPosition(VisibleRect::center()); + item3->setPosition(VisibleRect::leftBottom()); auto menu = Menu::create(item1, item2, item3, nullptr); - menu->setPosition(VisibleRect::leftBottom()); + menu->setPosition(VisibleRect::rightBottom() * 0.8 + Vec2(0, 40)); menu->setAnchorPoint(Vec2::ZERO); addChild(menu); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 3e5539cb8962..d5da249a83b7 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -993,14 +993,10 @@ void MySprite::onDraw(const Mat4 &transform, uint32_t flags) getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); - cocos2d::utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc( _blendFunc.src, _blendFunc.dst ); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, _texture->getName()); - - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::bindTexture2D( _texture->getName() ); + GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); #define kQuadSize sizeof(_quad.bl) size_t offset = (size_t)&_quad; diff --git a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp index f34b76beb59e..3ddc95155290 100644 --- a/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp +++ b/tests/cpp-tests/Classes/Scene3DTest/Scene3DTest.cpp @@ -26,7 +26,7 @@ #include "ui/CocosGUI.h" #include "renderer/CCRenderState.h" -#include +#include "spine/spine-cocos2dx.h" #include "../testResource.h" #include "../TerrainTest/TerrainTest.h" diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.h b/tests/cpp-tests/Classes/SpineTest/SpineTest.h index d9c9b049e676..b3a2b77f7264 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.h +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.h @@ -28,7 +28,7 @@ #include "cocos2d.h" #include "../BaseTest.h" -#include +#include "spine/spine-cocos2dx.h" DEFINE_TEST_SUITE(SpineTests); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp index 161e303aa16f..6d406d45aed1 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/DrawNode3D.cpp @@ -50,7 +50,7 @@ DrawNode3D::~DrawNode3D() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } } @@ -92,7 +92,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } glGenBuffers(1, &_vbo); @@ -109,7 +109,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } CHECK_GL_ERROR_DEBUG(); @@ -143,7 +143,7 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) glProgram->setUniformsForBuiltins(transform); glEnable(GL_DEPTH_TEST); RenderState::StateBlock::_defaultState->setDepthTest(true); - cocos2d::utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirty) { @@ -153,12 +153,11 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 298091212bed..531d64134e65 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -2295,8 +2295,7 @@ Animate3DCallbackTest::Animate3DCallbackTest() ValueMap valuemap0; animate->setKeyFrameUserInfo(275, valuemap0); - - auto listener = EventListenerCustom::create(Animate3DDisplayedNotification, [&](EventCustom* event) + _customEventListener = EventListenerCustom::create(Animate3DDisplayedNotification, [&](EventCustom* event) { auto info = (Animate3D::Animate3DDisplayedEventInfo*)event->getUserData(); auto node = getChildByTag(100); @@ -2310,12 +2309,19 @@ Animate3DCallbackTest::Animate3DCallbackTest() cocos2d::log("frame %d", info->frame); }); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(listener, -1); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_customEventListener, -1); } } Animate3DCallbackTest::~Animate3DCallbackTest() { + cocos2d::log("Animate3DCallbackTest destroied!"); + if(_customEventListener) + { + Director::getInstance()->getEventDispatcher()->removeEventListener(_customEventListener); + _customEventListener = nullptr; + } + } std::string Animate3DCallbackTest::title() const @@ -2441,7 +2447,8 @@ CameraBackgroundClearTest::CameraBackgroundClearTest() void CameraBackgroundClearTest::switch_CameraClearMode(cocos2d::Ref* sender) { - auto type = _camera->getBackgroundBrush()->getBrushType(); + auto brush = _camera->getBackgroundBrush(); + auto type = brush ? brush->getBrushType() : CameraBackgroundBrush::BrushType::NONE; if (type == CameraBackgroundBrush::BrushType::NONE) { _camera->setBackgroundBrush(CameraBackgroundBrush::createDepthBrush(1.f)); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index ef7fd284b5dc..eba8acc285ac 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -527,6 +527,7 @@ class Animate3DCallbackTest : public Sprite3DTestDemo protected: cocos2d::Sprite3D* _sprite3d; + cocos2d::EventListenerCustom *_customEventListener = nullptr; }; class Sprite3DTestMeshLight : public Sprite3DTestDemo diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp index bf17d4f83c44..5e1fe346633f 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp @@ -26,6 +26,8 @@ #include "SpriteFrameCacheTest.h" +#include + // enable log #define COCOS2D_DEBUG 1 @@ -34,6 +36,8 @@ USING_NS_CC; SpriteFrameCacheTests::SpriteFrameCacheTests() { ADD_TEST_CASE(SpriteFrameCachePixelFormatTest); + ADD_TEST_CASE(SpriteFrameCacheLoadMultipleTimes); + ADD_TEST_CASE(SpriteFrameCacheFullCheck); } SpriteFrameCachePixelFormatTest::SpriteFrameCachePixelFormatTest() @@ -84,4 +88,55 @@ void SpriteFrameCachePixelFormatTest::loadSpriteFrames(const std::string &file, SpriteFrameCache::getInstance()->removeSpriteFramesFromFile(file); Director::getInstance()->getTextureCache()->removeTexture(texture); -} \ No newline at end of file +} + + +SpriteFrameCacheLoadMultipleTimes::SpriteFrameCacheLoadMultipleTimes() +{ + const Size screenSize = Director::getInstance()->getWinSize(); + + // load atlas definition with specified PixelFormat and check that it matches to expected format + loadSpriteFrames("Images/sprite_frames_test/test_RGBA8888.plist", Texture2D::PixelFormat::RGBA8888); + loadSpriteFrames("Images/sprite_frames_test/test_RGBA8888.plist", Texture2D::PixelFormat::RGBA8888); + loadSpriteFrames("Images/sprite_frames_test/test_RGBA8888.plist", Texture2D::PixelFormat::RGBA8888); + loadSpriteFrames("Images/sprite_frames_test/test_RGBA8888.plist", Texture2D::PixelFormat::RGBA8888); + +} + +void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(const std::string &file, cocos2d::Texture2D::PixelFormat expectedFormat) +{ + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); + SpriteFrame *spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("grossini.png"); + Texture2D *texture = spriteFrame->getTexture(); + CC_ASSERT(texture->getPixelFormat() == expectedFormat); + + SpriteFrameCache::getInstance()->removeSpriteFrameByName("grossini.png"); + Director::getInstance()->getTextureCache()->removeTexture(texture); +} + + +SpriteFrameCacheFullCheck::SpriteFrameCacheFullCheck() +{ + const Size screenSize = Director::getInstance()->getWinSize(); + // load atlas definition with specified PixelFormat and check that it matches to expected format + loadSpriteFrames("Images/test_polygon.plist", Texture2D::PixelFormat::RGBA8888); +} + +void SpriteFrameCacheFullCheck::loadSpriteFrames(const std::string &file, cocos2d::Texture2D::PixelFormat expectedFormat) +{ + auto cache = SpriteFrameCache::getInstance(); + + CCASSERT(cache->isSpriteFramesWithFileLoaded("plist which not exists") == false, "Plist not exists"); + + cache->addSpriteFramesWithFile(file); + CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after loaded"); + + cache->removeSpriteFrameByName("not_exists_grossinis_sister.png"); + CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should not be still full"); + + cache->removeSpriteFrameByName("grossinis_sister1.png"); + CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == false, "Plist should not be full after remove any sprite"); + + cache->addSpriteFramesWithFile(file); + CCASSERT(cache->isSpriteFramesWithFileLoaded(file) == true, "Plist should be full after reloaded"); +} diff --git a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h index 5a55ff1f5388..99377028182c 100644 --- a/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h +++ b/tests/cpp-tests/Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.h @@ -45,4 +45,35 @@ class SpriteFrameCachePixelFormatTest : public TestCase private: cocos2d::Label *infoLabel; +}; + +class SpriteFrameCacheLoadMultipleTimes : public TestCase +{ +public: + CREATE_FUNC(SpriteFrameCacheLoadMultipleTimes); + + virtual std::string title() const override { return "Load same plist multiple times"; } + virtual std::string subtitle() const override { return "It shouldn't crash"; } + + SpriteFrameCacheLoadMultipleTimes(); + +private: + void loadSpriteFrames(const std::string &file, cocos2d::Texture2D::PixelFormat expectedFormat); + +}; + + +class SpriteFrameCacheFullCheck: public TestCase +{ +public: + CREATE_FUNC(SpriteFrameCacheFullCheck); + + virtual std::string title() const override { return "Test isSpriteFramesWithFileLoaded"; } + virtual std::string subtitle() const override { return "It shouldn't crash"; } + + SpriteFrameCacheFullCheck(); + +private: + void loadSpriteFrames(const std::string &file, cocos2d::Texture2D::PixelFormat expectedFormat); + }; \ No newline at end of file diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index cf279f607508..a01fe2eb0899 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp @@ -166,7 +166,7 @@ std::string ForceTouchTest::title() const std::string ForceTouchTest::subtitle() const { - return std::string("Touch with force to see info label changes\nOnly work on iPhone6s / iPhone6s Plus"); + return std::string("Touch with force to see info label changes\n work on iPhone6s+"); } void ForceTouchTest::onTouchesBegan(const std::vector& touches, cocos2d::Event* event) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index fbfe0aa1cc0d..7c2a5a0b424c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -64,22 +64,21 @@ bool UIFocusTestBase::init() _dpadMenu = Menu::create(); - auto winSize = Director::getInstance()->getVisibleSize(); auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); - leftItem->setPosition(Vec2(winSize.width - 100, winSize.height/2)); + leftItem->setPosition(VisibleRect::right() + Vec2(-100, 0)); _dpadMenu->addChild(leftItem); auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); - rightItem->setPosition(Vec2(winSize.width - 30, winSize.height/2)); + rightItem->setPosition(VisibleRect::right() + Vec2(-30, 0)); _dpadMenu->addChild(rightItem); auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); - upItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 + 50)); + upItem->setPosition(VisibleRect::right() + Vec2(-60, 50)); _dpadMenu->addChild(upItem); auto downItem = MenuItemFont::create("Down", CC_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); - downItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 - 50)); + downItem->setPosition(VisibleRect::right() + Vec2(-60, -50)); _dpadMenu->addChild(downItem); _dpadMenu->setPosition(Vec2::ZERO); @@ -95,7 +94,7 @@ bool UIFocusTestBase::init() _toggleButton = Button::create("cocosui/switch-mask.png"); _toggleButton->setTitleText("Toggle Loop"); - _toggleButton->setPosition(Vec2(60, winSize.height - 50)); + _toggleButton->setPosition(VisibleRect::leftTop() + Vec2(60, -50)); _toggleButton->setTitleColor(Color3B::RED); _toggleButton->setFocusEnabled(false); this->addChild(_toggleButton); @@ -181,10 +180,8 @@ bool UIFocusTestHorizontal::init() { if (UIFocusTestBase::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); - _horizontalLayout = HBox::create(); - _horizontalLayout->setPosition(Vec2(20, winSize.height/2 + 40)); + _horizontalLayout->setPosition(VisibleRect::left() + Vec2(20, 40)); _uiLayer->addChild(_horizontalLayout); _horizontalLayout->setFocused(true); @@ -202,7 +199,7 @@ bool UIFocusTestHorizontal::init() } _loopText = Text::create("loop enabled", "Arial", 20); - _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(VisibleRect::top() + Vec2(0, -50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); @@ -244,10 +241,8 @@ bool UIFocusTestVertical::init() { if (UIFocusTestBase::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); - _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vec2(winSize.width/2 - 100, winSize.height - 70)); + _verticalLayout->setPosition(VisibleRect::top() + Vec2(-100, -70)); _uiLayer->addChild(_verticalLayout); _verticalLayout->setTag(100); _verticalLayout->setScale(0.5); @@ -266,7 +261,7 @@ bool UIFocusTestVertical::init() } _loopText = Text::create("loop enabled", "Arial", 20); - _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(VisibleRect::top() + Vec2(0, -50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); @@ -305,10 +300,8 @@ bool UIFocusTestNestedLayout1::init() { if (UIFocusTestBase::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); - _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vec2(winSize.width/2 - 80, winSize.height - 70)); + _verticalLayout->setPosition(VisibleRect::top() + Vec2(-80, -70)); _uiLayer->addChild(_verticalLayout); _verticalLayout->setScale(0.5); @@ -362,7 +355,7 @@ bool UIFocusTestNestedLayout1::init() } _loopText = Text::create("loop enabled", "Arial", 20); - _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(VisibleRect::top() + Vec2(0, -50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); @@ -401,10 +394,8 @@ bool UIFocusTestNestedLayout2::init() { if (UIFocusTestBase::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); - _horizontalLayout = HBox::create(); - _horizontalLayout->setPosition(Vec2(winSize.width/2 - 200, winSize.height - 70)); + _horizontalLayout->setPosition(VisibleRect::top() + Vec2(-200, -70)); _uiLayer->addChild(_horizontalLayout); _horizontalLayout->setScale(0.6f); @@ -458,7 +449,7 @@ bool UIFocusTestNestedLayout2::init() } _loopText = Text::create("loop enabled", "Arial", 20); - _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(VisibleRect::top() + Vec2(0, -50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); @@ -497,10 +488,9 @@ bool UIFocusTestNestedLayout3::init() { if (UIFocusTestBase::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); - _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vec2(40, winSize.height - 70)); + _verticalLayout->setPosition(VisibleRect::leftTop() + Vec2(40, -70)); + _uiLayer->addChild(_verticalLayout); _verticalLayout->setScale(0.8f); @@ -562,7 +552,7 @@ bool UIFocusTestNestedLayout3::init() _loopText = Text::create("loop enabled", "Arial", 20); - _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(VisibleRect::top() + Vec2(0, -50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index 6094f5ae5555..34a9b0769c7f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -304,7 +304,7 @@ void UIRadioButtonTwoGroupsTest::addLog(const std::string& log) if(_numberOfLogLines > 10) { - size_t pos = existingLog.find("\n") + 1; + size_t pos = existingLog.find('\n') + 1; std::string newLog = existingLog.substr(pos); existingLog = newLog; --_numberOfLogLines; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index a371982cc4ef..2e1ac03a6fca 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -31,6 +31,7 @@ using namespace cocos2d::experimental::ui; VideoPlayerTests::VideoPlayerTests() { ADD_TEST_CASE(VideoPlayerTest); + ADD_TEST_CASE(SimpleVideoPlayerTest); } bool VideoPlayerTest::init() @@ -76,8 +77,12 @@ bool VideoPlayerTest::init() auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); ratioSwitch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); ratioSwitch->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 150)); + + auto loopToggle = MenuItemFont::create("LoopToogle", CC_CALLBACK_1(VideoPlayerTest::menuLoopCallback, this)); + loopToggle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + loopToggle->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 170)); - auto menu = Menu::create(resourceVideo,onlineVideo,ratioSwitch,fullSwitch,pauseItem,resumeItem,stopItem,hintItem,nullptr); + auto menu = Menu::create(resourceVideo,onlineVideo,ratioSwitch,loopToggle,fullSwitch,pauseItem,resumeItem,stopItem,hintItem,nullptr); menu->setPosition(Vec2::ZERO); _uiLayer->addChild(menu); @@ -85,6 +90,12 @@ bool VideoPlayerTest::init() _videoStateLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); _videoStateLabel->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 200)); _uiLayer->addChild(_videoStateLabel); + + _loopStatusLabel = Label::createWithSystemFont("(1)","Arial",10); + _loopStatusLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + _loopStatusLabel->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 185)); + _uiLayer->addChild(_loopStatusLabel); + createVideo(); return true; @@ -93,10 +104,6 @@ bool VideoPlayerTest::init() void VideoPlayerTest::menuCloseCallback(Ref* sender) { Director::getInstance()->end(); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif } void VideoPlayerTest::menuFullScreenCallback(Ref* sender) @@ -115,6 +122,16 @@ void VideoPlayerTest::menuRatioCallback(Ref* sender) } } +void VideoPlayerTest::menuLoopCallback(Ref* sender) +{ + if (_videoPlayer) + { + _videoPlayer->setLooping(! _videoPlayer->isLooping()); + _loopStatusLabel->setString(_videoPlayer->isLooping() ? "(OO)" : "(1)"); + } +} + + void VideoPlayerTest::menuResourceVideoCallback(Ref* sender) { if (_videoPlayer) @@ -239,3 +256,149 @@ void VideoPlayerTest::videoEventCallback(Ref* sender, VideoPlayer::EventType eve break; } } + + +// Simple Video Test + +SimpleVideoPlayerTest::SimpleVideoPlayerTest() +{ + _videoPlayer = nullptr; + _style = cocos2d::experimental::ui::VideoPlayer::StyleType::NONE; + _userInputEnabled = true; + + _switchUserInputEnabled = nullptr; + _switchStyle = nullptr; +} + +void SimpleVideoPlayerTest::updateButtonsTexts() +{ + if (_switchUserInputEnabled) + { + std::string str = _userInputEnabled ? "< User Input Enabled >" : "< User Input Disabled >"; + _switchUserInputEnabled->setString(str); + } + + if (_switchStyle) + { + std::string str = " - "; + switch(_style) + { + case cocos2d::experimental::ui::VideoPlayer::StyleType::NONE: + _switchUserInputEnabled->setVisible(false); + str = "< NO Sytle >"; + break; + + case cocos2d::experimental::ui::VideoPlayer::StyleType::DEFAULT: + str = "< Default Style >"; + _switchUserInputEnabled->setVisible(true); + break; + + default: + break; + } + + _switchStyle->setString(str); + } +} + +bool SimpleVideoPlayerTest::init() +{ + if ( !UIScene::init() ) + { + return false; + } + + _visibleRect = Director::getInstance()->getOpenGLView()->getVisibleRect(); + + MenuItemFont::setFontSize(16); + + _switchStyle = MenuItemFont::create("Switch Style", CC_CALLBACK_1(SimpleVideoPlayerTest::switchStyleCallback, this)); + _switchStyle->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + _switchStyle->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 50)); + + _switchUserInputEnabled = MenuItemFont::create("Enable User Input", CC_CALLBACK_1(SimpleVideoPlayerTest::switchUserInputCallback, this)); + _switchUserInputEnabled->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + _switchUserInputEnabled->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 100)); + + auto menu = Menu::create(_switchUserInputEnabled,_switchStyle,nullptr); + menu->setPosition(Vec2::ZERO); + _uiLayer->addChild(menu); + + createVideo(); + updateButtonsTexts(); + + return true; +} + +void SimpleVideoPlayerTest::menuCloseCallback(Ref* sender) +{ + Director::getInstance()->end(); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + exit(0); +#endif +} + + +void SimpleVideoPlayerTest::switchStyleCallback(Ref* sender) +{ + switch (_style) { + case cocos2d::experimental::ui::VideoPlayer::StyleType::NONE: + _style = cocos2d::experimental::ui::VideoPlayer::StyleType::DEFAULT; + break; + + case cocos2d::experimental::ui::VideoPlayer::StyleType::DEFAULT: + _style = cocos2d::experimental::ui::VideoPlayer::StyleType::NONE; + break; + + default: + break; + } + + if (_videoPlayer) + { + _videoPlayer->setStyle(_style); + } + + //createVideo(); + updateButtonsTexts(); +} + +void SimpleVideoPlayerTest::switchUserInputCallback(Ref* sender) +{ + _userInputEnabled = !_userInputEnabled; + if (_videoPlayer) + { + _videoPlayer->setUserInputEnabled(_userInputEnabled); + } + + //createVideo(); + updateButtonsTexts(); +} + + +void SimpleVideoPlayerTest::createVideo() +{ + if (_videoPlayer) + { + _uiLayer->removeChild(_videoPlayer); + } + auto centerPos = Vec2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2); + + auto widgetSize = _widget->getContentSize(); + + _videoPlayer = VideoPlayer::create(); + _videoPlayer->setPosition(centerPos); + _videoPlayer->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _videoPlayer->setContentSize(Size(widgetSize.width * 0.4f,widgetSize.height * 0.4f)); + _videoPlayer->setLooping(true); + _videoPlayer->setStyle(_style); + _videoPlayer->setUserInputEnabled(_userInputEnabled); + + _uiLayer->addChild(_videoPlayer); + + // _videoPlayer->addEventListener(CC_CALLBACK_2(SimpleVideoPlayerTest::videoEventCallback, this)); + + _videoPlayer->setFileName("cocosvideo.mp4"); + _videoPlayer->play(); +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h index 2e0de2609568..375a54ed25de 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h @@ -47,6 +47,7 @@ class VideoPlayerTest : public UIScene void menuResumeCallback(cocos2d::Ref* sender); void menuStopCallback(cocos2d::Ref* sender); void menuHintCallback(cocos2d::Ref* sender); + void menuLoopCallback(cocos2d::Ref* sender); void sliderCallback(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType eventType); @@ -59,10 +60,42 @@ class VideoPlayerTest : public UIScene cocos2d::MenuItemFont* _hintItem; cocos2d::experimental::ui::VideoPlayer* _videoPlayer; cocos2d::Label* _videoStateLabel; + cocos2d::Label* _loopStatusLabel; cocos2d::Rect _visibleRect; cocos2d::Layer* _rootLayer; }; + +class SimpleVideoPlayerTest : public UIScene +{ +public: + CREATE_FUNC(SimpleVideoPlayerTest); + + SimpleVideoPlayerTest(); + + virtual bool init() override; + + void menuCloseCallback(cocos2d::Ref* sender); + void switchStyleCallback(cocos2d::Ref* sender); + void switchUserInputCallback(cocos2d::Ref* sender); + +private: + void createVideo(); + + cocos2d::Rect _visibleRect; + cocos2d::experimental::ui::VideoPlayer* _videoPlayer; + + cocos2d::MenuItemFont* _switchUserInputEnabled; + cocos2d::MenuItemFont* _switchStyle; + + + bool _userInputEnabled; + cocos2d::experimental::ui::VideoPlayer::StyleType _style; + + void updateButtonsTexts(); +}; + + #endif // __tests__VideoPlayerTest__ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp index b2bf692538be..582e66b8646b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp @@ -36,12 +36,11 @@ WebViewTests::WebViewTests() bool WebViewTest::init() { if (UIScene::init()) { - Size winSize = Director::getInstance()->getVisibleSize(); + Size visableSize = Director::getInstance()->getVisibleSize(); - _webView = cocos2d::experimental::ui::WebView::create(); - _webView->setPosition(winSize/2); - _webView->setContentSize(winSize * 0.5); + _webView->setPosition(VisibleRect::center()); + _webView->setContentSize(visableSize * 0.5); _webView->loadURL("https://www.baidu.com"); _webView->setScalesPageToFit(true); @@ -52,13 +51,14 @@ bool WebViewTest::init() this->addChild(_webView); auto spriteHello = Sprite::create("Hello.png"); - spriteHello->setPosition(winSize/2); + spriteHello->setContentSize(visableSize * 0.5); + spriteHello->setPosition(VisibleRect::center()); this->addChild(spriteHello); TextField *urlTextField = TextField::create("Input a URL here", "Arial", 20); urlTextField->setPlaceHolderColor(Color3B::RED); - urlTextField->setPosition(Vec2(winSize/2) + Vec2(-80, _webView->getContentSize().height/2 + - urlTextField->getContentSize().height/2 + 10)); + urlTextField->setPosition(VisibleRect::center() + Vec2(-80, _webView->getContentSize().height/2 + + urlTextField->getContentSize().height/2 + 10)); this->addChild(urlTextField); Text *httpLabel = Text::create("https:// ", "Arial", 20); @@ -71,8 +71,8 @@ bool WebViewTest::init() Button *resetBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); resetBtn->setTitleText("Visit URL"); - resetBtn->setPosition(Vec2(winSize/2) + Vec2(50, _webView->getContentSize().height/2 + - resetBtn->getContentSize().height/2 + 10)); + resetBtn->setPosition(VisibleRect::center() + Vec2(50, _webView->getContentSize().height/2 + + resetBtn->getContentSize().height/2 + 10)); resetBtn->addClickEventListener([=](Ref*){ if (urlTextField->getString().size() != 0) { @@ -85,7 +85,7 @@ bool WebViewTest::init() Button *reloadBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); reloadBtn->setTitleText("Reload"); - reloadBtn->setPosition(Vec2(winSize/2) + Vec2( _webView->getContentSize().width/2 + + reloadBtn->setPosition(VisibleRect::center() + Vec2( _webView->getContentSize().width/2 + reloadBtn->getContentSize().width/2 + 10,50 )); reloadBtn->addClickEventListener([=](Ref*){ _webView->reload(); @@ -95,7 +95,7 @@ bool WebViewTest::init() Button *forwardBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); forwardBtn->setTitleText("Forward"); - forwardBtn->setPosition(Vec2(winSize/2) + Vec2( _webView->getContentSize().width/2 + + forwardBtn->setPosition(VisibleRect::center() + Vec2( _webView->getContentSize().width/2 + forwardBtn->getContentSize().width/2 + 10,0 )); forwardBtn->addClickEventListener([=](Ref*){ _webView->goForward(); @@ -107,7 +107,7 @@ bool WebViewTest::init() Button *backBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); backBtn->setTitleText("Back"); - backBtn->setPosition(Vec2(winSize/2) + Vec2( _webView->getContentSize().width/2 + + backBtn->setPosition(VisibleRect::center() + Vec2( _webView->getContentSize().width/2 + backBtn->getContentSize().width/2 + 10,-50 )); backBtn->addClickEventListener([=](Ref*){ _webView->goBack(); @@ -118,7 +118,7 @@ bool WebViewTest::init() Button *loadFileBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); loadFileBtn->setTitleText("Load FILE"); - loadFileBtn->setPosition(Vec2(winSize/2) - Vec2( _webView->getContentSize().width/2 + + loadFileBtn->setPosition(VisibleRect::center() - Vec2( _webView->getContentSize().width/2 + loadFileBtn->getContentSize().width/2 + 10,50 )); loadFileBtn->addClickEventListener([=](Ref*){ _webView->loadFile("Test.html"); @@ -128,7 +128,7 @@ bool WebViewTest::init() Button *loadHTMLBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); loadHTMLBtn->setTitleText("Load Data"); - loadHTMLBtn->setPosition(Vec2(winSize/2) - Vec2( _webView->getContentSize().width/2 + + loadHTMLBtn->setPosition(VisibleRect::center() - Vec2( _webView->getContentSize().width/2 + loadHTMLBtn->getContentSize().width/2 + 10,0 )); loadHTMLBtn->addClickEventListener([=](Ref*){ _webView->loadHTMLString("Hello World ","Images/"); @@ -141,10 +141,10 @@ bool WebViewTest::init() Button *evalJsBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); evalJsBtn->setTitleText("Evaluate JS"); - evalJsBtn->setPosition(Vec2(winSize/2) - Vec2( _webView->getContentSize().width/2 + + evalJsBtn->setPosition(VisibleRect::center() - Vec2( _webView->getContentSize().width/2 + evalJsBtn->getContentSize().width/2 + 10,-50 )); evalJsBtn->addClickEventListener([=](Ref*){ - _webView->evaluateJS("alert(\"hello\")"); + _webView->evaluateJS("setTimeout(function(){alert(\"hello\");}, 0)"); }); evalJsBtn->setName("evalJs"); this->addChild(evalJsBtn); @@ -152,7 +152,7 @@ bool WebViewTest::init() Button *opacityBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); opacityBtn->setTitleText("Opacity 1.f"); - opacityBtn->setPosition(Vec2(winSize/2) - Vec2( _webView->getContentSize().width/2 + + opacityBtn->setPosition(VisibleRect::center() - Vec2( _webView->getContentSize().width/2 + opacityBtn->getContentSize().width/2 + 10, 100 )); opacityBtn->addClickEventListener([=](Ref*){ auto currentOpacity = _webView->getOpacityWebView(); @@ -175,7 +175,7 @@ bool WebViewTest::init() Button *transparentBgBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); transparentBgBtn->setTitleText("Transparent BG"); - transparentBgBtn->setPosition(Vec2(winSize/2) + Vec2( _webView->getContentSize().width/2 + + transparentBgBtn->setPosition(VisibleRect::center() + Vec2( _webView->getContentSize().width/2 + transparentBgBtn->getContentSize().width/2 + 10,-100 )); transparentBgBtn->addClickEventListener([=](Ref*){ _webView->setBackgroundTransparent(); diff --git a/tests/cpp-tests/Resources/ActionTimeline/Default/Button_Disable.png b/tests/cpp-tests/Resources/ActionTimeline/Default/Button_Disable.png old mode 100644 new mode 100755 index 2266bd09055d..62ee840c40d3 Binary files a/tests/cpp-tests/Resources/ActionTimeline/Default/Button_Disable.png and b/tests/cpp-tests/Resources/ActionTimeline/Default/Button_Disable.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/Default/Sprite.png b/tests/cpp-tests/Resources/ActionTimeline/Default/Sprite.png old mode 100644 new mode 100755 index 7199a6ef4d92..115fa75667e5 Binary files a/tests/cpp-tests/Resources/ActionTimeline/Default/Sprite.png and b/tests/cpp-tests/Resources/ActionTimeline/Default/Sprite.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/01.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/01.png index 5377db476618..9dd0f7a3f7de 100644 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/01.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/01.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/1.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/1.png old mode 100644 new mode 100755 index 039478865420..065f83ff2ebf Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/1.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/1.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/2.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/2.png old mode 100644 new mode 100755 index 9f0903246a43..d5a5be287dc3 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/2.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/2.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/3.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/3.png old mode 100644 new mode 100755 index febc41ab1cd5..ad9bfdb60e82 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/3.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/3.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/4.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/4.png old mode 100644 new mode 100755 index 14020d856541..0ea0ff8179dd Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/4.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/4.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/5.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/5.png old mode 100644 new mode 100755 index 6443b87deb63..12ecbb639adf Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/5.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/5.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/6.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/6.png old mode 100644 new mode 100755 index ab5c8bdfecb9..e37584767d97 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/6.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/6.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/7.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/7.png old mode 100644 new mode 100755 index 83d7e7bc6d43..d1dc8179c9a1 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/7.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/7.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/8.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/8.png old mode 100644 new mode 100755 index 1a6f31edc02c..cf56899d0262 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/8.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/8.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/girl_arms.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/girl_arms.png index 34928c0ee5cd..b4e473296826 100644 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/girl_arms.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/girl_arms.png differ diff --git a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/hat.png b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/hat.png old mode 100644 new mode 100755 index ae84f0869750..5d1f77b357d4 Binary files a/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/hat.png and b/tests/cpp-tests/Resources/ActionTimeline/testAnimationResource/hat.png differ diff --git a/tests/cpp-tests/Resources/Hello.png b/tests/cpp-tests/Resources/Hello.png old mode 100644 new mode 100755 index ef470529d8ea..5fe89fb5bd58 Binary files a/tests/cpp-tests/Resources/Hello.png and b/tests/cpp-tests/Resources/Hello.png differ diff --git a/tests/cpp-tests/Resources/Images/Comet.png b/tests/cpp-tests/Resources/Images/Comet.png old mode 100644 new mode 100755 index e864edcc07e3..2d127a381684 Binary files a/tests/cpp-tests/Resources/Images/Comet.png and b/tests/cpp-tests/Resources/Images/Comet.png differ diff --git a/tests/cpp-tests/Resources/Images/CyanSquare.png b/tests/cpp-tests/Resources/Images/CyanSquare.png old mode 100644 new mode 100755 index c30e34de9547..a09e345c3a36 Binary files a/tests/cpp-tests/Resources/Images/CyanSquare.png and b/tests/cpp-tests/Resources/Images/CyanSquare.png differ diff --git a/tests/cpp-tests/Resources/Images/CyanTriangle.png b/tests/cpp-tests/Resources/Images/CyanTriangle.png old mode 100644 new mode 100755 index 84a0eba03d34..d98aff8dcbf0 Binary files a/tests/cpp-tests/Resources/Images/CyanTriangle.png and b/tests/cpp-tests/Resources/Images/CyanTriangle.png differ diff --git a/tests/cpp-tests/Resources/Images/Fog.png b/tests/cpp-tests/Resources/Images/Fog.png old mode 100644 new mode 100755 index 709886a9021b..16340434805a Binary files a/tests/cpp-tests/Resources/Images/Fog.png and b/tests/cpp-tests/Resources/Images/Fog.png differ diff --git a/tests/cpp-tests/Resources/Images/HelloWorld.png b/tests/cpp-tests/Resources/Images/HelloWorld.png old mode 100644 new mode 100755 index ef50e7c96fa0..b92aeeb7f6d2 Binary files a/tests/cpp-tests/Resources/Images/HelloWorld.png and b/tests/cpp-tests/Resources/Images/HelloWorld.png differ diff --git a/tests/cpp-tests/Resources/Images/Icon.png b/tests/cpp-tests/Resources/Images/Icon.png old mode 100644 new mode 100755 index 0b03366d3c7d..378483a33d31 Binary files a/tests/cpp-tests/Resources/Images/Icon.png and b/tests/cpp-tests/Resources/Images/Icon.png differ diff --git a/tests/cpp-tests/Resources/Images/MagentaSquare.png b/tests/cpp-tests/Resources/Images/MagentaSquare.png old mode 100644 new mode 100755 index ec173d1b303b..e27f4ffbe9d4 Binary files a/tests/cpp-tests/Resources/Images/MagentaSquare.png and b/tests/cpp-tests/Resources/Images/MagentaSquare.png differ diff --git a/tests/cpp-tests/Resources/Images/Pea.png b/tests/cpp-tests/Resources/Images/Pea.png old mode 100644 new mode 100755 index ba3c116b41f2..8575e8465120 Binary files a/tests/cpp-tests/Resources/Images/Pea.png and b/tests/cpp-tests/Resources/Images/Pea.png differ diff --git a/tests/cpp-tests/Resources/Images/SendScoreButton.png b/tests/cpp-tests/Resources/Images/SendScoreButton.png old mode 100644 new mode 100755 index ba5322bdcf38..974b5193dde6 Binary files a/tests/cpp-tests/Resources/Images/SendScoreButton.png and b/tests/cpp-tests/Resources/Images/SendScoreButton.png differ diff --git a/tests/cpp-tests/Resources/Images/SendScoreButtonPressed.png b/tests/cpp-tests/Resources/Images/SendScoreButtonPressed.png old mode 100644 new mode 100755 index f0d41121c883..e650bc4d3649 Binary files a/tests/cpp-tests/Resources/Images/SendScoreButtonPressed.png and b/tests/cpp-tests/Resources/Images/SendScoreButtonPressed.png differ diff --git a/tests/cpp-tests/Resources/Images/SpinningPeas.png b/tests/cpp-tests/Resources/Images/SpinningPeas.png old mode 100644 new mode 100755 index 5d7cad620bcd..24cf345bbf45 Binary files a/tests/cpp-tests/Resources/Images/SpinningPeas.png and b/tests/cpp-tests/Resources/Images/SpinningPeas.png differ diff --git a/tests/cpp-tests/Resources/Images/SpookyPeas.png b/tests/cpp-tests/Resources/Images/SpookyPeas.png old mode 100644 new mode 100755 index 5d7cad620bcd..24cf345bbf45 Binary files a/tests/cpp-tests/Resources/Images/SpookyPeas.png and b/tests/cpp-tests/Resources/Images/SpookyPeas.png differ diff --git a/tests/cpp-tests/Resources/Images/YellowSquare.png b/tests/cpp-tests/Resources/Images/YellowSquare.png old mode 100644 new mode 100755 index b70d2ac95f6d..e3956432e6bd Binary files a/tests/cpp-tests/Resources/Images/YellowSquare.png and b/tests/cpp-tests/Resources/Images/YellowSquare.png differ diff --git a/tests/cpp-tests/Resources/Images/YellowTriangle.png b/tests/cpp-tests/Resources/Images/YellowTriangle.png old mode 100644 new mode 100755 index 22baeb3c957e..bbad41e2719c Binary files a/tests/cpp-tests/Resources/Images/YellowTriangle.png and b/tests/cpp-tests/Resources/Images/YellowTriangle.png differ diff --git a/tests/cpp-tests/Resources/Images/arrows-hd.png b/tests/cpp-tests/Resources/Images/arrows-hd.png index ca8b20507ad3..1a24e6fdeccc 100644 Binary files a/tests/cpp-tests/Resources/Images/arrows-hd.png and b/tests/cpp-tests/Resources/Images/arrows-hd.png differ diff --git a/tests/cpp-tests/Resources/Images/arrows.png b/tests/cpp-tests/Resources/Images/arrows.png old mode 100644 new mode 100755 index bc8751a90cc9..77ead2d11295 Binary files a/tests/cpp-tests/Resources/Images/arrows.png and b/tests/cpp-tests/Resources/Images/arrows.png differ diff --git a/tests/cpp-tests/Resources/Images/arrowsBar-hd.png b/tests/cpp-tests/Resources/Images/arrowsBar-hd.png index d8fc67bcd5ed..694b4d97687e 100644 Binary files a/tests/cpp-tests/Resources/Images/arrowsBar-hd.png and b/tests/cpp-tests/Resources/Images/arrowsBar-hd.png differ diff --git a/tests/cpp-tests/Resources/Images/arrowsBar.png b/tests/cpp-tests/Resources/Images/arrowsBar.png old mode 100644 new mode 100755 index 884833fc8c57..bd5cd73a2cb4 Binary files a/tests/cpp-tests/Resources/Images/arrowsBar.png and b/tests/cpp-tests/Resources/Images/arrowsBar.png differ diff --git a/tests/cpp-tests/Resources/Images/assetMgrBackground2.png b/tests/cpp-tests/Resources/Images/assetMgrBackground2.png old mode 100644 new mode 100755 index 2a3132e0fee8..3ef262edd577 Binary files a/tests/cpp-tests/Resources/Images/assetMgrBackground2.png and b/tests/cpp-tests/Resources/Images/assetMgrBackground2.png differ diff --git a/tests/cpp-tests/Resources/Images/assetMgrBackground3.png b/tests/cpp-tests/Resources/Images/assetMgrBackground3.png old mode 100644 new mode 100755 index eab2722e77d0..4baa0c5bc829 Binary files a/tests/cpp-tests/Resources/Images/assetMgrBackground3.png and b/tests/cpp-tests/Resources/Images/assetMgrBackground3.png differ diff --git a/tests/cpp-tests/Resources/Images/atlastest.png b/tests/cpp-tests/Resources/Images/atlastest.png old mode 100644 new mode 100755 index 284918128c4e..51db470a8ac0 Binary files a/tests/cpp-tests/Resources/Images/atlastest.png and b/tests/cpp-tests/Resources/Images/atlastest.png differ diff --git a/tests/cpp-tests/Resources/Images/b1.png b/tests/cpp-tests/Resources/Images/b1.png old mode 100644 new mode 100755 index 5a9044874467..93ee8252f088 Binary files a/tests/cpp-tests/Resources/Images/b1.png and b/tests/cpp-tests/Resources/Images/b1.png differ diff --git a/tests/cpp-tests/Resources/Images/b2.png b/tests/cpp-tests/Resources/Images/b2.png old mode 100644 new mode 100755 index 100d91b53829..8cc30415fbd8 Binary files a/tests/cpp-tests/Resources/Images/b2.png and b/tests/cpp-tests/Resources/Images/b2.png differ diff --git a/tests/cpp-tests/Resources/Images/background.png b/tests/cpp-tests/Resources/Images/background.png old mode 100644 new mode 100755 index 2a3132e0fee8..3ef262edd577 Binary files a/tests/cpp-tests/Resources/Images/background.png and b/tests/cpp-tests/Resources/Images/background.png differ diff --git a/tests/cpp-tests/Resources/Images/background1.png b/tests/cpp-tests/Resources/Images/background1.png old mode 100644 new mode 100755 index d85dae3b3f46..55458ff57bca Binary files a/tests/cpp-tests/Resources/Images/background1.png and b/tests/cpp-tests/Resources/Images/background1.png differ diff --git a/tests/cpp-tests/Resources/Images/background2.png b/tests/cpp-tests/Resources/Images/background2.png old mode 100644 new mode 100755 index 9b98ca442400..2c5bc0b8d6bc Binary files a/tests/cpp-tests/Resources/Images/background2.png and b/tests/cpp-tests/Resources/Images/background2.png differ diff --git a/tests/cpp-tests/Resources/Images/background3.png b/tests/cpp-tests/Resources/Images/background3.png old mode 100644 new mode 100755 index eab2722e77d0..4baa0c5bc829 Binary files a/tests/cpp-tests/Resources/Images/background3.png and b/tests/cpp-tests/Resources/Images/background3.png differ diff --git a/tests/cpp-tests/Resources/Images/ball.png b/tests/cpp-tests/Resources/Images/ball.png old mode 100644 new mode 100755 index 781f2b073a33..2379f371fa78 Binary files a/tests/cpp-tests/Resources/Images/ball.png and b/tests/cpp-tests/Resources/Images/ball.png differ diff --git a/tests/cpp-tests/Resources/Images/bitmapFontTest3.png b/tests/cpp-tests/Resources/Images/bitmapFontTest3.png old mode 100644 new mode 100755 index 2c1ad5d03f80..501e3d315afc Binary files a/tests/cpp-tests/Resources/Images/bitmapFontTest3.png and b/tests/cpp-tests/Resources/Images/bitmapFontTest3.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks.png b/tests/cpp-tests/Resources/Images/blocks.png old mode 100644 new mode 100755 index 3f820111fadb..dd38d8b44835 Binary files a/tests/cpp-tests/Resources/Images/blocks.png and b/tests/cpp-tests/Resources/Images/blocks.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks9.png b/tests/cpp-tests/Resources/Images/blocks9.png old mode 100644 new mode 100755 index 4c6d29f9d7b3..1013f6ad0c1a Binary files a/tests/cpp-tests/Resources/Images/blocks9.png and b/tests/cpp-tests/Resources/Images/blocks9.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks9c.png b/tests/cpp-tests/Resources/Images/blocks9c.png index 79d069ad3eea..39674a445c4d 100644 Binary files a/tests/cpp-tests/Resources/Images/blocks9c.png and b/tests/cpp-tests/Resources/Images/blocks9c.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks9cr.png b/tests/cpp-tests/Resources/Images/blocks9cr.png index 851918a3c6b4..beea86d7f8b0 100644 Binary files a/tests/cpp-tests/Resources/Images/blocks9cr.png and b/tests/cpp-tests/Resources/Images/blocks9cr.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks9r.png b/tests/cpp-tests/Resources/Images/blocks9r.png old mode 100644 new mode 100755 index 095e695c8423..582d21752baf Binary files a/tests/cpp-tests/Resources/Images/blocks9r.png and b/tests/cpp-tests/Resources/Images/blocks9r.png differ diff --git a/tests/cpp-tests/Resources/Images/blocks9ss.png b/tests/cpp-tests/Resources/Images/blocks9ss.png old mode 100644 new mode 100755 index 5b484d960c29..0956f1d08459 Binary files a/tests/cpp-tests/Resources/Images/blocks9ss.png and b/tests/cpp-tests/Resources/Images/blocks9ss.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-about-normal-vertical.png b/tests/cpp-tests/Resources/Images/btn-about-normal-vertical.png old mode 100644 new mode 100755 index 22d83c9d3832..08a1ce61b45d Binary files a/tests/cpp-tests/Resources/Images/btn-about-normal-vertical.png and b/tests/cpp-tests/Resources/Images/btn-about-normal-vertical.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-about-normal.png b/tests/cpp-tests/Resources/Images/btn-about-normal.png old mode 100644 new mode 100755 index 8890e5aa3d3e..455ca632c0ea Binary files a/tests/cpp-tests/Resources/Images/btn-about-normal.png and b/tests/cpp-tests/Resources/Images/btn-about-normal.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-about-selected.png b/tests/cpp-tests/Resources/Images/btn-about-selected.png old mode 100644 new mode 100755 index 6b12058adb4d..20f12ecb3710 Binary files a/tests/cpp-tests/Resources/Images/btn-about-selected.png and b/tests/cpp-tests/Resources/Images/btn-about-selected.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-highscores-normal.png b/tests/cpp-tests/Resources/Images/btn-highscores-normal.png old mode 100644 new mode 100755 index 8681d07a85b0..c5c86c2de3d5 Binary files a/tests/cpp-tests/Resources/Images/btn-highscores-normal.png and b/tests/cpp-tests/Resources/Images/btn-highscores-normal.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-highscores-selected.png b/tests/cpp-tests/Resources/Images/btn-highscores-selected.png old mode 100644 new mode 100755 index 430c6d9cd4ce..ae5d9481d49f Binary files a/tests/cpp-tests/Resources/Images/btn-highscores-selected.png and b/tests/cpp-tests/Resources/Images/btn-highscores-selected.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-play-normal.png b/tests/cpp-tests/Resources/Images/btn-play-normal.png old mode 100644 new mode 100755 index 8a080cbbdcd5..976f700de0da Binary files a/tests/cpp-tests/Resources/Images/btn-play-normal.png and b/tests/cpp-tests/Resources/Images/btn-play-normal.png differ diff --git a/tests/cpp-tests/Resources/Images/btn-play-selected.png b/tests/cpp-tests/Resources/Images/btn-play-selected.png old mode 100644 new mode 100755 index 850e9fae0664..d8e8aba243b0 Binary files a/tests/cpp-tests/Resources/Images/btn-play-selected.png and b/tests/cpp-tests/Resources/Images/btn-play-selected.png differ diff --git a/tests/cpp-tests/Resources/Images/bug12847_sprite.png b/tests/cpp-tests/Resources/Images/bug12847_sprite.png index a87a6192ee12..6f13b95c676f 100644 Binary files a/tests/cpp-tests/Resources/Images/bug12847_sprite.png and b/tests/cpp-tests/Resources/Images/bug12847_sprite.png differ diff --git a/tests/cpp-tests/Resources/Images/bug12847_spriteframe.png b/tests/cpp-tests/Resources/Images/bug12847_spriteframe.png index afbe0b83959e..b63a0cc1b5c7 100644 Binary files a/tests/cpp-tests/Resources/Images/bug12847_spriteframe.png and b/tests/cpp-tests/Resources/Images/bug12847_spriteframe.png differ diff --git a/tests/cpp-tests/Resources/Images/bug14017.png b/tests/cpp-tests/Resources/Images/bug14017.png index 14aab485f0e5..824be98da729 100644 Binary files a/tests/cpp-tests/Resources/Images/bug14017.png and b/tests/cpp-tests/Resources/Images/bug14017.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/bug886.png b/tests/cpp-tests/Resources/Images/bugs/bug886.png old mode 100644 new mode 100755 index 5349301ffa8b..99fcdbbafffe Binary files a/tests/cpp-tests/Resources/Images/bugs/bug886.png and b/tests/cpp-tests/Resources/Images/bugs/bug886.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/circle.png b/tests/cpp-tests/Resources/Images/bugs/circle.png old mode 100644 new mode 100755 index 268f21062534..04722e626e86 Binary files a/tests/cpp-tests/Resources/Images/bugs/circle.png and b/tests/cpp-tests/Resources/Images/bugs/circle.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/corner.png b/tests/cpp-tests/Resources/Images/bugs/corner.png old mode 100644 new mode 100755 index 46054617f0a7..8bd0bab1b0cc Binary files a/tests/cpp-tests/Resources/Images/bugs/corner.png and b/tests/cpp-tests/Resources/Images/bugs/corner.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/edge.png b/tests/cpp-tests/Resources/Images/bugs/edge.png old mode 100644 new mode 100755 index 1f01e49ba34c..e8bc0ee3084e Binary files a/tests/cpp-tests/Resources/Images/bugs/edge.png and b/tests/cpp-tests/Resources/Images/bugs/edge.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/fill.png b/tests/cpp-tests/Resources/Images/bugs/fill.png old mode 100644 new mode 100755 index dbeaf53478ac..dfebed80c569 Binary files a/tests/cpp-tests/Resources/Images/bugs/fill.png and b/tests/cpp-tests/Resources/Images/bugs/fill.png differ diff --git a/tests/cpp-tests/Resources/Images/bugs/picture.png b/tests/cpp-tests/Resources/Images/bugs/picture.png old mode 100644 new mode 100755 index dfa44f4dbfaa..64fc17070c4f Binary files a/tests/cpp-tests/Resources/Images/bugs/picture.png and b/tests/cpp-tests/Resources/Images/bugs/picture.png differ diff --git a/tests/cpp-tests/Resources/Images/close.png b/tests/cpp-tests/Resources/Images/close.png old mode 100644 new mode 100755 index 1366a65e5d66..ef3b1d12ae6b Binary files a/tests/cpp-tests/Resources/Images/close.png and b/tests/cpp-tests/Resources/Images/close.png differ diff --git a/tests/cpp-tests/Resources/Images/cocos-html5.png b/tests/cpp-tests/Resources/Images/cocos-html5.png index 7472b2ffd832..ab7c7118e32a 100644 Binary files a/tests/cpp-tests/Resources/Images/cocos-html5.png and b/tests/cpp-tests/Resources/Images/cocos-html5.png differ diff --git a/tests/cpp-tests/Resources/Images/cocos2dbanner.png b/tests/cpp-tests/Resources/Images/cocos2dbanner.png index 2183674e545d..f60ca47c5733 100644 Binary files a/tests/cpp-tests/Resources/Images/cocos2dbanner.png and b/tests/cpp-tests/Resources/Images/cocos2dbanner.png differ diff --git a/tests/cpp-tests/Resources/Images/concave.png b/tests/cpp-tests/Resources/Images/concave.png index a985c06822e8..c39f0e9ce503 100644 Binary files a/tests/cpp-tests/Resources/Images/concave.png and b/tests/cpp-tests/Resources/Images/concave.png differ diff --git a/tests/cpp-tests/Resources/Images/dot.png b/tests/cpp-tests/Resources/Images/dot.png index b26e65f92187..eb89425ece66 100644 Binary files a/tests/cpp-tests/Resources/Images/dot.png and b/tests/cpp-tests/Resources/Images/dot.png differ diff --git a/tests/cpp-tests/Resources/Images/elephant1_Diffuse.png b/tests/cpp-tests/Resources/Images/elephant1_Diffuse.png old mode 100644 new mode 100755 index c5e2ad80860d..e73b2baa8270 Binary files a/tests/cpp-tests/Resources/Images/elephant1_Diffuse.png and b/tests/cpp-tests/Resources/Images/elephant1_Diffuse.png differ diff --git a/tests/cpp-tests/Resources/Images/elephant1_Normal.png b/tests/cpp-tests/Resources/Images/elephant1_Normal.png old mode 100644 new mode 100755 index bd52a878f187..6da6f09e0617 Binary files a/tests/cpp-tests/Resources/Images/elephant1_Normal.png and b/tests/cpp-tests/Resources/Images/elephant1_Normal.png differ diff --git a/tests/cpp-tests/Resources/Images/f1.png b/tests/cpp-tests/Resources/Images/f1.png old mode 100644 new mode 100755 index adea9fe7ddf1..385e22707b61 Binary files a/tests/cpp-tests/Resources/Images/f1.png and b/tests/cpp-tests/Resources/Images/f1.png differ diff --git a/tests/cpp-tests/Resources/Images/f2.png b/tests/cpp-tests/Resources/Images/f2.png old mode 100644 new mode 100755 index 2613cb7c6658..388a7399c5a3 Binary files a/tests/cpp-tests/Resources/Images/f2.png and b/tests/cpp-tests/Resources/Images/f2.png differ diff --git a/tests/cpp-tests/Resources/Images/fire-grayscale.png b/tests/cpp-tests/Resources/Images/fire-grayscale.png old mode 100644 new mode 100755 index aa8caf493ae0..5f48174f592e Binary files a/tests/cpp-tests/Resources/Images/fire-grayscale.png and b/tests/cpp-tests/Resources/Images/fire-grayscale.png differ diff --git a/tests/cpp-tests/Resources/Images/fire.png b/tests/cpp-tests/Resources/Images/fire.png old mode 100644 new mode 100755 index 18c5ca25df64..dd2be34cff9a Binary files a/tests/cpp-tests/Resources/Images/fire.png and b/tests/cpp-tests/Resources/Images/fire.png differ diff --git a/tests/cpp-tests/Resources/Images/fps_images.png b/tests/cpp-tests/Resources/Images/fps_images.png index 74c0f6b0767f..e91d0af540bf 100644 Binary files a/tests/cpp-tests/Resources/Images/fps_images.png and b/tests/cpp-tests/Resources/Images/fps_images.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini.png b/tests/cpp-tests/Resources/Images/grossini.png old mode 100644 new mode 100755 index bb2fb1c8aaeb..fad80b8e9af8 Binary files a/tests/cpp-tests/Resources/Images/grossini.png and b/tests/cpp-tests/Resources/Images/grossini.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_01.png b/tests/cpp-tests/Resources/Images/grossini_dance_01.png old mode 100644 new mode 100755 index f2a9e5b3b9cd..93aa6e983ac3 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_01.png and b/tests/cpp-tests/Resources/Images/grossini_dance_01.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_02.png b/tests/cpp-tests/Resources/Images/grossini_dance_02.png old mode 100644 new mode 100755 index 5dddcbe0df63..bf03d3312c36 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_02.png and b/tests/cpp-tests/Resources/Images/grossini_dance_02.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_03.png b/tests/cpp-tests/Resources/Images/grossini_dance_03.png old mode 100644 new mode 100755 index 80ef2db7b272..e01c593b40e5 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_03.png and b/tests/cpp-tests/Resources/Images/grossini_dance_03.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_04.png b/tests/cpp-tests/Resources/Images/grossini_dance_04.png old mode 100644 new mode 100755 index 1f5ea3bc4edc..c9b0ae252940 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_04.png and b/tests/cpp-tests/Resources/Images/grossini_dance_04.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_05.png b/tests/cpp-tests/Resources/Images/grossini_dance_05.png old mode 100644 new mode 100755 index fe9543994b7f..e65e6b2febb3 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_05.png and b/tests/cpp-tests/Resources/Images/grossini_dance_05.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_06.png b/tests/cpp-tests/Resources/Images/grossini_dance_06.png old mode 100644 new mode 100755 index 279c98458456..4c3be2334f25 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_06.png and b/tests/cpp-tests/Resources/Images/grossini_dance_06.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_07.png b/tests/cpp-tests/Resources/Images/grossini_dance_07.png old mode 100644 new mode 100755 index 4b0eb62253a1..4c38de3a789d Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_07.png and b/tests/cpp-tests/Resources/Images/grossini_dance_07.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_08.png b/tests/cpp-tests/Resources/Images/grossini_dance_08.png old mode 100644 new mode 100755 index bb2fb1c8aaeb..fad80b8e9af8 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_08.png and b/tests/cpp-tests/Resources/Images/grossini_dance_08.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_09.png b/tests/cpp-tests/Resources/Images/grossini_dance_09.png old mode 100644 new mode 100755 index ace80c5a611e..b0fa9aded3a3 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_09.png and b/tests/cpp-tests/Resources/Images/grossini_dance_09.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_10.png b/tests/cpp-tests/Resources/Images/grossini_dance_10.png old mode 100644 new mode 100755 index 47fbcd3061d5..0abb6eab9397 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_10.png and b/tests/cpp-tests/Resources/Images/grossini_dance_10.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_11.png b/tests/cpp-tests/Resources/Images/grossini_dance_11.png old mode 100644 new mode 100755 index 5d32b097ee61..7285fd6c76de Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_11.png and b/tests/cpp-tests/Resources/Images/grossini_dance_11.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_12.png b/tests/cpp-tests/Resources/Images/grossini_dance_12.png old mode 100644 new mode 100755 index 26d848203a6d..ce7d672004da Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_12.png and b/tests/cpp-tests/Resources/Images/grossini_dance_12.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_13.png b/tests/cpp-tests/Resources/Images/grossini_dance_13.png old mode 100644 new mode 100755 index fe29977f2bd7..92cbbd4da184 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_13.png and b/tests/cpp-tests/Resources/Images/grossini_dance_13.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_14.png b/tests/cpp-tests/Resources/Images/grossini_dance_14.png old mode 100644 new mode 100755 index 9bc05feed818..ee7d1bba0aea Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_14.png and b/tests/cpp-tests/Resources/Images/grossini_dance_14.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_atlas-mono.png b/tests/cpp-tests/Resources/Images/grossini_dance_atlas-mono.png old mode 100644 new mode 100755 index c01129672137..932ba39c5919 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_atlas-mono.png and b/tests/cpp-tests/Resources/Images/grossini_dance_atlas-mono.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_atlas.png b/tests/cpp-tests/Resources/Images/grossini_dance_atlas.png old mode 100644 new mode 100755 index 28607fdc7758..12bca1310fd7 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_atlas.png and b/tests/cpp-tests/Resources/Images/grossini_dance_atlas.png differ diff --git a/tests/cpp-tests/Resources/Images/grossini_dance_atlas_nomipmap.png b/tests/cpp-tests/Resources/Images/grossini_dance_atlas_nomipmap.png old mode 100644 new mode 100755 index 28607fdc7758..12bca1310fd7 Binary files a/tests/cpp-tests/Resources/Images/grossini_dance_atlas_nomipmap.png and b/tests/cpp-tests/Resources/Images/grossini_dance_atlas_nomipmap.png differ diff --git a/tests/cpp-tests/Resources/Images/grossinis_heads.png b/tests/cpp-tests/Resources/Images/grossinis_heads.png index 1b76039fae6f..47dddc50e86f 100644 Binary files a/tests/cpp-tests/Resources/Images/grossinis_heads.png and b/tests/cpp-tests/Resources/Images/grossinis_heads.png differ diff --git a/tests/cpp-tests/Resources/Images/grossinis_sister1-testalpha.png b/tests/cpp-tests/Resources/Images/grossinis_sister1-testalpha.png old mode 100644 new mode 100755 index cbf7e29c4d46..1715123a8bd6 Binary files a/tests/cpp-tests/Resources/Images/grossinis_sister1-testalpha.png and b/tests/cpp-tests/Resources/Images/grossinis_sister1-testalpha.png differ diff --git a/tests/cpp-tests/Resources/Images/grossinis_sister1.png b/tests/cpp-tests/Resources/Images/grossinis_sister1.png old mode 100644 new mode 100755 index ffbcd59b87ff..5be7918a604c Binary files a/tests/cpp-tests/Resources/Images/grossinis_sister1.png and b/tests/cpp-tests/Resources/Images/grossinis_sister1.png differ diff --git a/tests/cpp-tests/Resources/Images/grossinis_sister2.png b/tests/cpp-tests/Resources/Images/grossinis_sister2.png old mode 100644 new mode 100755 index 39c9556c28a3..b25d759a8fbe Binary files a/tests/cpp-tests/Resources/Images/grossinis_sister2.png and b/tests/cpp-tests/Resources/Images/grossinis_sister2.png differ diff --git a/tests/cpp-tests/Resources/Images/hole_effect.png b/tests/cpp-tests/Resources/Images/hole_effect.png old mode 100644 new mode 100755 index 29b98d78b1f2..da1f7e215b22 Binary files a/tests/cpp-tests/Resources/Images/hole_effect.png and b/tests/cpp-tests/Resources/Images/hole_effect.png differ diff --git a/tests/cpp-tests/Resources/Images/hole_stencil.png b/tests/cpp-tests/Resources/Images/hole_stencil.png old mode 100644 new mode 100755 index 36054c48ec47..9f69c3e0cb98 Binary files a/tests/cpp-tests/Resources/Images/hole_stencil.png and b/tests/cpp-tests/Resources/Images/hole_stencil.png differ diff --git a/tests/cpp-tests/Resources/Images/island_polygon.png b/tests/cpp-tests/Resources/Images/island_polygon.png index 3302f98ef4e8..d56140752905 100644 Binary files a/tests/cpp-tests/Resources/Images/island_polygon.png and b/tests/cpp-tests/Resources/Images/island_polygon.png differ diff --git a/tests/cpp-tests/Resources/Images/issue_17116.png b/tests/cpp-tests/Resources/Images/issue_17116.png index 6e3c2b27d1dc..5433f5d08c8a 100644 Binary files a/tests/cpp-tests/Resources/Images/issue_17116.png and b/tests/cpp-tests/Resources/Images/issue_17116.png differ diff --git a/tests/cpp-tests/Resources/Images/issue_17119.png b/tests/cpp-tests/Resources/Images/issue_17119.png index dc0901d40d83..c368260304b4 100644 Binary files a/tests/cpp-tests/Resources/Images/issue_17119.png and b/tests/cpp-tests/Resources/Images/issue_17119.png differ diff --git a/tests/cpp-tests/Resources/Images/labelatlas.png b/tests/cpp-tests/Resources/Images/labelatlas.png old mode 100644 new mode 100755 index a6c5440b8f99..41486794cd0b Binary files a/tests/cpp-tests/Resources/Images/labelatlas.png and b/tests/cpp-tests/Resources/Images/labelatlas.png differ diff --git a/tests/cpp-tests/Resources/Images/menuitemsprite.png b/tests/cpp-tests/Resources/Images/menuitemsprite.png old mode 100644 new mode 100755 index fed3a4bdc110..ae97b916b21d Binary files a/tests/cpp-tests/Resources/Images/menuitemsprite.png and b/tests/cpp-tests/Resources/Images/menuitemsprite.png differ diff --git a/tests/cpp-tests/Resources/Images/movement.png b/tests/cpp-tests/Resources/Images/movement.png index ee09a90380a3..5dd324c37cab 100644 Binary files a/tests/cpp-tests/Resources/Images/movement.png and b/tests/cpp-tests/Resources/Images/movement.png differ diff --git a/tests/cpp-tests/Resources/Images/noise.png b/tests/cpp-tests/Resources/Images/noise.png old mode 100644 new mode 100755 index 35adb41b6ba7..22be01654ca3 Binary files a/tests/cpp-tests/Resources/Images/noise.png and b/tests/cpp-tests/Resources/Images/noise.png differ diff --git a/tests/cpp-tests/Resources/Images/paddle.png b/tests/cpp-tests/Resources/Images/paddle.png old mode 100644 new mode 100755 index bd4c6f9457fb..eefd7e75355f Binary files a/tests/cpp-tests/Resources/Images/paddle.png and b/tests/cpp-tests/Resources/Images/paddle.png differ diff --git a/tests/cpp-tests/Resources/Images/particles-hd.png b/tests/cpp-tests/Resources/Images/particles-hd.png index 4fd96747f1bb..664a48e6d37c 100644 Binary files a/tests/cpp-tests/Resources/Images/particles-hd.png and b/tests/cpp-tests/Resources/Images/particles-hd.png differ diff --git a/tests/cpp-tests/Resources/Images/particles.png b/tests/cpp-tests/Resources/Images/particles.png old mode 100644 new mode 100755 index af8e5f7d5e7b..236e5a07a75c Binary files a/tests/cpp-tests/Resources/Images/particles.png and b/tests/cpp-tests/Resources/Images/particles.png differ diff --git a/tests/cpp-tests/Resources/Images/pattern1.png b/tests/cpp-tests/Resources/Images/pattern1.png old mode 100644 new mode 100755 index 3c9c57ee673d..a55490726db9 Binary files a/tests/cpp-tests/Resources/Images/pattern1.png and b/tests/cpp-tests/Resources/Images/pattern1.png differ diff --git a/tests/cpp-tests/Resources/Images/piece.png b/tests/cpp-tests/Resources/Images/piece.png old mode 100644 new mode 100755 index 5c496f961bfa..41367e45748f Binary files a/tests/cpp-tests/Resources/Images/piece.png and b/tests/cpp-tests/Resources/Images/piece.png differ diff --git a/tests/cpp-tests/Resources/Images/poly_test_textures.png b/tests/cpp-tests/Resources/Images/poly_test_textures.png index cbddd2ecd93a..484cc56942da 100644 Binary files a/tests/cpp-tests/Resources/Images/poly_test_textures.png and b/tests/cpp-tests/Resources/Images/poly_test_textures.png differ diff --git a/tests/cpp-tests/Resources/Images/powered.png b/tests/cpp-tests/Resources/Images/powered.png old mode 100644 new mode 100755 index 43116b8b6eb4..0ef51fd3a8a7 Binary files a/tests/cpp-tests/Resources/Images/powered.png and b/tests/cpp-tests/Resources/Images/powered.png differ diff --git a/tests/cpp-tests/Resources/Images/r1.png b/tests/cpp-tests/Resources/Images/r1.png old mode 100644 new mode 100755 index b145f5dc0630..96c070883199 Binary files a/tests/cpp-tests/Resources/Images/r1.png and b/tests/cpp-tests/Resources/Images/r1.png differ diff --git a/tests/cpp-tests/Resources/Images/r2.png b/tests/cpp-tests/Resources/Images/r2.png old mode 100644 new mode 100755 index 40b7cd5dbdff..1caf31f4bd82 Binary files a/tests/cpp-tests/Resources/Images/r2.png and b/tests/cpp-tests/Resources/Images/r2.png differ diff --git a/tests/cpp-tests/Resources/Images/shapemode.png b/tests/cpp-tests/Resources/Images/shapemode.png index 6c68b481c7a6..ebba704154b1 100644 Binary files a/tests/cpp-tests/Resources/Images/shapemode.png and b/tests/cpp-tests/Resources/Images/shapemode.png differ diff --git a/tests/cpp-tests/Resources/Images/snow.png b/tests/cpp-tests/Resources/Images/snow.png old mode 100644 new mode 100755 index a9de1a2d25fa..860b58107624 Binary files a/tests/cpp-tests/Resources/Images/snow.png and b/tests/cpp-tests/Resources/Images/snow.png differ diff --git a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_A8.png b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_A8.png index 397d384839a4..2f4630804f40 100644 Binary files a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_A8.png and b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_A8.png differ diff --git a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_AI88.png b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_AI88.png index 7cdc9a99cad2..105fa481e785 100644 Binary files a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_AI88.png and b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_AI88.png differ diff --git a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_RGBA8888.png b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_RGBA8888.png index 2a165394a0ea..ab9888d9667f 100644 Binary files a/tests/cpp-tests/Resources/Images/sprite_frames_test/test_RGBA8888.png and b/tests/cpp-tests/Resources/Images/sprite_frames_test/test_RGBA8888.png differ diff --git a/tests/cpp-tests/Resources/Images/sprite_polygon_crash.png b/tests/cpp-tests/Resources/Images/sprite_polygon_crash.png index d421a0514790..ec8d2fe590ee 100644 Binary files a/tests/cpp-tests/Resources/Images/sprite_polygon_crash.png and b/tests/cpp-tests/Resources/Images/sprite_polygon_crash.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-0.png old mode 100644 new mode 100755 index fe8d85a588e3..8256a5299290 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-1.png old mode 100644 new mode 100755 index 0e9c6ee27357..ea7d815696ba Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-2.png old mode 100644 new mode 100755 index 02b6fefe81f2..fb444b334845 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-3.png old mode 100644 new mode 100755 index 771b378a5fb8..81f6c287b9ff Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-4.png old mode 100644 new mode 100755 index 2438a3642274..a0d5ba8621f1 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-5.png old mode 100644 new mode 100755 index d5cf70d64135..307968b441f8 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-6.png old mode 100644 new mode 100755 index c88b760fd100..e98bbcd94e25 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-7.png old mode 100644 new mode 100755 index a757cb9c5ef8..5c13bee7b5fe Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-0-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-0.png old mode 100644 new mode 100755 index c7e96a30c33b..55836459810f Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-1.png old mode 100644 new mode 100755 index 9416bb457a21..665bb8b606fc Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-2.png old mode 100644 new mode 100755 index 58163427b00c..f73989bc7170 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-3.png old mode 100644 new mode 100755 index 178f9805e1c9..92cdc270d936 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-4.png old mode 100644 new mode 100755 index 1c7c1c5be906..d4c4ff36b10b Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-5.png old mode 100644 new mode 100755 index a0fa121e52e2..95fb8ba7e958 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-6.png old mode 100644 new mode 100755 index 5aa716bfa0aa..b576d2e3e65d Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-7.png old mode 100644 new mode 100755 index d6685102dc18..f0367c971d56 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-1-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-0.png old mode 100644 new mode 100755 index bf282a0a5c31..71044a10b13a Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-1.png old mode 100644 new mode 100755 index ccc921bdf5d8..3feb9e940f3c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-2.png old mode 100644 new mode 100755 index 22c8b6da6f9e..e7e874043938 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-3.png old mode 100644 new mode 100755 index 11e8b340f134..6ef5cc5e788b Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-4.png old mode 100644 new mode 100755 index cf9455689ae1..c6ac17cac89e Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-5.png old mode 100644 new mode 100755 index aad456f23c54..d496e3d02795 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-6.png old mode 100644 new mode 100755 index b29c19255513..066b38a5cf68 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-7.png old mode 100644 new mode 100755 index daebd72c50f5..78c89fc74848 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-2-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-0.png old mode 100644 new mode 100755 index 5de148f278f0..230107e65be5 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-1.png old mode 100644 new mode 100755 index b550aae37ae2..ec5990d45159 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-2.png old mode 100644 new mode 100755 index 7f12816e1e77..70b510b38c45 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-3.png old mode 100644 new mode 100755 index 0391552b1ac3..3b7d911e222f Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-4.png old mode 100644 new mode 100755 index 9c70c0a54187..8455784e3afe Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-5.png old mode 100644 new mode 100755 index ebb09b9012ca..2d28698df5e9 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-6.png old mode 100644 new mode 100755 index f31ebf6a7dd9..fdc30ee923ff Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-7.png old mode 100644 new mode 100755 index d13deb9bbd50..7dfd55fda38b Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-3-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-0.png old mode 100644 new mode 100755 index f1d6d6b2103f..6bfc144c7e51 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-1.png old mode 100644 new mode 100755 index 3379df52aa15..15d6eb1543d4 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-2.png old mode 100644 new mode 100755 index cf80a18d3081..32190cb70dca Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-3.png old mode 100644 new mode 100755 index e6a541173afa..2e0320578ad3 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-4.png old mode 100644 new mode 100755 index ed44270955bb..f0708bb42127 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-5.png old mode 100644 new mode 100755 index 16d079ea2bcc..6c9ec9f39f0c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-6.png old mode 100644 new mode 100755 index 252c543e295b..d93f278fd71e Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-7.png old mode 100644 new mode 100755 index b7c32e31ed94..5dce60c7119f Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-4-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-0.png old mode 100644 new mode 100755 index 40a663dbe989..1adff7adeed4 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-1.png old mode 100644 new mode 100755 index 87e3ded7959a..c3e56fe1662c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-2.png old mode 100644 new mode 100755 index 83a8a027969f..3659a67fe5a8 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-3.png old mode 100644 new mode 100755 index 41a3eb0a24e9..5e771251db39 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-4.png old mode 100644 new mode 100755 index 5fb456e2e6ca..907c3696c280 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-5.png old mode 100644 new mode 100755 index c979be13695b..a9175a5d0bf8 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-6.png old mode 100644 new mode 100755 index 54765e3dbe31..14bf384a9c1f Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-7.png old mode 100644 new mode 100755 index 7886066c5ba0..6d3017014732 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-5-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-0.png old mode 100644 new mode 100755 index 456366f0abc1..11be173003cc Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-1.png old mode 100644 new mode 100755 index e15e60ea2f85..259b7aed5330 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-2.png old mode 100644 new mode 100755 index d9c116855c64..b9bae9d70331 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-3.png old mode 100644 new mode 100755 index ea50e0e784f0..a84b7b5d0961 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-4.png old mode 100644 new mode 100755 index df33aba630ef..5ec22013c41c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-5.png old mode 100644 new mode 100755 index b51baf671516..3c07dc5190bc Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-6.png old mode 100644 new mode 100755 index 0eb505f80a8a..de9e1e6b4aad Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-7.png old mode 100644 new mode 100755 index da4b15ba9e2c..0cf0e8fc17bc Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-6-7.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-0.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-0.png old mode 100644 new mode 100755 index 9417639710df..58964c3fd83b Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-0.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-0.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-1.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-1.png old mode 100644 new mode 100755 index c997eca675cd..b733b95b4f94 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-1.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-1.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-2.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-2.png old mode 100644 new mode 100755 index 8f98bf07394e..14404fa36b6c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-2.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-2.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-3.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-3.png old mode 100644 new mode 100755 index 498056031765..1770b6982fb4 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-3.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-3.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-4.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-4.png old mode 100644 new mode 100755 index 1a07cfc99d77..3be136596ed4 Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-4.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-4.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-5.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-5.png old mode 100644 new mode 100755 index fdaa96907a51..594a7a8a732a Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-5.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-5.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-6.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-6.png old mode 100644 new mode 100755 index 11a33e4ab6e1..72a7ff18705a Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-6.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-6.png differ diff --git a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-7.png b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-7.png old mode 100644 new mode 100755 index 7108fb7f3faf..0287bd77116c Binary files a/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-7.png and b/tests/cpp-tests/Resources/Images/sprites_test/sprite-7-7.png differ diff --git a/tests/cpp-tests/Resources/Images/stars-grayscale.png b/tests/cpp-tests/Resources/Images/stars-grayscale.png old mode 100644 new mode 100755 index 585e45faec6c..fe47acd4fc04 Binary files a/tests/cpp-tests/Resources/Images/stars-grayscale.png and b/tests/cpp-tests/Resources/Images/stars-grayscale.png differ diff --git a/tests/cpp-tests/Resources/Images/stars.png b/tests/cpp-tests/Resources/Images/stars.png old mode 100644 new mode 100755 index 585e45faec6c..fe47acd4fc04 Binary files a/tests/cpp-tests/Resources/Images/stars.png and b/tests/cpp-tests/Resources/Images/stars.png differ diff --git a/tests/cpp-tests/Resources/Images/stars2-grayscale.png b/tests/cpp-tests/Resources/Images/stars2-grayscale.png old mode 100644 new mode 100755 index 2db010fb5fe4..ef841f9df569 Binary files a/tests/cpp-tests/Resources/Images/stars2-grayscale.png and b/tests/cpp-tests/Resources/Images/stars2-grayscale.png differ diff --git a/tests/cpp-tests/Resources/Images/stars2.png b/tests/cpp-tests/Resources/Images/stars2.png old mode 100644 new mode 100755 index cc0d7e1d09f7..ef841f9df569 Binary files a/tests/cpp-tests/Resources/Images/stars2.png and b/tests/cpp-tests/Resources/Images/stars2.png differ diff --git a/tests/cpp-tests/Resources/Images/stone.png b/tests/cpp-tests/Resources/Images/stone.png old mode 100644 new mode 100755 index 6ae4717a39cc..069608062110 Binary files a/tests/cpp-tests/Resources/Images/stone.png and b/tests/cpp-tests/Resources/Images/stone.png differ diff --git a/tests/cpp-tests/Resources/Images/streak.png b/tests/cpp-tests/Resources/Images/streak.png old mode 100644 new mode 100755 index 39255df13bc9..c602c98fc19b Binary files a/tests/cpp-tests/Resources/Images/streak.png and b/tests/cpp-tests/Resources/Images/streak.png differ diff --git a/tests/cpp-tests/Resources/Images/test-rgba1.png b/tests/cpp-tests/Resources/Images/test-rgba1.png old mode 100644 new mode 100755 index 5ec33bc1c244..302c63a08a36 Binary files a/tests/cpp-tests/Resources/Images/test-rgba1.png and b/tests/cpp-tests/Resources/Images/test-rgba1.png differ diff --git a/tests/cpp-tests/Resources/Images/test_blend.png b/tests/cpp-tests/Resources/Images/test_blend.png old mode 100644 new mode 100755 index 9ea7afaebe9f..de4cd69292b3 Binary files a/tests/cpp-tests/Resources/Images/test_blend.png and b/tests/cpp-tests/Resources/Images/test_blend.png differ diff --git a/tests/cpp-tests/Resources/Images/test_image.png b/tests/cpp-tests/Resources/Images/test_image.png old mode 100644 new mode 100755 index a094b8ff9484..eaf947476415 Binary files a/tests/cpp-tests/Resources/Images/test_image.png and b/tests/cpp-tests/Resources/Images/test_image.png differ diff --git a/tests/cpp-tests/Resources/Images/test_image_ai88.png b/tests/cpp-tests/Resources/Images/test_image_ai88.png old mode 100644 new mode 100755 index 5280de245b9d..7d0aa3110735 Binary files a/tests/cpp-tests/Resources/Images/test_image_ai88.png and b/tests/cpp-tests/Resources/Images/test_image_ai88.png differ diff --git a/tests/cpp-tests/Resources/Images/test_image_i8.png b/tests/cpp-tests/Resources/Images/test_image_i8.png old mode 100644 new mode 100755 index 707dadd03b8d..d35273890494 Binary files a/tests/cpp-tests/Resources/Images/test_image_i8.png and b/tests/cpp-tests/Resources/Images/test_image_i8.png differ diff --git a/tests/cpp-tests/Resources/Images/test_image_rgb888.png b/tests/cpp-tests/Resources/Images/test_image_rgb888.png old mode 100644 new mode 100755 index 6eadd9b9b089..173b63093f07 Binary files a/tests/cpp-tests/Resources/Images/test_image_rgb888.png and b/tests/cpp-tests/Resources/Images/test_image_rgb888.png differ diff --git a/tests/cpp-tests/Resources/Images/test_image_rgba8888.png b/tests/cpp-tests/Resources/Images/test_image_rgba8888.png old mode 100644 new mode 100755 index eef590c9f090..c6b6395312e7 Binary files a/tests/cpp-tests/Resources/Images/test_image_rgba8888.png and b/tests/cpp-tests/Resources/Images/test_image_rgba8888.png differ diff --git a/tests/cpp-tests/Resources/Images/test_polygon.png b/tests/cpp-tests/Resources/Images/test_polygon.png index 639a2b9fb001..c54a8480bb98 100644 Binary files a/tests/cpp-tests/Resources/Images/test_polygon.png and b/tests/cpp-tests/Resources/Images/test_polygon.png differ diff --git a/tests/cpp-tests/Resources/Images/texture1024x1024.png b/tests/cpp-tests/Resources/Images/texture1024x1024.png old mode 100644 new mode 100755 index 7f99d8d7b432..12a15fae99ec Binary files a/tests/cpp-tests/Resources/Images/texture1024x1024.png and b/tests/cpp-tests/Resources/Images/texture1024x1024.png differ diff --git a/tests/cpp-tests/Resources/Images/texture2048x2048.png b/tests/cpp-tests/Resources/Images/texture2048x2048.png old mode 100644 new mode 100755 index b9482e0d637f..3db29c49dc16 Binary files a/tests/cpp-tests/Resources/Images/texture2048x2048.png and b/tests/cpp-tests/Resources/Images/texture2048x2048.png differ diff --git a/tests/cpp-tests/Resources/Images/texture512x512.png b/tests/cpp-tests/Resources/Images/texture512x512.png old mode 100644 new mode 100755 index ad432559b7be..170c02fd828c Binary files a/tests/cpp-tests/Resources/Images/texture512x512.png and b/tests/cpp-tests/Resources/Images/texture512x512.png differ diff --git a/tests/cpp-tests/Resources/Images/texturemode.png b/tests/cpp-tests/Resources/Images/texturemode.png index 6310483bb0e8..0202080e9fc7 100644 Binary files a/tests/cpp-tests/Resources/Images/texturemode.png and b/tests/cpp-tests/Resources/Images/texturemode.png differ diff --git a/tests/cpp-tests/Resources/Images/ui.png b/tests/cpp-tests/Resources/Images/ui.png old mode 100644 new mode 100755 index 725ba8bd2db9..9a702b025f3b Binary files a/tests/cpp-tests/Resources/Images/ui.png and b/tests/cpp-tests/Resources/Images/ui.png differ diff --git a/tests/cpp-tests/Resources/Images/white-512x512.png b/tests/cpp-tests/Resources/Images/white-512x512.png old mode 100644 new mode 100755 index ad432559b7be..170c02fd828c Binary files a/tests/cpp-tests/Resources/Images/white-512x512.png and b/tests/cpp-tests/Resources/Images/white-512x512.png differ diff --git a/tests/cpp-tests/Resources/InputTest/cursor1.png b/tests/cpp-tests/Resources/InputTest/cursor1.png new file mode 100644 index 000000000000..973d3eafe0e7 Binary files /dev/null and b/tests/cpp-tests/Resources/InputTest/cursor1.png differ diff --git a/tests/cpp-tests/Resources/InputTest/cursor2.png b/tests/cpp-tests/Resources/InputTest/cursor2.png new file mode 100644 index 000000000000..d0d625191c02 Binary files /dev/null and b/tests/cpp-tests/Resources/InputTest/cursor2.png differ diff --git a/tests/cpp-tests/Resources/NavMesh/maps/scenetex.png b/tests/cpp-tests/Resources/NavMesh/maps/scenetex.png index f05f915f26a0..ce473f8dac5b 100644 Binary files a/tests/cpp-tests/Resources/NavMesh/maps/scenetex.png and b/tests/cpp-tests/Resources/NavMesh/maps/scenetex.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/crate6.png b/tests/cpp-tests/Resources/Particle3D/textures/crate6.png index 60181f8ee7f2..a7b0b0ecb3fe 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/crate6.png and b/tests/cpp-tests/Resources/Particle3D/textures/crate6.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/interpolate.png b/tests/cpp-tests/Resources/Particle3D/textures/interpolate.png index f1c83bbac5a9..29620cdca515 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/interpolate.png and b/tests/cpp-tests/Resources/Particle3D/textures/interpolate.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png b/tests/cpp-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png index 2e1e0dd13b17..18d6946ca4a3 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png and b/tests/cpp-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_01.png index 5605bad63369..402d821b1404 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_02.png index b4ca8f9f55bd..b5ee14b6cd6e 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_barrel_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_bbal.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_bbal.png index af4380cfcadb..7b76a89eb2f4 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_bbal.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_bbal.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_01.png index 7e768ecce2d7..b11f8435def4 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_02.png index 3c66c8e80d8b..144fb2b9b28e 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_beam_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_circle.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_circle.png index 69e0858cbd58..250f42b99cdc 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_circle.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_circle.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_dirt_256x512.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_dirt_256x512.png index 021ef560f9f0..7e95b872cb92 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_dirt_256x512.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_dirt_256x512.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png index e462d80d5ae9..0d85ab4e2c53 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png index d04468b7b537..f54578862def 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_flame.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_flame.png index 0850609893d1..5b92b5e66f33 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_flame.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_flame.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_flare.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_flare.png index 71a6811d69cf..4909d7fbf13b 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_flare.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_flare.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png index 647eee58a0df..f2c40269cef9 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_green_ball.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_green_ball.png index 5cab70eadd78..bbb484f3f561 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_green_ball.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_green_ball.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_hart.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_hart.png index 5caf72594f68..54a02515dcf9 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_hart.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_hart.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_lightning_20x64.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_lightning_20x64.png index b232b824d177..a55a98c146d5 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_lightning_20x64.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_lightning_20x64.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_nucleus.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_nucleus.png index 5c9c9e1cfc81..0c7bf955e454 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_nucleus.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_nucleus.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_rain.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_rain.png index da23752a4f0f..92d77d2bebba 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_rain.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_rain.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_rain_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_rain_01.png index a2c51e9ee047..fc316b7df4ad 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_rain_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_rain_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_ribbontrail.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_ribbontrail.png index 27921b993ab6..e6966640c0b6 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_ribbontrail.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_ribbontrail.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_sand_336x330.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_sand_336x330.png index 538aee32f83e..ae895594aeb1 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_sand_336x330.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_sand_336x330.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png index 63e81beb1cdc..d33371658655 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png b/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png index 884f43a0e028..9d13cb3c9abe 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png and b/tests/cpp-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_atlas_smoke.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_atlas_smoke.png index c43f4ec8294e..f946f98f9bdd 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_atlas_smoke.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_atlas_smoke.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_biohazzard.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_biohazzard.png index e11b4b29aa54..091be2f87a79 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_biohazzard.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_biohazzard.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble.png index f105f5abf58b..1eec4a3c0667 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble_blurred.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble_blurred.png index e684bfcf8e1d..a8411139e2ea 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble_blurred.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_bubble_blurred.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_celticknot.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_celticknot.png index 601073e71faf..22c9cd8bbbab 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_celticknot.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_celticknot.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_01.png index e4f130c9d7a2..c259757bb071 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_02.png index b622b957295d..9a026c93c108 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_dirt_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_01.png index 2753d30da608..ed9dc42e1e90 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_02.png index f01916dfeb25..c407c30cbc46 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_03.png index e042fcf5feeb..e77d9983d323 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_04.png index 30261a8702d4..592946aa63ea 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flame_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_01.png index 524b28c88085..a90214bbda43 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_02.png index 92a8be4384b7..8ead0155b234 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_03.png index c66f7879978f..1dc469c8e7f3 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_04.png index 8cce2882d2f8..868431ec1c77 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_05.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_05.png index e8fe09b736c2..469acc2de7a1 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_05.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_05.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_06.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_06.png index bf1e65a99e5a..60dadf22be82 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_06.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_flare_06.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_01.png index 2cabcb94b56f..5edcb8eebffc 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_02.png index 04b2c121df42..5473d523a5ef 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_genesis_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_hourglass.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_hourglass.png index 2ec45ed8801a..b322dc56cdca 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_hourglass.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_hourglass.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_leave.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_leave.png index 45dd306cd80a..1cda97a7dba4 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_leave.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_leave.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_01.png index 7a0cb2cd2ebb..a48297ddae0d 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_02.png index 4c1f7be42587..a9dd25c2f77a 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_03.png index 6281e5cab27e..095c1194a589 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_04.png index bfbebc09922f..01f9f07bbbd0 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_lightning_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png index a14efd19f64f..81010780e47c 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_01.png index daf6ed73910a..d77658644435 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_02.png index 55d80f3ebda2..e98fcad67394 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_metal_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_mmviii.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_mmviii.png index e672541541da..5cf2fa9153cc 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_mmviii.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_mmviii.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_01.png index 016c66a43673..836830d7c75c 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_02.png index 6c52a74afcef..49ddcbc954d3 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_pentagram_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_01.png index 918535e48d22..e52ae2032c41 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_02.png index cd97c20386da..c3c54817eb9c 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_03.png index f8b0e9cf61f3..812453c62519 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_04.png index 64b93dd8ffc6..871a3191ff1a 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_05.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_05.png index 09ca42eff830..f0deb8434e76 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_05.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_ring_05.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_01.png index 9374bd92863f..3e2735a056a3 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_02.png index fd3e2dcc857a..0313fadf602e 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_03.png index 2844d53c2f9e..cd0d92f68b5f 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_04.png index f8ae47690363..41bc91bf0888 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_05.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_05.png index 2a93e4d42968..b70942aebb6f 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_05.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_05.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_06.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_06.png index 58a855950e46..6a23466c31c8 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_06.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_06.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_07.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_07.png index 67504aee43c6..6a05665f746e 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_07.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_smoke_07.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_snow_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_snow_01.png index 46dd462a10b2..95c414e01820 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_snow_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_snow_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_spark_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_spark_01.png index c49dde08cc1f..2e826d60f43a 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_spark_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_spark_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_01.png index ab92bc7091d4..20b4a915f537 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_02.png index f122c96902c2..2ab43259b700 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_03.png index 49da4feb6422..21a5d4eb6918 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_04.png index c49d679ad6da..8864c5b5e173 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_05.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_05.png index 45e72084b796..34dbd49c40b0 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_star_05.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_star_05.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_01.png index f53993072995..5b2ce2ef20eb 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_02.png index 9b1d397d31a7..893c42189015 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_03.png index bf7ad7fc70f6..a9cd103b402e 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_04.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_04.png index f20606b1409c..cf0d7c79fedb 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_04.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_streak_04.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_01.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_01.png index a88aee273934..418137432e43 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_01.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_01.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_02.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_02.png index b606974a9344..1825ba5dcc41 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_02.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_02.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_03.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_03.png index 30926d45f278..35b8463fcf43 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_03.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_swirl_03.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/pump_watch.png b/tests/cpp-tests/Resources/Particle3D/textures/pump_watch.png index fb21667e469b..038fc737d4f3 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/pump_watch.png and b/tests/cpp-tests/Resources/Particle3D/textures/pump_watch.png differ diff --git a/tests/cpp-tests/Resources/Particle3D/textures/weaponTrail.png b/tests/cpp-tests/Resources/Particle3D/textures/weaponTrail.png index e34dff9f0bb9..4fadb7e89f1a 100644 Binary files a/tests/cpp-tests/Resources/Particle3D/textures/weaponTrail.png and b/tests/cpp-tests/Resources/Particle3D/textures/weaponTrail.png differ diff --git a/tests/cpp-tests/Resources/Particles/SpriteFrame.png b/tests/cpp-tests/Resources/Particles/SpriteFrame.png index 5d34d1ddfb63..efef9f9a2e8d 100644 Binary files a/tests/cpp-tests/Resources/Particles/SpriteFrame.png and b/tests/cpp-tests/Resources/Particles/SpriteFrame.png differ diff --git a/tests/cpp-tests/Resources/Presentation/chipmunk_status.png b/tests/cpp-tests/Resources/Presentation/chipmunk_status.png index c1dcf1b9619f..ce772e536c8a 100644 Binary files a/tests/cpp-tests/Resources/Presentation/chipmunk_status.png and b/tests/cpp-tests/Resources/Presentation/chipmunk_status.png differ diff --git a/tests/cpp-tests/Resources/Presentation/cocos2d_status.png b/tests/cpp-tests/Resources/Presentation/cocos2d_status.png index 7977da956024..f2eb13d49808 100644 Binary files a/tests/cpp-tests/Resources/Presentation/cocos2d_status.png and b/tests/cpp-tests/Resources/Presentation/cocos2d_status.png differ diff --git a/tests/cpp-tests/Resources/Presentation/cocosbuilder_status.png b/tests/cpp-tests/Resources/Presentation/cocosbuilder_status.png index 00f097868d61..8589cd257544 100644 Binary files a/tests/cpp-tests/Resources/Presentation/cocosbuilder_status.png and b/tests/cpp-tests/Resources/Presentation/cocosbuilder_status.png differ diff --git a/tests/cpp-tests/Resources/Presentation/comparison.png b/tests/cpp-tests/Resources/Presentation/comparison.png index e5b12b5934ca..6f94a831b7ce 100644 Binary files a/tests/cpp-tests/Resources/Presentation/comparison.png and b/tests/cpp-tests/Resources/Presentation/comparison.png differ diff --git a/tests/cpp-tests/Resources/Presentation/gdkaccelerator.png b/tests/cpp-tests/Resources/Presentation/gdkaccelerator.png index 95f0ed07c84c..2033340424fc 100644 Binary files a/tests/cpp-tests/Resources/Presentation/gdkaccelerator.png and b/tests/cpp-tests/Resources/Presentation/gdkaccelerator.png differ diff --git a/tests/cpp-tests/Resources/Presentation/html5accelerator.png b/tests/cpp-tests/Resources/Presentation/html5accelerator.png index bdb3f1cef487..78b2934d1caf 100644 Binary files a/tests/cpp-tests/Resources/Presentation/html5accelerator.png and b/tests/cpp-tests/Resources/Presentation/html5accelerator.png differ diff --git a/tests/cpp-tests/Resources/Presentation/proxy_model.png b/tests/cpp-tests/Resources/Presentation/proxy_model.png index 109acb4c8d28..2e32fd0f5e4b 100644 Binary files a/tests/cpp-tests/Resources/Presentation/proxy_model.png and b/tests/cpp-tests/Resources/Presentation/proxy_model.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Floor.png b/tests/cpp-tests/Resources/Sprite3DTest/Floor.png index 2a3b8e9ff324..4ebde104e762 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Floor.png and b/tests/cpp-tests/Resources/Sprite3DTest/Floor.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Face.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Face.png index 832f61c04c51..9dc0b7634d59 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Face.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Face.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Glasses01.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Glasses01.png index 1975a17bb2dd..0754928550e7 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Glasses01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Glasses01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair01.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair01.png index c5244fcbcce0..05d3f1b060df 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair02.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair02.png index c5079f98b020..c86e87ba274e 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair02.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hair02.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hand.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hand.png index 2ec9af346b38..f95fecae54f5 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hand.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Hand.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody01.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody01.png index 2a3942de8667..3b8ee9c27d94 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody02.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody02.png index 76447b763768..88150778673c 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody02.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_LowerBody02.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes01.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes01.png index 48f2984f4fdf..42d35215c248 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes02.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes02.png index f28685c9c39d..9e9f9d2899ad 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes02.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_Shoes02.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody01.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody01.png index e8c27102eed4..3b8233a4b732 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody02.png b/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody02.png index 9d6ab942ac62..ec01cd680689 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody02.png and b/tests/cpp-tests/Resources/Sprite3DTest/Girl_UpperBody02.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/Xie_01.png b/tests/cpp-tests/Resources/Sprite3DTest/Xie_01.png index 48f2984f4fdf..42d35215c248 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/Xie_01.png and b/tests/cpp-tests/Resources/Sprite3DTest/Xie_01.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/arx.png b/tests/cpp-tests/Resources/Sprite3DTest/arx.png old mode 100644 new mode 100755 index 1247bf8c9844..26c82f9d8084 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/arx.png and b/tests/cpp-tests/Resources/Sprite3DTest/arx.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/body.png b/tests/cpp-tests/Resources/Sprite3DTest/body.png index 45c297ab7579..f2c09089e403 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/body.png and b/tests/cpp-tests/Resources/Sprite3DTest/body.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/boss.png b/tests/cpp-tests/Resources/Sprite3DTest/boss.png index 5d85c3f1bed7..7073a9678cf9 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/boss.png and b/tests/cpp-tests/Resources/Sprite3DTest/boss.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/caustics.png b/tests/cpp-tests/Resources/Sprite3DTest/caustics.png index 84a086c19cbd..179f30dbc774 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/caustics.png and b/tests/cpp-tests/Resources/Sprite3DTest/caustics.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/circle.png b/tests/cpp-tests/Resources/Sprite3DTest/circle.png index e7d8f0928123..fb1e8d592ae4 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/circle.png and b/tests/cpp-tests/Resources/Sprite3DTest/circle.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/dragon.png b/tests/cpp-tests/Resources/Sprite3DTest/dragon.png index ee6a6e943ecf..0542b67ac383 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/dragon.png and b/tests/cpp-tests/Resources/Sprite3DTest/dragon.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/plane.png b/tests/cpp-tests/Resources/Sprite3DTest/plane.png index 37917bf93556..ac7c566c429e 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/plane.png and b/tests/cpp-tests/Resources/Sprite3DTest/plane.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/shadowCircle.png b/tests/cpp-tests/Resources/Sprite3DTest/shadowCircle.png index 77d1b5655f55..6442db45734c 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/shadowCircle.png and b/tests/cpp-tests/Resources/Sprite3DTest/shadowCircle.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/spheretex.png b/tests/cpp-tests/Resources/Sprite3DTest/spheretex.png index e5161cb6f1c3..94eed4b1dda4 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/spheretex.png and b/tests/cpp-tests/Resources/Sprite3DTest/spheretex.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/teapot.png b/tests/cpp-tests/Resources/Sprite3DTest/teapot.png index af66cad51f23..65c3aae6b836 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/teapot.png and b/tests/cpp-tests/Resources/Sprite3DTest/teapot.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/texture.png b/tests/cpp-tests/Resources/Sprite3DTest/texture.png index 7427be020707..c4ceacc87b90 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/texture.png and b/tests/cpp-tests/Resources/Sprite3DTest/texture.png differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/tortoise.png b/tests/cpp-tests/Resources/Sprite3DTest/tortoise.png index 1c6886f6cb64..7c12336ae2ca 100644 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/tortoise.png and b/tests/cpp-tests/Resources/Sprite3DTest/tortoise.png differ diff --git a/tests/cpp-tests/Resources/TerrainTest/Lightmap.png b/tests/cpp-tests/Resources/TerrainTest/Lightmap.png old mode 100644 new mode 100755 index 9f953c661992..673b6f88c1c9 Binary files a/tests/cpp-tests/Resources/TerrainTest/Lightmap.png and b/tests/cpp-tests/Resources/TerrainTest/Lightmap.png differ diff --git a/tests/cpp-tests/Resources/TerrainTest/alphamap.png b/tests/cpp-tests/Resources/TerrainTest/alphamap.png index a4fbed064719..70c9dab4f54a 100644 Binary files a/tests/cpp-tests/Resources/TerrainTest/alphamap.png and b/tests/cpp-tests/Resources/TerrainTest/alphamap.png differ diff --git a/tests/cpp-tests/Resources/TerrainTest/road.png b/tests/cpp-tests/Resources/TerrainTest/road.png index 72c07d4aac60..be03098b4358 100644 Binary files a/tests/cpp-tests/Resources/TerrainTest/road.png and b/tests/cpp-tests/Resources/TerrainTest/road.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/fixed-ortho-test2.png b/tests/cpp-tests/Resources/TileMaps/fixed-ortho-test2.png index 0fb810de8e9a..99668bad5eac 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/fixed-ortho-test2.png and b/tests/cpp-tests/Resources/TileMaps/fixed-ortho-test2.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/grass.png b/tests/cpp-tests/Resources/TileMaps/grass.png index 37590f203eb8..adb1ffbc1bb7 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/grass.png and b/tests/cpp-tests/Resources/TileMaps/grass.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/grass01.png b/tests/cpp-tests/Resources/TileMaps/grass01.png index 5fffef7582aa..748e3c9540e3 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/grass01.png and b/tests/cpp-tests/Resources/TileMaps/grass01.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/hexa-axis-x.png b/tests/cpp-tests/Resources/TileMaps/hexa-axis-x.png index 848efde22788..63c52593cff5 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/hexa-axis-x.png and b/tests/cpp-tests/Resources/TileMaps/hexa-axis-x.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/hexa-tiles.png b/tests/cpp-tests/Resources/TileMaps/hexa-tiles.png index 440ac6dcb42c..67b1f4a471f5 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/hexa-tiles.png and b/tests/cpp-tests/Resources/TileMaps/hexa-tiles.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/hexmini.png b/tests/cpp-tests/Resources/TileMaps/hexmini.png index f8f7613aaf5a..12d17bf0729f 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/hexmini.png and b/tests/cpp-tests/Resources/TileMaps/hexmini.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/iso-test.png b/tests/cpp-tests/Resources/TileMaps/iso-test.png index a624e4e2575e..00e694810e99 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/iso-test.png and b/tests/cpp-tests/Resources/TileMaps/iso-test.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/iso-test2.png b/tests/cpp-tests/Resources/TileMaps/iso-test2.png index d13bb5f44bb4..8668e0fe20c1 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/iso-test2.png and b/tests/cpp-tests/Resources/TileMaps/iso-test2.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/iso.png b/tests/cpp-tests/Resources/TileMaps/iso.png index 65e5fa7f1453..7658946a4517 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/iso.png and b/tests/cpp-tests/Resources/TileMaps/iso.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/issue_16512.png b/tests/cpp-tests/Resources/TileMaps/issue_16512.png index c912b90c468e..32e82ae46dfe 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/issue_16512.png and b/tests/cpp-tests/Resources/TileMaps/issue_16512.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/ortho-test1.png b/tests/cpp-tests/Resources/TileMaps/ortho-test1.png index b3a6394efa69..cc8dd1d0d875 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/ortho-test1.png and b/tests/cpp-tests/Resources/TileMaps/ortho-test1.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/ortho-test1_bw.png b/tests/cpp-tests/Resources/TileMaps/ortho-test1_bw.png index da5f258a83c2..a648cdbe1a06 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/ortho-test1_bw.png and b/tests/cpp-tests/Resources/TileMaps/ortho-test1_bw.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/ortho-test2.png b/tests/cpp-tests/Resources/TileMaps/ortho-test2.png index c24000ed717c..2fb43c6e1cd1 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/ortho-test2.png and b/tests/cpp-tests/Resources/TileMaps/ortho-test2.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/tile_iso_offset.png b/tests/cpp-tests/Resources/TileMaps/tile_iso_offset.png index 471aa0a59932..537ec4c9faf5 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/tile_iso_offset.png and b/tests/cpp-tests/Resources/TileMaps/tile_iso_offset.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/tiles-hd.png b/tests/cpp-tests/Resources/TileMaps/tiles-hd.png index ca84a261c8bc..08cdb0f1e486 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/tiles-hd.png and b/tests/cpp-tests/Resources/TileMaps/tiles-hd.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/tiles.png b/tests/cpp-tests/Resources/TileMaps/tiles.png index eee01c52652e..2929ba43025e 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/tiles.png and b/tests/cpp-tests/Resources/TileMaps/tiles.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing-hd.png b/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing-hd.png index 16d08a8888d9..ab9f840faed9 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing-hd.png and b/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing-hd.png differ diff --git a/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing.png b/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing.png index 4c4ff412d9db..8e23c6d345cd 100644 Binary files a/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing.png and b/tests/cpp-tests/Resources/TileMaps/tmw_desert_spacing.png differ diff --git a/tests/cpp-tests/Resources/animations/crystals.png b/tests/cpp-tests/Resources/animations/crystals.png index 77658a491426..2c0a41da0118 100644 Binary files a/tests/cpp-tests/Resources/animations/crystals.png and b/tests/cpp-tests/Resources/animations/crystals.png differ diff --git a/tests/cpp-tests/Resources/animations/dragon_animation-hd.png b/tests/cpp-tests/Resources/animations/dragon_animation-hd.png index 67915c1273b4..8fbe949c1f00 100644 Binary files a/tests/cpp-tests/Resources/animations/dragon_animation-hd.png and b/tests/cpp-tests/Resources/animations/dragon_animation-hd.png differ diff --git a/tests/cpp-tests/Resources/animations/dragon_animation.png b/tests/cpp-tests/Resources/animations/dragon_animation.png old mode 100644 new mode 100755 index 1907dba95b60..4d2a65cdc966 Binary files a/tests/cpp-tests/Resources/animations/dragon_animation.png and b/tests/cpp-tests/Resources/animations/dragon_animation.png differ diff --git a/tests/cpp-tests/Resources/animations/ghosts.png b/tests/cpp-tests/Resources/animations/ghosts.png old mode 100644 new mode 100755 index 3f515f65f71e..ad067dd1e082 Binary files a/tests/cpp-tests/Resources/animations/ghosts.png and b/tests/cpp-tests/Resources/animations/ghosts.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini-aliases.png b/tests/cpp-tests/Resources/animations/grossini-aliases.png old mode 100644 new mode 100755 index 00596acb796b..5672efb11950 Binary files a/tests/cpp-tests/Resources/animations/grossini-aliases.png and b/tests/cpp-tests/Resources/animations/grossini-aliases.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini.png b/tests/cpp-tests/Resources/animations/grossini.png old mode 100644 new mode 100755 index 4fbd9d9cca86..609e7804f6f2 Binary files a/tests/cpp-tests/Resources/animations/grossini.png and b/tests/cpp-tests/Resources/animations/grossini.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_anchors.png b/tests/cpp-tests/Resources/animations/grossini_anchors.png index 71d6c30bfd14..73c58de05ff8 100644 Binary files a/tests/cpp-tests/Resources/animations/grossini_anchors.png and b/tests/cpp-tests/Resources/animations/grossini_anchors.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_blue.png b/tests/cpp-tests/Resources/animations/grossini_blue.png old mode 100644 new mode 100755 index e480ca7b80ca..a29fc6441d76 Binary files a/tests/cpp-tests/Resources/animations/grossini_blue.png and b/tests/cpp-tests/Resources/animations/grossini_blue.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_dance_poly.png b/tests/cpp-tests/Resources/animations/grossini_dance_poly.png index 3ed6ae690d35..3d699ae3e83b 100644 Binary files a/tests/cpp-tests/Resources/animations/grossini_dance_poly.png and b/tests/cpp-tests/Resources/animations/grossini_dance_poly.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_family.png b/tests/cpp-tests/Resources/animations/grossini_family.png old mode 100644 new mode 100755 index b979302c1a45..acc73dc2c8b7 Binary files a/tests/cpp-tests/Resources/animations/grossini_family.png and b/tests/cpp-tests/Resources/animations/grossini_family.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_gray.png b/tests/cpp-tests/Resources/animations/grossini_gray.png old mode 100644 new mode 100755 index 3216e7f1c831..1a9ff597ed9d Binary files a/tests/cpp-tests/Resources/animations/grossini_gray.png and b/tests/cpp-tests/Resources/animations/grossini_gray.png differ diff --git a/tests/cpp-tests/Resources/animations/grossini_polygon.png b/tests/cpp-tests/Resources/animations/grossini_polygon.png index aeaf1ebd8a95..d8225431c0b6 100644 Binary files a/tests/cpp-tests/Resources/animations/grossini_polygon.png and b/tests/cpp-tests/Resources/animations/grossini_polygon.png differ diff --git a/tests/cpp-tests/Resources/animations/tcc_issue_1.png b/tests/cpp-tests/Resources/animations/tcc_issue_1.png index 467a64bf5c7c..1e5c2a9998c5 100644 Binary files a/tests/cpp-tests/Resources/animations/tcc_issue_1.png and b/tests/cpp-tests/Resources/animations/tcc_issue_1.png differ diff --git a/tests/cpp-tests/Resources/animations/tcc_issue_2.png b/tests/cpp-tests/Resources/animations/tcc_issue_2.png index af560501f86c..efbe1e09e2a4 100644 Binary files a/tests/cpp-tests/Resources/animations/tcc_issue_2.png and b/tests/cpp-tests/Resources/animations/tcc_issue_2.png differ diff --git a/tests/cpp-tests/Resources/ccb/animated-grossini.png b/tests/cpp-tests/Resources/ccb/animated-grossini.png old mode 100644 new mode 100755 index 7cda495513e4..89736acdaba8 Binary files a/tests/cpp-tests/Resources/ccb/animated-grossini.png and b/tests/cpp-tests/Resources/ccb/animated-grossini.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-a-0.png b/tests/cpp-tests/Resources/ccb/btn-a-0.png old mode 100644 new mode 100755 index ff15dce92c31..66a5d3df7185 Binary files a/tests/cpp-tests/Resources/ccb/btn-a-0.png and b/tests/cpp-tests/Resources/ccb/btn-a-0.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-a-1.png b/tests/cpp-tests/Resources/ccb/btn-a-1.png old mode 100644 new mode 100755 index 2ed866b6dce1..33f8a0c3f041 Binary files a/tests/cpp-tests/Resources/ccb/btn-a-1.png and b/tests/cpp-tests/Resources/ccb/btn-a-1.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-a-2.png b/tests/cpp-tests/Resources/ccb/btn-a-2.png old mode 100644 new mode 100755 index de762f2af9bf..c8532b3e23ae Binary files a/tests/cpp-tests/Resources/ccb/btn-a-2.png and b/tests/cpp-tests/Resources/ccb/btn-a-2.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-b-0.png b/tests/cpp-tests/Resources/ccb/btn-b-0.png old mode 100644 new mode 100755 index a9442a70466d..abd7d9a00b03 Binary files a/tests/cpp-tests/Resources/ccb/btn-b-0.png and b/tests/cpp-tests/Resources/ccb/btn-b-0.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-b-1.png b/tests/cpp-tests/Resources/ccb/btn-b-1.png old mode 100644 new mode 100755 index 0e850dbc499b..b55f91e77c04 Binary files a/tests/cpp-tests/Resources/ccb/btn-b-1.png and b/tests/cpp-tests/Resources/ccb/btn-b-1.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-b-2.png b/tests/cpp-tests/Resources/ccb/btn-b-2.png old mode 100644 new mode 100755 index a9fa96708d10..d47c7b6283e6 Binary files a/tests/cpp-tests/Resources/ccb/btn-b-2.png and b/tests/cpp-tests/Resources/ccb/btn-b-2.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-back-0.png b/tests/cpp-tests/Resources/ccb/btn-back-0.png old mode 100644 new mode 100755 index 2101c3153134..9caae52746ff Binary files a/tests/cpp-tests/Resources/ccb/btn-back-0.png and b/tests/cpp-tests/Resources/ccb/btn-back-0.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-back-1.png b/tests/cpp-tests/Resources/ccb/btn-back-1.png old mode 100644 new mode 100755 index 2c1464b0de07..6c7cf5f97a9e Binary files a/tests/cpp-tests/Resources/ccb/btn-back-1.png and b/tests/cpp-tests/Resources/ccb/btn-back-1.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-test-0.png b/tests/cpp-tests/Resources/ccb/btn-test-0.png old mode 100644 new mode 100755 index 2b916c06c1fe..2777fd1d5ecc Binary files a/tests/cpp-tests/Resources/ccb/btn-test-0.png and b/tests/cpp-tests/Resources/ccb/btn-test-0.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-test-1.png b/tests/cpp-tests/Resources/ccb/btn-test-1.png old mode 100644 new mode 100755 index ebf3ce40f829..b3be2a861637 Binary files a/tests/cpp-tests/Resources/ccb/btn-test-1.png and b/tests/cpp-tests/Resources/ccb/btn-test-1.png differ diff --git a/tests/cpp-tests/Resources/ccb/btn-test-2.png b/tests/cpp-tests/Resources/ccb/btn-test-2.png old mode 100644 new mode 100755 index bd606267168c..eab72947de72 Binary files a/tests/cpp-tests/Resources/ccb/btn-test-2.png and b/tests/cpp-tests/Resources/ccb/btn-test-2.png differ diff --git a/tests/cpp-tests/Resources/ccb/burst.png b/tests/cpp-tests/Resources/ccb/burst.png old mode 100644 new mode 100755 index 448f5f46c7c3..8681474538f4 Binary files a/tests/cpp-tests/Resources/ccb/burst.png and b/tests/cpp-tests/Resources/ccb/burst.png differ diff --git a/tests/cpp-tests/Resources/ccb/ccbParticleStars.png b/tests/cpp-tests/Resources/ccb/ccbParticleStars.png old mode 100644 new mode 100755 index df7e1145cd47..f493dcc33470 Binary files a/tests/cpp-tests/Resources/ccb/ccbParticleStars.png and b/tests/cpp-tests/Resources/ccb/ccbParticleStars.png differ diff --git a/tests/cpp-tests/Resources/ccb/grossini-generic.png b/tests/cpp-tests/Resources/ccb/grossini-generic.png old mode 100644 new mode 100755 index 65c5287371f5..5c0bbc67c854 Binary files a/tests/cpp-tests/Resources/ccb/grossini-generic.png and b/tests/cpp-tests/Resources/ccb/grossini-generic.png differ diff --git a/tests/cpp-tests/Resources/ccb/jungle-left.png b/tests/cpp-tests/Resources/ccb/jungle-left.png old mode 100644 new mode 100755 index 68dbe20a2e63..79bbf2033432 Binary files a/tests/cpp-tests/Resources/ccb/jungle-left.png and b/tests/cpp-tests/Resources/ccb/jungle-left.png differ diff --git a/tests/cpp-tests/Resources/ccb/jungle-right.png b/tests/cpp-tests/Resources/ccb/jungle-right.png old mode 100644 new mode 100755 index b73d837214cd..8da61b9f5861 Binary files a/tests/cpp-tests/Resources/ccb/jungle-right.png and b/tests/cpp-tests/Resources/ccb/jungle-right.png differ diff --git a/tests/cpp-tests/Resources/ccb/jungle.png b/tests/cpp-tests/Resources/ccb/jungle.png old mode 100644 new mode 100755 index 781ee4149d76..b3ddd92d2b09 Binary files a/tests/cpp-tests/Resources/ccb/jungle.png and b/tests/cpp-tests/Resources/ccb/jungle.png differ diff --git a/tests/cpp-tests/Resources/ccb/logo-icon.png b/tests/cpp-tests/Resources/ccb/logo-icon.png old mode 100644 new mode 100755 index a3b64cdac9bb..c668736dc74d Binary files a/tests/cpp-tests/Resources/ccb/logo-icon.png and b/tests/cpp-tests/Resources/ccb/logo-icon.png differ diff --git a/tests/cpp-tests/Resources/ccb/logo.png b/tests/cpp-tests/Resources/ccb/logo.png old mode 100644 new mode 100755 index b18bc2d72640..a4cd20c20e8f Binary files a/tests/cpp-tests/Resources/ccb/logo.png and b/tests/cpp-tests/Resources/ccb/logo.png differ diff --git a/tests/cpp-tests/Resources/ccb/markerfelt24shadow.png b/tests/cpp-tests/Resources/ccb/markerfelt24shadow.png old mode 100644 new mode 100755 index 9a617ba349db..5bab02849644 Binary files a/tests/cpp-tests/Resources/ccb/markerfelt24shadow.png and b/tests/cpp-tests/Resources/ccb/markerfelt24shadow.png differ diff --git a/tests/cpp-tests/Resources/ccb/particle-fire.png b/tests/cpp-tests/Resources/ccb/particle-fire.png old mode 100644 new mode 100755 index 84a1660c47f7..81c6d2410bb2 Binary files a/tests/cpp-tests/Resources/ccb/particle-fire.png and b/tests/cpp-tests/Resources/ccb/particle-fire.png differ diff --git a/tests/cpp-tests/Resources/ccb/particle-smoke.png b/tests/cpp-tests/Resources/ccb/particle-smoke.png old mode 100644 new mode 100755 index 2e68ea2f391c..a289b1371e29 Binary files a/tests/cpp-tests/Resources/ccb/particle-smoke.png and b/tests/cpp-tests/Resources/ccb/particle-smoke.png differ diff --git a/tests/cpp-tests/Resources/ccb/particle-snow.png b/tests/cpp-tests/Resources/ccb/particle-snow.png old mode 100644 new mode 100755 index 0c7ffb3034fc..9e12963498d7 Binary files a/tests/cpp-tests/Resources/ccb/particle-snow.png and b/tests/cpp-tests/Resources/ccb/particle-snow.png differ diff --git a/tests/cpp-tests/Resources/ccb/particle-stars.png b/tests/cpp-tests/Resources/ccb/particle-stars.png old mode 100644 new mode 100755 index df7e1145cd47..f493dcc33470 Binary files a/tests/cpp-tests/Resources/ccb/particle-stars.png and b/tests/cpp-tests/Resources/ccb/particle-stars.png differ diff --git a/tests/cpp-tests/Resources/ccb/scale-9-demo.png b/tests/cpp-tests/Resources/ccb/scale-9-demo.png old mode 100644 new mode 100755 index 8b90e1ab3935..ee4537207f1b Binary files a/tests/cpp-tests/Resources/ccb/scale-9-demo.png and b/tests/cpp-tests/Resources/ccb/scale-9-demo.png differ diff --git a/tests/cpp-tests/Resources/components/Player.png b/tests/cpp-tests/Resources/components/Player.png old mode 100644 new mode 100755 index 974f1a6887b3..77d4470de05b Binary files a/tests/cpp-tests/Resources/components/Player.png and b/tests/cpp-tests/Resources/components/Player.png differ diff --git a/tests/cpp-tests/Resources/components/Projectile.png b/tests/cpp-tests/Resources/components/Projectile.png old mode 100644 new mode 100755 index 243cd6a350cb..548fe432933f Binary files a/tests/cpp-tests/Resources/components/Projectile.png and b/tests/cpp-tests/Resources/components/Projectile.png differ diff --git a/tests/cpp-tests/Resources/components/Target.png b/tests/cpp-tests/Resources/components/Target.png old mode 100644 new mode 100755 index 0f39cf9c477d..22906f3c02e8 Binary files a/tests/cpp-tests/Resources/components/Target.png and b/tests/cpp-tests/Resources/components/Target.png differ diff --git a/tests/cpp-tests/Resources/extensions/CCControlColourPickerSpriteSheet.png b/tests/cpp-tests/Resources/extensions/CCControlColourPickerSpriteSheet.png old mode 100644 new mode 100755 index a73e8692c6b1..c49479ffaa00 Binary files a/tests/cpp-tests/Resources/extensions/CCControlColourPickerSpriteSheet.png and b/tests/cpp-tests/Resources/extensions/CCControlColourPickerSpriteSheet.png differ diff --git a/tests/cpp-tests/Resources/extensions/background.png b/tests/cpp-tests/Resources/extensions/background.png old mode 100644 new mode 100755 index b55ef8539230..500d95937f3f Binary files a/tests/cpp-tests/Resources/extensions/background.png and b/tests/cpp-tests/Resources/extensions/background.png differ diff --git a/tests/cpp-tests/Resources/extensions/button.png b/tests/cpp-tests/Resources/extensions/button.png old mode 100644 new mode 100755 index 2b2e9f905c33..816cf6e36ca9 Binary files a/tests/cpp-tests/Resources/extensions/button.png and b/tests/cpp-tests/Resources/extensions/button.png differ diff --git a/tests/cpp-tests/Resources/extensions/buttonBackground.png b/tests/cpp-tests/Resources/extensions/buttonBackground.png old mode 100644 new mode 100755 index 7116ce0ab5a7..a46706102bf8 Binary files a/tests/cpp-tests/Resources/extensions/buttonBackground.png and b/tests/cpp-tests/Resources/extensions/buttonBackground.png differ diff --git a/tests/cpp-tests/Resources/extensions/buttonHighlighted.png b/tests/cpp-tests/Resources/extensions/buttonHighlighted.png old mode 100644 new mode 100755 index 2d47d226ad96..f2073e86d262 Binary files a/tests/cpp-tests/Resources/extensions/buttonHighlighted.png and b/tests/cpp-tests/Resources/extensions/buttonHighlighted.png differ diff --git a/tests/cpp-tests/Resources/extensions/green_edit.png b/tests/cpp-tests/Resources/extensions/green_edit.png old mode 100644 new mode 100755 index e5a83e5bcda2..f3b22a4adc69 Binary files a/tests/cpp-tests/Resources/extensions/green_edit.png and b/tests/cpp-tests/Resources/extensions/green_edit.png differ diff --git a/tests/cpp-tests/Resources/extensions/orange_edit.png b/tests/cpp-tests/Resources/extensions/orange_edit.png old mode 100644 new mode 100755 index 7c7ab85c5b53..e1f7c30f7457 Binary files a/tests/cpp-tests/Resources/extensions/orange_edit.png and b/tests/cpp-tests/Resources/extensions/orange_edit.png differ diff --git a/tests/cpp-tests/Resources/extensions/potentiometerButton.png b/tests/cpp-tests/Resources/extensions/potentiometerButton.png old mode 100644 new mode 100755 index 3826b5a437f8..fb76d094d594 Binary files a/tests/cpp-tests/Resources/extensions/potentiometerButton.png and b/tests/cpp-tests/Resources/extensions/potentiometerButton.png differ diff --git a/tests/cpp-tests/Resources/extensions/potentiometerProgress.png b/tests/cpp-tests/Resources/extensions/potentiometerProgress.png old mode 100644 new mode 100755 index ef2c21a4a90e..6bd8b32636f8 Binary files a/tests/cpp-tests/Resources/extensions/potentiometerProgress.png and b/tests/cpp-tests/Resources/extensions/potentiometerProgress.png differ diff --git a/tests/cpp-tests/Resources/extensions/potentiometerTrack.png b/tests/cpp-tests/Resources/extensions/potentiometerTrack.png old mode 100644 new mode 100755 index ffd450027766..445c3ba65799 Binary files a/tests/cpp-tests/Resources/extensions/potentiometerTrack.png and b/tests/cpp-tests/Resources/extensions/potentiometerTrack.png differ diff --git a/tests/cpp-tests/Resources/extensions/ribbon.png b/tests/cpp-tests/Resources/extensions/ribbon.png old mode 100644 new mode 100755 index ed8ee0adcd00..b80fb9444419 Binary files a/tests/cpp-tests/Resources/extensions/ribbon.png and b/tests/cpp-tests/Resources/extensions/ribbon.png differ diff --git a/tests/cpp-tests/Resources/extensions/sliderProgress.png b/tests/cpp-tests/Resources/extensions/sliderProgress.png old mode 100644 new mode 100755 index f7ebe721a1c9..81d517307d7e Binary files a/tests/cpp-tests/Resources/extensions/sliderProgress.png and b/tests/cpp-tests/Resources/extensions/sliderProgress.png differ diff --git a/tests/cpp-tests/Resources/extensions/sliderProgress2.png b/tests/cpp-tests/Resources/extensions/sliderProgress2.png old mode 100644 new mode 100755 index 84170a12e191..3b8794e38c0f Binary files a/tests/cpp-tests/Resources/extensions/sliderProgress2.png and b/tests/cpp-tests/Resources/extensions/sliderProgress2.png differ diff --git a/tests/cpp-tests/Resources/extensions/sliderThumb.png b/tests/cpp-tests/Resources/extensions/sliderThumb.png old mode 100644 new mode 100755 index c30b3baa071f..901803d70fb6 Binary files a/tests/cpp-tests/Resources/extensions/sliderThumb.png and b/tests/cpp-tests/Resources/extensions/sliderThumb.png differ diff --git a/tests/cpp-tests/Resources/extensions/sliderTrack.png b/tests/cpp-tests/Resources/extensions/sliderTrack.png old mode 100644 new mode 100755 index aa28072e2616..59b8dc91b11c Binary files a/tests/cpp-tests/Resources/extensions/sliderTrack.png and b/tests/cpp-tests/Resources/extensions/sliderTrack.png differ diff --git a/tests/cpp-tests/Resources/extensions/sliderTrack2.png b/tests/cpp-tests/Resources/extensions/sliderTrack2.png old mode 100644 new mode 100755 index 505e7b111390..dbc3173b872b Binary files a/tests/cpp-tests/Resources/extensions/sliderTrack2.png and b/tests/cpp-tests/Resources/extensions/sliderTrack2.png differ diff --git a/tests/cpp-tests/Resources/extensions/stepper-minus.png b/tests/cpp-tests/Resources/extensions/stepper-minus.png old mode 100644 new mode 100755 index 2c5d5d085813..bae9cb4725f4 Binary files a/tests/cpp-tests/Resources/extensions/stepper-minus.png and b/tests/cpp-tests/Resources/extensions/stepper-minus.png differ diff --git a/tests/cpp-tests/Resources/extensions/stepper-plus.png b/tests/cpp-tests/Resources/extensions/stepper-plus.png old mode 100644 new mode 100755 index 55de127ee52a..82b0673077e9 Binary files a/tests/cpp-tests/Resources/extensions/stepper-plus.png and b/tests/cpp-tests/Resources/extensions/stepper-plus.png differ diff --git a/tests/cpp-tests/Resources/extensions/switch-mask.png b/tests/cpp-tests/Resources/extensions/switch-mask.png old mode 100644 new mode 100755 index 03b241419684..fc49f947d734 Binary files a/tests/cpp-tests/Resources/extensions/switch-mask.png and b/tests/cpp-tests/Resources/extensions/switch-mask.png differ diff --git a/tests/cpp-tests/Resources/extensions/switch-off.png b/tests/cpp-tests/Resources/extensions/switch-off.png old mode 100644 new mode 100755 index 6b88e5fb4dad..ec2992a4247a Binary files a/tests/cpp-tests/Resources/extensions/switch-off.png and b/tests/cpp-tests/Resources/extensions/switch-off.png differ diff --git a/tests/cpp-tests/Resources/extensions/switch-on.png b/tests/cpp-tests/Resources/extensions/switch-on.png old mode 100644 new mode 100755 index ce0f22b99224..2d8acc00e31e Binary files a/tests/cpp-tests/Resources/extensions/switch-on.png and b/tests/cpp-tests/Resources/extensions/switch-on.png differ diff --git a/tests/cpp-tests/Resources/extensions/switch-thumb.png b/tests/cpp-tests/Resources/extensions/switch-thumb.png old mode 100644 new mode 100755 index 29abab0dccd0..a7363e5ac36b Binary files a/tests/cpp-tests/Resources/extensions/switch-thumb.png and b/tests/cpp-tests/Resources/extensions/switch-thumb.png differ diff --git a/tests/cpp-tests/Resources/extensions/yellow_edit.png b/tests/cpp-tests/Resources/extensions/yellow_edit.png old mode 100644 new mode 100755 index bb8f3120271e..f9dc6b114d71 Binary files a/tests/cpp-tests/Resources/extensions/yellow_edit.png and b/tests/cpp-tests/Resources/extensions/yellow_edit.png differ diff --git a/tests/cpp-tests/Resources/fonts/Roboto.bmf_0.png b/tests/cpp-tests/Resources/fonts/Roboto.bmf_0.png old mode 100644 new mode 100755 index 6d19a9d06992..ddf50bdd13db Binary files a/tests/cpp-tests/Resources/fonts/Roboto.bmf_0.png and b/tests/cpp-tests/Resources/fonts/Roboto.bmf_0.png differ diff --git a/tests/cpp-tests/Resources/fonts/arial-26-en-ru_0.png b/tests/cpp-tests/Resources/fonts/arial-26-en-ru_0.png old mode 100644 new mode 100755 index af41f14059ce..6bba537945f3 Binary files a/tests/cpp-tests/Resources/fonts/arial-26-en-ru_0.png and b/tests/cpp-tests/Resources/fonts/arial-26-en-ru_0.png differ diff --git a/tests/cpp-tests/Resources/fonts/arial-unicode-26.png b/tests/cpp-tests/Resources/fonts/arial-unicode-26.png old mode 100644 new mode 100755 index b4b433ec07a4..c2eabd7cd8b6 Binary files a/tests/cpp-tests/Resources/fonts/arial-unicode-26.png and b/tests/cpp-tests/Resources/fonts/arial-unicode-26.png differ diff --git a/tests/cpp-tests/Resources/fonts/arial16.png b/tests/cpp-tests/Resources/fonts/arial16.png old mode 100644 new mode 100755 index c6d00cc953ed..9bba8ea89177 Binary files a/tests/cpp-tests/Resources/fonts/arial16.png and b/tests/cpp-tests/Resources/fonts/arial16.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontChinese.png b/tests/cpp-tests/Resources/fonts/bitmapFontChinese.png old mode 100644 new mode 100755 index 3829b16da8cc..9d2adf428a20 Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontChinese.png and b/tests/cpp-tests/Resources/fonts/bitmapFontChinese.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontTest.png b/tests/cpp-tests/Resources/fonts/bitmapFontTest.png old mode 100644 new mode 100755 index 9eb412b87242..112328fdb03b Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontTest.png and b/tests/cpp-tests/Resources/fonts/bitmapFontTest.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontTest2.png b/tests/cpp-tests/Resources/fonts/bitmapFontTest2.png old mode 100644 new mode 100755 index a37503a8416a..9975e4961272 Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontTest2.png and b/tests/cpp-tests/Resources/fonts/bitmapFontTest2.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontTest3.png b/tests/cpp-tests/Resources/fonts/bitmapFontTest3.png old mode 100644 new mode 100755 index a49e9117af77..d19379f5e776 Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontTest3.png and b/tests/cpp-tests/Resources/fonts/bitmapFontTest3.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontTest4.png b/tests/cpp-tests/Resources/fonts/bitmapFontTest4.png old mode 100644 new mode 100755 index 3b181fb2bcf1..93dacc080684 Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontTest4.png and b/tests/cpp-tests/Resources/fonts/bitmapFontTest4.png differ diff --git a/tests/cpp-tests/Resources/fonts/bitmapFontTest5.png b/tests/cpp-tests/Resources/fonts/bitmapFontTest5.png old mode 100644 new mode 100755 index 219c53bbb3b2..4777c7616296 Binary files a/tests/cpp-tests/Resources/fonts/bitmapFontTest5.png and b/tests/cpp-tests/Resources/fonts/bitmapFontTest5.png differ diff --git a/tests/cpp-tests/Resources/fonts/boundsTestFont.png b/tests/cpp-tests/Resources/fonts/boundsTestFont.png old mode 100644 new mode 100755 index 96a0fced31ff..da5da270feaa Binary files a/tests/cpp-tests/Resources/fonts/boundsTestFont.png and b/tests/cpp-tests/Resources/fonts/boundsTestFont.png differ diff --git a/tests/cpp-tests/Resources/fonts/enligsh-chinese.png b/tests/cpp-tests/Resources/fonts/enligsh-chinese.png index 30cf1c59a3f4..a3bc36f97502 100644 Binary files a/tests/cpp-tests/Resources/fonts/enligsh-chinese.png and b/tests/cpp-tests/Resources/fonts/enligsh-chinese.png differ diff --git a/tests/cpp-tests/Resources/fonts/font-issue1343-hd.png b/tests/cpp-tests/Resources/fonts/font-issue1343-hd.png old mode 100644 new mode 100755 index 8b25950089ba..a6ca8414e453 Binary files a/tests/cpp-tests/Resources/fonts/font-issue1343-hd.png and b/tests/cpp-tests/Resources/fonts/font-issue1343-hd.png differ diff --git a/tests/cpp-tests/Resources/fonts/font-issue1343.png b/tests/cpp-tests/Resources/fonts/font-issue1343.png old mode 100644 new mode 100755 index 403c40388b81..68a96b06c711 Binary files a/tests/cpp-tests/Resources/fonts/font-issue1343.png and b/tests/cpp-tests/Resources/fonts/font-issue1343.png differ diff --git a/tests/cpp-tests/Resources/fonts/futura-48.png b/tests/cpp-tests/Resources/fonts/futura-48.png old mode 100644 new mode 100755 index fb034990ce54..796a33e41fb8 Binary files a/tests/cpp-tests/Resources/fonts/futura-48.png and b/tests/cpp-tests/Resources/fonts/futura-48.png differ diff --git a/tests/cpp-tests/Resources/fonts/helvetica-geneva-32.png b/tests/cpp-tests/Resources/fonts/helvetica-geneva-32.png old mode 100644 new mode 100755 index 720292cef13b..8d997c0f9ffd Binary files a/tests/cpp-tests/Resources/fonts/helvetica-geneva-32.png and b/tests/cpp-tests/Resources/fonts/helvetica-geneva-32.png differ diff --git a/tests/cpp-tests/Resources/fonts/konqa32-hd.png b/tests/cpp-tests/Resources/fonts/konqa32-hd.png index b3f3ca4c6a07..051e8d5bd30f 100644 Binary files a/tests/cpp-tests/Resources/fonts/konqa32-hd.png and b/tests/cpp-tests/Resources/fonts/konqa32-hd.png differ diff --git a/tests/cpp-tests/Resources/fonts/konqa32.png b/tests/cpp-tests/Resources/fonts/konqa32.png old mode 100644 new mode 100755 index f739d8cb5375..7ed3ceefcd2d Binary files a/tests/cpp-tests/Resources/fonts/konqa32.png and b/tests/cpp-tests/Resources/fonts/konqa32.png differ diff --git a/tests/cpp-tests/Resources/fonts/labelatlas.png b/tests/cpp-tests/Resources/fonts/labelatlas.png old mode 100644 new mode 100755 index 30f465d97605..e91d0af540bf Binary files a/tests/cpp-tests/Resources/fonts/labelatlas.png and b/tests/cpp-tests/Resources/fonts/labelatlas.png differ diff --git a/tests/cpp-tests/Resources/fonts/larabie-16-hd.png b/tests/cpp-tests/Resources/fonts/larabie-16-hd.png index 06d685abb09f..7aac30647d07 100644 Binary files a/tests/cpp-tests/Resources/fonts/larabie-16-hd.png and b/tests/cpp-tests/Resources/fonts/larabie-16-hd.png differ diff --git a/tests/cpp-tests/Resources/fonts/larabie-16.png b/tests/cpp-tests/Resources/fonts/larabie-16.png old mode 100644 new mode 100755 index 1c3496d00859..304240c7c182 Binary files a/tests/cpp-tests/Resources/fonts/larabie-16.png and b/tests/cpp-tests/Resources/fonts/larabie-16.png differ diff --git a/tests/cpp-tests/Resources/fonts/markerFelt-hd.png b/tests/cpp-tests/Resources/fonts/markerFelt-hd.png index 8abbe410550a..3988cfdf6548 100644 Binary files a/tests/cpp-tests/Resources/fonts/markerFelt-hd.png and b/tests/cpp-tests/Resources/fonts/markerFelt-hd.png differ diff --git a/tests/cpp-tests/Resources/fonts/markerFelt.png b/tests/cpp-tests/Resources/fonts/markerFelt.png old mode 100644 new mode 100755 index d730bca8419e..8651e05e3283 Binary files a/tests/cpp-tests/Resources/fonts/markerFelt.png and b/tests/cpp-tests/Resources/fonts/markerFelt.png differ diff --git a/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap-hd.png b/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap-hd.png index 2276fa2367bd..8167faf6c40f 100644 Binary files a/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap-hd.png and b/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap-hd.png differ diff --git a/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap.png b/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap.png old mode 100644 new mode 100755 index 62cf0d587cb5..c39d1a9a4bf3 Binary files a/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap.png and b/tests/cpp-tests/Resources/fonts/tuffy_bold_italic-charmap.png differ diff --git a/tests/cpp-tests/Resources/fonts/west_england-64.png b/tests/cpp-tests/Resources/fonts/west_england-64.png old mode 100644 new mode 100755 index 33f0381d58ef..cadb3fd2d651 Binary files a/tests/cpp-tests/Resources/fonts/west_england-64.png and b/tests/cpp-tests/Resources/fonts/west_england-64.png differ diff --git a/tests/cpp-tests/Resources/fps_images.png b/tests/cpp-tests/Resources/fps_images.png index e48259b153c1..c7449025bf10 100644 Binary files a/tests/cpp-tests/Resources/fps_images.png and b/tests/cpp-tests/Resources/fps_images.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Button_Disable.png b/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Button_Disable.png old mode 100644 new mode 100755 index c31793290355..62ee840c40d3 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Button_Disable.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Button_Disable.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Sprite.png b/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Sprite.png old mode 100644 new mode 100755 index c7fae283de68..115fa75667e5 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Sprite.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/Default/Sprite.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/01.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/01.png index 2f4a20b64091..9dd0f7a3f7de 100644 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/01.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/01.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/1.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/1.png old mode 100644 new mode 100755 index 4445a3345048..0ec85b0da611 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/1.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/1.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/2.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/2.png old mode 100644 new mode 100755 index 209e914ac4b2..d8c6e5ee0824 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/2.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/2.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/3.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/3.png old mode 100644 new mode 100755 index e20039969660..99108df77d27 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/3.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/3.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/4.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/4.png old mode 100644 new mode 100755 index af6e9c448c36..9feffd9d28db Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/4.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/4.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/5.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/5.png old mode 100644 new mode 100755 index caa125f36605..dae73f97a39a Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/5.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/5.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/6.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/6.png old mode 100644 new mode 100755 index 2a01180b250e..4278626d74f7 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/6.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/6.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/7.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/7.png old mode 100644 new mode 100755 index d0d79054c38a..2eb4e1a90357 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/7.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/7.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/8.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/8.png old mode 100644 new mode 100755 index 48ed9d24542c..2fe061f5f3e4 Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/8.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/8.png differ diff --git a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/hat.png b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/hat.png old mode 100644 new mode 100755 index fe31d709e470..f46f7b95fd4b Binary files a/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/hat.png and b/tests/cpp-tests/Resources/hd/ActionTimeline/testAnimationResource/hat.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/CyanSquare.png b/tests/cpp-tests/Resources/hd/Images/CyanSquare.png old mode 100644 new mode 100755 index 3fd1055156d9..f552f44956d4 Binary files a/tests/cpp-tests/Resources/hd/Images/CyanSquare.png and b/tests/cpp-tests/Resources/hd/Images/CyanSquare.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/Icon.png b/tests/cpp-tests/Resources/hd/Images/Icon.png old mode 100644 new mode 100755 index 0b3da9cfd46b..eea077ca2d4b Binary files a/tests/cpp-tests/Resources/hd/Images/Icon.png and b/tests/cpp-tests/Resources/hd/Images/Icon.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/MagentaSquare.png b/tests/cpp-tests/Resources/hd/Images/MagentaSquare.png old mode 100644 new mode 100755 index d58b52414cc2..c81a4387fcf2 Binary files a/tests/cpp-tests/Resources/hd/Images/MagentaSquare.png and b/tests/cpp-tests/Resources/hd/Images/MagentaSquare.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/YellowSquare.png b/tests/cpp-tests/Resources/hd/Images/YellowSquare.png old mode 100644 new mode 100755 index 370d45155ac2..85ee45ad4315 Binary files a/tests/cpp-tests/Resources/hd/Images/YellowSquare.png and b/tests/cpp-tests/Resources/hd/Images/YellowSquare.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/arrows.png b/tests/cpp-tests/Resources/hd/Images/arrows.png old mode 100644 new mode 100755 index 7c37dc0e9bf9..2bb760a397f3 Binary files a/tests/cpp-tests/Resources/hd/Images/arrows.png and b/tests/cpp-tests/Resources/hd/Images/arrows.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/arrowsBar.png b/tests/cpp-tests/Resources/hd/Images/arrowsBar.png old mode 100644 new mode 100755 index 7e4d9fab007a..41b0735179b0 Binary files a/tests/cpp-tests/Resources/hd/Images/arrowsBar.png and b/tests/cpp-tests/Resources/hd/Images/arrowsBar.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/b1.png b/tests/cpp-tests/Resources/hd/Images/b1.png old mode 100644 new mode 100755 index f75fcfc0ab45..8e799db7afe2 Binary files a/tests/cpp-tests/Resources/hd/Images/b1.png and b/tests/cpp-tests/Resources/hd/Images/b1.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/b2.png b/tests/cpp-tests/Resources/hd/Images/b2.png old mode 100644 new mode 100755 index a25b33839d89..3ceb3e6ccf2c Binary files a/tests/cpp-tests/Resources/hd/Images/b2.png and b/tests/cpp-tests/Resources/hd/Images/b2.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/background1.png b/tests/cpp-tests/Resources/hd/Images/background1.png old mode 100644 new mode 100755 index fe13e1342b0b..f3e0bb43f458 Binary files a/tests/cpp-tests/Resources/hd/Images/background1.png and b/tests/cpp-tests/Resources/hd/Images/background1.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/background2.png b/tests/cpp-tests/Resources/hd/Images/background2.png old mode 100644 new mode 100755 index 93a959603e38..4075ef39c08e Binary files a/tests/cpp-tests/Resources/hd/Images/background2.png and b/tests/cpp-tests/Resources/hd/Images/background2.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/background3.png b/tests/cpp-tests/Resources/hd/Images/background3.png old mode 100644 new mode 100755 index cac2d5b37850..deef861517ea Binary files a/tests/cpp-tests/Resources/hd/Images/background3.png and b/tests/cpp-tests/Resources/hd/Images/background3.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/ball.png b/tests/cpp-tests/Resources/hd/Images/ball.png old mode 100644 new mode 100755 index f9ee6a8cf305..a9b5b569b813 Binary files a/tests/cpp-tests/Resources/hd/Images/ball.png and b/tests/cpp-tests/Resources/hd/Images/ball.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks.png b/tests/cpp-tests/Resources/hd/Images/blocks.png old mode 100644 new mode 100755 index 8732203541ad..64ed615e86bf Binary files a/tests/cpp-tests/Resources/hd/Images/blocks.png and b/tests/cpp-tests/Resources/hd/Images/blocks.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9.png b/tests/cpp-tests/Resources/hd/Images/blocks9.png old mode 100644 new mode 100755 index e02b39b59641..e41ca2c49289 Binary files a/tests/cpp-tests/Resources/hd/Images/blocks9.png and b/tests/cpp-tests/Resources/hd/Images/blocks9.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9c.png b/tests/cpp-tests/Resources/hd/Images/blocks9c.png index 058c413592f8..2dca8583566c 100644 Binary files a/tests/cpp-tests/Resources/hd/Images/blocks9c.png and b/tests/cpp-tests/Resources/hd/Images/blocks9c.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9cr.png b/tests/cpp-tests/Resources/hd/Images/blocks9cr.png index e2fd52de143d..74fc6c8b01e2 100644 Binary files a/tests/cpp-tests/Resources/hd/Images/blocks9cr.png and b/tests/cpp-tests/Resources/hd/Images/blocks9cr.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9r.png b/tests/cpp-tests/Resources/hd/Images/blocks9r.png index ca6ec1a5e3ea..79c0c94604b8 100644 Binary files a/tests/cpp-tests/Resources/hd/Images/blocks9r.png and b/tests/cpp-tests/Resources/hd/Images/blocks9r.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9ss.png b/tests/cpp-tests/Resources/hd/Images/blocks9ss.png old mode 100644 new mode 100755 index 135d018d21e6..5fc40c4f417c Binary files a/tests/cpp-tests/Resources/hd/Images/blocks9ss.png and b/tests/cpp-tests/Resources/hd/Images/blocks9ss.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/bugs/circle.png b/tests/cpp-tests/Resources/hd/Images/bugs/circle.png old mode 100644 new mode 100755 index 117b5b4f49a5..6afff53d2948 Binary files a/tests/cpp-tests/Resources/hd/Images/bugs/circle.png and b/tests/cpp-tests/Resources/hd/Images/bugs/circle.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/bugs/picture.png b/tests/cpp-tests/Resources/hd/Images/bugs/picture.png old mode 100644 new mode 100755 index 8cfe2d06ee1e..0c3c568d5ceb Binary files a/tests/cpp-tests/Resources/hd/Images/bugs/picture.png and b/tests/cpp-tests/Resources/hd/Images/bugs/picture.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/bugs/test_issue_1179.png b/tests/cpp-tests/Resources/hd/Images/bugs/test_issue_1179.png old mode 100644 new mode 100755 index 5d82829999bb..04722e626e86 Binary files a/tests/cpp-tests/Resources/hd/Images/bugs/test_issue_1179.png and b/tests/cpp-tests/Resources/hd/Images/bugs/test_issue_1179.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/close.png b/tests/cpp-tests/Resources/hd/Images/close.png old mode 100644 new mode 100755 index 5edfc3733007..4b4d817e44b3 Binary files a/tests/cpp-tests/Resources/hd/Images/close.png and b/tests/cpp-tests/Resources/hd/Images/close.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/f1.png b/tests/cpp-tests/Resources/hd/Images/f1.png old mode 100644 new mode 100755 index 8162430b88ff..be28b78e34dc Binary files a/tests/cpp-tests/Resources/hd/Images/f1.png and b/tests/cpp-tests/Resources/hd/Images/f1.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/f2.png b/tests/cpp-tests/Resources/hd/Images/f2.png old mode 100644 new mode 100755 index 3b7f0e54c2ef..f933ad1d1fee Binary files a/tests/cpp-tests/Resources/hd/Images/f2.png and b/tests/cpp-tests/Resources/hd/Images/f2.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini.png b/tests/cpp-tests/Resources/hd/Images/grossini.png old mode 100644 new mode 100755 index 679f03e4bf0b..a0a76f5c2fd2 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini.png and b/tests/cpp-tests/Resources/hd/Images/grossini.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_01.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_01.png old mode 100644 new mode 100755 index 7cd70d0883c6..2a8aab20150e Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_01.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_01.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_02.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_02.png old mode 100644 new mode 100755 index 238bbb92fe8c..b2052cb72749 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_02.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_02.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_03.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_03.png old mode 100644 new mode 100755 index 5555d3869c3d..da543a9b9213 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_03.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_03.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_04.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_04.png old mode 100644 new mode 100755 index 0c3a8a458321..6653968f8917 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_04.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_04.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_05.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_05.png old mode 100644 new mode 100755 index a143cea5caa7..ccb8f72b1bc4 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_05.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_05.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_06.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_06.png old mode 100644 new mode 100755 index c77484773b85..d26bd64997fd Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_06.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_06.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_07.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_07.png old mode 100644 new mode 100755 index e7280a941f8a..b58d9df9f9b5 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_07.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_07.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_08.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_08.png old mode 100644 new mode 100755 index 6c62b5cc91d7..4fad28ce487c Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_08.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_08.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_09.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_09.png old mode 100644 new mode 100755 index 63fa988aa2ee..eaf6644b8a7f Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_09.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_09.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_10.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_10.png old mode 100644 new mode 100755 index fae3115da7a0..095ae812dd51 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_10.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_10.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_11.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_11.png old mode 100644 new mode 100755 index 065618daccd8..8d6848d4e1f6 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_11.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_11.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_12.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_12.png old mode 100644 new mode 100755 index 33a521bccfef..f062bde9f725 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_12.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_12.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_13.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_13.png old mode 100644 new mode 100755 index d9c901498293..3df970d98188 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_13.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_13.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_14.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_14.png old mode 100644 new mode 100755 index bd1066fc4278..92a4bc904199 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_14.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_14.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossini_dance_atlas.png b/tests/cpp-tests/Resources/hd/Images/grossini_dance_atlas.png old mode 100644 new mode 100755 index c19b3a0288d3..9a8bb38c10c6 Binary files a/tests/cpp-tests/Resources/hd/Images/grossini_dance_atlas.png and b/tests/cpp-tests/Resources/hd/Images/grossini_dance_atlas.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossinis_sister1.png b/tests/cpp-tests/Resources/hd/Images/grossinis_sister1.png old mode 100644 new mode 100755 index eda158d60768..ec22292e11b9 Binary files a/tests/cpp-tests/Resources/hd/Images/grossinis_sister1.png and b/tests/cpp-tests/Resources/hd/Images/grossinis_sister1.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/grossinis_sister2.png b/tests/cpp-tests/Resources/hd/Images/grossinis_sister2.png old mode 100644 new mode 100755 index 64536ebc6732..c3b392d1e8df Binary files a/tests/cpp-tests/Resources/hd/Images/grossinis_sister2.png and b/tests/cpp-tests/Resources/hd/Images/grossinis_sister2.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/hole_effect.png b/tests/cpp-tests/Resources/hd/Images/hole_effect.png old mode 100644 new mode 100755 index 799434284c2d..50eddb1c12a5 Binary files a/tests/cpp-tests/Resources/hd/Images/hole_effect.png and b/tests/cpp-tests/Resources/hd/Images/hole_effect.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/hole_stencil.png b/tests/cpp-tests/Resources/hd/Images/hole_stencil.png old mode 100644 new mode 100755 index 1fe600d264c2..253d46d5475f Binary files a/tests/cpp-tests/Resources/hd/Images/hole_stencil.png and b/tests/cpp-tests/Resources/hd/Images/hole_stencil.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/paddle.png b/tests/cpp-tests/Resources/hd/Images/paddle.png old mode 100644 new mode 100755 index 2b0d6e711543..43520a61ae1e Binary files a/tests/cpp-tests/Resources/hd/Images/paddle.png and b/tests/cpp-tests/Resources/hd/Images/paddle.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/particles.png b/tests/cpp-tests/Resources/hd/Images/particles.png old mode 100644 new mode 100755 index 2ba77b9e489d..be07eba22202 Binary files a/tests/cpp-tests/Resources/hd/Images/particles.png and b/tests/cpp-tests/Resources/hd/Images/particles.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/r1.png b/tests/cpp-tests/Resources/hd/Images/r1.png old mode 100644 new mode 100755 index 5fe4c448b84a..41cbbb5d6f21 Binary files a/tests/cpp-tests/Resources/hd/Images/r1.png and b/tests/cpp-tests/Resources/hd/Images/r1.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/r2.png b/tests/cpp-tests/Resources/hd/Images/r2.png old mode 100644 new mode 100755 index 5686801927f1..676732f19dcf Binary files a/tests/cpp-tests/Resources/hd/Images/r2.png and b/tests/cpp-tests/Resources/hd/Images/r2.png differ diff --git a/tests/cpp-tests/Resources/hd/Images/ui.png b/tests/cpp-tests/Resources/hd/Images/ui.png old mode 100644 new mode 100755 index 2bcd8796eced..a14a4fbcf158 Binary files a/tests/cpp-tests/Resources/hd/Images/ui.png and b/tests/cpp-tests/Resources/hd/Images/ui.png differ diff --git a/tests/cpp-tests/Resources/hd/TileMaps/tiles.png b/tests/cpp-tests/Resources/hd/TileMaps/tiles.png old mode 100644 new mode 100755 index 51e989d5486d..187cfee7878d Binary files a/tests/cpp-tests/Resources/hd/TileMaps/tiles.png and b/tests/cpp-tests/Resources/hd/TileMaps/tiles.png differ diff --git a/tests/cpp-tests/Resources/hd/TileMaps/tmw_desert_spacing.png b/tests/cpp-tests/Resources/hd/TileMaps/tmw_desert_spacing.png old mode 100644 new mode 100755 index 22f29806e2b7..1c62fbf263a3 Binary files a/tests/cpp-tests/Resources/hd/TileMaps/tmw_desert_spacing.png and b/tests/cpp-tests/Resources/hd/TileMaps/tmw_desert_spacing.png differ diff --git a/tests/cpp-tests/Resources/hd/animations/dragon_animation.png b/tests/cpp-tests/Resources/hd/animations/dragon_animation.png old mode 100644 new mode 100755 index ac05aa637748..8fbe949c1f00 Binary files a/tests/cpp-tests/Resources/hd/animations/dragon_animation.png and b/tests/cpp-tests/Resources/hd/animations/dragon_animation.png differ diff --git a/tests/cpp-tests/Resources/hd/components/Player.png b/tests/cpp-tests/Resources/hd/components/Player.png old mode 100644 new mode 100755 index b1a423980704..312351e40871 Binary files a/tests/cpp-tests/Resources/hd/components/Player.png and b/tests/cpp-tests/Resources/hd/components/Player.png differ diff --git a/tests/cpp-tests/Resources/hd/components/Projectile.png b/tests/cpp-tests/Resources/hd/components/Projectile.png old mode 100644 new mode 100755 index 63c3fe69f8cc..aae84e1ddad9 Binary files a/tests/cpp-tests/Resources/hd/components/Projectile.png and b/tests/cpp-tests/Resources/hd/components/Projectile.png differ diff --git a/tests/cpp-tests/Resources/hd/components/Target.png b/tests/cpp-tests/Resources/hd/components/Target.png old mode 100644 new mode 100755 index 509f0bb695a0..76dc863da22d Binary files a/tests/cpp-tests/Resources/hd/components/Target.png and b/tests/cpp-tests/Resources/hd/components/Target.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/CCControlColourPickerSpriteSheet.png b/tests/cpp-tests/Resources/hd/extensions/CCControlColourPickerSpriteSheet.png old mode 100644 new mode 100755 index bed750a6350c..b2f6361a8a74 Binary files a/tests/cpp-tests/Resources/hd/extensions/CCControlColourPickerSpriteSheet.png and b/tests/cpp-tests/Resources/hd/extensions/CCControlColourPickerSpriteSheet.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/background.png b/tests/cpp-tests/Resources/hd/extensions/background.png old mode 100644 new mode 100755 index 18f17c486f46..eff519b0334e Binary files a/tests/cpp-tests/Resources/hd/extensions/background.png and b/tests/cpp-tests/Resources/hd/extensions/background.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/button.png b/tests/cpp-tests/Resources/hd/extensions/button.png old mode 100644 new mode 100755 index 41a085d4aaa7..03aebc7bac18 Binary files a/tests/cpp-tests/Resources/hd/extensions/button.png and b/tests/cpp-tests/Resources/hd/extensions/button.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/buttonHighlighted.png b/tests/cpp-tests/Resources/hd/extensions/buttonHighlighted.png old mode 100644 new mode 100755 index a3bbd452724d..8bc814d3f037 Binary files a/tests/cpp-tests/Resources/hd/extensions/buttonHighlighted.png and b/tests/cpp-tests/Resources/hd/extensions/buttonHighlighted.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/potentiometerButton.png b/tests/cpp-tests/Resources/hd/extensions/potentiometerButton.png old mode 100644 new mode 100755 index b7da8c297a47..b729c31617bd Binary files a/tests/cpp-tests/Resources/hd/extensions/potentiometerButton.png and b/tests/cpp-tests/Resources/hd/extensions/potentiometerButton.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/potentiometerProgress.png b/tests/cpp-tests/Resources/hd/extensions/potentiometerProgress.png old mode 100644 new mode 100755 index c9ce448d02ca..683041699ff9 Binary files a/tests/cpp-tests/Resources/hd/extensions/potentiometerProgress.png and b/tests/cpp-tests/Resources/hd/extensions/potentiometerProgress.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/potentiometerTrack.png b/tests/cpp-tests/Resources/hd/extensions/potentiometerTrack.png old mode 100644 new mode 100755 index 1e84864d543e..0cfcc5553bd1 Binary files a/tests/cpp-tests/Resources/hd/extensions/potentiometerTrack.png and b/tests/cpp-tests/Resources/hd/extensions/potentiometerTrack.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/ribbon.png b/tests/cpp-tests/Resources/hd/extensions/ribbon.png old mode 100644 new mode 100755 index 0088ea0bf3a1..28583f52b5f4 Binary files a/tests/cpp-tests/Resources/hd/extensions/ribbon.png and b/tests/cpp-tests/Resources/hd/extensions/ribbon.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/sliderProgress.png b/tests/cpp-tests/Resources/hd/extensions/sliderProgress.png old mode 100644 new mode 100755 index 52795beab46f..f78bfc1b0d1a Binary files a/tests/cpp-tests/Resources/hd/extensions/sliderProgress.png and b/tests/cpp-tests/Resources/hd/extensions/sliderProgress.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/sliderProgress2.png b/tests/cpp-tests/Resources/hd/extensions/sliderProgress2.png old mode 100644 new mode 100755 index a01ad0223d02..81d517307d7e Binary files a/tests/cpp-tests/Resources/hd/extensions/sliderProgress2.png and b/tests/cpp-tests/Resources/hd/extensions/sliderProgress2.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/sliderThumb.png b/tests/cpp-tests/Resources/hd/extensions/sliderThumb.png old mode 100644 new mode 100755 index 27e4965889a1..d9a0abdf16c6 Binary files a/tests/cpp-tests/Resources/hd/extensions/sliderThumb.png and b/tests/cpp-tests/Resources/hd/extensions/sliderThumb.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/sliderTrack.png b/tests/cpp-tests/Resources/hd/extensions/sliderTrack.png old mode 100644 new mode 100755 index f0b3de458306..a803eb5c57a6 Binary files a/tests/cpp-tests/Resources/hd/extensions/sliderTrack.png and b/tests/cpp-tests/Resources/hd/extensions/sliderTrack.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/sliderTrack2.png b/tests/cpp-tests/Resources/hd/extensions/sliderTrack2.png old mode 100644 new mode 100755 index c3b8b28013f4..59b8dc91b11c Binary files a/tests/cpp-tests/Resources/hd/extensions/sliderTrack2.png and b/tests/cpp-tests/Resources/hd/extensions/sliderTrack2.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/stepper-minus.png b/tests/cpp-tests/Resources/hd/extensions/stepper-minus.png old mode 100644 new mode 100755 index 333363d3d887..8d3e18ed5283 Binary files a/tests/cpp-tests/Resources/hd/extensions/stepper-minus.png and b/tests/cpp-tests/Resources/hd/extensions/stepper-minus.png differ diff --git a/tests/cpp-tests/Resources/hd/extensions/stepper-plus.png b/tests/cpp-tests/Resources/hd/extensions/stepper-plus.png old mode 100644 new mode 100755 index 1731eddcad50..ef6de5e5d026 Binary files a/tests/cpp-tests/Resources/hd/extensions/stepper-plus.png and b/tests/cpp-tests/Resources/hd/extensions/stepper-plus.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/font-issue1343.png b/tests/cpp-tests/Resources/hd/fonts/font-issue1343.png old mode 100644 new mode 100755 index 36d7d4bf622c..a6ca8414e453 Binary files a/tests/cpp-tests/Resources/hd/fonts/font-issue1343.png and b/tests/cpp-tests/Resources/hd/fonts/font-issue1343.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/konqa32.png b/tests/cpp-tests/Resources/hd/fonts/konqa32.png old mode 100644 new mode 100755 index dfb34878c17e..051e8d5bd30f Binary files a/tests/cpp-tests/Resources/hd/fonts/konqa32.png and b/tests/cpp-tests/Resources/hd/fonts/konqa32.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/labelatlas.png b/tests/cpp-tests/Resources/hd/fonts/labelatlas.png old mode 100644 new mode 100755 index e79887debff6..bb8ce11e54c2 Binary files a/tests/cpp-tests/Resources/hd/fonts/labelatlas.png and b/tests/cpp-tests/Resources/hd/fonts/labelatlas.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/larabie-16.png b/tests/cpp-tests/Resources/hd/fonts/larabie-16.png old mode 100644 new mode 100755 index cc8d988554c8..f860d02fabee Binary files a/tests/cpp-tests/Resources/hd/fonts/larabie-16.png and b/tests/cpp-tests/Resources/hd/fonts/larabie-16.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/markerFelt.png b/tests/cpp-tests/Resources/hd/fonts/markerFelt.png old mode 100644 new mode 100755 index d3088bec6c9a..3988cfdf6548 Binary files a/tests/cpp-tests/Resources/hd/fonts/markerFelt.png and b/tests/cpp-tests/Resources/hd/fonts/markerFelt.png differ diff --git a/tests/cpp-tests/Resources/hd/fonts/tuffy_bold_italic-charmap.png b/tests/cpp-tests/Resources/hd/fonts/tuffy_bold_italic-charmap.png old mode 100644 new mode 100755 index 370761c10a6b..8167faf6c40f Binary files a/tests/cpp-tests/Resources/hd/fonts/tuffy_bold_italic-charmap.png and b/tests/cpp-tests/Resources/hd/fonts/tuffy_bold_italic-charmap.png differ diff --git a/tests/cpp-tests/Resources/hd/fps_images.png b/tests/cpp-tests/Resources/hd/fps_images.png index 98d2069a19c5..54a299ed9189 100644 Binary files a/tests/cpp-tests/Resources/hd/fps_images.png and b/tests/cpp-tests/Resources/hd/fps_images.png differ diff --git a/tests/cpp-tests/Resources/spine/coin.png b/tests/cpp-tests/Resources/spine/coin.png index d4481accd4a1..7d14a6b6f98c 100644 Binary files a/tests/cpp-tests/Resources/spine/coin.png and b/tests/cpp-tests/Resources/spine/coin.png differ diff --git a/tests/cpp-tests/Resources/spine/goblins.png b/tests/cpp-tests/Resources/spine/goblins.png index cadd1c621aa6..9d1ae572a556 100644 Binary files a/tests/cpp-tests/Resources/spine/goblins.png and b/tests/cpp-tests/Resources/spine/goblins.png differ diff --git a/tests/cpp-tests/Resources/spine/raptor.png b/tests/cpp-tests/Resources/spine/raptor.png index 0df1ac967103..f8d67bd9f6fd 100644 Binary files a/tests/cpp-tests/Resources/spine/raptor.png and b/tests/cpp-tests/Resources/spine/raptor.png differ diff --git a/tests/cpp-tests/Resources/spine/spineboy.png b/tests/cpp-tests/Resources/spine/spineboy.png index 12563a27e186..dc771e870b21 100644 Binary files a/tests/cpp-tests/Resources/spine/spineboy.png and b/tests/cpp-tests/Resources/spine/spineboy.png differ diff --git a/tests/cpp-tests/Resources/spine/sprite.png b/tests/cpp-tests/Resources/spine/sprite.png index b8aff3768a77..91dd46533758 100644 Binary files a/tests/cpp-tests/Resources/spine/sprite.png and b/tests/cpp-tests/Resources/spine/sprite.png differ diff --git a/tests/cpp-tests/Resources/spine/tank.png b/tests/cpp-tests/Resources/spine/tank.png index 6774d7e7db1d..29481daf898e 100644 Binary files a/tests/cpp-tests/Resources/spine/tank.png and b/tests/cpp-tests/Resources/spine/tank.png differ diff --git a/tests/cpp-tests/Resources/zwoptex/grossini-generic.png b/tests/cpp-tests/Resources/zwoptex/grossini-generic.png old mode 100644 new mode 100755 index 15803e5a5973..5c0bbc67c854 Binary files a/tests/cpp-tests/Resources/zwoptex/grossini-generic.png and b/tests/cpp-tests/Resources/zwoptex/grossini-generic.png differ diff --git a/tests/cpp-tests/Resources/zwoptex/grossini.png b/tests/cpp-tests/Resources/zwoptex/grossini.png old mode 100644 new mode 100755 index 15803e5a5973..5c0bbc67c854 Binary files a/tests/cpp-tests/Resources/zwoptex/grossini.png and b/tests/cpp-tests/Resources/zwoptex/grossini.png differ diff --git a/tests/cpp-tests/proj.android/app/AndroidManifest.xml b/tests/cpp-tests/proj.android/app/AndroidManifest.xml index c7d83e557293..82be4ae7c060 100644 --- a/tests/cpp-tests/proj.android/app/AndroidManifest.xml +++ b/tests/cpp-tests/proj.android/app/AndroidManifest.xml @@ -8,6 +8,7 @@ diff --git a/tests/cpp-tests/proj.android/app/build.gradle b/tests/cpp-tests/proj.android/app/build.gradle index 0d76faa4690b..7fce939a168e 100644 --- a/tests/cpp-tests/proj.android/app/build.gradle +++ b/tests/cpp-tests/proj.android/app/build.gradle @@ -34,9 +34,8 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { targets 'cpp_tests' - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/tests/cpp-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/cpp-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png index 347369290269..45ee51d15f96 100644 Binary files a/tests/cpp-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/cpp-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/cpp-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png index b1b7749de25d..0dd2a608998e 100644 Binary files a/tests/cpp-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/cpp-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/cpp-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index da139dcd9853..a32f16f930b3 100644 Binary files a/tests/cpp-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/cpp-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/cpp-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 6726b2fe032d..332f268edc46 100644 Binary files a/tests/cpp-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/cpp-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/cpp-tests/proj.android/settings.gradle b/tests/cpp-tests/proj.android/settings.gradle index 20644fa006fd..72c6f3a475f8 100644 --- a/tests/cpp-tests/proj.android/settings.gradle +++ b/tests/cpp-tests/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') include ':CppTests' project(':CppTests').projectDir = new File(settingsDir, 'app') +rootProject.name = "cpp-tests" diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20.png index 5d49de2c3d34..8ead23e36507 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@2x.png index 5b009b8c3263..775685daca94 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@3x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@3x.png index 16b844a741f9..a5b49ccbb199 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@3x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-20@3x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29.png index 9c1fb7f75048..0500184c869c 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@2x.png index 5903458d985a..f0f8b7fe9833 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@3x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@3x.png index a750877b3020..5287e50a7986 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@3x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-29@3x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40.png index 5b009b8c3263..775685daca94 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@2x.png index 58ce0bb76a1c..d9c7ab446bb7 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@3x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@3x.png index 16b844a741f9..a5b49ccbb199 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@3x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-40@3x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50.png index ade12a5a9d21..ac381bc20e85 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50@2x.png index 4a5231a0b79f..ef38d4500a80 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-50@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57.png index 7de9113e6f6a..4fcc6fddffe1 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57@2x.png index bac3cf32f6c6..c3807861ad29 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-57@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@2x.png index 16b844a741f9..a5b49ccbb199 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@3x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@3x.png index 02690f15a799..d4bc53132ce3 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@3x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-60@3x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72.png index 9dc7c3f12e35..2c573c8df4c3 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72@2x.png index d8b6a74ed7ff..1526615c02d1 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-72@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76.png index 016bc84ac158..8a1fa1850c03 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76@2x.png index df2fbe041858..8aa82506d0d1 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-76@2x.png differ diff --git a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-83.5@2x.png b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-83.5@2x.png index 85bdb364946c..6bf801d17507 100644 Binary files a/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-83.5@2x.png and b/tests/cpp-tests/proj.ios/Images.xcassets/AppIcon-cpp-tests.appiconset/Icon-83.5@2x.png differ diff --git a/tests/cpp-tests/proj.ios/LaunchScreenBackground.png b/tests/cpp-tests/proj.ios/LaunchScreenBackground.png index bfbe6c2c7a21..dadccee68624 100644 Binary files a/tests/cpp-tests/proj.ios/LaunchScreenBackground.png and b/tests/cpp-tests/proj.ios/LaunchScreenBackground.png differ diff --git a/tests/cpp-tests/proj.win10/App.xaml b/tests/cpp-tests/proj.win10/App.xaml deleted file mode 100644 index 936aef6db41d..000000000000 --- a/tests/cpp-tests/proj.win10/App.xaml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - cpp_tests - - \ No newline at end of file diff --git a/tests/cpp-tests/proj.win10/App.xaml.cpp b/tests/cpp-tests/proj.win10/App.xaml.cpp deleted file mode 100644 index b32b2e6c8aa9..000000000000 --- a/tests/cpp-tests/proj.win10/App.xaml.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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 "App.xaml.h" -#include "OpenGLESPage.xaml.h" - -using namespace Platform; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Activation; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::UI::Xaml::Media::Animation; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Interop; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; -using namespace cocos2d; -using namespace CocosAppWinRT; - -App::App() -{ - InitializeComponent(); - Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); - Resuming += ref new EventHandler(this, &App::OnResuming); -} - -/// -/// Invoked when the application is launched normally by the end user. Other entry points -/// will be used such as when the application is launched to open a specific file. -/// -/// Details about the launch request and process. -void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) -{ - // if our app is prelaunched do nothing - // see https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/handle-app-prelaunch - if (e->PrelaunchActivated) - { - return; - } - - auto rootFrame = dynamic_cast(Window::Current->Content); - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == nullptr) - { - // Create a Frame to act as the navigation context and associate it with - // a SuspensionManager key - rootFrame = ref new Frame(); - - rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); - - if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) - { - // TODO: Restore the saved session state only when appropriate, scheduling the - // final launch steps after the restore is complete - - } - - // Place the frame in the current Window - Window::Current->Content = rootFrame; - // Ensure the current window is active - } - - if (rootFrame->Content == nullptr) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame->Content = mPage = ref new OpenGLESPage(&mOpenGLES); - } - // Ensure the current window is active - Window::Current->Activate(); -} - -/// -/// Invoked when application execution is being suspended. Application state is saved -/// without knowing whether the application will be terminated or resumed with the contents -/// of memory still intact. -/// -void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) -{ - (void)sender; // Unused parameter - (void)e; // Unused parameter - - if (mPage) - { - mPage->SetVisibility(false); - } -} - -/// -/// Invoked when application execution is being resumed. -/// -/// The source of the resume request. -/// Details about the resume request. -void App::OnResuming(Object ^sender, Object ^args) -{ - (void)sender; // Unused parameter - (void)args; // Unused parameter - - if (mPage) - { - mPage->SetVisibility(true); - } -} - -/// -/// Invoked when Navigation to a certain page fails -/// -/// The Frame which failed navigation -/// Details about the navigation failure -void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) -{ - throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); -} - - - - diff --git a/tests/cpp-tests/proj.win10/App.xaml.h b/tests/cpp-tests/proj.win10/App.xaml.h deleted file mode 100644 index 57c7f8d8c1ab..000000000000 --- a/tests/cpp-tests/proj.win10/App.xaml.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - 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. - ****************************************************************************/ - -#pragma once - -#include "app.g.h" -#include "OpenGLES.h" -#include "OpenGLESPage.xaml.h" - -namespace CocosAppWinRT -{ - ref class App sealed - { - public: - App(); - virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; - - private: - void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); - void OnResuming(Platform::Object ^sender, Platform::Object ^args); - void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); - - OpenGLESPage^ mPage; - OpenGLES mOpenGLES; - }; -} diff --git a/tests/cpp-tests/proj.win10/Assets/LockScreenLogo.scale-200.png b/tests/cpp-tests/proj.win10/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index ad81b3a1fec9..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/SplashScreen.scale-200.png b/tests/cpp-tests/proj.win10/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 9b441acfb4e7..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/Square150x150Logo.scale-200.png b/tests/cpp-tests/proj.win10/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index a4cde35cb458..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.scale-200.png b/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index c02f1a915a12..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index cdfeac07b1e0..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/StoreLogo.png b/tests/cpp-tests/proj.win10/Assets/StoreLogo.png deleted file mode 100644 index e17ce163d104..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/StoreLogo.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Assets/Wide310x150Logo.scale-200.png b/tests/cpp-tests/proj.win10/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 61adac18ca2f..000000000000 Binary files a/tests/cpp-tests/proj.win10/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/Package.appxmanifest b/tests/cpp-tests/proj.win10/Package.appxmanifest deleted file mode 100644 index 39f52406f938..000000000000 --- a/tests/cpp-tests/proj.win10/Package.appxmanifest +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - cpp-tests - Microsoft Open Technologies, Inc. - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj deleted file mode 100644 index 590441fd458b..000000000000 --- a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj +++ /dev/null @@ -1,619 +0,0 @@ - - - - {c1307b42-d00a-4b88-bcdd-0a16a81ff4c1} - CocosAppWinRT - en-US - 14.0 - true - Windows Store - 8.2 - 10.0.10240.0 - 10.0.10240.0 - - - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - Win32 - - - Release - x64 - - - - Application - true - v141 - - - Application - true - v141 - - - Application - true - v141 - - - Application - false - true - v141 - - - Application - false - true - v141 - - - Application - false - true - v141 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cpp-tests_TemporaryKey.pfx - A047654C44C0BB81CD13E278200A30E4B48AC0F9 - - - false - - - false - - - false - - - false - - - false - - - false - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056;4800; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - ProgramDatabase - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - false - ProgramDatabase - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) - - - - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056;4800; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - ProgramDatabase - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - false - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) - ProgramDatabase - - - - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056;4800; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - ProgramDatabase - CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions) - - - MSVCRT;%(IgnoreSpecificDefaultLibraries) - - - - - /Zm384 /bigobj %(AdditionalOptions) - 4453;28204;4251;4244;4056; - pch.h - ..\Classes;$(EngineRoot)cocos\platform\win8.1-universal;%(AdditionalIncludeDirectories) - false - false - CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions) - ProgramDatabase - - - - - - - - - - ..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - Designer - - - - - Designer - - - - - - - - ..\..\..\cocos\platform\win8.1-universal\OpenGLESPage.xaml - - - Create - Create - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - {07c2895d-720c-487d-b7b4-12c293ea533f} - - - {4b3ba10a-941f-4e08-8a50-8a7fcb822bb8} - - - {0c32d479-46d5-46c3-9aa9-0a8ff8320516} - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters deleted file mode 100644 index f51dbab47370..000000000000 --- a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters +++ /dev/null @@ -1,1289 +0,0 @@ - - - - - 97d8d08c-848a-420e-aab1-5061457b491f - bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png - - - {72a5938d-b456-4ee5-a76a-5e28c0cf30b5} - - - {81d00d76-81ec-4274-8e14-0066561a59f3} - - - {12320dbd-8679-44e8-b002-10cfd1f0ab8d} - - - {ec79851d-4b4e-4cca-a60a-db3bd19e9df0} - - - {c71ed4ef-b44c-4efa-a557-96d792c4082f} - - - {a762d21f-dab4-4e65-9635-8a2d1c3720a5} - - - {ff2c6e21-2e15-47ba-8e8a-d32db4c4bd7d} - - - {bddbff12-4011-4071-86c3-d2d4b01d9f07} - - - {142a60f8-f519-453f-9641-13c42af61fbc} - - - {0a14dee6-42c3-4144-a086-30bcae298e81} - - - {36c8d894-0028-4d9a-b9c1-3d2b121630da} - - - {ef5441af-f919-4af7-b130-f69ad71bf475} - - - {1a800ef0-fbc5-47ad-903d-48cb2e6e884a} - - - {e05a72bb-7eed-46a8-8216-1714220c79bf} - - - {6990fa3c-1895-48ec-9823-c82132260315} - - - {440a9c5a-db16-4c28-99ee-58ff0f719ba2} - - - {d73c786c-4cfe-4e17-9d9a-322375186ec7} - - - {4fdbcbde-1a04-49bc-a560-0b23a61c9850} - - - {583443c6-166b-4693-a2d1-ad846f6813bc} - - - {54e78cdc-cc15-4d83-8d3c-ff77beae1446} - - - {8e16d7fe-b605-4eaf-9474-ec8a1298abdc} - - - {e5b0399b-acae-4f23-9a37-063323e86386} - - - {afcfb524-ce73-49ba-89ce-cb99287eda6c} - - - {8a60f5bf-9873-44fc-aa4d-29056ae1c370} - - - {d8bbe73e-03bd-4262-b49f-402a14f8a13d} - - - {8a4d0c1b-0951-4965-8740-e430dde2fbe8} - - - {0bf42589-4ced-4603-a901-e773767d83f7} - - - {ff1dcf6c-41df-4b5c-aa35-80f52ecc34eb} - - - {7fda7040-9402-4f45-b141-22a74978c3d2} - - - {64eae2a4-f1f2-4d57-af0e-f417669bf6ab} - - - {9f2342f7-9cfa-4897-8610-5aba7d2a8eda} - - - {618404c5-9e20-4c6b-ba9c-11699ba3c45c} - - - {a6a92123-dd2f-4c1e-9780-a8183491b3d2} - - - {ee4418eb-5a74-4ba6-a3d9-361793492383} - - - {50348955-c1df-4e27-ba81-7f1f7a7f7d0b} - - - {a3022a16-5125-46fe-bbbf-88b6327fdf90} - - - {c182d51b-571a-41b9-93c4-2f16a9a6e382} - - - {24c2bc37-1b31-4844-981f-d0b842636df1} - - - {a8c99d83-bb5b-4732-9654-5c4a46833584} - - - {df4917f4-0ed9-483b-9133-71d60ba8a4fd} - - - {0648a349-fa88-45e2-8304-58576ac063b2} - - - {1a5d3f8b-3643-47e1-a6d9-7dad49dcb624} - - - {ae687fa8-7a8d-4b9c-9618-3191c9be1927} - - - {b39e1877-a9c0-4c7c-acc9-a685ad2daf3b} - - - {53ec3574-9cb7-4e7b-af67-e7f7f9e6a0e6} - - - {3a131364-6664-4c15-a66e-2dbdf2b296b9} - - - {8d4ad0bf-81d4-4767-ac71-39b5c75b72ba} - - - {d93b735e-696c-43b7-9a79-993ca680b953} - - - {19e37819-45ae-474d-86d9-46104d51e247} - - - {aa8d908d-05dd-4dd3-9cd7-1a381e167ba8} - - - {6a181335-c139-4928-84f0-40c3373befb8} - - - {6135b950-f660-4f73-8c40-bbc31c6e2863} - - - {43e4143b-0be4-4800-9cd3-9293bb1006ce} - - - {1716fd6e-cd96-4bea-96d0-37d57dd602c5} - - - {718a904b-d90b-4aa0-944f-81a69d287ea5} - - - {1ec92552-3f16-4080-ba2f-a171b3a7f92c} - - - {cf755f22-4dbd-427a-b92a-f7ef14f72990} - - - {8240d810-c3a1-403c-8d60-f83ca945bf34} - - - {f2357ab1-759e-42fa-87f3-1e33a775c912} - - - {c84d9ab4-0f15-4a7e-b214-238249f06204} - - - {e45b72a6-fe38-4c7a-986a-424d303b847f} - - - {7ec771c0-0344-43e9-9ae8-0f8a278791a2} - - - {3bd8ffaa-c24f-455b-bb31-25b038490329} - - - {878bc3fc-cc88-43cb-85b7-f64c31c527b6} - - - {340b2acb-098d-441d-9737-6788ea17541a} - - - {ff68b4b0-3bdf-4813-8552-b79af838c8a3} - - - {a60b411f-fae8-461b-afe7-8e8033d2153c} - - - {ccc87a7c-9e62-4035-a4c5-f7a5880139a8} - - - {8d6fe7eb-ba6c-4cea-93b2-1adaf2c8e2ae} - - - {119e04c5-5d54-4972-aeb8-9bb32f7a33ac} - - - {04b6873a-ec2a-4695-80b5-df70a54a37d5} - - - {3df38e07-ce63-44fa-900b-e20d39848bad} - - - {e5a446a6-fee6-4802-952b-eb18a397f446} - - - {16c5df56-4880-4bf2-a626-fc8974cd9df3} - - - {5e03116b-9f99-4db3-808a-b36aaae5dae0} - - - {baf5dbe8-8801-4333-a8c2-6f96fbe31b5d} - - - {11da21cc-bd40-4f2c-8bf9-5056772f1ba0} - - - {733a8fe7-3fee-43e8-9437-d220158bb48b} - - - {ac191442-d014-4327-84cc-e31d233cb5ed} - - - {684498f9-817b-4058-a932-0cd4d9cde9eb} - - - {8af92cb5-8107-4998-8fa8-f7e959146a06} - - - {62e7ccf1-beeb-4f93-b069-5a81e62776a4} - - - {2d74d632-649d-4d94-bf6a-cfa01315a5b0} - - - {82556440-cf2a-45b7-8a23-718c25ad9007} - - - {842b8441-0677-46fd-ac69-effbe83b0776} - - - {ea7e291b-1de5-4be5-9f59-c92dfcb5dac5} - - - {f10b76ee-8c87-4b9f-b8af-ace7a38bb6f2} - - - {568809dd-eb65-4bb2-90d2-251313e5b67e} - - - {1830aea4-07f5-466e-928c-a67a02083535} - - - {a34bc185-d0fa-4e93-b289-954abaedcaae} - - - {a49e5dee-6eab-4a2a-9769-9f84ff6a5610} - - - {a6b76076-ceeb-43e6-9005-1656c65778b6} - - - {fd63b656-b611-447b-b4a1-f2d11f92ff83} - - - {c6bd28ea-2696-4d05-90b2-2646ed934a49} - - - {848aacea-a328-4797-9119-403b3c94d3d7} - - - - - - - - - Classes - - - Classes - - - Classes - - - Classes - - - Classes\ActionManagerTest - - - Classes\ActionsEaseTest - - - Classes\ActionsProgressTest - - - Classes\ActionsTest - - - Classes\AllocatorTest - - - Classes\BillBoardTest - - - Classes\Box2DTest - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest\Bug-458 - - - Classes\BugsTest\Bug-458 - - - Classes\Camera3DTest - - - Classes\ChipmunkTest - - - Classes\ClickAndMoveTest - - - Classes\ClippingNodeTest - - - Classes\CocosDenshionTest - - - Classes\ConfigurationTest - - - Classes\ConsoleTest - - - Classes\CurrentLanguageTest - - - Classes\DataVisitorTest - - - Classes\DrawPrimitivesTest - - - Classes\EffectsAdvancedTest - - - Classes\EffectsTest - - - Classes\ExtensionsTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\TableViewTest - - - Classes\ExtensionsTest\TableViewTest - - - Classes\FileUtilsTest - - - Classes\InputTest - - - Classes\FontTest - - - Classes\IntervalTest - - - Classes\LabelTest - - - Classes\LabelTest - - - Classes\LayerTest - - - Classes\LightTest - - - Classes\MenuTest - - - Classes\MotionStreakTest - - - Classes\MultiTouchTest - - - Classes\NewEventDispatcherTest - - - Classes\NewRendererTest - - - Classes\NodeTest - - - Classes\OpenURLTest - - - Classes\ParallaxTest - - - Classes\Particle3DTest - - - Classes\ParticleTest - - - Classes\PhysicsTest - - - Classes\ReleasePoolTest - - - Classes\RenderTextureTest - - - Classes\RotateWorldTest - - - Classes\SceneTest - - - Classes\SchedulerTest - - - Classes\ShaderTest - - - Classes\ShaderTest - - - Classes\SpineTest - - - Classes\Sprite3DTest - - - Classes\Sprite3DTest - - - Classes\SpriteTest - - - Classes\TerrainTest - - - Classes\TextInputTest - - - Classes\Texture2dTest - - - Classes\TextureCacheTest - - - Classes\TexturePackerEncryptionTest - - - Classes\TileMapTest - - - Classes\TileMapTest - - - Classes\TouchesTest - - - Classes\TouchesTest - - - Classes\TouchesTest - - - Classes\TransitionsTest - - - Classes\UITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest\UIButtonTest - - - Classes\UITest\CocoStudioGUITest\UICheckBoxTest - - - Classes\UITest\CocoStudioGUITest\UIFocusTest - - - Classes\UITest\CocoStudioGUITest\UIImageViewTest - - - Classes\UITest\CocoStudioGUITest\UILayoutTest - - - Classes\UITest\CocoStudioGUITest\UIListViewTest - - - Classes\UITest\CocoStudioGUITest\UILoadingBarTest - - - Classes\UITest\CocoStudioGUITest\UIPageViewTest - - - Classes\UITest\CocoStudioGUITest\UIRichTextTest - - - Classes\UITest\CocoStudioGUITest\UIScrollViewTest - - - Classes\UITest\CocoStudioGUITest\UISliderTest - - - Classes\UITest\CocoStudioGUITest\UITextAtlasTest - - - Classes\UITest\CocoStudioGUITest\UITextBMFontTest - - - Classes\UITest\CocoStudioGUITest\UITextFieldTest - - - Classes\UITest\CocoStudioGUITest\UITextTest - - - Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest - - - Classes\UnitTest - - - Classes\UnitTest - - - Classes\UserDefaultTest - - - Classes\VibrateTest - - - Classes\ZwoptexTest - - - - - - - Classes\SpritePolygonTest - - - Classes\Scene3DTest - - - Classes\MaterialSystemTest - - - Classes\NewAudioEngineTest - - - Classes\Physics3DTest - - - Classes\NavMeshTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\CurlTest - - - Classes\ExtensionsTest\AssetsManagerExTest - - - Classes\DownloaderTest - - - Classes\UITest\CocoStudioGUITest\UIRadioButtonTest - - - Classes\UITest\CocoStudioGUITest\UITabContorlTest - - - - Classes\VRTests - - - - - - Classes - - - Classes - - - Classes - - - Classes - - - Classes - - - Classes - - - Classes - - - Classes\ActionManagerTest - - - Classes\ActionsEaseTest - - - Classes\ActionsProgressTest - - - Classes\ActionsTest - - - Classes\AllocatorTest - - - Classes\BillBoardTest - - - Classes\Box2DTest - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\Box2DTestBed\Tests - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest\Bug-458 - - - Classes\BugsTest\Bug-458 - - - Classes\Camera3DTest - - - Classes\ChipmunkTest - - - Classes\ClickAndMoveTest - - - Classes\ClippingNodeTest - - - Classes\CocosDenshionTest - - - Classes\ConfigurationTest - - - Classes\ConsoleTest - - - Classes\CurrentLanguageTest - - - Classes\DataVisitorTest - - - Classes\DrawPrimitivesTest - - - Classes\EffectsAdvancedTest - - - Classes\EffectsTest - - - Classes\ExtensionsTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\NetworkTest - - - Classes\ExtensionsTest\TableViewTest - - - Classes\ExtensionsTest\TableViewTest - - - Classes\FileUtilsTest - - - Classes\InputTest - - - Classes\FontTest - - - Classes\IntervalTest - - - Classes\LabelTest - - - Classes\LabelTest - - - Classes\LayerTest - - - Classes\LightTest - - - Classes\MenuTest - - - Classes\MotionStreakTest - - - Classes\MultiTouchTest - - - Classes\NewEventDispatcherTest - - - Classes\NewRendererTest - - - Classes\NodeTest - - - Classes\OpenURLTest - - - Classes\ParallaxTest - - - Classes\Particle3DTest - - - Classes\ParticleTest - - - Classes\PhysicsTest - - - Classes\ReleasePoolTest - - - Classes\RenderTextureTest - - - Classes\RotateWorldTest - - - Classes\SceneTest - - - Classes\SchedulerTest - - - Classes\ShaderTest - - - Classes\ShaderTest - - - Classes\ShaderTest - - - Classes\ShaderTest - - - Classes\SpineTest - - - Classes\Sprite3DTest - - - Classes\Sprite3DTest - - - Classes\SpriteTest - - - Classes\TerrainTest - - - Classes\TextInputTest - - - Classes\Texture2dTest - - - Classes\TextureCacheTest - - - Classes\TexturePackerEncryptionTest - - - Classes\TileMapTest - - - Classes\TileMapTest - - - Classes\TouchesTest - - - Classes\TouchesTest - - - Classes\TouchesTest - - - Classes\TransitionsTest - - - Classes\UITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest - - - Classes\UITest\CocoStudioGUITest\UIButtonTest - - - Classes\UITest\CocoStudioGUITest\UICheckBoxTest - - - Classes\UITest\CocoStudioGUITest\UIFocusTest - - - Classes\UITest\CocoStudioGUITest\UIImageViewTest - - - Classes\UITest\CocoStudioGUITest\UILayoutTest - - - Classes\UITest\CocoStudioGUITest\UIListViewTest - - - Classes\UITest\CocoStudioGUITest\UILoadingBarTest - - - Classes\UITest\CocoStudioGUITest\UIPageViewTest - - - Classes\UITest\CocoStudioGUITest\UIRichTextTest - - - Classes\UITest\CocoStudioGUITest\UIScrollViewTest - - - Classes\UITest\CocoStudioGUITest\UISliderTest - - - Classes\UITest\CocoStudioGUITest\UITextAtlasTest - - - Classes\UITest\CocoStudioGUITest\UITextBMFontTest - - - Classes\UITest\CocoStudioGUITest\UITextFieldTest - - - Classes\UITest\CocoStudioGUITest\UITextTest - - - Classes\UITest\CocoStudioGUITest\UIWidgetAddNodeTest - - - Classes\UnitTest - - - Classes\UnitTest - - - Classes\UserDefaultTest - - - Classes\VibrateTest - - - Classes\ZwoptexTest - - - - - - - Classes\SpritePolygonTest - - - Classes\Scene3DTest - - - Classes\MaterialSystemTest - - - Classes\NewAudioEngineTest - - - Classes\Physics3DTest - - - Classes\NavMeshTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\BugsTest - - - Classes\CurlTest - - - Classes\ExtensionsTest\AssetsManagerExTest - - - Classes\DownloaderTest - - - Classes\UITest\CocoStudioGUITest\UIRadioButtonTest - - - Classes\UITest\CocoStudioGUITest\UITabContorlTest - - - - - - - Classes\VRTests - - - - - - - - - - - - - - - - - - - - - - - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - \ No newline at end of file diff --git a/tests/cpp-tests/proj.win10/cpp-tests_TemporaryKey.pfx b/tests/cpp-tests/proj.win10/cpp-tests_TemporaryKey.pfx deleted file mode 100644 index 9d758bf01500..000000000000 Binary files a/tests/cpp-tests/proj.win10/cpp-tests_TemporaryKey.pfx and /dev/null differ diff --git a/tests/cpp-tests/proj.win10/resources.props b/tests/cpp-tests/proj.win10/resources.props deleted file mode 100644 index 27ed6639498e..000000000000 --- a/tests/cpp-tests/proj.win10/resources.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - <_CustomResource Include="..\Resources\**\*"> - Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) - true - - - - - - - - - - - diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 062ebe13cfbc..993258f22d77 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -14,6 +14,7 @@ {76A39BB2-9B84-4C65-98A5-654D86B86F2A} test_win32 Win32Proj + 10.0.17134.0 @@ -104,7 +105,7 @@ - xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y @@ -148,7 +149,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y diff --git a/tests/game-controller-test/Classes/GameControllerTest.cpp b/tests/game-controller-test/Classes/GameControllerTest.cpp index 63e6903a519b..07a9095edee6 100644 --- a/tests/game-controller-test/Classes/GameControllerTest.cpp +++ b/tests/game-controller-test/Classes/GameControllerTest.cpp @@ -473,8 +473,4 @@ void GameControllerTest::createControllerSprite(ControllerHolder& holder) void GameControllerTest::menuCloseCallback(Ref* sender) { Director::getInstance()->end(); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif } \ No newline at end of file diff --git a/tests/game-controller-test/Resources/ipad/A.png b/tests/game-controller-test/Resources/ipad/A.png index cb88f5bf2d84..fa35c7cd0257 100644 Binary files a/tests/game-controller-test/Resources/ipad/A.png and b/tests/game-controller-test/Resources/ipad/A.png differ diff --git a/tests/game-controller-test/Resources/ipad/B.png b/tests/game-controller-test/Resources/ipad/B.png index 0595ae9cf17d..5f14c27bb78e 100644 Binary files a/tests/game-controller-test/Resources/ipad/B.png and b/tests/game-controller-test/Resources/ipad/B.png differ diff --git a/tests/game-controller-test/Resources/ipad/CloseNormal.png b/tests/game-controller-test/Resources/ipad/CloseNormal.png index 97237344c53b..85a44c0d0367 100644 Binary files a/tests/game-controller-test/Resources/ipad/CloseNormal.png and b/tests/game-controller-test/Resources/ipad/CloseNormal.png differ diff --git a/tests/game-controller-test/Resources/ipad/CloseSelected.png b/tests/game-controller-test/Resources/ipad/CloseSelected.png index 3440df6b1517..42c55a30a230 100644 Binary files a/tests/game-controller-test/Resources/ipad/CloseSelected.png and b/tests/game-controller-test/Resources/ipad/CloseSelected.png differ diff --git a/tests/game-controller-test/Resources/ipad/L1.png b/tests/game-controller-test/Resources/ipad/L1.png index db5abd7f259f..a59e0c74d76b 100644 Binary files a/tests/game-controller-test/Resources/ipad/L1.png and b/tests/game-controller-test/Resources/ipad/L1.png differ diff --git a/tests/game-controller-test/Resources/ipad/L2.png b/tests/game-controller-test/Resources/ipad/L2.png index eb7fc523d732..526d7276171f 100644 Binary files a/tests/game-controller-test/Resources/ipad/L2.png and b/tests/game-controller-test/Resources/ipad/L2.png differ diff --git a/tests/game-controller-test/Resources/ipad/R1.png b/tests/game-controller-test/Resources/ipad/R1.png index 291af0fd6bb2..028abf6363ed 100644 Binary files a/tests/game-controller-test/Resources/ipad/R1.png and b/tests/game-controller-test/Resources/ipad/R1.png differ diff --git a/tests/game-controller-test/Resources/ipad/R2.png b/tests/game-controller-test/Resources/ipad/R2.png index c7dabe62c148..10109019b211 100644 Binary files a/tests/game-controller-test/Resources/ipad/R2.png and b/tests/game-controller-test/Resources/ipad/R2.png differ diff --git a/tests/game-controller-test/Resources/ipad/X.png b/tests/game-controller-test/Resources/ipad/X.png index 1fed711bd561..38b3a03ec47e 100644 Binary files a/tests/game-controller-test/Resources/ipad/X.png and b/tests/game-controller-test/Resources/ipad/X.png differ diff --git a/tests/game-controller-test/Resources/ipad/Y.png b/tests/game-controller-test/Resources/ipad/Y.png index 3b2bfeeebf49..180d80a39e79 100644 Binary files a/tests/game-controller-test/Resources/ipad/Y.png and b/tests/game-controller-test/Resources/ipad/Y.png differ diff --git a/tests/game-controller-test/Resources/ipad/controller-1.png b/tests/game-controller-test/Resources/ipad/controller-1.png index 389c2276dd8a..347b8f4f3111 100644 Binary files a/tests/game-controller-test/Resources/ipad/controller-1.png and b/tests/game-controller-test/Resources/ipad/controller-1.png differ diff --git a/tests/game-controller-test/Resources/ipad/controller-2.png b/tests/game-controller-test/Resources/ipad/controller-2.png index 1d92330f938e..5116523c5e57 100644 Binary files a/tests/game-controller-test/Resources/ipad/controller-2.png and b/tests/game-controller-test/Resources/ipad/controller-2.png differ diff --git a/tests/game-controller-test/Resources/ipad/dPad.png b/tests/game-controller-test/Resources/ipad/dPad.png index eb6a5b84a752..79963b856590 100644 Binary files a/tests/game-controller-test/Resources/ipad/dPad.png and b/tests/game-controller-test/Resources/ipad/dPad.png differ diff --git a/tests/game-controller-test/Resources/ipad/dpad-key.png b/tests/game-controller-test/Resources/ipad/dpad-key.png index 1ce511431042..9000a25eedda 100644 Binary files a/tests/game-controller-test/Resources/ipad/dpad-key.png and b/tests/game-controller-test/Resources/ipad/dpad-key.png differ diff --git a/tests/game-controller-test/Resources/ipad/joystick.png b/tests/game-controller-test/Resources/ipad/joystick.png index d9edf57c4425..801f68c2547c 100644 Binary files a/tests/game-controller-test/Resources/ipad/joystick.png and b/tests/game-controller-test/Resources/ipad/joystick.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/A.png b/tests/game-controller-test/Resources/ipadhd/A.png index 2704d750dd64..d5fb7b2928de 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/A.png and b/tests/game-controller-test/Resources/ipadhd/A.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/B.png b/tests/game-controller-test/Resources/ipadhd/B.png index 303af3a48985..ccb1bf07bacd 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/B.png and b/tests/game-controller-test/Resources/ipadhd/B.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/CloseNormal.png b/tests/game-controller-test/Resources/ipadhd/CloseNormal.png index caf94654b3c1..c0cac812713e 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/CloseNormal.png and b/tests/game-controller-test/Resources/ipadhd/CloseNormal.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/CloseSelected.png b/tests/game-controller-test/Resources/ipadhd/CloseSelected.png index b024f2704cf1..8df43e29a476 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/CloseSelected.png and b/tests/game-controller-test/Resources/ipadhd/CloseSelected.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/L1.png b/tests/game-controller-test/Resources/ipadhd/L1.png index 9fb7a51626f2..1280cf85d0b7 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/L1.png and b/tests/game-controller-test/Resources/ipadhd/L1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/L2.png b/tests/game-controller-test/Resources/ipadhd/L2.png index b4d100746ab5..85d52f2c8ba1 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/L2.png and b/tests/game-controller-test/Resources/ipadhd/L2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/R1.png b/tests/game-controller-test/Resources/ipadhd/R1.png index 41f7e919182c..59e71ccb644f 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/R1.png and b/tests/game-controller-test/Resources/ipadhd/R1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/R2.png b/tests/game-controller-test/Resources/ipadhd/R2.png index 8463938c00b8..6d5d31ad7fd0 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/R2.png and b/tests/game-controller-test/Resources/ipadhd/R2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/X.png b/tests/game-controller-test/Resources/ipadhd/X.png index e34347786994..b78718c237c5 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/X.png and b/tests/game-controller-test/Resources/ipadhd/X.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/Y.png b/tests/game-controller-test/Resources/ipadhd/Y.png index 08eec68c1df2..34e6d6db46a2 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/Y.png and b/tests/game-controller-test/Resources/ipadhd/Y.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/controller-1.png b/tests/game-controller-test/Resources/ipadhd/controller-1.png index 0162f2ec8500..f005ea25a864 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/controller-1.png and b/tests/game-controller-test/Resources/ipadhd/controller-1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/controller-2.png b/tests/game-controller-test/Resources/ipadhd/controller-2.png index 4197024bfc10..2926750b3c8d 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/controller-2.png and b/tests/game-controller-test/Resources/ipadhd/controller-2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/dPad.png b/tests/game-controller-test/Resources/ipadhd/dPad.png index bc119978a5c6..26860c3714f8 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/dPad.png and b/tests/game-controller-test/Resources/ipadhd/dPad.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/joystick.png b/tests/game-controller-test/Resources/ipadhd/joystick.png index 94bacde78012..4baec700eeb8 100644 Binary files a/tests/game-controller-test/Resources/ipadhd/joystick.png and b/tests/game-controller-test/Resources/ipadhd/joystick.png differ diff --git a/tests/game-controller-test/Resources/iphone/CloseNormal.png b/tests/game-controller-test/Resources/iphone/CloseNormal.png index e52c5fbb9ef7..8ff9369dc96a 100644 Binary files a/tests/game-controller-test/Resources/iphone/CloseNormal.png and b/tests/game-controller-test/Resources/iphone/CloseNormal.png differ diff --git a/tests/game-controller-test/Resources/iphone/CloseSelected.png b/tests/game-controller-test/Resources/iphone/CloseSelected.png index c0eb2975b17e..f75c4179a57c 100644 Binary files a/tests/game-controller-test/Resources/iphone/CloseSelected.png and b/tests/game-controller-test/Resources/iphone/CloseSelected.png differ diff --git a/tests/game-controller-test/proj.android/app/AndroidManifest.xml b/tests/game-controller-test/proj.android/app/AndroidManifest.xml index c4cc598c0fe3..d0d3b954f7af 100644 --- a/tests/game-controller-test/proj.android/app/AndroidManifest.xml +++ b/tests/game-controller-test/proj.android/app/AndroidManifest.xml @@ -13,6 +13,7 @@ diff --git a/tests/game-controller-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/game-controller-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png index e0731c0ddf96..45ee51d15f96 100644 Binary files a/tests/game-controller-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/game-controller-test/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/game-controller-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png index ef83f645df0b..0dd2a608998e 100644 Binary files a/tests/game-controller-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/game-controller-test/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/game-controller-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index a4c703535fd2..a32f16f930b3 100644 Binary files a/tests/game-controller-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/game-controller-test/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/game-controller-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 0869e705e85c..332f268edc46 100644 Binary files a/tests/game-controller-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/game-controller-test/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/game-controller-test/proj.android/settings.gradle b/tests/game-controller-test/proj.android/settings.gradle index f8b8e3329d1d..5b83b6c5f177 100644 --- a/tests/game-controller-test/proj.android/settings.gradle +++ b/tests/game-controller-test/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx_with_controller' project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx-with-controller') include ':GameControllerTest' project(':GameControllerTest').projectDir = new File(settingsDir, 'app') +rootProject.name = "game-controller-test" diff --git a/tests/game-controller-test/proj.ios/Default-568h@2x.png b/tests/game-controller-test/proj.ios/Default-568h@2x.png index 1e58dc1fc033..66c6d1cead37 100644 Binary files a/tests/game-controller-test/proj.ios/Default-568h@2x.png and b/tests/game-controller-test/proj.ios/Default-568h@2x.png differ diff --git a/tests/game-controller-test/proj.ios/Default-667h@2x.png b/tests/game-controller-test/proj.ios/Default-667h@2x.png index c9d3b3d4266d..a0f61ec8e639 100644 Binary files a/tests/game-controller-test/proj.ios/Default-667h@2x.png and b/tests/game-controller-test/proj.ios/Default-667h@2x.png differ diff --git a/tests/game-controller-test/proj.ios/Default-736h@3x.png b/tests/game-controller-test/proj.ios/Default-736h@3x.png index b2d16d9568c9..dadccee68624 100644 Binary files a/tests/game-controller-test/proj.ios/Default-736h@3x.png and b/tests/game-controller-test/proj.ios/Default-736h@3x.png differ diff --git a/tests/game-controller-test/proj.ios/Default.png b/tests/game-controller-test/proj.ios/Default.png index 3ff42990fe3a..dcb80725de2a 100644 Binary files a/tests/game-controller-test/proj.ios/Default.png and b/tests/game-controller-test/proj.ios/Default.png differ diff --git a/tests/game-controller-test/proj.ios/Default@2x.png b/tests/game-controller-test/proj.ios/Default@2x.png index 9fcc4115eb79..84689888a14a 100644 Binary files a/tests/game-controller-test/proj.ios/Default@2x.png and b/tests/game-controller-test/proj.ios/Default@2x.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-100.png b/tests/game-controller-test/proj.ios/Icon-100.png index 0791e8db2b23..ef38d4500a80 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-100.png and b/tests/game-controller-test/proj.ios/Icon-100.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-114.png b/tests/game-controller-test/proj.ios/Icon-114.png index 9d822dd646c1..c3807861ad29 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-114.png and b/tests/game-controller-test/proj.ios/Icon-114.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-120.png b/tests/game-controller-test/proj.ios/Icon-120.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-120.png and b/tests/game-controller-test/proj.ios/Icon-120.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-144.png b/tests/game-controller-test/proj.ios/Icon-144.png index c613bec2dcd1..1526615c02d1 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-144.png and b/tests/game-controller-test/proj.ios/Icon-144.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-152.png b/tests/game-controller-test/proj.ios/Icon-152.png index 978f1ba7dc2c..8aa82506d0d1 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-152.png and b/tests/game-controller-test/proj.ios/Icon-152.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-40.png b/tests/game-controller-test/proj.ios/Icon-40.png index 453036453045..775685daca94 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-40.png and b/tests/game-controller-test/proj.ios/Icon-40.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-57.png b/tests/game-controller-test/proj.ios/Icon-57.png index 2c5b1a8d067e..4fcc6fddffe1 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-57.png and b/tests/game-controller-test/proj.ios/Icon-57.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-58.png b/tests/game-controller-test/proj.ios/Icon-58.png index 0d72b8acc88a..f0f8b7fe9833 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-58.png and b/tests/game-controller-test/proj.ios/Icon-58.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-72.png b/tests/game-controller-test/proj.ios/Icon-72.png index 9f28d1f72ebf..2c573c8df4c3 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-72.png and b/tests/game-controller-test/proj.ios/Icon-72.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-76.png b/tests/game-controller-test/proj.ios/Icon-76.png index 9c5fc86d91bd..8a1fa1850c03 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-76.png and b/tests/game-controller-test/proj.ios/Icon-76.png differ diff --git a/tests/game-controller-test/proj.ios/Icon-80.png b/tests/game-controller-test/proj.ios/Icon-80.png index 99c0ebce2c3d..d9c7ab446bb7 100644 Binary files a/tests/game-controller-test/proj.ios/Icon-80.png and b/tests/game-controller-test/proj.ios/Icon-80.png differ diff --git a/tests/game-controller-test/proj.win32/game-controller-test.vcxproj b/tests/game-controller-test/proj.win32/game-controller-test.vcxproj index 3ea8c11aad50..1d0d348cb095 100644 --- a/tests/game-controller-test/proj.win32/game-controller-test.vcxproj +++ b/tests/game-controller-test/proj.win32/game-controller-test.vcxproj @@ -14,6 +14,7 @@ {1FA2BD06-2F52-48F6-8468-C0CC33127F5E} test_win32 Win32Proj + 10.0.17134.0 @@ -103,7 +104,7 @@ - xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y @@ -144,7 +145,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y diff --git a/tests/js-tests/project/CMakeLists.txt b/tests/js-tests/project/CMakeLists.txt index be5ed780b492..05eb44a9c105 100644 --- a/tests/js-tests/project/CMakeLists.txt +++ b/tests/js-tests/project/CMakeLists.txt @@ -32,10 +32,8 @@ if(NOT DEFINED BUILD_ENGINE_DONE) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) - if(NOT USE_COCOS_PREBUILT) - set(BUILD_JS_LIBS ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - endif() + set(BUILD_JS_LIBS ON) + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() set(res_main_files @@ -158,15 +156,18 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR} FILES ${res_main_files}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/script FOLDERS ${res_script_folders}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FILES ${res_main_files}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/script FOLDERS ${res_script_folders}) endif() diff --git a/tests/js-tests/project/Classes/AppDelegate.cpp b/tests/js-tests/project/Classes/AppDelegate.cpp index 6f116f2915d4..1b01eab1b6e4 100644 --- a/tests/js-tests/project/Classes/AppDelegate.cpp +++ b/tests/js-tests/project/Classes/AppDelegate.cpp @@ -88,7 +88,6 @@ AppDelegate::AppDelegate() AppDelegate::~AppDelegate() { - ScriptEngineManager::destroyInstance(); } void AppDelegate::initGLContextAttrs() diff --git a/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp b/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp index 2a299f11d518..3388cdf24b78 100644 --- a/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp +++ b/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp @@ -132,7 +132,7 @@ DrawNode3D::~DrawNode3D() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } } @@ -174,7 +174,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } glGenBuffers(1, &_vbo); @@ -191,7 +191,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } CHECK_GL_ERROR_DEBUG(); @@ -224,7 +224,7 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) glProgram->use(); glProgram->setUniformsForBuiltins(transform); glEnable(GL_DEPTH_TEST); - glBlendFunc(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirty) { @@ -234,12 +234,11 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex @@ -562,4 +561,4 @@ void register_DrawNode3D_bindings(JSContext *cx, JS::HandleObject global) JS::RootedObject ccobj(cx); get_or_create_js_obj(cx, global, "cc", &ccobj); js_register_cocos2dx_DrawNode3D(cx, ccobj); -} +} \ No newline at end of file diff --git a/tests/js-tests/project/proj.android/app/AndroidManifest.xml b/tests/js-tests/project/proj.android/app/AndroidManifest.xml index 2e52099d32e7..6be2691cf131 100644 --- a/tests/js-tests/project/proj.android/app/AndroidManifest.xml +++ b/tests/js-tests/project/proj.android/app/AndroidManifest.xml @@ -14,6 +14,7 @@ diff --git a/tests/js-tests/project/proj.android/app/build.gradle b/tests/js-tests/project/proj.android/app/build.gradle index 5265372f9277..ae341fe5a4d4 100644 --- a/tests/js-tests/project/proj.android/app/build.gradle +++ b/tests/js-tests/project/proj.android/app/build.gradle @@ -34,9 +34,8 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { targets "js_tests" - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_JS_LIBS=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/tests/js-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/js-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png index b0d2b4ac10d3..45ee51d15f96 100644 Binary files a/tests/js-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/js-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/js-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png index b80addadac9f..0dd2a608998e 100644 Binary files a/tests/js-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/js-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/js-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index 57235c0b712b..a32f16f930b3 100644 Binary files a/tests/js-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/js-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/js-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 15e20bb99277..332f268edc46 100644 Binary files a/tests/js-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/js-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/js-tests/project/proj.android/settings.gradle b/tests/js-tests/project/proj.android/settings.gradle index 05e6a4191f3e..2fde8c99cf41 100644 --- a/tests/js-tests/project/proj.android/settings.gradle +++ b/tests/js-tests/project/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') include ':JSTests' project(':JSTests').projectDir = new File(settingsDir, 'app') +rootProject.name = "js-tests" \ No newline at end of file diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20.png index 9ac82f2c131d..8ead23e36507 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@2x.png index 453036453045..775685daca94 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@3x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@3x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@3x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-20@3x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29.png index b34735dd028f..0500184c869c 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@2x.png index 0d72b8acc88a..f0f8b7fe9833 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@3x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@3x.png index 42e8664e038e..5287e50a7986 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@3x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-29@3x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40.png index 453036453045..775685daca94 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@2x.png index 99c0ebce2c3d..d9c7ab446bb7 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@3x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@3x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@3x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-40@3x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50.png index 04a74a69d850..ac381bc20e85 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50@2x.png index 0791e8db2b23..ef38d4500a80 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-50@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57.png index 2c5b1a8d067e..4fcc6fddffe1 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57@2x.png index 9d822dd646c1..c3807861ad29 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-57@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@2x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@3x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@3x.png index 88a5c70568a1..d4bc53132ce3 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@3x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-60@3x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72.png index 9f28d1f72ebf..2c573c8df4c3 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72@2x.png index c613bec2dcd1..1526615c02d1 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-72@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76.png index 9c5fc86d91bd..8a1fa1850c03 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76@2x.png index 978f1ba7dc2c..8aa82506d0d1 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-76@2x.png differ diff --git a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-83.5@2x.png b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-83.5@2x.png index 599979fa572f..6bf801d17507 100644 Binary files a/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-83.5@2x.png and b/tests/js-tests/project/proj.ios/Images.xcassets/AppIcon-js-tests.appiconset/Icon-83.5@2x.png differ diff --git a/tests/js-tests/project/proj.ios/LaunchScreenBackground.png b/tests/js-tests/project/proj.ios/LaunchScreenBackground.png index 48d2b63b0116..dadccee68624 100644 Binary files a/tests/js-tests/project/proj.ios/LaunchScreenBackground.png and b/tests/js-tests/project/proj.ios/LaunchScreenBackground.png differ diff --git a/tests/js-tests/project/proj.win32/js-tests.vcxproj b/tests/js-tests/project/proj.win32/js-tests.vcxproj index 37c376cb8c90..fae67edd8b48 100644 --- a/tests/js-tests/project/proj.win32/js-tests.vcxproj +++ b/tests/js-tests/project/proj.win32/js-tests.vcxproj @@ -13,6 +13,7 @@ {D0F06A44-A245-4D13-A498-0120C203B539} js-tests + 10.0.17134.0 @@ -102,11 +103,6 @@ 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)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" - mozjs-33.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) @@ -114,23 +110,23 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ Windows MachineX86 - + if not exist "$(OutDir)" mkdir "$(OutDir)" -mkdir "$(OutDir)\script" -mkdir "$(OutDir)\src" -mkdir "$(OutDir)\res" +mkdir "$(OutDir)\Resources\script" +mkdir "$(OutDir)\Resources\src" +mkdir "$(OutDir)\Resources\res" xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\js-bindings\script\*" "$(OutDir)\script" /e /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)\src\" /e /Y -xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(OutDir)\res\" /e /Y -copy "$(ProjectDir)..\..\main.js" "$(OutDir)" -copy "$(ProjectDir)..\..\project.json" "$(OutDir)" -xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\res\resjs\" /e /Y - - +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\js-bindings\script\*" "$(OutDir)\Resources\script\" /e /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)\Resources\src\" /e /Y +xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(OutDir)\Resources\res\" /e /Y +copy "$(ProjectDir)..\..\main.js" "$(OutDir)\Resources\" +copy "$(ProjectDir)..\..\project.json" "$(OutDir)\Resources\" +xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\Resources\res\resjs\" /e /Y + + Copy js and resource files. - + @@ -164,11 +160,6 @@ xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\res\resjs\" /e /Y 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)" -xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$(OutDir)" - mozjs-33.lib;ws2_32.lib;sqlite3.lib;%(AdditionalDependencies) $(OutDir);$(SolutionDir)$(Configuration).win32;%(AdditionalLibraryDirectories) @@ -176,21 +167,24 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$ MachineX86 true - + if not exist "$(OutDir)" mkdir "$(OutDir)" -mkdir "$(OutDir)\script" -mkdir "$(OutDir)\src" -mkdir "$(OutDir)\res" +mkdir "$(OutDir)\Resources\script" +mkdir "$(OutDir)\Resources\src" +mkdir "$(OutDir)\Resources\res" xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\js-bindings\script\*" "$(OutDir)\script" /e /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)\src\" /e /Y -xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(OutDir)\res\" /e /Y -copy "$(ProjectDir)..\..\main.js" "$(OutDir)" -copy "$(ProjectDir)..\..\project.json" "$(OutDir)" -xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\res\" /e /Y +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\js-bindings\script\*" "$(OutDir)\Resources\script" /e /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)\Resources\src\" /e /Y +xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(OutDir)\Resources\res\" /e /Y +copy "$(ProjectDir)..\..\main.js" "$(OutDir)\Resources\" +copy "$(ProjectDir)..\..\project.json" "$(OutDir)\Resources\" +xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\Resources\res\" /e /Y + Copy js and resource files. + + Copy js and resource files. - + diff --git a/tests/js-tests/resjs/ccb/animated-grossini.png b/tests/js-tests/resjs/ccb/animated-grossini.png index 663d02187850..89736acdaba8 100644 Binary files a/tests/js-tests/resjs/ccb/animated-grossini.png and b/tests/js-tests/resjs/ccb/animated-grossini.png differ diff --git a/tests/js-tests/resjs/ccb/btn-a-0.png b/tests/js-tests/resjs/ccb/btn-a-0.png index 3444aa9ffb82..66a5d3df7185 100644 Binary files a/tests/js-tests/resjs/ccb/btn-a-0.png and b/tests/js-tests/resjs/ccb/btn-a-0.png differ diff --git a/tests/js-tests/resjs/ccb/btn-a-1.png b/tests/js-tests/resjs/ccb/btn-a-1.png index 4b6658f1639d..33f8a0c3f041 100644 Binary files a/tests/js-tests/resjs/ccb/btn-a-1.png and b/tests/js-tests/resjs/ccb/btn-a-1.png differ diff --git a/tests/js-tests/resjs/ccb/btn-a-2.png b/tests/js-tests/resjs/ccb/btn-a-2.png index 616a56d7b07e..c8532b3e23ae 100644 Binary files a/tests/js-tests/resjs/ccb/btn-a-2.png and b/tests/js-tests/resjs/ccb/btn-a-2.png differ diff --git a/tests/js-tests/resjs/ccb/btn-b-0.png b/tests/js-tests/resjs/ccb/btn-b-0.png index ba5c73fa83da..abd7d9a00b03 100644 Binary files a/tests/js-tests/resjs/ccb/btn-b-0.png and b/tests/js-tests/resjs/ccb/btn-b-0.png differ diff --git a/tests/js-tests/resjs/ccb/btn-b-1.png b/tests/js-tests/resjs/ccb/btn-b-1.png index 5551f49721f3..b55f91e77c04 100644 Binary files a/tests/js-tests/resjs/ccb/btn-b-1.png and b/tests/js-tests/resjs/ccb/btn-b-1.png differ diff --git a/tests/js-tests/resjs/ccb/btn-b-2.png b/tests/js-tests/resjs/ccb/btn-b-2.png index 61023e9af3fe..d47c7b6283e6 100644 Binary files a/tests/js-tests/resjs/ccb/btn-b-2.png and b/tests/js-tests/resjs/ccb/btn-b-2.png differ diff --git a/tests/js-tests/resjs/ccb/btn-back-0.png b/tests/js-tests/resjs/ccb/btn-back-0.png index 4d0a671d76af..9caae52746ff 100644 Binary files a/tests/js-tests/resjs/ccb/btn-back-0.png and b/tests/js-tests/resjs/ccb/btn-back-0.png differ diff --git a/tests/js-tests/resjs/ccb/btn-back-1.png b/tests/js-tests/resjs/ccb/btn-back-1.png index 577fa5f84a6d..6c7cf5f97a9e 100644 Binary files a/tests/js-tests/resjs/ccb/btn-back-1.png and b/tests/js-tests/resjs/ccb/btn-back-1.png differ diff --git a/tests/js-tests/resjs/ccb/btn-test-0.png b/tests/js-tests/resjs/ccb/btn-test-0.png index 7ded821ace96..2777fd1d5ecc 100644 Binary files a/tests/js-tests/resjs/ccb/btn-test-0.png and b/tests/js-tests/resjs/ccb/btn-test-0.png differ diff --git a/tests/js-tests/resjs/ccb/btn-test-1.png b/tests/js-tests/resjs/ccb/btn-test-1.png index 34a09c1e5b06..b3be2a861637 100644 Binary files a/tests/js-tests/resjs/ccb/btn-test-1.png and b/tests/js-tests/resjs/ccb/btn-test-1.png differ diff --git a/tests/js-tests/resjs/ccb/btn-test-2.png b/tests/js-tests/resjs/ccb/btn-test-2.png index 744824b1f09a..eab72947de72 100644 Binary files a/tests/js-tests/resjs/ccb/btn-test-2.png and b/tests/js-tests/resjs/ccb/btn-test-2.png differ diff --git a/tests/js-tests/resjs/ccb/burst.png b/tests/js-tests/resjs/ccb/burst.png index 3ede762054e2..8681474538f4 100644 Binary files a/tests/js-tests/resjs/ccb/burst.png and b/tests/js-tests/resjs/ccb/burst.png differ diff --git a/tests/js-tests/resjs/ccb/ccbParticleStars.png b/tests/js-tests/resjs/ccb/ccbParticleStars.png index 2ff41c7dd47f..f493dcc33470 100644 Binary files a/tests/js-tests/resjs/ccb/ccbParticleStars.png and b/tests/js-tests/resjs/ccb/ccbParticleStars.png differ diff --git a/tests/js-tests/resjs/ccb/grossini-generic.png b/tests/js-tests/resjs/ccb/grossini-generic.png index 16e741ff75ed..5c0bbc67c854 100644 Binary files a/tests/js-tests/resjs/ccb/grossini-generic.png and b/tests/js-tests/resjs/ccb/grossini-generic.png differ diff --git a/tests/js-tests/resjs/ccb/jungle-left.png b/tests/js-tests/resjs/ccb/jungle-left.png index 0a79a65786fc..79bbf2033432 100644 Binary files a/tests/js-tests/resjs/ccb/jungle-left.png and b/tests/js-tests/resjs/ccb/jungle-left.png differ diff --git a/tests/js-tests/resjs/ccb/jungle-right.png b/tests/js-tests/resjs/ccb/jungle-right.png index 2ac67b963795..8da61b9f5861 100644 Binary files a/tests/js-tests/resjs/ccb/jungle-right.png and b/tests/js-tests/resjs/ccb/jungle-right.png differ diff --git a/tests/js-tests/resjs/ccb/jungle.png b/tests/js-tests/resjs/ccb/jungle.png index 8532046b55a4..b3ddd92d2b09 100644 Binary files a/tests/js-tests/resjs/ccb/jungle.png and b/tests/js-tests/resjs/ccb/jungle.png differ diff --git a/tests/js-tests/resjs/ccb/logo-icon.png b/tests/js-tests/resjs/ccb/logo-icon.png index dbb9301e552b..c668736dc74d 100644 Binary files a/tests/js-tests/resjs/ccb/logo-icon.png and b/tests/js-tests/resjs/ccb/logo-icon.png differ diff --git a/tests/js-tests/resjs/ccb/logo.png b/tests/js-tests/resjs/ccb/logo.png index 64b68a253274..a4cd20c20e8f 100644 Binary files a/tests/js-tests/resjs/ccb/logo.png and b/tests/js-tests/resjs/ccb/logo.png differ diff --git a/tests/js-tests/resjs/ccb/markerfelt24shadow.png b/tests/js-tests/resjs/ccb/markerfelt24shadow.png index 3f164677b8ce..5bab02849644 100644 Binary files a/tests/js-tests/resjs/ccb/markerfelt24shadow.png and b/tests/js-tests/resjs/ccb/markerfelt24shadow.png differ diff --git a/tests/js-tests/resjs/ccb/particle-fire.png b/tests/js-tests/resjs/ccb/particle-fire.png index 76fff66a4d51..81c6d2410bb2 100644 Binary files a/tests/js-tests/resjs/ccb/particle-fire.png and b/tests/js-tests/resjs/ccb/particle-fire.png differ diff --git a/tests/js-tests/resjs/ccb/particle-smoke.png b/tests/js-tests/resjs/ccb/particle-smoke.png index 2f508149eca6..a289b1371e29 100644 Binary files a/tests/js-tests/resjs/ccb/particle-smoke.png and b/tests/js-tests/resjs/ccb/particle-smoke.png differ diff --git a/tests/js-tests/resjs/ccb/particle-snow.png b/tests/js-tests/resjs/ccb/particle-snow.png index 43b8e39ac74f..9e12963498d7 100644 Binary files a/tests/js-tests/resjs/ccb/particle-snow.png and b/tests/js-tests/resjs/ccb/particle-snow.png differ diff --git a/tests/js-tests/resjs/ccb/particle-stars.png b/tests/js-tests/resjs/ccb/particle-stars.png index 2ff41c7dd47f..f493dcc33470 100644 Binary files a/tests/js-tests/resjs/ccb/particle-stars.png and b/tests/js-tests/resjs/ccb/particle-stars.png differ diff --git a/tests/js-tests/resjs/ccb/scale-9-demo.png b/tests/js-tests/resjs/ccb/scale-9-demo.png index 0b391c333aa1..ee4537207f1b 100644 Binary files a/tests/js-tests/resjs/ccb/scale-9-demo.png and b/tests/js-tests/resjs/ccb/scale-9-demo.png differ diff --git a/tests/js-tests/src/ChipmunkTest/ChipmunkTest.js b/tests/js-tests/src/ChipmunkTest/ChipmunkTest.js index 8a9690a00192..b121cc5d4dad 100644 --- a/tests/js-tests/src/ChipmunkTest/ChipmunkTest.js +++ b/tests/js-tests/src/ChipmunkTest/ChipmunkTest.js @@ -840,7 +840,7 @@ var ChipmunkReleaseTest = ChipmunkBaseLayer.extend({ cc.log("OnExit"); // not calling this on purpose - // this.space.removeCollisionHandler( 10, 11 ); + this.space.removeCollisionHandler( 10, 11 ); this.space = null; // cc.base(this, 'onExit'); diff --git a/tests/js-tests/src/ExtensionsTest/NetworkTest/WebSocketTest.js b/tests/js-tests/src/ExtensionsTest/NetworkTest/WebSocketTest.js index 9d048eed7622..b54124c57c59 100644 --- a/tests/js-tests/src/ExtensionsTest/NetworkTest/WebSocketTest.js +++ b/tests/js-tests/src/ExtensionsTest/NetworkTest/WebSocketTest.js @@ -108,7 +108,7 @@ var WebSocketTestLayer = cc.Layer.extend({ var self = this; - this._wsiSendText = new WebSocket("wss://echo.websocket.org"); + this._wsiSendText = new WebSocket("wss://echo.websocket.org", "", "cacert.pem"); this._wsiSendText.onopen = function(evt) { self._sendTextStatus.setString("Opened, url: " + self._wsiSendText.url + ", protocol: " + self._wsiSendText.protocol); }; diff --git a/tests/js-tests/src/IntervalTest/IntervalTest.js b/tests/js-tests/src/IntervalTest/IntervalTest.js index 5c8293ae3b98..35009a30daef 100644 --- a/tests/js-tests/src/IntervalTest/IntervalTest.js +++ b/tests/js-tests/src/IntervalTest/IntervalTest.js @@ -57,12 +57,12 @@ var IntervalLayer = cc.LayerGradient.extend({ sun.setLife(0.6); this.addChild(sun); - // timers - this.label0 = new cc.LabelTTF("0", "Arial", 24); - this.label1 = new cc.LabelTTF("0", "Arial", 24); - this.label2 = new cc.LabelTTF("0", "Arial", 24); - this.label3 = new cc.LabelTTF("0", "Arial", 24); - this.label4 = new cc.LabelTTF("0", "Arial", 24); + // timers, font "fonts/bitmapFontTest4.fnt" + this.label0 = cc.Label.createWithBMFont("fonts/bitmapFontTest4.fnt", 24); + this.label1 = cc.Label.createWithBMFont("fonts/bitmapFontTest4.fnt", 24); + this.label2 = cc.Label.createWithBMFont("fonts/bitmapFontTest4.fnt", 24); + this.label3 = cc.Label.createWithBMFont("fonts/bitmapFontTest4.fnt", 24); + this.label4 = cc.Label.createWithBMFont("fonts/bitmapFontTest4.fnt", 24); this.scheduleUpdate(); this.schedule(this.step1); diff --git a/tests/js-tests/src/tests-main.js b/tests/js-tests/src/tests-main.js index a212b1b504fb..04d93aa8f93d 100644 --- a/tests/js-tests/src/tests-main.js +++ b/tests/js-tests/src/tests-main.js @@ -45,6 +45,7 @@ var autoTestEnabled = autoTestEnabled || false; var autoTestCurrentTestName = autoTestCurrentTestName || "N/A"; var TestScene = cc.Scene.extend({ + _mainMenu :null, ctor:function (bPortrait) { this._super(); this.init(); @@ -53,6 +54,7 @@ var TestScene = cc.Scene.extend({ var menuItem = new cc.MenuItemLabel(label, this.onMainMenuCallback, this); var menu = new cc.Menu(menuItem); + this._mainMenu = menu; menu.x = 0; menu.y = 0; menuItem.x = winSize.width - 50; @@ -66,6 +68,7 @@ var TestScene = cc.Scene.extend({ if (director.isPaused()) { director.resume(); } + this._mainMenu.enabled = false; var scene = new cc.Scene(); var layer = new TestController(); scene.addChild(layer); @@ -131,7 +134,7 @@ var TestController = cc.LayerGradient.extend({ this._itemMenu = new cc.Menu();//item menu is where all the label goes, and the one gets scrolled for (var i = 0, len = testNames.length; i < len; i++) { - var label = new cc.LabelTTF(testNames[i].title, "Arial", 24); + var label = new cc.LabelTTF((i + 1) +". "+ testNames[i].title, "Arial", 24); var menuItem = new cc.MenuItemLabel(label, this.onMenuCallback, this); this._itemMenu.addChild(menuItem, i + 10000); menuItem.x = winSize.width / 2; diff --git a/tests/lua-empty-test/project/CMakeLists.txt b/tests/lua-empty-test/project/CMakeLists.txt index cf85a2038f69..d499caddf516 100644 --- a/tests/lua-empty-test/project/CMakeLists.txt +++ b/tests/lua-empty-test/project/CMakeLists.txt @@ -9,10 +9,8 @@ if(NOT DEFINED BUILD_ENGINE_DONE) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) - if(NOT USE_COCOS_PREBUILT) - set(BUILD_LUA_LIBS ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - endif() + set(BUILD_LUA_LIBS ON) + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() set(res_res_folders @@ -47,7 +45,6 @@ if(ANDROID) elseif(LINUX) list(APPEND GAME_SOURCE proj.linux/main.cpp) elseif(WINDOWS) - add_definitions(-D_USRLUASTATIC) list(APPEND GAME_HEADER proj.win32/main.h) list(APPEND GAME_SOURCE proj.win32/main.cpp ${cc_common_res}) elseif(APPLE) @@ -110,13 +107,16 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) endif() \ No newline at end of file diff --git a/tests/lua-empty-test/project/Classes/AppDelegate.cpp b/tests/lua-empty-test/project/Classes/AppDelegate.cpp index 49736e07c706..a4f14317141a 100644 --- a/tests/lua-empty-test/project/Classes/AppDelegate.cpp +++ b/tests/lua-empty-test/project/Classes/AppDelegate.cpp @@ -42,7 +42,6 @@ AppDelegate::~AppDelegate() { // end simple audio engine here, or it may crashed on win32 SimpleAudioEngine::getInstance()->end(); - //CCScriptEngineManager::destroyInstance(); } void AppDelegate::initGLContextAttrs() diff --git a/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml b/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml index dd64c3d7bf77..843c7b4124ea 100644 --- a/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml +++ b/tests/lua-empty-test/project/proj.android/app/AndroidManifest.xml @@ -7,6 +7,7 @@ diff --git a/tests/lua-empty-test/project/proj.android/app/build.gradle b/tests/lua-empty-test/project/proj.android/app/build.gradle index 069731ccfdfc..0c04b6c252ff 100644 --- a/tests/lua-empty-test/project/proj.android/app/build.gradle +++ b/tests/lua-empty-test/project/proj.android/app/build.gradle @@ -34,9 +34,8 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { targets "lua_empty_test" - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png index b0d2b4ac10d3..45ee51d15f96 100644 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/lua-empty-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png index b80addadac9f..0dd2a608998e 100644 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/lua-empty-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index 57235c0b712b..a32f16f930b3 100644 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 15e20bb99277..332f268edc46 100644 Binary files a/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/lua-empty-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-empty-test/project/proj.android/settings.gradle b/tests/lua-empty-test/project/proj.android/settings.gradle index 11316ebf9c4c..e45551612e07 100644 --- a/tests/lua-empty-test/project/proj.android/settings.gradle +++ b/tests/lua-empty-test/project/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') include ':LuaEmptyTest' project(':LuaEmptyTest').projectDir = new File(settingsDir, 'app') +rootProject.name = "lua-empty-test" \ No newline at end of file diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png index 9ac82f2c131d..8ead23e36507 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png index 453036453045..775685daca94 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-20@3x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png index b34735dd028f..0500184c869c 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png index 0d72b8acc88a..f0f8b7fe9833 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png index 42e8664e038e..5287e50a7986 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-29@3x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png index 453036453045..775685daca94 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png index 99c0ebce2c3d..d9c7ab446bb7 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-40@3x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png index 04a74a69d850..ac381bc20e85 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png index 0791e8db2b23..ef38d4500a80 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-50@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png index 2c5b1a8d067e..4fcc6fddffe1 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png index 9d822dd646c1..c3807861ad29 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-57@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png index a4cde8ab3ac6..a5b49ccbb199 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png index 88a5c70568a1..d4bc53132ce3 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-60@3x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png index 9f28d1f72ebf..2c573c8df4c3 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png index c613bec2dcd1..1526615c02d1 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-72@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png index 9c5fc86d91bd..8a1fa1850c03 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png index 978f1ba7dc2c..8aa82506d0d1 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-76@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png index 599979fa572f..6bf801d17507 100644 Binary files a/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png and b/tests/lua-empty-test/project/proj.ios/Images.xcassets/AppIcon-lua-empty-test.appiconset/Icon-83.5@2x.png differ diff --git a/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png b/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png index 67d03b172d40..dadccee68624 100644 Binary files a/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png and b/tests/lua-empty-test/project/proj.ios/LaunchScreenBackground.png differ diff --git a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj index 639e7942389c..f3b58d34297e 100644 --- a/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj +++ b/tests/lua-empty-test/project/proj.win32/lua-empty-test.vcxproj @@ -13,6 +13,7 @@ {13E55395-94A2-4CD9-BFC2-1A051F80C17D} lua-empty-test.win32 + 10.0.17134.0 @@ -110,12 +111,12 @@ MachineX86 libcmt.lib;%(IgnoreSpecificDefaultLibraries) - - xcopy "$(ProjectDir)..\..\res" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)src" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)src\cocos" /D /E /I /F /Y + + xcopy "$(ProjectDir)..\..\res" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)Resources\src\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)Resources\src\cocos\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - + @@ -165,12 +166,12 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - - xcopy "$(ProjectDir)..\..\res" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)src" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)src\cocos" /D /E /I /F /Y + + xcopy "$(ProjectDir)..\..\res" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)Resources\src\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)Resources\src\cocos" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - + diff --git a/tests/lua-empty-test/res/crop.png b/tests/lua-empty-test/res/crop.png index 3c3895f0596b..9ea84bc93fd6 100644 Binary files a/tests/lua-empty-test/res/crop.png and b/tests/lua-empty-test/res/crop.png differ diff --git a/tests/lua-empty-test/res/dog.png b/tests/lua-empty-test/res/dog.png index 9bd6b802e19a..76bdca07a123 100644 Binary files a/tests/lua-empty-test/res/dog.png and b/tests/lua-empty-test/res/dog.png differ diff --git a/tests/lua-empty-test/res/land.png b/tests/lua-empty-test/res/land.png index 3bc0bfa576ca..6e0785b545d7 100644 Binary files a/tests/lua-empty-test/res/land.png and b/tests/lua-empty-test/res/land.png differ diff --git a/tests/lua-empty-test/res/menu1.png b/tests/lua-empty-test/res/menu1.png index cc2600163ac2..eeb327a4cbcd 100644 Binary files a/tests/lua-empty-test/res/menu1.png and b/tests/lua-empty-test/res/menu1.png differ diff --git a/tests/lua-empty-test/res/menu2.png b/tests/lua-empty-test/res/menu2.png index 111415f531c3..04763ea1a443 100644 Binary files a/tests/lua-empty-test/res/menu2.png and b/tests/lua-empty-test/res/menu2.png differ diff --git a/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp b/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp index 740352dde5fd..eca67be144ac 100644 --- a/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp +++ b/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp @@ -43,7 +43,6 @@ AppDelegate::~AppDelegate() { // end simple audio engine here, or it may crashed on win32 SimpleAudioEngine::getInstance()->end(); - //CCScriptEngineManager::destroyInstance(); } bool AppDelegate::applicationDidFinishLaunching() diff --git a/tests/lua-game-controller-test/project/proj.android/app/AndroidManifest.xml b/tests/lua-game-controller-test/project/proj.android/app/AndroidManifest.xml index 197f5e9a3f99..8ea21190c3e4 100644 --- a/tests/lua-game-controller-test/project/proj.android/app/AndroidManifest.xml +++ b/tests/lua-game-controller-test/project/proj.android/app/AndroidManifest.xml @@ -11,6 +11,7 @@ diff --git a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png index b7c70af06279..45ee51d15f96 100644 Binary files a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png index 205b38de0b80..0dd2a608998e 100644 Binary files a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index 848469586508..a32f16f930b3 100644 Binary files a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 1902955a2247..332f268edc46 100644 Binary files a/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/lua-game-controller-test/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/settings.gradle b/tests/lua-game-controller-test/project/proj.android/settings.gradle index 57e3fb033030..5f8033f66e93 100644 --- a/tests/lua-game-controller-test/project/proj.android/settings.gradle +++ b/tests/lua-game-controller-test/project/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx_with_controller' project(':libcocos2dx_with_controller').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx-with-controller') include ':LuaGameControllerTest' project(':LuaGameControllerTest').projectDir = new File(settingsDir, 'app') +rootProject.name = "lua-game-controller-test" diff --git a/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png b/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png index f23dc35d9781..66c6d1cead37 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png and b/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default-667h@2x.png b/tests/lua-game-controller-test/project/proj.ios/Default-667h@2x.png index c92192a92ec8..a0f61ec8e639 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Default-667h@2x.png and b/tests/lua-game-controller-test/project/proj.ios/Default-667h@2x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default-736h@3x.png b/tests/lua-game-controller-test/project/proj.ios/Default-736h@3x.png index e8bbddf1b925..dadccee68624 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Default-736h@3x.png and b/tests/lua-game-controller-test/project/proj.ios/Default-736h@3x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default.png b/tests/lua-game-controller-test/project/proj.ios/Default.png index 8ca8f3332574..dcb80725de2a 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Default.png and b/tests/lua-game-controller-test/project/proj.ios/Default.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default@2x.png b/tests/lua-game-controller-test/project/proj.ios/Default@2x.png index 7b854f39931e..84689888a14a 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Default@2x.png and b/tests/lua-game-controller-test/project/proj.ios/Default@2x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-114.png b/tests/lua-game-controller-test/project/proj.ios/Icon-114.png index 6ddb38c633e5..c3807861ad29 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-114.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-114.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-120.png b/tests/lua-game-controller-test/project/proj.ios/Icon-120.png index 6c50aba2414a..a5b49ccbb199 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-120.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-120.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-144.png b/tests/lua-game-controller-test/project/proj.ios/Icon-144.png index fe6e1662634d..1526615c02d1 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-144.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-144.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-152.png b/tests/lua-game-controller-test/project/proj.ios/Icon-152.png index e448eee9d57d..8aa82506d0d1 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-152.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-152.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-57.png b/tests/lua-game-controller-test/project/proj.ios/Icon-57.png index 5e355f7cb5c1..4fcc6fddffe1 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-57.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-57.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-72.png b/tests/lua-game-controller-test/project/proj.ios/Icon-72.png index 589f775f5ed2..2c573c8df4c3 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-72.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-72.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-76.png b/tests/lua-game-controller-test/project/proj.ios/Icon-76.png index 157eeba15884..8a1fa1850c03 100644 Binary files a/tests/lua-game-controller-test/project/proj.ios/Icon-76.png and b/tests/lua-game-controller-test/project/proj.ios/Icon-76.png differ diff --git a/tests/lua-tests/project/CMakeLists.txt b/tests/lua-tests/project/CMakeLists.txt index 3b7e72dc3f90..54b334d3d150 100644 --- a/tests/lua-tests/project/CMakeLists.txt +++ b/tests/lua-tests/project/CMakeLists.txt @@ -9,10 +9,8 @@ if(NOT DEFINED BUILD_ENGINE_DONE) set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/) include(CocosBuildSet) - if(NOT USE_COCOS_PREBUILT) - set(BUILD_LUA_LIBS ON) - add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) - endif() + set(BUILD_LUA_LIBS ON) + add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core) endif() set(GAME_HEADER @@ -50,7 +48,6 @@ if(ANDROID) elseif(LINUX) list(APPEND GAME_SOURCE proj.linux/main.cpp) elseif(WINDOWS) - add_definitions(-D_USRLUASTATIC) list(APPEND GAME_HEADER proj.win32/main.h proj.win32/resource.h @@ -118,13 +115,16 @@ if(APPLE) elseif(IOS) cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") + set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") + set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") endif() elseif(WINDOWS) - cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}) + cocos_copy_target_dll(${APP_NAME}) endif() if(LINUX OR WINDOWS) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) - cocos_copy_res(COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) + set(APP_RES_DIR "$/Resources") + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/res FOLDERS ${res_res_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src FOLDERS ${res_src_folders}) + cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR}/src/cocos FOLDERS ${res_script_folders}) endif() diff --git a/tests/lua-tests/project/Classes/lua_test_bindings.cpp b/tests/lua-tests/project/Classes/lua_test_bindings.cpp index 58104723278f..955a68fb08a8 100644 --- a/tests/lua-tests/project/Classes/lua_test_bindings.cpp +++ b/tests/lua-tests/project/Classes/lua_test_bindings.cpp @@ -134,7 +134,7 @@ DrawNode3D::~DrawNode3D() if (Configuration::getInstance()->supportsShareableVAO()) { glDeleteVertexArrays(1, &_vao); - glBindVertexArray(0); + GL::bindVAO(0); _vao = 0; } } @@ -176,7 +176,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { glGenVertexArrays(1, &_vao); - glBindVertexArray(_vao); + GL::bindVAO(_vao); } glGenBuffers(1, &_vbo); @@ -193,7 +193,7 @@ bool DrawNode3D::init() if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(0); + GL::bindVAO(0); } CHECK_GL_ERROR_DEBUG(); @@ -226,7 +226,7 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) glProgram->use(); glProgram->setUniformsForBuiltins(transform); glEnable(GL_DEPTH_TEST); - utils::setBlending(_blendFunc.src, _blendFunc.dst); + GL::blendFunc(_blendFunc.src, _blendFunc.dst); if (_dirty) { @@ -236,12 +236,11 @@ void DrawNode3D::onDraw(const Mat4 &transform, uint32_t flags) } if (Configuration::getInstance()->supportsShareableVAO()) { - glBindVertexArray(_vao); + GL::bindVAO(_vao); } else { - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION); - glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR); + GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX); glBindBuffer(GL_ARRAY_BUFFER, _vbo); // vertex diff --git a/tests/lua-tests/project/proj.android/app/AndroidManifest.xml b/tests/lua-tests/project/proj.android/app/AndroidManifest.xml index 16f6cdb54bb1..45c68f522ad4 100644 --- a/tests/lua-tests/project/proj.android/app/AndroidManifest.xml +++ b/tests/lua-tests/project/proj.android/app/AndroidManifest.xml @@ -8,6 +8,7 @@ diff --git a/tests/lua-tests/project/proj.android/app/build.gradle b/tests/lua-tests/project/proj.android/app/build.gradle index fc22e233df32..8e7ec1de88cf 100644 --- a/tests/lua-tests/project/proj.android/app/build.gradle +++ b/tests/lua-tests/project/proj.android/app/build.gradle @@ -34,9 +34,8 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { targets 'lua_tests' - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \ - "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE", "-DBUILD_LUA_LIBS=TRUE" - cppFlags "-frtti -fexceptions" + arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" + cppFlags "-frtti -fexceptions -fsigned-char" } } } diff --git a/tests/lua-tests/project/proj.android/app/proguard-rules.pro b/tests/lua-tests/project/proj.android/app/proguard-rules.pro index 2c062c494602..83d0fa1dde7b 100644 --- a/tests/lua-tests/project/proj.android/app/proguard-rules.pro +++ b/tests/lua-tests/project/proj.android/app/proguard-rules.pro @@ -23,6 +23,8 @@ -dontwarn com.chukong.** -keep public class com.huawei.android.** { *; } -dontwarn com.huawei.android.** +-keep public class com.cocos2dx.sample.** { *; } +-dontwarn com.cocos2dx.sample.** # Proguard Apache HTTP for release -keep class org.apache.http.** { *; } diff --git a/tests/lua-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/lua-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png index a58d118d5339..45ee51d15f96 100644 Binary files a/tests/lua-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/lua-tests/project/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/lua-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png index 3d921e19265e..0dd2a608998e 100644 Binary files a/tests/lua-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/lua-tests/project/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/lua-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index 6f4f3fc8f86d..a32f16f930b3 100644 Binary files a/tests/lua-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/lua-tests/project/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/lua-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 7ffc316459a1..332f268edc46 100644 Binary files a/tests/lua-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/lua-tests/project/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/lua-tests/project/proj.android/settings.gradle b/tests/lua-tests/project/proj.android/settings.gradle index 6087728e424b..05c3a5eb7971 100644 --- a/tests/lua-tests/project/proj.android/settings.gradle +++ b/tests/lua-tests/project/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../../cocos/platform/android/libcocos2dx') include ':LuaTests' project(':LuaTests').projectDir = new File(settingsDir, 'app') +rootProject.name = "lua-tests" diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20.png index 7cba320b858d..8ead23e36507 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@2x.png index 7e34719ba837..775685daca94 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@3x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@3x.png index 6c50aba2414a..a5b49ccbb199 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@3x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-20@3x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29.png index 5fe9afd2372c..0500184c869c 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@2x.png index 6cd69bf338b1..f0f8b7fe9833 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@3x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@3x.png index abb89cab6382..5287e50a7986 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@3x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-29@3x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40.png index 7e34719ba837..775685daca94 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@2x.png index 361307424626..d9c7ab446bb7 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@3x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@3x.png index 6c50aba2414a..a5b49ccbb199 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@3x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-40@3x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50.png index dd23cd1b6fa4..ac381bc20e85 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50@2x.png index 29e0b3d01f14..ef38d4500a80 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-50@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57.png index 5e355f7cb5c1..4fcc6fddffe1 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57@2x.png index 6ddb38c633e5..c3807861ad29 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-57@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@2x.png index 6c50aba2414a..a5b49ccbb199 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@3x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@3x.png index 4ab7ff4aa201..d4bc53132ce3 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@3x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-60@3x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72.png index 589f775f5ed2..2c573c8df4c3 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72@2x.png index fe6e1662634d..1526615c02d1 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-72@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76.png index 157eeba15884..8a1fa1850c03 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76@2x.png index e448eee9d57d..8aa82506d0d1 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-76@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-83.5@2x.png b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-83.5@2x.png index 9a849c7f7caa..6bf801d17507 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-83.5@2x.png and b/tests/lua-tests/project/proj.ios_mac/ios/Images.xcassets/AppIcon-lua-tests.appiconset/Icon-83.5@2x.png differ diff --git a/tests/lua-tests/project/proj.ios_mac/ios/LaunchScreenBackground.png b/tests/lua-tests/project/proj.ios_mac/ios/LaunchScreenBackground.png index e8bbddf1b925..dadccee68624 100644 Binary files a/tests/lua-tests/project/proj.ios_mac/ios/LaunchScreenBackground.png and b/tests/lua-tests/project/proj.ios_mac/ios/LaunchScreenBackground.png differ diff --git a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj index 16db32e2438d..39aadd707377 100644 --- a/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj +++ b/tests/lua-tests/project/proj.win32/lua-tests.win32.vcxproj @@ -13,6 +13,7 @@ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED} lua-tests + 10.0.17134.0 @@ -110,15 +111,15 @@ - - xcopy "$(ProjectDir)..\..\res" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)src" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\tests\cpp-tests\Resources" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)src\cocos" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\script" "$(OutDir)script" /D /E /I /F /Y + + xcopy "$(ProjectDir)..\..\res" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)Resources\src\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\tests\cpp-tests\Resources" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)Resources\src\cocos\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\script" "$(OutDir)Resources\script\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y copy files - + @@ -163,21 +164,21 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y - + copy files - + - xcopy "$(ProjectDir)..\..\res" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\src" "$(OutDir)src" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\tests\cpp-tests\Resources" "$(OutDir)res" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)src\cocos" /D /E /I /F /Y -xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\script" "$(OutDir)script" /D /E /I /F /Y + xcopy "$(ProjectDir)..\..\res" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\src" "$(OutDir)Resources\src\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\tests\cpp-tests\Resources" "$(OutDir)Resources\res\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\cocos\scripting\lua-bindings\script" "$(OutDir)Resources\src\cocos\" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\..\external\lua\luasocket\script" "$(OutDir)Resources\script\" /D /E /I /F /Y xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/animated-grossini.png b/tests/lua-tests/res/cocosbuilderRes/ccb/animated-grossini.png old mode 100644 new mode 100755 index 4125591abc88..89736acdaba8 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/animated-grossini.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/animated-grossini.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-0.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-0.png old mode 100644 new mode 100755 index 088abd2a8e35..66a5d3df7185 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-0.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-0.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-1.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-1.png old mode 100644 new mode 100755 index 8ae8c02f9a46..33f8a0c3f041 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-1.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-1.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-2.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-2.png old mode 100644 new mode 100755 index e38d806eaf4c..c8532b3e23ae Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-2.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-a-2.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-0.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-0.png old mode 100644 new mode 100755 index 6bd4677575d1..abd7d9a00b03 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-0.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-0.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-1.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-1.png old mode 100644 new mode 100755 index 57f0e2a55db2..b55f91e77c04 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-1.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-1.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-2.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-2.png old mode 100644 new mode 100755 index b7e343084acb..d47c7b6283e6 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-2.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-b-2.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-0.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-0.png old mode 100644 new mode 100755 index 0080cee8acc6..9caae52746ff Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-0.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-0.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-1.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-1.png old mode 100644 new mode 100755 index 5c874caea9b8..6c7cf5f97a9e Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-1.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-back-1.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-0.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-0.png old mode 100644 new mode 100755 index f189b276fa10..2777fd1d5ecc Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-0.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-0.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-1.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-1.png old mode 100644 new mode 100755 index 394b7ae4313b..b3be2a861637 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-1.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-1.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-2.png b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-2.png old mode 100644 new mode 100755 index ac7ed12942d4..eab72947de72 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-2.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/btn-test-2.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/burst.png b/tests/lua-tests/res/cocosbuilderRes/ccb/burst.png old mode 100644 new mode 100755 index 6f4bf92f1653..8681474538f4 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/burst.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/burst.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/ccbParticleStars.png b/tests/lua-tests/res/cocosbuilderRes/ccb/ccbParticleStars.png old mode 100644 new mode 100755 index e7042b651a16..f493dcc33470 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/ccbParticleStars.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/ccbParticleStars.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/grossini-generic.png b/tests/lua-tests/res/cocosbuilderRes/ccb/grossini-generic.png old mode 100644 new mode 100755 index 55eb67b0d6d4..5c0bbc67c854 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/grossini-generic.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/grossini-generic.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-left.png b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-left.png old mode 100644 new mode 100755 index 43f389c8b585..79bbf2033432 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-left.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-left.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-right.png b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-right.png old mode 100644 new mode 100755 index b252efc5fab4..8da61b9f5861 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-right.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle-right.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle.png b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle.png old mode 100644 new mode 100755 index 303616fee5fb..b3ddd92d2b09 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/jungle.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/jungle.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/logo-icon.png b/tests/lua-tests/res/cocosbuilderRes/ccb/logo-icon.png old mode 100644 new mode 100755 index f742d1b3b076..c668736dc74d Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/logo-icon.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/logo-icon.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/logo.png b/tests/lua-tests/res/cocosbuilderRes/ccb/logo.png old mode 100644 new mode 100755 index cacbf7d749a6..a4cd20c20e8f Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/logo.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/logo.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/markerfelt24shadow.png b/tests/lua-tests/res/cocosbuilderRes/ccb/markerfelt24shadow.png old mode 100644 new mode 100755 index 82b24297cbec..5bab02849644 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/markerfelt24shadow.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/markerfelt24shadow.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-fire.png b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-fire.png old mode 100644 new mode 100755 index 3f6c26fee711..81c6d2410bb2 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-fire.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-fire.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-smoke.png b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-smoke.png old mode 100644 new mode 100755 index 4e0cd72ec1a3..a289b1371e29 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-smoke.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-smoke.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-snow.png b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-snow.png old mode 100644 new mode 100755 index 6d6e9c7385bf..9e12963498d7 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-snow.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-snow.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-stars.png b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-stars.png old mode 100644 new mode 100755 index e7042b651a16..f493dcc33470 Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/particle-stars.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/particle-stars.png differ diff --git a/tests/lua-tests/res/cocosbuilderRes/ccb/scale-9-demo.png b/tests/lua-tests/res/cocosbuilderRes/ccb/scale-9-demo.png old mode 100644 new mode 100755 index af68db072fed..ee4537207f1b Binary files a/tests/lua-tests/res/cocosbuilderRes/ccb/scale-9-demo.png and b/tests/lua-tests/res/cocosbuilderRes/ccb/scale-9-demo.png differ diff --git a/tests/lua-tests/src/BugsTest/BugsTest.lua b/tests/lua-tests/src/BugsTest/BugsTest.lua index ee3a6e44fddc..ce0549b75dc0 100644 --- a/tests/lua-tests/src/BugsTest/BugsTest.lua +++ b/tests/lua-tests/src/BugsTest/BugsTest.lua @@ -441,7 +441,7 @@ local function BugTest1174() print("Test1 - Start") local i = 0 - for i = 0, 9999 do + for i = 0, 999 do --[[ A|b ----- @@ -513,7 +513,7 @@ local function BugTest1174() ok=0 err=0 - for i = 0 , 9999 do + for i = 0 , 999 do -- A | b -- ----- -- c | d diff --git a/tests/lua-tests/src/DownloaderTest/DownloaderTest.lua b/tests/lua-tests/src/DownloaderTest/DownloaderTest.lua new file mode 100644 index 000000000000..a8bdd1722812 --- /dev/null +++ b/tests/lua-tests/src/DownloaderTest/DownloaderTest.lua @@ -0,0 +1,104 @@ +require("json") + + +local imgURI = "http://forum.cocos.com/images/logo.png" +local notExistURI = "http://www.cocos2d-x.org/attachments/1503/no_exist.txt" + +local downloader = cc.Downloader.new() +local writablePath = cc.FileUtils:getInstance():getWritablePath() +local function DownloaderLayer() + local layer = cc.Layer:create() + local winSize = cc.Director:getInstance():getWinSize() + local margin = 40 + local space = 35 + + local task1 = nil + local task2 = nil + + local function init() + + local label = cc.Label:createWithTTF("Downloader Test", s_arialPath, 28) + label:setAnchorPoint(cc.p(0.5, 0.5)) + label:setPosition(cc.p(winSize.width / 2, winSize.height - margin)) + layer:addChild(label, 0) + + --Response Code Label + local labelStatusCode = cc.Label:createWithTTF("status", s_markerFeltFontPath, 20) + labelStatusCode:setAnchorPoint(cc.p(0.5, 0.5)) + labelStatusCode:setPosition(cc.p(winSize.width / 2, winSize.height - margin - 6 * space)) + layer:addChild(labelStatusCode) + + local menuRequest = cc.Menu:create() + menuRequest:setPosition(cc.p(0,0)) + layer:addChild(menuRequest) + + --success + local function onDownloadFileClicked() + downloader:createDownloadFileTask(imgURI, writablePath .. "/2dx_icon_512_rounded.png", "task_img"); + labelStatusCode:setString("waiting...") + end + + local labelGet = cc.Label:createWithTTF("Test Download Image", s_arialPath, 22) + labelGet:setAnchorPoint(cc.p(0.5, 0.5)) + local itemGet = cc.MenuItemLabel:create(labelGet) + itemGet:registerScriptTapHandler(onDownloadFileClicked) + itemGet:setPosition(cc.p(winSize.width / 2, winSize.height - margin - space)) + menuRequest:addChild(itemGet) + + --failure + local function onDownloadTxtClicked() + downloader:createDownloadFileTask(notExistURI, writablePath .. "/no_exists.txt", "task_no_exist"); + labelStatusCode:setString("waiting...") + end + + local labelPost = cc.Label:createWithTTF("Test Download File Not Exists", s_arialPath, 22) + labelPost:setAnchorPoint(cc.p(0.5, 0.5)) + local itemPost = cc.MenuItemLabel:create(labelPost) + itemPost:registerScriptTapHandler(onDownloadTxtClicked) + itemPost:setPosition(cc.p(winSize.width / 2, winSize.height - margin - 2 * space)) + menuRequest:addChild(itemPost) + + local function onTaskSuccess(task) + if task.identifier == "task_img" then + labelStatusCode:setString("image download success") + elseif task.identifier == "task_no_exist" then + labelStatusCode:setString("txt download success") + end + end + local function onProgress(task, bytesReceived, totalBytesReceived, totalBytesExpected) + if task.identifier == "task_img" then + labelStatusCode:setString("image download progress " .. tostring(math.floor(totalBytesReceived/totalBytesExpected*100))) + elseif task.identifier == "task_no_exist" then + labelStatusCode:setString("txt download progress " .. tostring(math.floor(totalBytesReceived/totalBytesExpected*100))) + end + end + local function onTaskError(task, errorCode, errorCodeInternal, errorStr) + if task.identifier == "task_img" then + labelStatusCode:setString("image download error: "..errorStr) + elseif task.identifier == "task_no_exist" then + labelStatusCode:setString("txt download error: "..errorStr) + end + end + downloader:setOnFileTaskSuccess(onTaskSuccess) + downloader:setOnTaskProgress(onProgress) + downloader:setOnTaskError(onTaskError) + + end + + local function onNodeEvent(eventName) + if "enter" == eventName then + init() + end + end + + layer:registerScriptHandler(onNodeEvent) + + return layer +end + +function DownloaderTestMain() + local scene = cc.Scene:create() + scene:addChild(DownloaderLayer()) + scene:addChild(CreateBackMenuItem()) + return scene +end diff --git a/tests/lua-tests/src/EffectsTest/EffectsTest.lua b/tests/lua-tests/src/EffectsTest/EffectsTest.lua index 715171e926cb..0c8dca639151 100644 --- a/tests/lua-tests/src/EffectsTest/EffectsTest.lua +++ b/tests/lua-tests/src/EffectsTest/EffectsTest.lua @@ -48,7 +48,7 @@ end local function nextAction() ActionIdx = ActionIdx + 1 - ActionIdx = math.mod(ActionIdx, MAX_LAYER) + ActionIdx = math.fmod(ActionIdx, MAX_LAYER) return CreateEffectsTestLayer() end diff --git a/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua b/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua index a7ea9477d225..2231ff51d04c 100644 --- a/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua +++ b/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua @@ -226,7 +226,7 @@ local function ExtensionsMainLayer() listener:registerScriptHandler(onTouchesMoved,cc.Handler.EVENT_TOUCHES_MOVED ) local eventDispatcher = layer:getEventDispatcher() - eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer) + --eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer) return layer end diff --git a/tests/lua-tests/src/FontTest/FontTest.lua b/tests/lua-tests/src/FontTest/FontTest.lua index 6ac2566635cd..41903b68f888 100644 --- a/tests/lua-tests/src/FontTest/FontTest.lua +++ b/tests/lua-tests/src/FontTest/FontTest.lua @@ -24,15 +24,15 @@ local verticalAlignment = { local vAlignCount = table.getn(verticalAlignment) -local function showFont(ret, pFont) +local function showFont(ret, pFont, index) cclog("vAlignIdx="..vAlignIdx) local s = cc.Director:getInstance():getWinSize() - local blockSize = cc.size(s.width/3, 200) + local blockSize = cc.size(s.width/3, 100) local fontSize = 26 - local top = cc.Label:createWithTTF(pFont, pFont, 24) + local top = cc.Label:createWithTTF(tostring(index) .. ". " ..pFont, pFont, 24) local left = cc.Label:createWithTTF("alignment left", pFont, fontSize, blockSize, cc.TEXT_ALIGNMENT_LEFT, verticalAlignment[vAlignIdx]) local center = cc.Label:createWithTTF("alignment center", pFont, fontSize, @@ -85,7 +85,7 @@ local function createTestLayer() end local ret = originCreateLayer("") - showFont(ret, fontList[Helper.index]) + showFont(ret, fontList[Helper.index], Helper.index) return ret end diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index 154a7acb7cb1..4eb1b54ffb8c 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -212,11 +212,11 @@ function TouchableSpriteTest:onEnter() local function onTouchBegan(touch, event) local target = event:getCurrentTarget() - + local locationInNode = target:convertToNodeSpace(touch:getLocation()) local s = target:getContentSize() local rect = cc.rect(0, 0, s.width, s.height) - + if cc.rectContainsPoint(rect, locationInNode) then print(string.format("sprite began... x = %f, y = %f", locationInNode.x, locationInNode.y)) target:setOpacity(180) @@ -265,7 +265,7 @@ function TouchableSpriteTest:onEnter() nextMenuItem:setFontSizeObj(16) nextMenuItem:setPosition(cc.p(VisibleRect:right().x - 100, VisibleRect:right().y - 30)) nextMenuItem:registerScriptTapHandler(self.nextCallback) - + local menu2 = cc.Menu:create(nextMenuItem) menu2:setPosition(cc.p(0, 0)) menu2:setAnchorPoint(cc.p(0, 0)) @@ -292,7 +292,7 @@ function TouchableSpriteTest.create() elseif event == "exit" then end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -323,17 +323,17 @@ function TouchableSpriteWithFixedPriority:onEnter() local locationInNode = self:convertToNodeSpace(touch:getLocation()) local s = self:getContentSize() local rect = cc.rect(0, 0, s.width, s.height) - + if cc.rectContainsPoint(rect, locationInNode) then self:setColor(cc.c3b(255, 0, 0)) return true end - return false + return false end local function onTouchMoved(touch, event) - + end local function onTouchEnded(touch, event) @@ -348,7 +348,7 @@ function TouchableSpriteWithFixedPriority:onEnter() local listener = cc.EventListenerTouchOneByOne:create() self._listener = listener listener:setSwallowTouches(true) - + listener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN ) listener:registerScriptHandler(onTouchMoved,cc.Handler.EVENT_TOUCH_MOVED ) listener:registerScriptHandler(onTouchEnded,cc.Handler.EVENT_TOUCH_ENDED ) @@ -391,7 +391,7 @@ function TouchableSpriteWithFixedPriority.create() touchableSprite:onExit() end end - + touchableSprite:registerScriptHandler(onNodeEvent) return touchableSprite end @@ -441,7 +441,7 @@ function FixedPriorityTest.create() elseif event == "exit" then end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -478,7 +478,7 @@ function RemoveListenerWhenDispatchingTest:onEnter() sprite1:setColor(cc.c3b(255, 0, 0)) return true end - + return false end @@ -533,7 +533,7 @@ function RemoveListenerWhenDispatchingTest.create() elseif event == "exit" then end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -560,7 +560,7 @@ function CustomEventTest:onEnter() local size = cc.Director:getInstance():getVisibleSize() local count1 = 0 local count2 = 0 - + cc.MenuItemFont:setFontSize(20) local statusLabel1 = cc.Label:createWithSystemFont("No custom event 1 received!", "", 20) @@ -580,7 +580,7 @@ function CustomEventTest:onEnter() local function sendCallback1(tag, sender) count1 = count1 + 1 - + local event = cc.EventCustom:new("game_custom_event1") event._usedata = string.format("%d",count1) eventDispatcher:dispatchEvent(event) @@ -605,7 +605,7 @@ function CustomEventTest:onEnter() local function sendCallback2(tag, sender) count2 = count2 + 1 - + local event = cc.EventCustom:new("game_custom_event2") event._usedata = string.format("%d",count2) eventDispatcher:dispatchEvent(event) @@ -614,7 +614,26 @@ function CustomEventTest:onEnter() sendItem2:registerScriptTapHandler(sendCallback2) sendItem2:setPosition(cc.p(origin.x + size.width/2, origin.y + size.height/2 - 40)) - local menu = cc.Menu:create(sendItem1, sendItem2) + -- addCustomEventListener test begin + local count3 = 0 + local statusLabel3 = cc.Label:createWithSystemFont('addCustomEventListener: Received "event_custom" 0 times', "", 14) + statusLabel3:setAnchorPoint(cc.p(0.5, 0.5)) + statusLabel3:setPosition(cc.p(origin.x + size.width/2, origin.y + size.height-140 )) + self:addChild(statusLabel3) + + eventDispatcher:addCustomEventListener('event_custom' ,function(...) + count3 = count3 + 1 + statusLabel3:setString('addCustomEventListener: Received "event_custom" ' .. count3 .. ' times') + end) + + local sendItem3 = cc.MenuItemFont:create('dispatchCustomEvent("event_custom")') + sendItem3:registerScriptTapHandler(function ( ) + eventDispatcher:dispatchCustomEvent("event_custom") + end) + sendItem3:setPosition(cc.p(origin.x + size.width/2, origin.y + size.height/2 - 80)) + -- addCustomEventListener test end + + local menu = cc.Menu:create(sendItem1, sendItem2, sendItem3) menu:setPosition(cc.p(0, 0)) menu:setAnchorPoint(cc.p(0, 0)) self:addChild(menu, -1) @@ -624,6 +643,7 @@ function CustomEventTest:onExit() local eventDispatcher = self:getEventDispatcher() eventDispatcher:removeEventListener(self._listener1) eventDispatcher:removeEventListener(self._listener2) + eventDispatcher:removeCustomEventListeners('event_custom') end function CustomEventTest.create() @@ -636,7 +656,7 @@ function CustomEventTest.create() layer:onExit() end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -661,7 +681,7 @@ end function LabelKeyboardEventTest:onEnter() local origin = cc.Director:getInstance():getVisibleOrigin() local size = cc.Director:getInstance():getVisibleSize() - + local statusLabel = cc.Label:createWithSystemFont("No keyboard event received!", "", 20) statusLabel:setAnchorPoint(cc.p(0.5, 0.5)) statusLabel:setPosition(cc.p(origin.x + size.width/2,origin.y + size.height/2)) @@ -697,7 +717,7 @@ function LabelKeyboardEventTest.create() elseif event == "exit" then end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -739,7 +759,7 @@ function SpriteAccelerationEventTest:onEnter() elseif ptNowX > maxX then ptNowX = maxX end - + local minY = math.floor(VisibleRect:bottom().y + ballSize.height / 2.0) local maxY = math.floor(VisibleRect:top().y - ballSize.height / 2.0) if ptNowY < minY then @@ -770,7 +790,7 @@ function SpriteAccelerationEventTest.create() layer:onExit() end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -808,13 +828,13 @@ function RemoveAndRetainNodeTest:onEnter() local locationInNode = target:convertToNodeSpace(touch:getLocation()) local s = target:getContentSize() local rect = cc.rect(0, 0, s.width, s.height) - + if cc.rectContainsPoint(rect, locationInNode) then print(string.format("sprite began... x = %f, y = %f", locationInNode.x, locationInNode.y)) target:setOpacity(180) return true end - return false + return false end local function onTouchMoved(touch,event) @@ -882,7 +902,7 @@ function RemoveAndRetainNodeTest.create() layer:onExit() end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -933,7 +953,7 @@ function RemoveListenerAfterAddingTest:onEnter() local nextButton = cc.MenuItemFont:create("Please Click Me To Reset!") nextButton:registerScriptTapHandler(nextButtonCallback) nextButton:setPosition(cc.p(VisibleRect:center().x, VisibleRect:center().y - 40)) - + local menu = cc.Menu:create(nextButton) menu:setPosition(VisibleRect:leftBottom()) menu:setAnchorPoint(cc.p(0,0)) @@ -949,10 +969,10 @@ function RemoveListenerAfterAddingTest:onEnter() local listener = cc.EventListenerTouchOneByOne:create() listener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN) - + eventDispatcher:addEventListenerWithFixedPriority(listener, -1) eventDispatcher:removeEventListenersForType(cc.EVENT_TOUCH_ONE_BY_ONE) - + addNextButton() end @@ -970,10 +990,10 @@ function RemoveListenerAfterAddingTest:onEnter() local listener = cc.EventListenerTouchOneByOne:create() listener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN) - + eventDispatcher:addEventListenerWithFixedPriority(listener, -1) eventDispatcher:removeAllEventListeners() - + addNextButton() end @@ -1003,7 +1023,7 @@ function RemoveListenerAfterAddingTest.create() layer:onExit() end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -1029,11 +1049,11 @@ end function GlobalZTouchTest:onEnter() local function onTouchBegan(touch, event) local target = event:getCurrentTarget() - + local locationInNode = target:convertToNodeSpace(touch:getLocation()) local s = target:getContentSize() local rect = cc.rect(0, 0, s.width, s.height) - + if cc.rectContainsPoint(rect, locationInNode) then print(string.format("sprite began... x = %f, y = %f", locationInNode.x, locationInNode.y)) target:setOpacity(180) @@ -1104,7 +1124,7 @@ function GlobalZTouchTest.create() layer:onExit() end end - + layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) @@ -1203,14 +1223,14 @@ function StopPropagationTest:onEnter() sprite = cc.Sprite:create("Images/CyanSquare.png") sprite:setTag(TAG_BLUE_SPRITE) self:addChild(sprite, 100) - + sprite2 = cc.Sprite:create("Images/CyanSquare.png") sprite2:setTag(TAG_BLUE_SPRITE2) self:addChild(sprite2, 100) else sprite = cc.Sprite:create("Images/YellowSquare.png") self:addChild(sprite, 0) - + sprite2 = cc.Sprite:create("Images/YellowSquare.png") self:addChild(sprite2, 0) end @@ -1231,7 +1251,7 @@ function StopPropagationTest:onEnter() end function StopPropagationTest:onExit() - + end function StopPropagationTest:isPointInNode(pt, node) @@ -1249,7 +1269,7 @@ function StopPropagationTest:isPointInTopHalfAreaOfScreen(pt) if pt.y >= winSize.height / 2 then return true end - + return false end @@ -1267,7 +1287,7 @@ function StopPropagationTest.create() layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) - + return layer end @@ -1286,17 +1306,17 @@ end function PauseResumeTargetTest:onEnter() local origin = cc.Director:getInstance():getVisibleOrigin() local size = cc.Director:getInstance():getVisibleSize() - + local sprite1 = TouchableSpriteWithFixedPriority.create() sprite1:setTexture("Images/CyanSquare.png") sprite1:setPosition(cc.p(origin.x + size.width/2 - 80, origin.y + size.height/2 + 40)) self:addChild(sprite1, -10) - + local sprite2 = TouchableSpriteWithFixedPriority.create() sprite2:setTexture("Images/MagentaSquare.png") sprite2:setPosition(cc.p(origin.x + size.width/2, origin.y + size.height/2)) self:addChild(sprite2, -20) - + local sprite3 = TouchableSpriteWithFixedPriority.create() sprite3:setTexture("Images/YellowSquare.png") sprite3:setPosition(cc.p(0, 0)) @@ -1317,28 +1337,28 @@ function PauseResumeTargetTest:onEnter() local closeItem = cc.MenuItemFont:create("close") closeItem:registerScriptTapHandler(closePopUp) closeItem:setPosition(VisibleRect:center()) - + local closeMenu = cc.Menu:create(closeItem) closeMenu:setAnchorPoint(cc.p(0.0, 0.0)) closeMenu:setPosition(cc.p(0.0, 0.0)) - + colorLayer:addChild(closeMenu) end local popUpItem = cc.MenuItemFont:create("Popup") - popUpItem:registerScriptTapHandler(popUp) + popUpItem:registerScriptTapHandler(popUp) popUpItem:setAnchorPoint(cc.p(1.0, 0.5)) popUpItem:setPosition(VisibleRect:right()) - + local menu = cc.Menu:create(popUpItem) menu:setAnchorPoint(cc.p(0.0, 0.0)) menu:setPosition(cc.p(0.0, 0.0)) - + self:addChild(menu) end function PauseResumeTargetTest:onExit() - + end function PauseResumeTargetTest.create() @@ -1355,7 +1375,7 @@ function PauseResumeTargetTest.create() layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) - + return layer end @@ -1381,7 +1401,7 @@ function Issue4129Test:onEnter() label:setAnchorPoint(cc.p(0, 0.5)) label:setPosition(VisibleRect:left()) self:addChild(label) - + eventDispatcher:removeEventListener(self._customListener) self._customListener = nil @@ -1394,9 +1414,9 @@ function Issue4129Test:onEnter() local function removeAllTouch(tag, sender) local senderItem = sender senderItem:setString("Only 'Reset' item could be clicked") - + eventDispatcher:removeAllEventListeners() - + local function next(tag, sender) assert(bugFixed, "This issue was not fixed!") self.restartCallback() @@ -1405,12 +1425,12 @@ function Issue4129Test:onEnter() nextItem:registerScriptTapHandler(next) nextItem:setFontSizeObj(16) nextItem:setPosition(cc.p(VisibleRect:right().x - 100 , VisibleRect:right().y - 30)) - + local menu2 = cc.Menu:create(nextItem) menu2:setPosition(cc.p(0, 0)) menu2:setAnchorPoint(cc.p(0, 0)) self:addChild(menu2) - + --Simulate to dispatch 'come to background' event local event = cc.EventCustom:new("event_come_to_background") eventDispatcher:dispatchEvent(event) @@ -1420,7 +1440,7 @@ function Issue4129Test:onEnter() removeAllTouchItem:registerScriptTapHandler(removeAllTouch) removeAllTouchItem:setFontSizeObj(16) removeAllTouchItem:setPosition(cc.p(VisibleRect:right().x - 100, VisibleRect:right().y)) - + local menu = cc.Menu:create(removeAllTouchItem) menu:setPosition(cc.p(0, 0)) menu:setAnchorPoint(cc.p(0, 0)) @@ -1448,7 +1468,7 @@ function Issue4129Test.create() layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) - + return layer end @@ -1468,20 +1488,20 @@ end function Issue4160Test:onEnter() local origin = cc.Director:getInstance():getVisibleOrigin() local size = cc.Director:getInstance():getVisibleSize() - + local sprite1 = TouchableSpriteWithFixedPriority.create() sprite1:setPriority(-30) sprite1:setTexture("Images/CyanSquare.png") sprite1:setPosition(cc.p(origin.x + size.width/2 - 80, origin.y + size.height/2 + 40)) self:addChild(sprite1, -10) - + local sprite2 = TouchableSpriteWithFixedPriority.create() sprite2:setPriority(-20) sprite2:setTexture("Images/MagentaSquare.png") sprite2:removeListenerOnTouchEnded(true) sprite2:setPosition(cc.p(origin.x + size.width/2, origin.y + size.height/2)) self:addChild(sprite2, -20) - + local sprite3 = TouchableSpriteWithFixedPriority.create() sprite3:setPriority(-10) sprite3:setTexture("Images/YellowSquare.png") @@ -1507,7 +1527,7 @@ function Issue4160Test.create() layer:createMenu() layer:creatTitleAndSubTitle(curLayerIdx) layer:registerScriptHandler(onNodeEvent) - + return layer end diff --git a/tests/lua-tests/src/ParticleTest/ParticleTest.lua b/tests/lua-tests/src/ParticleTest/ParticleTest.lua index 7257eb95fd83..869de767ced4 100644 --- a/tests/lua-tests/src/ParticleTest/ParticleTest.lua +++ b/tests/lua-tests/src/ParticleTest/ParticleTest.lua @@ -29,7 +29,7 @@ end local function nextAction() SceneIdx = SceneIdx + 1 - SceneIdx = math.mod(SceneIdx, MAX_LAYER) + SceneIdx = math.fmod(SceneIdx, MAX_LAYER) return CreateParticleLayer() end @@ -208,17 +208,17 @@ local function reorderParticles(dt) local child2 = parent:getChildByTag(2) local child3 = parent:getChildByTag(3) - if math.mod(ParticleReorder_Order, 3) == 0 then + if math.fmod(ParticleReorder_Order, 3) == 0 then parent:reorderChild(child1, 1) parent:reorderChild(child2, 2) parent:reorderChild(child3, 3) - elseif math.mod(ParticleReorder_Order, 3) == 1 then + elseif math.fmod(ParticleReorder_Order, 3) == 1 then parent:reorderChild(child1, 3) parent:reorderChild(child2, 1) parent:reorderChild(child3, 2) - elseif math.mod(ParticleReorder_Order, 3) == 2 then + elseif math.fmod(ParticleReorder_Order, 3) == 2 then parent:reorderChild(child1, 2) parent:reorderChild(child2, 3) parent:reorderChild(child3, 1) @@ -1233,7 +1233,7 @@ local Issue870_entry = nil local function updateQuads(dt) update(dt) - Issue870_index = math.mod(Issue870_index + 1, 4) + Issue870_index = math.fmod(Issue870_index + 1, 4) local rect = cc.rect(Issue870_index * 32, 0, 32, 32) emitter:setTextureWithRect(emitter:getTexture(), rect) end @@ -1344,7 +1344,7 @@ local function removeSystem(dt) local ChildrenCount = table.getn(AddAndDeleteParticleSystems_batchNode:getChildren()) if ChildrenCount > 0 then cclog("remove random system") - local rand = math.mod(math.random(1, 999999), ChildrenCount - 1) + local rand = math.fmod(math.random(1, 999999), ChildrenCount - 1) AddAndDeleteParticleSystems_batchNode:removeChild(AddAndDeleteParticleSystems_batchNode:getChildren()[(rand)], true) --add new @@ -1352,7 +1352,7 @@ local function removeSystem(dt) particleSystem:setPositionType(cc.POSITION_TYPE_GROUPED ) particleSystem:setTotalParticles(200) - particleSystem:setPosition(math.mod(math.random(1, 999999), 300) ,math.mod(math.random(1, 999999), 400)) + particleSystem:setPosition(math.fmod(math.random(1, 999999), 300) ,math.fmod(math.random(1, 999999), 400)) cclog("add a new system") local randZ = math.floor(math.random() * 100) diff --git a/tests/lua-tests/src/SpriteTest/SpriteTest.lua b/tests/lua-tests/src/SpriteTest/SpriteTest.lua index 01e8affbd34f..1556621b440c 100644 --- a/tests/lua-tests/src/SpriteTest/SpriteTest.lua +++ b/tests/lua-tests/src/SpriteTest/SpriteTest.lua @@ -26,7 +26,7 @@ Sprite1.__index = Sprite1 function Sprite1.addNewSpriteWithCoords(layer, point) local idx = math.floor(math.random() * 1400 / 100) - local x = math.floor(math.mod(idx,5) * 85) + local x = math.floor(math.fmod(idx,5) * 85) local y = math.floor(idx / 5) * 121 local sprite = cc.Sprite:create("Images/grossini_dance_atlas.png", cc.rect(x,y,85,121) ) @@ -87,7 +87,7 @@ SpriteBatchNode1.__index = SpriteBatchNode1 function SpriteBatchNode1.addNewSpriteWithCoords(layer, point) local BatchNode = layer:getChildByTag( kTagSpriteBatchNode ) local idx = math.floor(math.random() * 1400 / 100) - local x = math.floor(math.mod(idx,5) * 85) + local x = math.floor(math.fmod(idx,5) * 85) local y = math.floor(idx / 5) * 121 local sprite = cc.Sprite:createWithTexture(BatchNode:getTexture(), cc.rect(x,y,85,121) ) @@ -316,7 +316,7 @@ function SpriteFrameTest.flipSprites(dt) local fx = false local fy = false - local i = math.mod(SpriteFrameTest.m_nCounter, 4) + local i = math.fmod(SpriteFrameTest.m_nCounter, 4) if(i == 0) then fx = false diff --git a/tests/lua-tests/src/TransitionsTest/TransitionsTest.lua b/tests/lua-tests/src/TransitionsTest/TransitionsTest.lua index 79b6eeb09efc..fcefde3395ff 100644 --- a/tests/lua-tests/src/TransitionsTest/TransitionsTest.lua +++ b/tests/lua-tests/src/TransitionsTest/TransitionsTest.lua @@ -30,7 +30,7 @@ end local function nextAction() SceneIdx = SceneIdx + 1 - SceneIdx = math.mod(SceneIdx, Transition_Table.MAX_LAYER) + SceneIdx = math.fmod(SceneIdx, Transition_Table.MAX_LAYER) switchSceneTypeNo() return generateTranScene() diff --git a/tests/lua-tests/src/WebViewTest/WebViewTest.lua b/tests/lua-tests/src/WebViewTest/WebViewTest.lua index a33ca192590b..29dad3ab1b0c 100644 --- a/tests/lua-tests/src/WebViewTest/WebViewTest.lua +++ b/tests/lua-tests/src/WebViewTest/WebViewTest.lua @@ -77,7 +77,7 @@ function WebViewTest:init() local backBtn = ccui.Button:create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png") backBtn:setTitleText("Back") - backBtn:setPosition(winSize.width / 2 + self._webView:getContentSize().width/2 + backBtn:getContentSize().width/2 + 10, winSize.height - 50) + backBtn:setPosition(winSize.width / 2 + self._webView:getContentSize().width/2 + backBtn:getContentSize().width/2 + 10, winSize.height - 10) backBtn:addClickEventListener(function(sender) self._webView:goBack() end) @@ -103,7 +103,7 @@ function WebViewTest:init() evalJsBtn:setTitleText("Evaluate JS") evalJsBtn:setPosition(winSize.width / 2 - self._webView:getContentSize().width/2 - evalJsBtn:getContentSize().width/2 - 30, winSize.height / 2 - 50) evalJsBtn:addClickEventListener(function(sender) - self._webView:evaluateJS("alert(\"hello\")") + self._webView:evaluateJS("setTimeout(function(){alert(\"hello\");}, 0);") end) self:addChild(evalJsBtn) end @@ -127,4 +127,4 @@ function WebViewTestMain() scene:addChild(WebViewTest.create()) scene:addChild(CreateBackMenuItem()) return scene -end \ No newline at end of file +end diff --git a/tests/lua-tests/src/mainMenu.lua b/tests/lua-tests/src/mainMenu.lua index c47123b8fb8c..b0b01e2b29fe 100644 --- a/tests/lua-tests/src/mainMenu.lua +++ b/tests/lua-tests/src/mainMenu.lua @@ -16,6 +16,7 @@ require "ClickAndMoveTest/ClickAndMoveTest" require "CocosDenshionTest/CocosDenshionTest" require "ComponentTest/main" require "CurrentLanguageTest/CurrentLanguageTest" +require "DownloaderTest/DownloaderTest" require "DrawPrimitivesTest/DrawPrimitivesTest" require "EffectsTest/EffectsTest" require "EffectsAdvancedTest/EffectsAdvancedTest" @@ -107,6 +108,7 @@ local _allTests = { { isSupported = true, name = "CocosDenshionTest" , create_func = CocosDenshionTestMain }, { isSupported = true, name = "ComponentTest" , create_func = ComponentTestMain }, { isSupported = false, name = "CurlTest" , create_func= CurlTestMain }, + { isSupported = true, name = "DownloaderTest" , create_func= DownloaderTestMain }, { isSupported = true, name = "CurrentLanguageTest" , create_func= CurrentLanguageTestMain }, { isSupported = true, name = "DrawPrimitivesTest" , create_func= DrawPrimitivesTest }, { isSupported = true, name = "EffectsTest" , create_func = EffectsTest }, @@ -197,17 +199,15 @@ function CreateTestMenu() CloseMenu:setPosition(0, 0) CloseMenu:addChild(CloseItem) menuLayer:addChild(CloseMenu) + local targetPlatform = cc.Application:getInstance():getTargetPlatform() - if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) then - CloseMenu:setVisible(false) - end -- add menu items for tests local MainMenu = cc.Menu:create() local index = 0 local obj = nil - for index, obj in pairs(_allTests) do - local testLabel = cc.Label:createWithTTF(obj.name, s_arialPath, 24) + for index, obj in pairs(_allTests) do + local testLabel = cc.Label:createWithTTF(index .. ". " .. obj.name, s_arialPath, 24) testLabel:setAnchorPoint(cc.p(0.5, 0.5)) local testMenuItem = cc.MenuItemLabel:create(testLabel) if not obj.isSupported then diff --git a/tests/performance-tests/Classes/tests/BaseTest.cpp b/tests/performance-tests/Classes/tests/BaseTest.cpp index 306cf96be6ee..d028fdb43412 100644 --- a/tests/performance-tests/Classes/tests/BaseTest.cpp +++ b/tests/performance-tests/Classes/tests/BaseTest.cpp @@ -184,9 +184,6 @@ void TestList::runThisTest() TestController::getInstance()->stopAutoTest(); TestController::destroyInstance(); Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - exit(0); -#endif }); closeItem->setPosition(VisibleRect::right().x - 30, VisibleRect::top().y - 30); diff --git a/tests/performance-tests/Resources/CloseNormal.png b/tests/performance-tests/Resources/CloseNormal.png index 4a4bcc91868c..b65498c94159 100644 Binary files a/tests/performance-tests/Resources/CloseNormal.png and b/tests/performance-tests/Resources/CloseNormal.png differ diff --git a/tests/performance-tests/Resources/CloseSelected.png b/tests/performance-tests/Resources/CloseSelected.png index d923b6cf8435..306749ecd20d 100644 Binary files a/tests/performance-tests/Resources/CloseSelected.png and b/tests/performance-tests/Resources/CloseSelected.png differ diff --git a/tests/performance-tests/Resources/Images/PlanetCute-1024x1024.png b/tests/performance-tests/Resources/Images/PlanetCute-1024x1024.png index 59634fef260a..7b047c6f1b8f 100644 Binary files a/tests/performance-tests/Resources/Images/PlanetCute-1024x1024.png and b/tests/performance-tests/Resources/Images/PlanetCute-1024x1024.png differ diff --git a/tests/performance-tests/Resources/Images/b1.png b/tests/performance-tests/Resources/Images/b1.png old mode 100644 new mode 100755 index 67708eaedd2f..93ee8252f088 Binary files a/tests/performance-tests/Resources/Images/b1.png and b/tests/performance-tests/Resources/Images/b1.png differ diff --git a/tests/performance-tests/Resources/Images/b2.png b/tests/performance-tests/Resources/Images/b2.png old mode 100644 new mode 100755 index 5ccecdb6e2e1..8cc30415fbd8 Binary files a/tests/performance-tests/Resources/Images/b2.png and b/tests/performance-tests/Resources/Images/b2.png differ diff --git a/tests/performance-tests/Resources/Images/close.png b/tests/performance-tests/Resources/Images/close.png old mode 100644 new mode 100755 index f04be4fc0100..ef3b1d12ae6b Binary files a/tests/performance-tests/Resources/Images/close.png and b/tests/performance-tests/Resources/Images/close.png differ diff --git a/tests/performance-tests/Resources/Images/f1.png b/tests/performance-tests/Resources/Images/f1.png old mode 100644 new mode 100755 index 561001528faf..385e22707b61 Binary files a/tests/performance-tests/Resources/Images/f1.png and b/tests/performance-tests/Resources/Images/f1.png differ diff --git a/tests/performance-tests/Resources/Images/f2.png b/tests/performance-tests/Resources/Images/f2.png old mode 100644 new mode 100755 index e249137eb252..388a7399c5a3 Binary files a/tests/performance-tests/Resources/Images/f2.png and b/tests/performance-tests/Resources/Images/f2.png differ diff --git a/tests/performance-tests/Resources/Images/fire.png b/tests/performance-tests/Resources/Images/fire.png old mode 100644 new mode 100755 index 5edf1ba6f85f..dd2be34cff9a Binary files a/tests/performance-tests/Resources/Images/fire.png and b/tests/performance-tests/Resources/Images/fire.png differ diff --git a/tests/performance-tests/Resources/Images/grossini.png b/tests/performance-tests/Resources/Images/grossini.png old mode 100644 new mode 100755 index 1fab40708373..fad80b8e9af8 Binary files a/tests/performance-tests/Resources/Images/grossini.png and b/tests/performance-tests/Resources/Images/grossini.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_01.png b/tests/performance-tests/Resources/Images/grossini_dance_01.png old mode 100644 new mode 100755 index 368da44b5f5d..93aa6e983ac3 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_01.png and b/tests/performance-tests/Resources/Images/grossini_dance_01.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_02.png b/tests/performance-tests/Resources/Images/grossini_dance_02.png old mode 100644 new mode 100755 index 21a4d58abdf3..bf03d3312c36 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_02.png and b/tests/performance-tests/Resources/Images/grossini_dance_02.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_03.png b/tests/performance-tests/Resources/Images/grossini_dance_03.png old mode 100644 new mode 100755 index 63a57ca5f845..e01c593b40e5 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_03.png and b/tests/performance-tests/Resources/Images/grossini_dance_03.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_04.png b/tests/performance-tests/Resources/Images/grossini_dance_04.png old mode 100644 new mode 100755 index a12fdb5e492d..c9b0ae252940 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_04.png and b/tests/performance-tests/Resources/Images/grossini_dance_04.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_05.png b/tests/performance-tests/Resources/Images/grossini_dance_05.png old mode 100644 new mode 100755 index 109cd343266f..e65e6b2febb3 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_05.png and b/tests/performance-tests/Resources/Images/grossini_dance_05.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_06.png b/tests/performance-tests/Resources/Images/grossini_dance_06.png old mode 100644 new mode 100755 index 94f4de504749..4c3be2334f25 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_06.png and b/tests/performance-tests/Resources/Images/grossini_dance_06.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_07.png b/tests/performance-tests/Resources/Images/grossini_dance_07.png old mode 100644 new mode 100755 index 7e6cba555802..4c38de3a789d Binary files a/tests/performance-tests/Resources/Images/grossini_dance_07.png and b/tests/performance-tests/Resources/Images/grossini_dance_07.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_08.png b/tests/performance-tests/Resources/Images/grossini_dance_08.png old mode 100644 new mode 100755 index 1fab40708373..fad80b8e9af8 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_08.png and b/tests/performance-tests/Resources/Images/grossini_dance_08.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_09.png b/tests/performance-tests/Resources/Images/grossini_dance_09.png old mode 100644 new mode 100755 index b7ac1b7c1c69..b0fa9aded3a3 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_09.png and b/tests/performance-tests/Resources/Images/grossini_dance_09.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_10.png b/tests/performance-tests/Resources/Images/grossini_dance_10.png old mode 100644 new mode 100755 index 580d1aff223a..0abb6eab9397 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_10.png and b/tests/performance-tests/Resources/Images/grossini_dance_10.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_11.png b/tests/performance-tests/Resources/Images/grossini_dance_11.png old mode 100644 new mode 100755 index 27e9ffb91d27..7285fd6c76de Binary files a/tests/performance-tests/Resources/Images/grossini_dance_11.png and b/tests/performance-tests/Resources/Images/grossini_dance_11.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_12.png b/tests/performance-tests/Resources/Images/grossini_dance_12.png old mode 100644 new mode 100755 index 3d66efff8557..ce7d672004da Binary files a/tests/performance-tests/Resources/Images/grossini_dance_12.png and b/tests/performance-tests/Resources/Images/grossini_dance_12.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_13.png b/tests/performance-tests/Resources/Images/grossini_dance_13.png old mode 100644 new mode 100755 index 74757723ff7b..92cbbd4da184 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_13.png and b/tests/performance-tests/Resources/Images/grossini_dance_13.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_14.png b/tests/performance-tests/Resources/Images/grossini_dance_14.png old mode 100644 new mode 100755 index 021bf4fc1f71..ee7d1bba0aea Binary files a/tests/performance-tests/Resources/Images/grossini_dance_14.png and b/tests/performance-tests/Resources/Images/grossini_dance_14.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_dance_atlas.png b/tests/performance-tests/Resources/Images/grossini_dance_atlas.png old mode 100644 new mode 100755 index 7566b3628469..12bca1310fd7 Binary files a/tests/performance-tests/Resources/Images/grossini_dance_atlas.png and b/tests/performance-tests/Resources/Images/grossini_dance_atlas.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_polygon.png b/tests/performance-tests/Resources/Images/grossini_polygon.png index 012846098cf4..b8a9d7fc8a4d 100644 Binary files a/tests/performance-tests/Resources/Images/grossini_polygon.png and b/tests/performance-tests/Resources/Images/grossini_polygon.png differ diff --git a/tests/performance-tests/Resources/Images/grossini_quad.png b/tests/performance-tests/Resources/Images/grossini_quad.png index 2686cfad9be0..7daa0177d93c 100644 Binary files a/tests/performance-tests/Resources/Images/grossini_quad.png and b/tests/performance-tests/Resources/Images/grossini_quad.png differ diff --git a/tests/performance-tests/Resources/Images/grossinis_sister1.png b/tests/performance-tests/Resources/Images/grossinis_sister1.png old mode 100644 new mode 100755 index cb0185cbafac..5be7918a604c Binary files a/tests/performance-tests/Resources/Images/grossinis_sister1.png and b/tests/performance-tests/Resources/Images/grossinis_sister1.png differ diff --git a/tests/performance-tests/Resources/Images/grossinis_sister1_sp.png b/tests/performance-tests/Resources/Images/grossinis_sister1_sp.png index cd2a69282276..62a42c9a9a93 100644 Binary files a/tests/performance-tests/Resources/Images/grossinis_sister1_sp.png and b/tests/performance-tests/Resources/Images/grossinis_sister1_sp.png differ diff --git a/tests/performance-tests/Resources/Images/grossinis_sister2.png b/tests/performance-tests/Resources/Images/grossinis_sister2.png old mode 100644 new mode 100755 index 51d2a5d95212..b25d759a8fbe Binary files a/tests/performance-tests/Resources/Images/grossinis_sister2.png and b/tests/performance-tests/Resources/Images/grossinis_sister2.png differ diff --git a/tests/performance-tests/Resources/Images/grossinis_sister2_sp.png b/tests/performance-tests/Resources/Images/grossinis_sister2_sp.png index e9446d4795dc..30e7f3c02f8d 100644 Binary files a/tests/performance-tests/Resources/Images/grossinis_sister2_sp.png and b/tests/performance-tests/Resources/Images/grossinis_sister2_sp.png differ diff --git a/tests/performance-tests/Resources/Images/landscape-1024x1024.png b/tests/performance-tests/Resources/Images/landscape-1024x1024.png index 25e9ba2d861e..b592a8ba208c 100644 Binary files a/tests/performance-tests/Resources/Images/landscape-1024x1024.png and b/tests/performance-tests/Resources/Images/landscape-1024x1024.png differ diff --git a/tests/performance-tests/Resources/Images/r1.png b/tests/performance-tests/Resources/Images/r1.png old mode 100644 new mode 100755 index ea985ecd5897..96c070883199 Binary files a/tests/performance-tests/Resources/Images/r1.png and b/tests/performance-tests/Resources/Images/r1.png differ diff --git a/tests/performance-tests/Resources/Images/r2.png b/tests/performance-tests/Resources/Images/r2.png old mode 100644 new mode 100755 index 8fcf6fcdfcd0..1caf31f4bd82 Binary files a/tests/performance-tests/Resources/Images/r2.png and b/tests/performance-tests/Resources/Images/r2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-0.png old mode 100644 new mode 100755 index a118259965bf..8256a5299290 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-1.png old mode 100644 new mode 100755 index 4560f08ce271..ea7d815696ba Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-2.png old mode 100644 new mode 100755 index 10e926d6a188..fb444b334845 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-3.png old mode 100644 new mode 100755 index aeedc99268cf..81f6c287b9ff Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-4.png old mode 100644 new mode 100755 index eaf7b8d03858..a0d5ba8621f1 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-5.png old mode 100644 new mode 100755 index 183ecb307371..307968b441f8 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-6.png old mode 100644 new mode 100755 index 1fb3808d56ad..e98bbcd94e25 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-7.png old mode 100644 new mode 100755 index 76c66bc696d6..5c13bee7b5fe Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-0-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-0-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-0.png old mode 100644 new mode 100755 index 11681a558252..55836459810f Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-1.png old mode 100644 new mode 100755 index b46c5177cfbd..665bb8b606fc Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-2.png old mode 100644 new mode 100755 index 3b532bf5c2ae..f73989bc7170 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-3.png old mode 100644 new mode 100755 index ca039392ffa0..92cdc270d936 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-4.png old mode 100644 new mode 100755 index 7f037eb24539..d4c4ff36b10b Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-5.png old mode 100644 new mode 100755 index 097433a80466..95fb8ba7e958 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-6.png old mode 100644 new mode 100755 index 7d04557e6610..b576d2e3e65d Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-7.png old mode 100644 new mode 100755 index f4f751428e85..f0367c971d56 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-1-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-1-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-0.png old mode 100644 new mode 100755 index cb69326b5c7d..71044a10b13a Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-1.png old mode 100644 new mode 100755 index 4b2d616a7b7c..3feb9e940f3c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-2.png old mode 100644 new mode 100755 index a68a28f9f1f9..e7e874043938 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-3.png old mode 100644 new mode 100755 index 652d45549688..6ef5cc5e788b Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-4.png old mode 100644 new mode 100755 index 1f5d4055337e..c6ac17cac89e Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-5.png old mode 100644 new mode 100755 index 5bb402c6675d..d496e3d02795 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-6.png old mode 100644 new mode 100755 index 6bf0002c46c1..066b38a5cf68 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-7.png old mode 100644 new mode 100755 index 9281b02fd650..78c89fc74848 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-2-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-2-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-0.png old mode 100644 new mode 100755 index b013f8d2c08f..230107e65be5 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-1.png old mode 100644 new mode 100755 index 5edf4c6e66a0..ec5990d45159 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-2.png old mode 100644 new mode 100755 index 74d3d08ca349..70b510b38c45 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-3.png old mode 100644 new mode 100755 index 207ab47c05d7..3b7d911e222f Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-4.png old mode 100644 new mode 100755 index 83b1a6802118..8455784e3afe Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-5.png old mode 100644 new mode 100755 index 78ac3f7c7811..2d28698df5e9 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-6.png old mode 100644 new mode 100755 index 9d86d66a51fb..fdc30ee923ff Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-7.png old mode 100644 new mode 100755 index 26f090978952..7dfd55fda38b Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-3-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-3-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-0.png old mode 100644 new mode 100755 index ad514ffddf0b..6bfc144c7e51 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-1.png old mode 100644 new mode 100755 index 8736be3d058c..15d6eb1543d4 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-2.png old mode 100644 new mode 100755 index e306cb367980..32190cb70dca Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-3.png old mode 100644 new mode 100755 index 0d0499f85a16..2e0320578ad3 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-4.png old mode 100644 new mode 100755 index 79524d71a7f7..f0708bb42127 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-5.png old mode 100644 new mode 100755 index fed64254f27d..6c9ec9f39f0c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-6.png old mode 100644 new mode 100755 index 78206badc390..d93f278fd71e Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-7.png old mode 100644 new mode 100755 index 09a5cd518a29..5dce60c7119f Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-4-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-4-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-0.png old mode 100644 new mode 100755 index a14b948929ae..1adff7adeed4 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-1.png old mode 100644 new mode 100755 index e49a31c2034f..c3e56fe1662c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-2.png old mode 100644 new mode 100755 index caf438864fe1..3659a67fe5a8 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-3.png old mode 100644 new mode 100755 index 384419f3d61b..5e771251db39 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-4.png old mode 100644 new mode 100755 index 436eda4a9b48..907c3696c280 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-5.png old mode 100644 new mode 100755 index 03e2d6c640da..a9175a5d0bf8 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-6.png old mode 100644 new mode 100755 index 9d85a52f164d..14bf384a9c1f Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-7.png old mode 100644 new mode 100755 index acf2fb835397..6d3017014732 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-5-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-5-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-0.png old mode 100644 new mode 100755 index 872c43cb7848..11be173003cc Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-1.png old mode 100644 new mode 100755 index 51236b80b782..259b7aed5330 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-2.png old mode 100644 new mode 100755 index 282ea3ac54e4..b9bae9d70331 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-3.png old mode 100644 new mode 100755 index 8724b39e1be3..a84b7b5d0961 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-4.png old mode 100644 new mode 100755 index ccb396293795..5ec22013c41c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-5.png old mode 100644 new mode 100755 index 2cec9196222c..3c07dc5190bc Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-6.png old mode 100644 new mode 100755 index fdb542d78319..de9e1e6b4aad Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-7.png old mode 100644 new mode 100755 index e04b541ab658..0cf0e8fc17bc Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-6-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-6-7.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-0.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-0.png old mode 100644 new mode 100755 index 9b1bd293b1e3..58964c3fd83b Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-0.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-0.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-1.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-1.png old mode 100644 new mode 100755 index 5e73cceb0136..b733b95b4f94 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-1.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-1.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-2.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-2.png old mode 100644 new mode 100755 index 22c2076a2a04..14404fa36b6c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-2.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-2.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-3.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-3.png old mode 100644 new mode 100755 index ff118f4cfba2..1770b6982fb4 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-3.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-3.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-4.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-4.png old mode 100644 new mode 100755 index 219b4b83ec7c..3be136596ed4 Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-4.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-4.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-5.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-5.png old mode 100644 new mode 100755 index 2f0b2f435406..594a7a8a732a Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-5.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-5.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-6.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-6.png old mode 100644 new mode 100755 index 86f934b51324..72a7ff18705a Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-6.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-6.png differ diff --git a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-7.png b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-7.png old mode 100644 new mode 100755 index 732d76602e3f..0287bd77116c Binary files a/tests/performance-tests/Resources/Images/sprites_test/sprite-7-7.png and b/tests/performance-tests/Resources/Images/sprites_test/sprite-7-7.png differ diff --git a/tests/performance-tests/Resources/Images/spritesheet1.png b/tests/performance-tests/Resources/Images/spritesheet1.png old mode 100644 new mode 100755 index 817280bb670b..7ab88aaa4e3b Binary files a/tests/performance-tests/Resources/Images/spritesheet1.png and b/tests/performance-tests/Resources/Images/spritesheet1.png differ diff --git a/tests/performance-tests/Resources/Images/test_image.png b/tests/performance-tests/Resources/Images/test_image.png old mode 100644 new mode 100755 index 53090c7f3ac8..eaf947476415 Binary files a/tests/performance-tests/Resources/Images/test_image.png and b/tests/performance-tests/Resources/Images/test_image.png differ diff --git a/tests/performance-tests/Resources/Images/texture1024x1024.png b/tests/performance-tests/Resources/Images/texture1024x1024.png old mode 100644 new mode 100755 index d7d3a7a4836e..12a15fae99ec Binary files a/tests/performance-tests/Resources/Images/texture1024x1024.png and b/tests/performance-tests/Resources/Images/texture1024x1024.png differ diff --git a/tests/performance-tests/Resources/Images/texture512x512.png b/tests/performance-tests/Resources/Images/texture512x512.png old mode 100644 new mode 100755 index ab5a61f0190a..170c02fd828c Binary files a/tests/performance-tests/Resources/Images/texture512x512.png and b/tests/performance-tests/Resources/Images/texture512x512.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/crate6.png b/tests/performance-tests/Resources/Particle3D/textures/crate6.png index ffdc131dd913..a7b0b0ecb3fe 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/crate6.png and b/tests/performance-tests/Resources/Particle3D/textures/crate6.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/interpolate.png b/tests/performance-tests/Resources/Particle3D/textures/interpolate.png index 367bbe50c15d..29620cdca515 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/interpolate.png and b/tests/performance-tests/Resources/Particle3D/textures/interpolate.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png b/tests/performance-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png index 56d8c9be51be..18d6946ca4a3 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png and b/tests/performance-tests/Resources/Particle3D/textures/mp_fire_02_2x2.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_01.png b/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_01.png index edd21fa5d196..402d821b1404 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_02.png b/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_02.png index 9773c6325757..b5ee14b6cd6e 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_barrel_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_bbal.png b/tests/performance-tests/Resources/Particle3D/textures/pu_bbal.png index 3a64d0a48a4a..7b76a89eb2f4 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_bbal.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_bbal.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_beam_01.png b/tests/performance-tests/Resources/Particle3D/textures/pu_beam_01.png index 9da260f56869..b11f8435def4 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_beam_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_beam_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_beam_02.png b/tests/performance-tests/Resources/Particle3D/textures/pu_beam_02.png index 5563796cb8b8..144fb2b9b28e 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_beam_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_beam_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_circle.png b/tests/performance-tests/Resources/Particle3D/textures/pu_circle.png index 54a35d7dd13d..250f42b99cdc 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_circle.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_circle.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_dirt_256x512.png b/tests/performance-tests/Resources/Particle3D/textures/pu_dirt_256x512.png index 43bfd5189028..7e95b872cb92 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_dirt_256x512.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_dirt_256x512.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png b/tests/performance-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png index 14151b4b8417..0d85ab4e2c53 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_dot_03_64x64.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png b/tests/performance-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png index bbf2486cfbef..f54578862def 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_fire_01_64x64.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_flame.png b/tests/performance-tests/Resources/Particle3D/textures/pu_flame.png index 3f7c1d0e419c..5b92b5e66f33 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_flame.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_flame.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_flare.png b/tests/performance-tests/Resources/Particle3D/textures/pu_flare.png index c146e540e080..4909d7fbf13b 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_flare.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_flare.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png b/tests/performance-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png index 7f7ecaf92519..f2c40269cef9 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_flare_12_256x256.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_green_ball.png b/tests/performance-tests/Resources/Particle3D/textures/pu_green_ball.png index 9b47d090fdc8..bbb484f3f561 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_green_ball.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_green_ball.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_hart.png b/tests/performance-tests/Resources/Particle3D/textures/pu_hart.png index bce6265a3d2a..54a02515dcf9 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_hart.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_hart.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_lightning_20x64.png b/tests/performance-tests/Resources/Particle3D/textures/pu_lightning_20x64.png index d5238f452749..a55a98c146d5 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_lightning_20x64.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_lightning_20x64.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_nucleus.png b/tests/performance-tests/Resources/Particle3D/textures/pu_nucleus.png index aede95e22e3f..0c7bf955e454 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_nucleus.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_nucleus.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_rain.png b/tests/performance-tests/Resources/Particle3D/textures/pu_rain.png index 632735bb6c73..92d77d2bebba 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_rain.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_rain.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_rain_01.png b/tests/performance-tests/Resources/Particle3D/textures/pu_rain_01.png index dcd0aed6de40..fc316b7df4ad 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_rain_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_rain_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_ribbontrail.png b/tests/performance-tests/Resources/Particle3D/textures/pu_ribbontrail.png index e0d45f3ebab0..e6966640c0b6 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_ribbontrail.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_ribbontrail.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_sand_336x330.png b/tests/performance-tests/Resources/Particle3D/textures/pu_sand_336x330.png index 392263824349..ae895594aeb1 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_sand_336x330.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_sand_336x330.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png b/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png index a12d5a51cbdb..d33371658655 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_02_128x128.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png b/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png index 6a1253c8d3b8..9d13cb3c9abe 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png and b/tests/performance-tests/Resources/Particle3D/textures/pu_smoke_brown_336x330.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_atlas_smoke.png b/tests/performance-tests/Resources/Particle3D/textures/pump_atlas_smoke.png index 8bcef1457b28..f946f98f9bdd 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_atlas_smoke.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_atlas_smoke.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_biohazzard.png b/tests/performance-tests/Resources/Particle3D/textures/pump_biohazzard.png index 8b87fb15ecec..091be2f87a79 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_biohazzard.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_biohazzard.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_bubble.png b/tests/performance-tests/Resources/Particle3D/textures/pump_bubble.png index b74c8e39f394..1eec4a3c0667 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_bubble.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_bubble.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_bubble_blurred.png b/tests/performance-tests/Resources/Particle3D/textures/pump_bubble_blurred.png index 20e15e8971b9..a8411139e2ea 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_bubble_blurred.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_bubble_blurred.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_celticknot.png b/tests/performance-tests/Resources/Particle3D/textures/pump_celticknot.png index 4f4bc20e72f3..22c9cd8bbbab 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_celticknot.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_celticknot.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_01.png index 9c6c3678e989..c259757bb071 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_02.png index 354593c07470..9a026c93c108 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_dirt_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_01.png index 2d75c733251a..ed9dc42e1e90 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_02.png index 2e3bacb9bf02..c407c30cbc46 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_03.png index a36aab49f02e..e77d9983d323 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_04.png index f4019eaae99e..592946aa63ea 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flame_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flame_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_01.png index 423731e99e01..a90214bbda43 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_02.png index 69ab2447c83d..8ead0155b234 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_03.png index e082b2a7b43d..1dc469c8e7f3 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_04.png index ccf3d85c9320..868431ec1c77 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_05.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_05.png index 43a74c10fc39..469acc2de7a1 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_05.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_05.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_06.png b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_06.png index 4fdd093f721e..60dadf22be82 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_flare_06.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_flare_06.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_01.png index 06c49a0826e6..5edcb8eebffc 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_02.png index c13bf1f111ee..5473d523a5ef 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_genesis_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_hourglass.png b/tests/performance-tests/Resources/Particle3D/textures/pump_hourglass.png index 332088adff4e..b322dc56cdca 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_hourglass.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_hourglass.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_leave.png b/tests/performance-tests/Resources/Particle3D/textures/pump_leave.png index 50bf6b59b645..1cda97a7dba4 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_leave.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_leave.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_01.png index 4d71749a056b..a48297ddae0d 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_02.png index 54771348fd29..a9dd25c2f77a 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_03.png index cc9598d78f7f..095c1194a589 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_04.png index 28af9efbe793..01f9f07bbbd0 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_lightning_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png b/tests/performance-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png index e30005a7d690..81010780e47c 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_mcdxiiiv.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_metal_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_metal_01.png index 9b004bf4d3c7..d77658644435 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_metal_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_metal_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_metal_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_metal_02.png index 037a66129f10..e98fcad67394 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_metal_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_metal_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_mmviii.png b/tests/performance-tests/Resources/Particle3D/textures/pump_mmviii.png index a093b1dc3a79..5cf2fa9153cc 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_mmviii.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_mmviii.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_01.png index df55ce3254e0..836830d7c75c 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_02.png index 0723eaec7234..49ddcbc954d3 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_pentagram_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_01.png index 24fe5e9386a6..e52ae2032c41 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_02.png index 8e11e1f06b46..c3c54817eb9c 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_03.png index 1d8da62ba896..812453c62519 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_04.png index 9a6d54ed2718..871a3191ff1a 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_05.png b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_05.png index b94d220e1d37..f0deb8434e76 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_ring_05.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_ring_05.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_01.png index 2bbc43e07903..3e2735a056a3 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_02.png index fc8970c31919..0313fadf602e 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_03.png index 167f71da5fab..cd0d92f68b5f 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_04.png index 996b23101cdb..41bc91bf0888 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_05.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_05.png index da88a4214098..b70942aebb6f 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_05.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_05.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_06.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_06.png index c3a1bad370d4..6a23466c31c8 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_06.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_06.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_07.png b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_07.png index 437b9837e766..6a05665f746e 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_07.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_smoke_07.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_snow_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_snow_01.png index a40b775fe29e..95c414e01820 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_snow_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_snow_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_spark_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_spark_01.png index 725b27018790..2e826d60f43a 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_spark_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_spark_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_star_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_star_01.png index 21accd59c687..20b4a915f537 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_star_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_star_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_star_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_star_02.png index d71f015cf345..2ab43259b700 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_star_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_star_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_star_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_star_03.png index d3625f3799a8..21a5d4eb6918 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_star_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_star_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_star_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_star_04.png index f55ed4065698..8864c5b5e173 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_star_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_star_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_star_05.png b/tests/performance-tests/Resources/Particle3D/textures/pump_star_05.png index 8d12369a29bb..34dbd49c40b0 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_star_05.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_star_05.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_01.png index 24c41f881e52..5b2ce2ef20eb 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_02.png index 1c1b0f71a41e..893c42189015 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_03.png index 510f95e694bc..a9cd103b402e 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_04.png b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_04.png index a266795fe863..cf0d7c79fedb 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_streak_04.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_streak_04.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_01.png b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_01.png index 9608c01a7e91..418137432e43 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_01.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_01.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_02.png b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_02.png index ddef5d5cb43b..1825ba5dcc41 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_02.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_02.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_03.png b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_03.png index 8d88a9a9a851..35b8463fcf43 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_03.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_swirl_03.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/pump_watch.png b/tests/performance-tests/Resources/Particle3D/textures/pump_watch.png index 2acac9b88644..038fc737d4f3 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/pump_watch.png and b/tests/performance-tests/Resources/Particle3D/textures/pump_watch.png differ diff --git a/tests/performance-tests/Resources/Particle3D/textures/weaponTrail.png b/tests/performance-tests/Resources/Particle3D/textures/weaponTrail.png index 2b471d3b9d19..4fadb7e89f1a 100644 Binary files a/tests/performance-tests/Resources/Particle3D/textures/weaponTrail.png and b/tests/performance-tests/Resources/Particle3D/textures/weaponTrail.png differ diff --git a/tests/performance-tests/Resources/TileMaps/iso-test.png b/tests/performance-tests/Resources/TileMaps/iso-test.png old mode 100644 new mode 100755 index 4b4b88106d7e..00e694810e99 Binary files a/tests/performance-tests/Resources/TileMaps/iso-test.png and b/tests/performance-tests/Resources/TileMaps/iso-test.png differ diff --git a/tests/performance-tests/Resources/TileMaps/iso-test2.png b/tests/performance-tests/Resources/TileMaps/iso-test2.png old mode 100644 new mode 100755 index 5ffde202cbb0..8668e0fe20c1 Binary files a/tests/performance-tests/Resources/TileMaps/iso-test2.png and b/tests/performance-tests/Resources/TileMaps/iso-test2.png differ diff --git a/tests/performance-tests/Resources/fonts/bitmapFontTest3.png b/tests/performance-tests/Resources/fonts/bitmapFontTest3.png old mode 100644 new mode 100755 index 570b8138e42e..d19379f5e776 Binary files a/tests/performance-tests/Resources/fonts/bitmapFontTest3.png and b/tests/performance-tests/Resources/fonts/bitmapFontTest3.png differ diff --git a/tests/performance-tests/Resources/fps_images.png b/tests/performance-tests/Resources/fps_images.png index 6ab40e0a64b9..c7449025bf10 100644 Binary files a/tests/performance-tests/Resources/fps_images.png and b/tests/performance-tests/Resources/fps_images.png differ diff --git a/tests/performance-tests/proj.android/app/AndroidManifest.xml b/tests/performance-tests/proj.android/app/AndroidManifest.xml index 1102ae0b3dc0..8102d060dc07 100644 --- a/tests/performance-tests/proj.android/app/AndroidManifest.xml +++ b/tests/performance-tests/proj.android/app/AndroidManifest.xml @@ -6,6 +6,7 @@ diff --git a/tests/performance-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/tests/performance-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png index cd0c7c33c806..45ee51d15f96 100644 Binary files a/tests/performance-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png and b/tests/performance-tests/proj.android/app/res/mipmap-hdpi/ic_launcher.png differ diff --git a/tests/performance-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/tests/performance-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png index 465779ca4d10..0dd2a608998e 100644 Binary files a/tests/performance-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png and b/tests/performance-tests/proj.android/app/res/mipmap-mdpi/ic_launcher.png differ diff --git a/tests/performance-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/tests/performance-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png index 292c6c4ae4c9..a32f16f930b3 100644 Binary files a/tests/performance-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and b/tests/performance-tests/proj.android/app/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/tests/performance-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/tests/performance-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png index 081feababd55..332f268edc46 100644 Binary files a/tests/performance-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and b/tests/performance-tests/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/tests/performance-tests/proj.android/settings.gradle b/tests/performance-tests/proj.android/settings.gradle index 9261b5b19a3e..01cf7ba1af9a 100644 --- a/tests/performance-tests/proj.android/settings.gradle +++ b/tests/performance-tests/proj.android/settings.gradle @@ -2,3 +2,4 @@ include ':libcocos2dx' project(':libcocos2dx').projectDir = new File(settingsDir, '../../../cocos/platform/android/libcocos2dx') include ':performance-tests' project(':performance-tests').projectDir = new File(settingsDir, 'app') +rootProject.name = "performance-tests" diff --git a/tests/performance-tests/proj.ios/Default-568h@2x.png b/tests/performance-tests/proj.ios/Default-568h@2x.png index 53e7f7a60f5f..66c6d1cead37 100644 Binary files a/tests/performance-tests/proj.ios/Default-568h@2x.png and b/tests/performance-tests/proj.ios/Default-568h@2x.png differ diff --git a/tests/performance-tests/proj.ios/Default-667h@2x.png b/tests/performance-tests/proj.ios/Default-667h@2x.png index 39a55be13068..a0f61ec8e639 100644 Binary files a/tests/performance-tests/proj.ios/Default-667h@2x.png and b/tests/performance-tests/proj.ios/Default-667h@2x.png differ diff --git a/tests/performance-tests/proj.ios/Default-736h@3x.png b/tests/performance-tests/proj.ios/Default-736h@3x.png index f1ee6557ce14..dadccee68624 100644 Binary files a/tests/performance-tests/proj.ios/Default-736h@3x.png and b/tests/performance-tests/proj.ios/Default-736h@3x.png differ diff --git a/tests/performance-tests/proj.ios/Default.png b/tests/performance-tests/proj.ios/Default.png index ca2c61641521..dcb80725de2a 100644 Binary files a/tests/performance-tests/proj.ios/Default.png and b/tests/performance-tests/proj.ios/Default.png differ diff --git a/tests/performance-tests/proj.ios/Default@2x.png b/tests/performance-tests/proj.ios/Default@2x.png index 4e996dab6493..84689888a14a 100644 Binary files a/tests/performance-tests/proj.ios/Default@2x.png and b/tests/performance-tests/proj.ios/Default@2x.png differ diff --git a/tests/performance-tests/proj.ios/Icon-100.png b/tests/performance-tests/proj.ios/Icon-100.png index c2f17d59cc14..ef38d4500a80 100644 Binary files a/tests/performance-tests/proj.ios/Icon-100.png and b/tests/performance-tests/proj.ios/Icon-100.png differ diff --git a/tests/performance-tests/proj.ios/Icon-114.png b/tests/performance-tests/proj.ios/Icon-114.png index b3539af0a2d3..c3807861ad29 100644 Binary files a/tests/performance-tests/proj.ios/Icon-114.png and b/tests/performance-tests/proj.ios/Icon-114.png differ diff --git a/tests/performance-tests/proj.ios/Icon-120.png b/tests/performance-tests/proj.ios/Icon-120.png index 5a359573c85b..a5b49ccbb199 100644 Binary files a/tests/performance-tests/proj.ios/Icon-120.png and b/tests/performance-tests/proj.ios/Icon-120.png differ diff --git a/tests/performance-tests/proj.ios/Icon-144.png b/tests/performance-tests/proj.ios/Icon-144.png index 8a471ffcd7a0..1526615c02d1 100644 Binary files a/tests/performance-tests/proj.ios/Icon-144.png and b/tests/performance-tests/proj.ios/Icon-144.png differ diff --git a/tests/performance-tests/proj.ios/Icon-152.png b/tests/performance-tests/proj.ios/Icon-152.png index a76648b10c98..8aa82506d0d1 100644 Binary files a/tests/performance-tests/proj.ios/Icon-152.png and b/tests/performance-tests/proj.ios/Icon-152.png differ diff --git a/tests/performance-tests/proj.ios/Icon-29.png b/tests/performance-tests/proj.ios/Icon-29.png index 0ec72eb7331b..0500184c869c 100644 Binary files a/tests/performance-tests/proj.ios/Icon-29.png and b/tests/performance-tests/proj.ios/Icon-29.png differ diff --git a/tests/performance-tests/proj.ios/Icon-40.png b/tests/performance-tests/proj.ios/Icon-40.png index 1a739c28d874..775685daca94 100644 Binary files a/tests/performance-tests/proj.ios/Icon-40.png and b/tests/performance-tests/proj.ios/Icon-40.png differ diff --git a/tests/performance-tests/proj.ios/Icon-50.png b/tests/performance-tests/proj.ios/Icon-50.png index aa19bead4e9b..ac381bc20e85 100644 Binary files a/tests/performance-tests/proj.ios/Icon-50.png and b/tests/performance-tests/proj.ios/Icon-50.png differ diff --git a/tests/performance-tests/proj.ios/Icon-57.png b/tests/performance-tests/proj.ios/Icon-57.png index efd2c898782c..4fcc6fddffe1 100644 Binary files a/tests/performance-tests/proj.ios/Icon-57.png and b/tests/performance-tests/proj.ios/Icon-57.png differ diff --git a/tests/performance-tests/proj.ios/Icon-58.png b/tests/performance-tests/proj.ios/Icon-58.png index f7be6849c135..f0f8b7fe9833 100644 Binary files a/tests/performance-tests/proj.ios/Icon-58.png and b/tests/performance-tests/proj.ios/Icon-58.png differ diff --git a/tests/performance-tests/proj.ios/Icon-72.png b/tests/performance-tests/proj.ios/Icon-72.png index 79dc8d2635ce..2c573c8df4c3 100644 Binary files a/tests/performance-tests/proj.ios/Icon-72.png and b/tests/performance-tests/proj.ios/Icon-72.png differ diff --git a/tests/performance-tests/proj.ios/Icon-76.png b/tests/performance-tests/proj.ios/Icon-76.png index d5f191fa8e53..8a1fa1850c03 100644 Binary files a/tests/performance-tests/proj.ios/Icon-76.png and b/tests/performance-tests/proj.ios/Icon-76.png differ diff --git a/tests/performance-tests/proj.ios/Icon-80.png b/tests/performance-tests/proj.ios/Icon-80.png index 0f434e31dde9..d9c7ab446bb7 100644 Binary files a/tests/performance-tests/proj.ios/Icon-80.png and b/tests/performance-tests/proj.ios/Icon-80.png differ diff --git a/tests/performance-tests/proj.win32/performance-tests.vcxproj b/tests/performance-tests/proj.win32/performance-tests.vcxproj index d2b36e9e9dba..913a93749ec6 100644 --- a/tests/performance-tests/proj.win32/performance-tests.vcxproj +++ b/tests/performance-tests/proj.win32/performance-tests.vcxproj @@ -14,6 +14,7 @@ {2778C02D-DDD0-4A92-A6AA-C3E2B7EDE3FF} test_win32 Win32Proj + 10.0.17134.0 @@ -107,7 +108,7 @@ if not exist "$(OutDir)" mkdir "$(OutDir)" -xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y +xcopy "$(ProjectDir)..\Resources" "$(OutDir)\Resources\" /D /E /I /F /Y $(TargetName).cab $(TargetFileName) diff --git a/tools/appveyor-scripts/before-build.ps1 b/tools/appveyor-scripts/before-build.ps1 index 4f9b5c46c559..728fc00a727d 100644 --- a/tools/appveyor-scripts/before-build.ps1 +++ b/tools/appveyor-scripts/before-build.ps1 @@ -40,10 +40,15 @@ Download-Deps & python -m pip install retry -If ($env:build_type -eq "windows32") { +# don't need generate binding codes for cpp only target +If ($env:build_type -ne "android_cpp_tests") { & $python -u .\tools\appveyor-scripts\setup_android.py --ndk_only Generate-Binding-Codes -} elseif ($env:build_type -like "android*") { +} + +If ($env:build_type -like "android*") { + & choco install ninja + & ninja --version & $python -u .\tools\appveyor-scripts\setup_android.py if ($lastexitcode -ne 0) {throw} } \ No newline at end of file diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 14f9fd26c3a1..643f423415c6 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 14f9fd26c3a17cf81dd147ced8a9c5fcd6582d0b +Subproject commit 643f423415c62a1b610549323c4bf5499683baab diff --git a/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk b/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk index 6dcdd68a3102..b5e145525e87 100644 --- a/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk +++ b/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := cocos2dlua_shared -LOCAL_MODULE_FILENAME := libcclua +LOCAL_MODULE_FILENAME := libcocos2dlua LOCAL_ARM_MODE := arm diff --git a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png old mode 100644 new mode 100755 index 05d307bf352d..8aa4767c2fbf Binary files a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png and b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png old mode 100644 new mode 100755 index c9a1d06eca6e..17ce11a0856b Binary files a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png and b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png old mode 100644 new mode 100755 index bd7a87ac42e0..3780aac46c76 Binary files a/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png and b/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png old mode 100644 new mode 100755 index ccfc3fa9b651..66c6d1cead37 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png old mode 100644 new mode 100755 index fbed34a3223a..a0f61ec8e639 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png old mode 100644 new mode 100755 index 93bdb7220920..dadccee68624 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png old mode 100644 new mode 100755 index cb58a0e2708d..dcb80725de2a Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png old mode 100644 new mode 100755 index bda7cb9b72d2..84689888a14a Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png old mode 100644 new mode 100755 index e6da566e36f6..ef38d4500a80 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png old mode 100644 new mode 100755 index 78961c7b04cb..c3807861ad29 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png old mode 100644 new mode 100755 index a9385cc90390..a5b49ccbb199 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png old mode 100644 new mode 100755 index d75d43f9df3e..1526615c02d1 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png old mode 100644 new mode 100755 index ebecbfc0f417..8aa82506d0d1 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png old mode 100644 new mode 100755 index 74129df4a194..0500184c869c Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png old mode 100644 new mode 100755 index d5a1aabb4b16..775685daca94 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png old mode 100644 new mode 100755 index 590028981f4a..ac381bc20e85 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png old mode 100644 new mode 100755 index c70c2fb4a046..4fcc6fddffe1 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png old mode 100644 new mode 100755 index 5a8e3bff7599..f0f8b7fe9833 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png old mode 100644 new mode 100755 index f75a7556f026..2c573c8df4c3 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png old mode 100644 new mode 100755 index 093540a3942b..8a1fa1850c03 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png differ diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png old mode 100644 new mode 100755 index cec227f48b51..d9c7ab446bb7 Binary files a/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png and b/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png differ diff --git a/tools/simulator/libsimulator/CMakeLists.txt b/tools/simulator/libsimulator/CMakeLists.txt index f801663973f2..a9c0be0573df 100644 --- a/tools/simulator/libsimulator/CMakeLists.txt +++ b/tools/simulator/libsimulator/CMakeLists.txt @@ -24,16 +24,7 @@ set(SIMULATOR_LIB_PATH ${COCOS2DX_ROOT_PATH}/tools/simulator/libsimulator/lib) -if(MACOSX) - # add define for mac os GLFW_EXPOSE_NATIVE_NSGL - add_definitions(-DGLFW_EXPOSE_NATIVE_NSGL) -elseif(WINDOWS) - add_definitions(-DUNICODE -D_UNICODE) - add_definitions(-D_USRLIBSIMSTATIC -DGLFW_EXPOSE_NATIVE_WIN32 -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS) - include_directories(${SIMULATOR_LIB_PATH}/../proj.win32) -endif() - -if(WIN32) +if(WINDOWS) set(PLATFORM_HEADER ${SIMULATOR_LIB_PATH}/../proj.win32/stdafx.h ${SIMULATOR_LIB_PATH}/../proj.win32/targetver.h @@ -189,23 +180,31 @@ set(SIMULATOR_SOURCE ${PLATFORM_SOURCE} ) -include_directories( - ${SIMULATOR_LIB_PATH} - ${SIMULATOR_LIB_PATH}/platform/${PLATFORM_FOLDER} - ${SIMULATOR_LIB_PATH}/protobuf-lite - ${SIMULATOR_LIB_PATH}/runtime - ${COCOS2DX_ROOT_PATH}/cocos/editor-support -) set(LIB_SOURCE ${SIMULATOR_SOURCE} ${SIMULATOR_HEADER}) -add_library(simulator STATIC - ${LIB_SOURCE} - ) +add_library(simulatorlib STATIC ${LIB_SOURCE}) +target_link_libraries(simulatorlib cocos2d) + +if(WINDOWS) + target_compile_definitions(simulatorlib + PUBLIC _USRLIBSIMSTATIC + PRIVATE _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + ) + target_include_directories(simulatorlib + PRIVATE ${SIMULATOR_LIB_PATH}/../proj.win32 + ) +endif() -target_use_simulator_depend_libs(simulator) +target_include_directories(simulatorlib + PRIVATE ${SIMULATOR_LIB_PATH} + PRIVATE ${SIMULATOR_LIB_PATH}/platform/${PLATFORM_FOLDER} + PRIVATE ${SIMULATOR_LIB_PATH}/protobuf-lite + PRIVATE ${SIMULATOR_LIB_PATH}/runtime + PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/editor-support +) -set_target_properties(simulator +set_target_properties(simulatorlib PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" @@ -213,5 +212,5 @@ set_target_properties(simulator ) if(XCODE OR VS) - cocos_mark_code_files("simulator") + cocos_mark_code_files("simulatorlib") endif() diff --git a/tools/simulator/libsimulator/lib/platform/mac/PlayerFileDialogServiceMac.mm b/tools/simulator/libsimulator/lib/platform/mac/PlayerFileDialogServiceMac.mm index ae8ab1a96064..e8332415753d 100644 --- a/tools/simulator/libsimulator/lib/platform/mac/PlayerFileDialogServiceMac.mm +++ b/tools/simulator/libsimulator/lib/platform/mac/PlayerFileDialogServiceMac.mm @@ -25,6 +25,14 @@ of this software and associated documentation files (the "Software"), to deal #import #include "PlayerFileDialogServiceMac.h" +#ifndef GLFW_EXPOSE_NATIVE_NSGL +#define GLFW_EXPOSE_NATIVE_NSGL +#endif +#ifndef GLFW_EXPOSE_NATIVE_COCOA +#define GLFW_EXPOSE_NATIVE_COCOA +#endif +// (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + #include "glfw3.h" #include "glfw3native.h" diff --git a/tools/simulator/libsimulator/lib/platform/win32/SimulatorWin.cpp b/tools/simulator/libsimulator/lib/platform/win32/SimulatorWin.cpp index a2b7613cac3c..1b15000c6fc8 100644 --- a/tools/simulator/libsimulator/lib/platform/win32/SimulatorWin.cpp +++ b/tools/simulator/libsimulator/lib/platform/win32/SimulatorWin.cpp @@ -43,6 +43,14 @@ #include "SimulatorWin.h" +#ifndef GLFW_EXPOSE_NATIVE_WIN32 +#define GLFW_EXPOSE_NATIVE_WIN32 +#endif +#ifndef GLFW_EXPOSE_NATIVE_WGL +#define GLFW_EXPOSE_NATIVE_WGL +#endif +/* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ + #include "glfw3.h" #include "glfw3native.h" diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index f30d5c3f38e1..b8abd930f2bd 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -7,11 +7,11 @@ prefix = cocos2dx # all classes will be embedded in that namespace target_namespace = cc -android_headers = +android_headers = android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include -clang_headers = +clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/external @@ -114,6 +114,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS RenderTexture::[listenToBackground listenToForeground], TMXTiledMap::[getPropertiesForGID], EventCustom::[getUserData setUserData], + EventDispatcher::[addCustomEventListener], Component::[serialize], Console::[addCommand addSubCommand getSubCommand delSubCommand getCommand], ParallaxNode::[(s|g)etParallaxArray], diff --git a/tools/travis-scripts/before-install.sh b/tools/travis-scripts/before-install.sh index 393d4e8ea310..d0c2ee71d9d2 100755 --- a/tools/travis-scripts/before-install.sh +++ b/tools/travis-scripts/before-install.sh @@ -11,9 +11,9 @@ CURL="curl --retry 999 --retry-max-time 0" function install_android_ndk() { sudo python -m pip install retry - if [ "$BUILD_TARGET" == "android_ndk-build" ]\ + if [ "$BUILD_TARGET" == "android_cpp_ndk-build" ]\ || [ "$BUILD_TARGET" == "android_lua_ndk-build" ]\ - || [ "$BUILD_TARGET" == "android_cmake" ]\ + || [ "$BUILD_TARGET" == "android_cpp_cmake" ]\ || [ "$BUILD_TARGET" == "android_js_cmake" ]\ || [ "$BUILD_TARGET" == "android_lua_cmake" ] ; then python $COCOS2DX_ROOT/tools/appveyor-scripts/setup_android.py @@ -24,37 +24,6 @@ function install_android_ndk() function install_linux_environment() { - mkdir -p $HOME/bin - pushd $HOME/bin - - echo "GCC version: `gcc --version`" - # install new version cmake - CMAKE_VERSION="3.7.2" - CMAKE_DOWNLOAD_URL="https://cmake.org/files/v3.7/cmake-${CMAKE_VERSION}.tar.gz" - echo "Download ${CMAKE_DOWNLOAD_URL}" - ${CURL} -O ${CMAKE_DOWNLOAD_URL} - tar -zxf "cmake-${CMAKE_VERSION}.tar.gz" - cd "cmake-${CMAKE_VERSION}" - ./configure > /dev/null - make -j2 > /dev/null - sudo make install > /dev/null - echo "CMake Version: `cmake --version`" - cd .. - - # install new version binutils - BINUTILS_VERSION="2.27" - BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.gz" - echo "Download ${BINUTILS_URL}" - ${CURL} -O ${BINUTILS_URL} - tar -zxf "binutils-${BINUTILS_VERSION}.tar.gz" - cd "binutils-${BINUTILS_VERSION}" - ./configure > /dev/null - make -j2 > /dev/null - sudo make install > /dev/null - echo "ld Version: `ld --version`" - echo "which ld: `which ld`" - sudo rm /usr/bin/ld - popd echo "Installing linux dependence packages ..." echo -e "y" | bash $COCOS2DX_ROOT/build/install-deps-linux.sh echo "Installing linux dependence packages finished!" @@ -90,6 +59,9 @@ function install_environement_for_pull_request() echo "Building pull request ..." if [ "$TRAVIS_OS_NAME" == "linux" ]; then + sudo apt-get update + sudo apt-get install ninja-build + ninja --version if [ "$BUILD_TARGET" == "linux" ]; then install_linux_environment fi @@ -118,16 +90,22 @@ function install_environement_for_after_merge() download_deps } -if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then +if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then + sudo apt-get update + sudo apt-get install ninja-build + ninja --version download_deps sudo python -m pip install retry python $COCOS2DX_ROOT/tools/appveyor-scripts/setup_android.py exit 0 fi -if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then +if [ "$BUILD_TARGET" == "linux_cocos_new_lua_test" ]; then download_deps install_linux_environment + sudo python -m pip install retry + # set android ndk environment by setup_android.py + python $COCOS2DX_ROOT/tools/appveyor-scripts/setup_android.py --ndk_only exit 0 fi diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index 366cd65bfd6e..2505b4525344 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -29,14 +29,12 @@ function do_retry() function build_linux() { - CPU_CORES=`grep -c ^processor /proc/cpuinfo` echo "Building tests ..." cd $COCOS2DX_ROOT/build mkdir -p linux-build cd linux-build cmake ../.. - echo "cpu cores: ${CPU_CORES}" - make -j${CPU_CORES} VERBOSE=1 + cmake --build . } function build_mac() @@ -96,7 +94,7 @@ function build_ios_cmake() exit 0 } -function build_android_ndk-build() +function build_android_cpp_ndk-build() { # Build all samples echo "Building Android samples ..." @@ -119,7 +117,7 @@ function build_android_ndk-build() # popd } -function build_android_cmake() +function build_android_cpp_cmake() { # Build all samples echo "Building Android samples ..." @@ -287,48 +285,59 @@ function generate_pull_request_for_binding_codes_and_cocosfiles() function run_pull_request() { - echo "Building pull request ..." - - # need to generate binding codes for all targets - genernate_binding_codes - # linux if [ $BUILD_TARGET == 'linux' ]; then + genernate_binding_codes build_linux fi # android - if [ $BUILD_TARGET == 'android_ndk-build' ]; then - build_android_ndk-build + if [ $BUILD_TARGET == 'android_cpp_ndk-build' ]; then + build_android_cpp_ndk-build fi # android - if [ $BUILD_TARGET == 'android_cmake' ]; then - build_android_cmake + if [ $BUILD_TARGET == 'android_cpp_cmake' ]; then + build_android_cpp_cmake fi # android_lua if [ $BUILD_TARGET == 'android_lua_ndk-build' ]; then + genernate_binding_codes build_android_lua_ndk-build fi # android_lua if [ $BUILD_TARGET == 'android_lua_cmake' ]; then + genernate_binding_codes build_android_lua_cmake fi # android_js if [ $BUILD_TARGET == 'android_js_cmake' ]; then + genernate_binding_codes build_android_js_cmake fi if [ $BUILD_TARGET == 'mac' ]; then + genernate_binding_codes build_mac fi if [ $BUILD_TARGET == 'ios' ]; then + genernate_binding_codes build_ios fi + + if [ $BUILD_TARGET == 'mac_cmake' ]; then + genernate_binding_codes + build_mac_cmake + fi + + if [ $BUILD_TARGET == 'ios_cmake' ]; then + genernate_binding_codes + build_ios_cmake + fi } function run_after_merge() @@ -358,7 +367,10 @@ function run_after_merge() # build pull request if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then + + echo "Building pull request ..." + + if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then source ../environment.sh pushd $COCOS2DX_ROOT update_cocos_files @@ -370,28 +382,19 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0 fi - if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then + if [ "$BUILD_TARGET" == "linux_cocos_new_lua_test" ]; then + genernate_binding_codes pushd $COCOS2DX_ROOT update_cocos_files python -u tools/cocos2d-console/bin/cocos.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test popd - CPU_CORES=`grep -c ^processor /proc/cpuinfo` + echo "Building tests ..." cd $COCOS2DX_ROOT/cocos_new_test mkdir -p linux-build cd linux-build cmake .. - echo "cpu cores: ${CPU_CORES}" - make -j${CPU_CORES} VERBOSE=1 - exit 0 - fi - if [ $BUILD_TARGET == 'mac_cmake' ]; then - build_mac_cmake - exit 0 - fi - - if [ $BUILD_TARGET == 'ios_cmake' ]; then - build_ios_cmake + cmake --build . exit 0 fi