diff --git a/CMakeLists.txt b/CMakeLists.txt index 9de383f74f..cc96a0d6fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,9 +76,4 @@ if(AX_BUILD_TESTS) add_subdirectory(${AXIS_ROOT_PATH}/tests/lua-tests/project ${ENGINE_BINARY_PATH}/tests/lua-test) endif(AX_ENABLE_EXT_LUA) -endif() - -if(AX_BUILD_EXAMPLES) - # add examples/SimpleSnake into project(axis) for tmp example - add_subdirectory(${AXIS_ROOT_PATH}/examples/SimpleSnake ${ENGINE_BINARY_PATH}/examples/SimpleSnake) -endif() +endif() \ No newline at end of file diff --git a/examples/SimpleSnake/CMakeLists.txt b/examples/SimpleSnake/CMakeLists.txt deleted file mode 100644 index d7f43ca751..0000000000 --- a/examples/SimpleSnake/CMakeLists.txt +++ /dev/null @@ -1,203 +0,0 @@ -#/**************************************************************************** -# Copyright (c) 2013-2014 cocos2d-x.org -# Copyright (c) 2021-2022 Bytedance Inc. -# -# https://axis-project.github.io -# -# 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. -# ****************************************************************************/ - -cmake_minimum_required(VERSION 3.10) - -set(APP_NAME SimpleSnake) - -project(${APP_NAME}) - -if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project - if(XCODE) - set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) - endif() - - # config quick starter batch script run.bat for windows - if(WIN32) - file(RELATIVE_PATH CMAKE_BUILD_RELATIVE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/run.bat.in" "${CMAKE_CURRENT_SOURCE_DIR}/run.bat" @ONLY) - endif() - - set(AXIS_ROOT "$ENV{AXIS_ROOT}") - - if(NOT (AXIS_ROOT STREQUAL "")) - set(AXIS_ROOT_PATH "${AXIS_ROOT}") - file(TO_CMAKE_PATH ${AXIS_ROOT_PATH} AXIS_ROOT_PATH) # string(REPLACE "\\" "/" AXIS_ROOT_PATH ${AXIS_ROOT_PATH}) - message(STATUS "Using system env var AXIS_ROOT=${AXIS_ROOT}") - else() - message(FATAL_ERROR "Please run setup.py add system env var 'AXIS_ROOT' to specific the engine root") - endif() - - set(CMAKE_MODULE_PATH ${AXIS_ROOT_PATH}/cmake/Modules/) - - include(AxisBuildSet) - set(_AX_USE_PREBUILT FALSE) - if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${AXIS_ROOT_PATH}/${AX_PREBUILT_DIR}) - set(_AX_USE_PREBUILT TRUE) - endif() - - if (NOT _AX_USE_PREBUILT) - add_subdirectory(${AXIS_ROOT_PATH}/core ${ENGINE_BINARY_PATH}/axis/core) - endif() -endif() - -# record sources, headers, resources... -set(GAME_SOURCE) -set(GAME_HEADER) - -set(GAME_RES_FOLDER - "${CMAKE_CURRENT_SOURCE_DIR}/Resources" - ) -if(APPLE OR WINDOWS) - cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER}) -endif() - -# add cross-platforms source files and header files -list(APPEND GAME_SOURCE - Classes/AppDelegate.cpp - Classes/SimpleSnakeScene.cpp - ) -list(APPEND GAME_HEADER - Classes/AppDelegate.h - Classes/SimpleSnakeScene.h - ) - -if(ANDROID) - # the APP_NAME should match on AndroidManifest.xml - list(APPEND GAME_SOURCE - proj.android/app/jni/hellocpp/main.cpp - ) -elseif(LINUX) - list(APPEND GAME_SOURCE - proj.linux/main.cpp - ) -elseif(WINDOWS) - list(APPEND GAME_HEADER - proj.win32/main.h - proj.win32/resource.h - ) - list(APPEND GAME_SOURCE - proj.win32/main.cpp - proj.win32/game.rc - ${common_res_files} - ) -elseif(APPLE) - if(IOS) - list(APPEND GAME_HEADER - proj.ios_mac/ios/AppController.h - proj.ios_mac/ios/RootViewController.h - ) - set(APP_UI_RES - proj.ios_mac/ios/LaunchScreen.storyboard - proj.ios_mac/ios/LaunchScreenBackground.png - proj.ios_mac/ios/Images.xcassets - ) - list(APPEND GAME_SOURCE - proj.ios_mac/ios/main.m - proj.ios_mac/ios/AppController.mm - proj.ios_mac/ios/RootViewController.mm - proj.ios_mac/ios/Prefix.pch - ${APP_UI_RES} - ) - elseif(MACOSX) - set(APP_UI_RES - proj.ios_mac/mac/Icon.icns - proj.ios_mac/mac/Info.plist - ) - list(APPEND GAME_SOURCE - proj.ios_mac/mac/main.cpp - proj.ios_mac/mac/Prefix.pch - ${APP_UI_RES} - ) - endif() - list(APPEND GAME_SOURCE ${common_res_files}) -endif() - -# mark app complie info and libs info -set(all_code_files - ${GAME_HEADER} - ${GAME_SOURCE} - ) -if(NOT ANDROID) - add_executable(${APP_NAME} ${all_code_files}) -else() - add_library(${APP_NAME} SHARED ${all_code_files}) - # whole archive for jni - add_subdirectory(${AXIS_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform) - target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) - config_android_shared_libs("org.cocos2dx.lib" "${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/src") -endif() - -if (NOT _AX_USE_PREBUILT) - target_link_libraries(${APP_NAME} ${AXIS_CORE_LIB}) -endif() - -target_include_directories(${APP_NAME} - PRIVATE Classes - PRIVATE ${AXIS_ROOT_PATH}/core/audio -) - -# mark app resources -setup_cocos_app_config(${APP_NAME}) -if(APPLE) - set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}") - set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)") - set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "org.axis.hellocpp") - - if(MACOSX) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist") - elseif(IOS) - set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist") - set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") - endif() - - # For code-signing, set the DEVELOPMENT_TEAM: - #set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9") -elseif(WINDOWS) - if(NOT _AX_USE_PREBUILT) - cocos_copy_target_dll(${APP_NAME}) - endif() -endif() - -if((WINDOWS AND (CMAKE_GENERATOR STREQUAL "Ninja")) OR LINUX) - cocos_get_resource_path(APP_RES_DIR ${APP_NAME}) - cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) -elseif(WINDOWS) - set_property(TARGET ${APP_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${GAME_RES_FOLDER}") - if(NOT DEFINED BUILD_ENGINE_DONE) - set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME}) - endif() -endif() - -# The optional thirdparties(not dependent by engine) -if (AX_WITH_YAML_CPP) - target_include_directories(${APP_NAME} PRIVATE ${AXIS_ROOT_PATH}/thirdparty/yaml-cpp/include) - target_link_libraries(${APP_NAME} yaml-cpp) -endif() - -if (_AX_USE_PREBUILT) # support windows only - include(${AXIS_ROOT_PATH}/cmake/Modules/AxisLinkHelpers.cmake) - axis_link_cxx_prebuilt(${APP_NAME} ${AXIS_ROOT_PATH} ${AX_PREBUILT_DIR}) -endif() diff --git a/examples/SimpleSnake/Classes/AppDelegate.cpp b/examples/SimpleSnake/Classes/AppDelegate.cpp deleted file mode 100644 index cbc3f2e14e..0000000000 --- a/examples/SimpleSnake/Classes/AppDelegate.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - Copyright (c) 2021 Bytedance Inc. - - https://axis-project.github.io/ - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "AppDelegate.h" -#include "SimpleSnakeScene.h" - -#define USE_AUDIO_ENGINE 1 - -#if USE_AUDIO_ENGINE -# include "audio/AudioEngine.h" -#endif - -USING_NS_AX; - -static axis::Size designResolutionSize = axis::Size(720, 720); -static axis::Size smallResolutionSize = axis::Size(480, 320); -static axis::Size mediumResolutionSize = axis::Size(1024, 768); -static axis::Size largeResolutionSize = axis::Size(2048, 1536); - -AppDelegate::AppDelegate() {} - -AppDelegate::~AppDelegate() {} - -// if you want a different context, modify the value of glContextAttrs -// it will affect all platforms -void AppDelegate::initGLContextAttrs() -{ - // set OpenGL context attributes: red,green,blue,alpha,depth,stencil,multisamplesCount - GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8, 0}; - - GLView::setGLContextAttrs(glContextAttrs); -} - -// if you want to use the package manager to install more packages, -// don't modify or remove this function -static int register_all_packages() -{ - return 0; // flag for packages manager -} - -bool AppDelegate::applicationDidFinishLaunching() -{ - // initialize director - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if (!glview) - { -#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || \ - (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) - glview = GLViewImpl::createWithRect( - "Example: Simple Snake", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height)); -#else - glview = GLViewImpl::create("Example: Simple Snake"); -#endif - director->setOpenGLView(glview); - } - - // turn on display FPS - director->setStatsDisplay(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0f / 60); - - // Set the design resolution - glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, - ResolutionPolicy::NO_BORDER); - auto frameSize = glview->getFrameSize(); - // if the frame's height is larger than the height of medium size. - if (frameSize.height > mediumResolutionSize.height) - { - director->setContentScaleFactor(MIN(largeResolutionSize.height / designResolutionSize.height, - largeResolutionSize.width / designResolutionSize.width)); - } - // if the frame's height is larger than the height of small size. - else if (frameSize.height > smallResolutionSize.height) - { - director->setContentScaleFactor(MIN(mediumResolutionSize.height / designResolutionSize.height, - mediumResolutionSize.width / designResolutionSize.width)); - } - // if the frame's height is smaller than the height of medium size. - else - { - director->setContentScaleFactor(MIN(smallResolutionSize.height / designResolutionSize.height, - smallResolutionSize.width / designResolutionSize.width)); - } - - register_all_packages(); - - // create a scene. it's an autorelease object - auto scene = utils::createInstance(); - - // run - director->runWithScene(scene); - - return true; -} - -// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. -void AppDelegate::applicationDidEnterBackground() -{ - Director::getInstance()->stopAnimation(); - -#if USE_AUDIO_ENGINE - AudioEngine::pauseAll(); -#endif -} - -// this function will be called when the app is active again -void AppDelegate::applicationWillEnterForeground() -{ - Director::getInstance()->startAnimation(); - -#if USE_AUDIO_ENGINE - AudioEngine::resumeAll(); -#endif -} diff --git a/examples/SimpleSnake/Classes/AppDelegate.h b/examples/SimpleSnake/Classes/AppDelegate.h deleted file mode 100644 index 174ca18c01..0000000000 --- a/examples/SimpleSnake/Classes/AppDelegate.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - Copyright (c) 2021 Bytedance Inc. - - https://axis-project.github.io/ - - 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 _APP_DELEGATE_H_ -#define _APP_DELEGATE_H_ - -#include "cocos2d.h" - -/** -@brief The cocos2d Application. - -Private inheritance here hides part of interface from Director. -*/ -class AppDelegate : private axis::Application -{ -public: - AppDelegate(); - virtual ~AppDelegate(); - - void initGLContextAttrs() override; - - /** - @brief Implement Director and Scene init code here. - @return true Initialize success, app continue. - @return false Initialize failed, app terminate. - */ - bool applicationDidFinishLaunching() override; - - /** - @brief Called when the application moves to the background - @param the pointer of the application - */ - void applicationDidEnterBackground() override; - - /** - @brief Called when the application reenters the foreground - @param the pointer of the application - */ - void applicationWillEnterForeground() override; -}; - -#endif // _APP_DELEGATE_H_ diff --git a/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp b/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp deleted file mode 100644 index f0aff72b73..0000000000 --- a/examples/SimpleSnake/Classes/SimpleSnakeScene.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2022 @aismann; Peter Eismann, Germany; dreifrankensoft - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#include "SimpleSnakeScene.h" -#include -#include - -USING_NS_AX; - -struct Snake -{ - int x, y; -} s[snakeBodies + StartBodies]; - -struct Fruit -{ - int x, y; -} f; - -// Print useful error message instead of segfaulting when files are not there. - -static void problemLoading(const char* filename) -{ - printf("Error while loading: %s\n", filename); - printf( - "Depending on how you compiled you might have to add 'Resources/' in front of filenames in " - "HelloWorldScene.cpp\n"); -} - -inline void setNodeIgnoreDesignScale(axis::Node* node) -{ - AXASSERT(node, "node pointer cannot be null."); - - Size actualFrameSize = Director::getInstance()->getOpenGLView()->getFrameSize(); - Size actualWinSize = Director::getInstance()->getWinSizeInPixels(); - node->setScaleX(actualWinSize.width / actualFrameSize.width); - node->setScaleY(actualWinSize.height / actualFrameSize.height); -} - -// on "init" you need to initialize your instance -bool SimpleSnake::init() -{ - ////////////////////////////// - // 1. super init first - if (!Scene::init()) - { - return false; - } - - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - auto safeArea = Director::getInstance()->getSafeAreaRect(); - auto safeOrigin = safeArea.origin; - offset = Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y); - - ///////////////////////////// - // 2. add a menu item with "X" image, which is clicked to quit the program - // you may modify it. - - // add a "close" icon to exit the progress. it's an autorelease object - auto closeItem = MenuItemImage::create("CloseNormal.png", "CloseSelected.png", - AX_CALLBACK_1(SimpleSnake::menuCloseCallback, this)); - - if (closeItem == nullptr || closeItem->getContentSize().width <= 0 || closeItem->getContentSize().height <= 0) - { - problemLoading("'CloseNormal.png' and 'CloseSelected.png'"); - } - else - { - float x = safeOrigin.x + safeArea.size.width - closeItem->getContentSize().width / 2; - float y = safeOrigin.y + closeItem->getContentSize().height / 2; - closeItem->setPosition(Vec2(x, y)); - } - - // create menu, it's an autorelease object - auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Vec2::ZERO); - this->addChild(menu, 1); - - ///////////////////////////// - // 3. add your codes below... - - auto listener = EventListenerKeyboard::create(); - listener->onKeyPressed = AX_CALLBACK_2(SimpleSnake::onKeyPressed, this); - _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - - // add a label shows "Hello World" - // create and initialize a label - - auto label1 = Label::createWithTTF("Simple Snake", "fonts/arial.ttf", 24); - if (label1 == nullptr) - { - problemLoading("'fonts/arial.ttf'"); - } - else - { - // position the label on the center of the screen - label1->setPosition(Vec2(origin.x + visibleSize.width / 2, - origin.y + visibleSize.height - label1->getContentSize().height*2 - visibleSize.height/2)); - // add the label as a child to this layer - this->addChild(label1, 1); - } - auto label2 = Label::createWithTTF("Eat as fast as you can!", "fonts/arial.ttf", 24); - if (label2 == nullptr) - { - problemLoading("'fonts/arial.ttf'"); - } - else - { - // position the label on the center of the screen - label2->setPosition( - Vec2(origin.x + visibleSize.width / 2, - origin.y + visibleSize.height - label2->getContentSize().height * 3 - visibleSize.height/2)); - - // add the label as a child to this layer - this->addChild(label2, 1); - } - - // add "AXIS" splash screen" - auto sprite = Sprite::create("AXIS_white.png"sv); - setNodeIgnoreDesignScale(sprite); - if (sprite == nullptr) - { - problemLoading("'AXIS_white.png'"); - } - else - { - // position the sprite on the center of the screen - sprite->setPosition(offset); - - // add the sprite as a child to this layer - this->addChild(sprite, 9); - auto drawNode = DrawNode::create(); - drawNode->setPosition(Vec2(0, 0)); - addChild(drawNode, 20); - - drawNode->drawRect(safeArea.origin, safeArea.origin + safeArea.size, Color4F::BLUE); - } - - srand(time(0)); - - mydraw = DrawNode::create(); - addChild(mydraw, 10); - - background = Sprite::create("Background.png"); - background->setPosition(offset); - background->setScale(1.1); - addChild(background, 0); - - f.x = 10; - f.y = 10; - s[0].x = 20; - s[0].y = 20; - - char buffer[1024]; - - for (int i = 0; i < snakeBodies+1; i++) - { - myScore[i] = 0.0; - sprintf(buffer, "%i: %f", i + 1, myScore[i]); - myScoreLabel[i] = Label::createWithTTF(std::string(buffer), "fonts/arial.ttf", 20); - myScoreLabel[i]->setAnchorPoint(Vec2(0, 1)); - myScoreLabel[i]->setPosition(Vec2(10, origin.y + visibleSize.height - 10 - i * 20)); - this->addChild(myScoreLabel[i], 1); - } - myScoreLabel[snakeBodies]->setString("");//"Eat as fast as you can!"); - - scheduleUpdate(); - return true; -} - -void SimpleSnake::onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event) -{ - switch (keyCode) - { - case EventKeyboard::KeyCode::KEY_LEFT_ARROW: - if (dir != 2) - dir = 1; - break; - case EventKeyboard::KeyCode::KEY_RIGHT_ARROW: - if (dir != 1) - dir = 2; - break; - case EventKeyboard::KeyCode::KEY_UP_ARROW: - if (dir != 3) - dir = 0; - break; - case EventKeyboard::KeyCode::KEY_DOWN_ARROW: - if (dir != 0) - dir = 3; - break; - case EventKeyboard::KeyCode::KEY_1: - Director::getInstance()->setStatsAnchor(AnchorPreset::BOTTOM_LEFT); - break; - case EventKeyboard::KeyCode::KEY_4: - Director::getInstance()->setStatsAnchor(AnchorPreset::CENTER_LEFT); - break; - case EventKeyboard::KeyCode::KEY_7: - Director::getInstance()->setStatsAnchor(AnchorPreset::TOP_LEFT); - break; - case EventKeyboard::KeyCode::KEY_8: - Director::getInstance()->setStatsAnchor(AnchorPreset::TOP_CENTER); - break; - case EventKeyboard::KeyCode::KEY_9: - Director::getInstance()->setStatsAnchor(AnchorPreset::TOP_RIGHT); - break; - case EventKeyboard::KeyCode::KEY_6: - Director::getInstance()->setStatsAnchor(AnchorPreset::CENTER_RIGHT); - break; - case EventKeyboard::KeyCode::KEY_3: - Director::getInstance()->setStatsAnchor(AnchorPreset::BOTTOM_RIGHT); - break; - case EventKeyboard::KeyCode::KEY_2: - Director::getInstance()->setStatsAnchor(AnchorPreset::BOTTOM_CENTER); - break; - case EventKeyboard::KeyCode::KEY_5: - Director::getInstance()->setStatsAnchor(AnchorPreset::CENTER); - break; - default: - break; - } -} - -void SimpleSnake::menuCloseCallback(Ref* sender) -{ - Director::getInstance()->end(); -} - -void SimpleSnake::update(float delta) -{ - static float runTime = 0; - static bool finish = false; - runTime += delta; - endLevelTime += delta; - - - - if (finish) - { - float myScale = runTime + 1.1; - if (myScale > 3.0) - myScale = 3.0; - background->setScale(myScale); - return; - } - - if (runTime > level) - { - for (int i = num; i > 0; --i) - { - s[i] = s[i - 1]; - } - switch (dir) - { - case 0: - s[0].y++; - if (s[0].y >= M) s[0].y = 0; - break; - case 1: - s[0].x--; - if (s[0].x < 0) s[0].x = N - 1; - break; - case 2: - s[0].x++; - if (s[0].x >= N) s[0].x = 0; - break; - case 3: - s[0].y--; - if (s[0].y < 0) s[0].y = M - 1; - break; - default: - break; - } - - if ((s[0].x == f.x) && (s[0].y == f.y)) - { - bool posOk; - do - { - posOk = true; - f.x = rand() % N; - f.y = rand() % M; - - for (int i = 0; i < num; i++) - { - if (f.x == s[i].x && f.y == s[i].y) - { - posOk = false; - break; - } - } - } while (!posOk); - - // next level - num++; - if (num >= (snakeBodies + StartBodies - 1)) - { - myScoreLabel[snakeBodies]->setString("!!! FINISH !!!"); - finish = true; - drawAll(finish); - } - level -= 0.01; - startLevelTime = 0.0; - endLevelTime = startLevelTime; - } - runTime = 0; - } - - if (!finish) - { - drawAll(finish); - } -} - -void SimpleSnake::drawAll(bool finish) -{ - // score - char buffer[124]; - myScore[num - StartBodies] = endLevelTime; - sprintf(buffer, "%i: %f", num - StartBodies + 1, myScore[num - StartBodies]); - myScoreLabel[num - StartBodies]->setString(buffer); - - - mydraw->clear(); - // draw snake body - for (int i = 1; i < num; i++) - { - mydraw->drawDot(Vec2(size / 2 + s[i].x * size, size / 2 + s[i].y * size), size / 2, Color4B::BLUE); - } - //draw snake head - mydraw->drawDot(Vec2(size / 2 + s[0].x * size, size / 2 + s[0].y * size), size / 2, Color4B::MAGENTA); - - if (!finish) - { - // draw food - mydraw->drawDot(Vec2(size / 2 + f.x * size, size / 2 + f.y * size), size / 2, Color4B::GREEN); - } -} \ No newline at end of file diff --git a/examples/SimpleSnake/Classes/SimpleSnakeScene.h b/examples/SimpleSnake/Classes/SimpleSnakeScene.h deleted file mode 100644 index e46af984f0..0000000000 --- a/examples/SimpleSnake/Classes/SimpleSnakeScene.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 @aismann; Peter Eismann, Germany; dreifrankensoft - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#ifndef __SIMPLE_SNAKE_SCENE_H__ -#define __SIMPLE_SNAKE_SCENE_H__ - -#include "cocos2d.h" - -const int snakeBodies = 9; -const int StartBodies = 4; - -class SimpleSnake : public axis::Scene -{ -public: - virtual bool init() override; - - // a selector callback - void menuCloseCallback(Ref* sender); - virtual void update(float delta) override; - void drawAll(bool finish); - void onKeyPressed(axis::EventKeyboard::KeyCode keyCode, axis::Event* event); - - axis::Vec2 offset; - axis::DrawNode* mydraw; - - // game stuff - int N = 36, M = 36; - int size = 20; - int w = size * N; - int h = size * M; - float level = 0.1; - float myScore[snakeBodies + StartBodies]; - - float startLevelTime = 0.0; - float endLevelTime = 0.0; - - int dir, num = StartBodies; - axis::Label* myScoreLabel[snakeBodies + 1]; - axis::Sprite* background; -}; - -#endif // __SIMPLE_SNAKE_SCENE_H__ diff --git a/examples/SimpleSnake/LICENSE b/examples/SimpleSnake/LICENSE deleted file mode 100644 index fc35ef1041..0000000000 --- a/examples/SimpleSnake/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) @aismann; Peter Eismann, Germany; dreifrankensoft - -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. diff --git a/examples/SimpleSnake/README.md b/examples/SimpleSnake/README.md deleted file mode 100644 index cd1c1f4553..0000000000 --- a/examples/SimpleSnake/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Simple Snake -axis version of a "Simple Snake" game. - -![image](https://user-images.githubusercontent.com/8652787/175750227-f3f412dd-f555-4b05-bb91-8efe2f3ccc6b.png) - - -If you have any questions or want to continue this project feel free to do so. - -### Here are some ideas: -- Improve the "score optic" -- Save the "highsore times" -- Use sprites unstead of draw primitives -- Add some effects (sound, exploding stuff, traps, etc) - -- or use it as startup of your own snake version with axis - -### Idea from here: -https://www.youtube.com/channel/UCC7qpnId5RIQruKDJOt2exw - - -MIT License diff --git a/examples/SimpleSnake/Resources/AXIS_black.png b/examples/SimpleSnake/Resources/AXIS_black.png deleted file mode 100644 index e8283cbe8e..0000000000 Binary files a/examples/SimpleSnake/Resources/AXIS_black.png and /dev/null differ diff --git a/examples/SimpleSnake/Resources/AXIS_white.png b/examples/SimpleSnake/Resources/AXIS_white.png deleted file mode 100644 index a0d0154a7a..0000000000 Binary files a/examples/SimpleSnake/Resources/AXIS_white.png and /dev/null differ diff --git a/examples/SimpleSnake/Resources/Background.png b/examples/SimpleSnake/Resources/Background.png deleted file mode 100644 index 35f444729b..0000000000 Binary files a/examples/SimpleSnake/Resources/Background.png and /dev/null differ diff --git a/examples/SimpleSnake/Resources/CloseNormal.png b/examples/SimpleSnake/Resources/CloseNormal.png deleted file mode 100644 index b65498c941..0000000000 Binary files a/examples/SimpleSnake/Resources/CloseNormal.png and /dev/null differ diff --git a/examples/SimpleSnake/Resources/CloseSelected.png b/examples/SimpleSnake/Resources/CloseSelected.png deleted file mode 100644 index 306749ecd2..0000000000 Binary files a/examples/SimpleSnake/Resources/CloseSelected.png and /dev/null differ diff --git a/examples/SimpleSnake/Resources/fonts/Marker Felt.ttf b/examples/SimpleSnake/Resources/fonts/Marker Felt.ttf deleted file mode 100644 index 3752ef3110..0000000000 Binary files a/examples/SimpleSnake/Resources/fonts/Marker Felt.ttf and /dev/null differ diff --git a/examples/SimpleSnake/Resources/fonts/arial.ttf b/examples/SimpleSnake/Resources/fonts/arial.ttf deleted file mode 100644 index abc899cd55..0000000000 Binary files a/examples/SimpleSnake/Resources/fonts/arial.ttf and /dev/null differ diff --git a/examples/SimpleSnake/Resources/res/.gitkeep b/examples/SimpleSnake/Resources/res/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/SimpleSnake/Resources/screenshot.png b/examples/SimpleSnake/Resources/screenshot.png deleted file mode 100644 index 28c7f1d6b9..0000000000 Binary files a/examples/SimpleSnake/Resources/screenshot.png and /dev/null differ diff --git a/examples/SimpleSnake/axis-project-template.json b/examples/SimpleSnake/axis-project-template.json deleted file mode 100644 index 9f4382b9de..0000000000 --- a/examples/SimpleSnake/axis-project-template.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "do_default":{ - "project_rename":{ - "src_project_name":"HelloCpp", - "files":[ - ] - }, - "project_replace_project_name":{ - "src_project_name":"HelloCpp", - "files":[ - "Classes/AppDelegate.cpp", - "proj.win32/main.cpp", - "proj.android/settings.gradle", - "proj.android/app/res/values/strings.xml", - "proj.ios_mac/ios/main.m", - "proj.ios_mac/ios/Prefix.pch", - "CMakeLists.txt" - ] - }, - "project_replace_package_name":{ - "src_package_name":"org.cocos2dx.hellocpp", - "files":[ - "proj.android/app/build.gradle", - "proj.android/app/AndroidManifest.xml" - ] - }, - "project_replace_so_name": { - "src_so_name": "HelloCpp", - "files": [ - "proj.android/app/AndroidManifest.xml" - ] - }, - "project_replace_mac_bundleid": { - "src_bundle_id": "org.cocos2dx.hellocpp", - "files": [ - "proj.ios_mac/mac/Info.plist" - ] - }, - "project_replace_ios_bundleid": { - "src_bundle_id": "org.cocos2dx.hellocpp", - "files": [ - "proj.ios_mac/ios/Info.plist" - ] - } - }, - "change_orientation": { - "modify_files": [ - { - "file_path": "Classes/AppDelegate.cpp", - "pattern": "static\\s+cocos2d\\:\\:Size\\s+([a-zA-Z_\\d]+)\\s*=\\s*cocos2d\\:\\:Size\\(\\s*(\\d+),\\s*(\\d+)\\)", - "replace_string": "static cocos2d::Size \\1 = cocos2d::Size(\\3, \\2)" - }, - { - "file_path": "proj.ios_mac/ios/Info.plist", - "pattern": "UIInterfaceOrientationLandscapeRight", - "replace_string": "UIInterfaceOrientationPortrait" - }, - { - "file_path": "proj.ios_mac/ios/Info.plist", - "pattern": "UIInterfaceOrientationLandscapeLeft", - "replace_string": "UIInterfaceOrientationPortraitUpsideDown" - }, - - { - "file_path": "proj.android/app/AndroidManifest.xml", - "pattern": "android:screenOrientation=\\\".*\\\"", - "replace_string": "android:screenOrientation=\"portrait\"" - } - ] - } -} - diff --git a/examples/SimpleSnake/proj.android/.gitignore b/examples/SimpleSnake/proj.android/.gitignore deleted file mode 100644 index 233199aa7b..0000000000 --- a/examples/SimpleSnake/proj.android/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures -/.externalNativeBuild diff --git a/examples/SimpleSnake/proj.android/app/.gitignore b/examples/SimpleSnake/proj.android/app/.gitignore deleted file mode 100644 index 0886f94956..0000000000 --- a/examples/SimpleSnake/proj.android/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/.externalNativeBuild diff --git a/examples/SimpleSnake/proj.android/app/AndroidManifest.xml b/examples/SimpleSnake/proj.android/app/AndroidManifest.xml deleted file mode 100644 index 3e9a77e159..0000000000 --- a/examples/SimpleSnake/proj.android/app/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/SimpleSnake/proj.android/app/build.gradle b/examples/SimpleSnake/proj.android/app/build.gradle deleted file mode 100644 index 76e6d22d2d..0000000000 --- a/examples/SimpleSnake/proj.android/app/build.gradle +++ /dev/null @@ -1,123 +0,0 @@ -import org.gradle.internal.os.OperatingSystem -import java.nio.file.Paths -import java.nio.file.Files - -apply plugin: 'com.android.application' -apply from: project(':libcocos2dx').projectDir.toString() + "/axistools.gradle" - -android { - compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger() - - // setup ndk - def ndkInfo = axistools.findNDK(project) - ndkVersion = ndkInfo[0] - if(ndkInfo[1]) { - ndkPath = ndkInfo[1] - } - - // setup cmake - def cmakeVer = axistools.findCMake(project) - - defaultConfig { - applicationId "org.cocos2dx.hellocpp" - minSdkVersion PROP_MIN_SDK_VERSION - targetSdkVersion PROP_TARGET_SDK_VERSION - versionCode 1 - versionName "1.0" - - externalNativeBuild { - cmake { - arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_shared", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE" - cppFlags "-frtti -fexceptions -fsigned-char" - } - } - - ndk { - abiFilters = [] - abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String}) - } - } - - sourceSets.main { - java.srcDir "src" - res.srcDir "res" - manifest.srcFile "AndroidManifest.xml" - assets.srcDir "../../Resources" - } - - externalNativeBuild { - cmake { - version "$cmakeVer" - path "../../CMakeLists.txt" - } - } - - signingConfigs { - - release { - if (project.hasProperty("RELEASE_STORE_FILE")) { - storeFile file(RELEASE_STORE_FILE) - storePassword RELEASE_STORE_PASSWORD - keyAlias RELEASE_KEY_ALIAS - keyPassword RELEASE_KEY_PASSWORD - } - } - } - - buildTypes { - release { - debuggable false - jniDebuggable false - renderscriptDebuggable false - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if (project.hasProperty("RELEASE_STORE_FILE")) { - signingConfig signingConfigs.release - } - } - - debug { - debuggable true - jniDebuggable true - renderscriptDebuggable true - } - } - - aaptOptions { - noCompress 'mp3','ogg','wav','mp4','ttf','ttc' - } -} - -android.applicationVariants.all { variant -> - def project_root_folder = "${projectDir}/../.." - def dest_assets_folder = "${projectDir}/assets" - - // delete previous files first - delete dest_assets_folder - def targetName = variant.name.capitalize() - def copyTaskName = "copy${targetName}ResourcesToAssets" - - tasks.register(copyTaskName) { - copy { - from "${buildDir}/../../../Resources" - into "${buildDir}/intermediates/assets/${variant.dirName}" - exclude "**/*.gz" - } - } - tasks.getByName("pre${targetName}Build").dependsOn copyTaskName -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':libcocos2dx') -} - -project.afterEvaluate { - if (tasks.findByName("externalNativeBuildDebug")) { - compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug - } - if (tasks.findByName("externalNativeBuildRelease")) { - compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease - } -} diff --git a/examples/SimpleSnake/proj.android/app/jni/hellocpp/main.cpp b/examples/SimpleSnake/proj.android/app/jni/hellocpp/main.cpp deleted file mode 100644 index ccd4757e4c..0000000000 --- a/examples/SimpleSnake/proj.android/app/jni/hellocpp/main.cpp +++ /dev/null @@ -1,44 +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 - -#include -#include - -#include "AppDelegate.h" - -#define LOG_TAG "main" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) - -namespace -{ -std::unique_ptr appDelegate; -} - -void cocos_android_app_init(JNIEnv* env) -{ - LOGD("cocos_android_app_init"); - appDelegate.reset(new AppDelegate()); -} diff --git a/examples/SimpleSnake/proj.android/app/proguard-rules.pro b/examples/SimpleSnake/proj.android/app/proguard-rules.pro deleted file mode 100644 index 2c062c4946..0000000000 --- a/examples/SimpleSnake/proj.android/app/proguard-rules.pro +++ /dev/null @@ -1,37 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Proguard Cocos2d-x for release --keep public class org.cocos2dx.** { *; } --dontwarn org.cocos2dx.** --keep public class com.chukong.** { *; } --dontwarn com.chukong.** --keep public class com.huawei.android.** { *; } --dontwarn com.huawei.android.** - -# Proguard Apache HTTP for release --keep class org.apache.http.** { *; } --dontwarn org.apache.http.** - -# Proguard Android Webivew for release. uncomment if you are using a webview in cocos2d-x -#-keep public class android.net.http.SslError -#-keep public class android.webkit.WebViewClient - -#-dontwarn android.webkit.WebView -#-dontwarn android.net.http.SslError -#-dontwarn android.webkit.WebViewClient \ No newline at end of file diff --git a/examples/SimpleSnake/proj.android/app/res/mipmap-hdpi/ic_launcher.png b/examples/SimpleSnake/proj.android/app/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 45ee51d15f..0000000000 Binary files a/examples/SimpleSnake/proj.android/app/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.android/app/res/mipmap-mdpi/ic_launcher.png b/examples/SimpleSnake/proj.android/app/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 0dd2a60899..0000000000 Binary files a/examples/SimpleSnake/proj.android/app/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.android/app/res/mipmap-xhdpi/ic_launcher.png b/examples/SimpleSnake/proj.android/app/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index a32f16f930..0000000000 Binary files a/examples/SimpleSnake/proj.android/app/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png b/examples/SimpleSnake/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 332f268edc..0000000000 Binary files a/examples/SimpleSnake/proj.android/app/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.android/app/res/values/strings.xml b/examples/SimpleSnake/proj.android/app/res/values/strings.xml deleted file mode 100644 index 4fb39f4955..0000000000 --- a/examples/SimpleSnake/proj.android/app/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - HelloCpp - diff --git a/examples/SimpleSnake/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java b/examples/SimpleSnake/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java deleted file mode 100644 index e560f91804..0000000000 --- a/examples/SimpleSnake/proj.android/app/src/org/cocos2dx/cpp/AppActivity.java +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -Copyright (c) 2015-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. -****************************************************************************/ -package org.cocos2dx.cpp; - -import android.os.Bundle; -import org.cocos2dx.lib.Cocos2dxActivity; -import org.cocos2dx.lib.SharedLoader; -import android.os.Build; -import android.view.WindowManager; -//import android.view.WindowManager.LayoutParams; - -public class AppActivity extends Cocos2dxActivity { - static { - // DNT remove, some android simulator require explicit load shared libraries, otherwise will crash - SharedLoader.load(); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.setEnableVirtualButton(false); - super.onCreate(savedInstanceState); - // Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508 - if (!isTaskRoot()) { - // Android launched another instance of the root activity into an existing task - // so just quietly finish and go away, dropping the user back into the activity - // at the top of the stack (ie: the last state of this task) - // 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/examples/SimpleSnake/proj.android/build.gradle b/examples/SimpleSnake/proj.android/build.gradle deleted file mode 100644 index 5a44a79f98..0000000000 --- a/examples/SimpleSnake/proj.android/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/examples/SimpleSnake/proj.android/gradle.properties b/examples/SimpleSnake/proj.android/gradle.properties deleted file mode 100644 index 16df63bf19..0000000000 --- a/examples/SimpleSnake/proj.android/gradle.properties +++ /dev/null @@ -1,42 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# Android SDK version that will be used as the compile project -PROP_COMPILE_SDK_VERSION=28 - -# Android SDK version that will be used as the earliest version of android this application can run on -PROP_MIN_SDK_VERSION=17 - -# Android SDK version that will be used as the latest version of android this application has been tested on -PROP_TARGET_SDK_VERSION=28 - - -# List of CPU Archtexture to build that application with -# Available architextures (armeabi-v7a | arm64-v8a | x86) -# To build for multiple architexture, use the `:` between them -# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 -PROP_APP_ABI=arm64-v8a - -# uncomment it and fill in sign information for release mode -#RELEASE_STORE_FILE=file path of keystore -#RELEASE_STORE_PASSWORD=password of keystore -#RELEASE_KEY_ALIAS=alias of key -#RELEASE_KEY_PASSWORD=password of key - -android.injected.testOnly=false diff --git a/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.jar b/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a86..0000000000 Binary files a/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.properties b/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index c6d2e0473d..0000000000 --- a/examples/SimpleSnake/proj.android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Tue Mar 14 17:40:59 CST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip diff --git a/examples/SimpleSnake/proj.android/gradlew b/examples/SimpleSnake/proj.android/gradlew deleted file mode 100644 index 91a7e269e1..0000000000 --- a/examples/SimpleSnake/proj.android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/examples/SimpleSnake/proj.android/gradlew.bat b/examples/SimpleSnake/proj.android/gradlew.bat deleted file mode 100644 index 8a0b282aa6..0000000000 --- a/examples/SimpleSnake/proj.android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/examples/SimpleSnake/proj.android/settings.gradle b/examples/SimpleSnake/proj.android/settings.gradle deleted file mode 100644 index f0b76b99b8..0000000000 --- a/examples/SimpleSnake/proj.android/settings.gradle +++ /dev/null @@ -1,6 +0,0 @@ -import java.nio.file.Paths -include ':libcocos2dx' -project(':libcocos2dx').projectDir = new File(Paths.get("${System.env.AXIS_ROOT}/core/platform/android/libcocos2dx").toUri()) -include ':HelloCpp' -project(':HelloCpp').projectDir = new File(settingsDir, 'app') -rootProject.name = "HelloCpp" diff --git a/examples/SimpleSnake/proj.ios_mac/ios/AppController.h b/examples/SimpleSnake/proj.ios_mac/ios/AppController.h deleted file mode 100644 index aeb65f5085..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/AppController.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2013 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. - ****************************************************************************/ - -#import - -@class RootViewController; - -@interface AppController : NSObject { -} - -@property(nonatomic, readonly) RootViewController* viewController; - -@end diff --git a/examples/SimpleSnake/proj.ios_mac/ios/AppController.mm b/examples/SimpleSnake/proj.ios_mac/ios/AppController.mm deleted file mode 100644 index 28c5b7e56b..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/AppController.mm +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2013 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. - ****************************************************************************/ - -#import "AppController.h" -#import "cocos2d.h" -#import "AppDelegate.h" -#import "RootViewController.h" - -@implementation AppController - -@synthesize window; - -#pragma mark - -#pragma mark Application lifecycle - -// cocos2d application instance -static AppDelegate s_sharedApplication; - -- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions -{ - - axis::Application* app = axis::Application::getInstance(); - - // Initialize the GLView attributes - app->initGLContextAttrs(); - axis::GLViewImpl::convertAttrs(); - - // Override point for customization after application launch. - - // Add the view controller's view to the window and display. - window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - - // Use RootViewController to manage CCEAGLView - _viewController = [[RootViewController alloc] init]; - _viewController.wantsFullScreenLayout = YES; - - // Set RootViewController to window - if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0) - { - // warning: addSubView doesn't work on iOS6 - [window addSubview:_viewController.view]; - } - else - { - // use this method on ios6 - [window setRootViewController:_viewController]; - } - - [window makeKeyAndVisible]; - - [[UIApplication sharedApplication] setStatusBarHidden:true]; - - // Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior. - if ([[UIDevice currentDevice].systemVersion floatValue] >= 13.0f) - { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAllowsDefaultLineBreakStrategy"]; - } - - // IMPORTANT: Setting the GLView should be done after creating the RootViewController - axis::GLView* glview = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view); - axis::Director::getInstance()->setOpenGLView(glview); - - // run the cocos2d-x game scene - app->run(); - - return YES; -} - -- (void)applicationWillResignActive:(UIApplication*)application -{ - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of - temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and - it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and - throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ - // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - /* axis::Director::getInstance()->pause(); */ -} - -- (void)applicationDidBecomeActive:(UIApplication*)application -{ - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was - previously in the background, optionally refresh the user interface. - */ - // We don't need to call this method any more. It will interrupt user defined game pause&resume logic - /* axis::Director::getInstance()->resume(); */ -} - -- (void)applicationDidEnterBackground:(UIApplication*)application -{ - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state - information to restore your application to its current state in case it is terminated later. If your application - supports background execution, called instead of applicationWillTerminate: when the user quits. - */ - axis::Application::getInstance()->applicationDidEnterBackground(); -} - -- (void)applicationWillEnterForeground:(UIApplication*)application -{ - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made - on entering the background. - */ - axis::Application::getInstance()->applicationWillEnterForeground(); -} - -- (void)applicationWillTerminate:(UIApplication*)application -{ - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application -{ - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) - later. - */ -} - -#if __has_feature(objc_arc) -#else -- (void)dealloc -{ - [window release]; - [_viewController release]; - [super dealloc]; -} -#endif - -@end diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 51cbd32fe0..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon-57@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-50@2x.png", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "Icon-72@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-83.5@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png deleted file mode 100644 index 8ead23e365..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-20@3x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png deleted file mode 100644 index 0500184c86..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png deleted file mode 100644 index f0f8b7fe98..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png deleted file mode 100644 index 5287e50a79..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png deleted file mode 100644 index 775685daca..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png deleted file mode 100644 index d9c7ab446b..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png deleted file mode 100644 index ac381bc20e..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png deleted file mode 100644 index ef38d4500a..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-50@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png deleted file mode 100644 index 4fcc6fddff..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png deleted file mode 100644 index c3807861ad..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-57@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index a5b49ccbb1..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index d4bc53132c..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png deleted file mode 100644 index 2c573c8df4..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png deleted file mode 100644 index 1526615c02..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-72@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png deleted file mode 100644 index 8a1fa1850c..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png deleted file mode 100644 index 8aa82506d0..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png deleted file mode 100644 index 6bf801d175..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/Contents.json b/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Info.plist b/examples/SimpleSnake/proj.ios_mac/ios/Info.plist deleted file mode 100644 index 6a5e22f8a6..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PROJECT_NAME} - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon-57.png - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundleShortVersionString - 1.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIAppFonts - - UILaunchStoryboardName - LaunchScreen - UIPrerenderedIcon - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationLandscapeLeft - - NSHumanReadableCopyright - Copyright © 2019. All rights reserved. - - diff --git a/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreen.storyboard b/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreen.storyboard deleted file mode 100644 index 068bbaa879..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreen.storyboard +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreenBackground.png b/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreenBackground.png deleted file mode 100644 index dadccee686..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/ios/LaunchScreenBackground.png and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/ios/Prefix.pch b/examples/SimpleSnake/proj.ios_mac/ios/Prefix.pch deleted file mode 100644 index 3da08ad7ff..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/Prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -// -// Prefix header for all source files of the 'iphone' target in the 'iphone' project -// - -#ifdef __OBJC__ - #import - #import -#endif - -#ifdef __cplusplus - #include "cocos2d.h" -#endif \ No newline at end of file diff --git a/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.h b/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.h deleted file mode 100644 index 06c3b05562..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 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. - ****************************************************************************/ - -#import - -@interface RootViewController : UIViewController { -} -- (BOOL)prefersStatusBarHidden; - -@end diff --git a/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.mm b/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.mm deleted file mode 100644 index a5ded72f81..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/RootViewController.mm +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 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. - ****************************************************************************/ - -#import "RootViewController.h" -#import "cocos2d.h" -#import "platform/ios/CCEAGLView-ios.h" - -@implementation RootViewController - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform -customization that is not appropriate for viewDidLoad. -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { - // Custom initialization - } - return self; -} -*/ - -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView -{ - // Initialize the CCEAGLView - CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds - pixelFormat:(__bridge NSString*)axis::GLViewImpl::_pixelFormat - depthFormat:axis::GLViewImpl::_depthFormat - preserveBackbuffer:NO - sharegroup:nil - multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO - numberOfSamples:axis::GLViewImpl::_multisamplingCount]; - - // Enable or disable multiple touches - [eaglView setMultipleTouchEnabled:NO]; - - // Set EAGLView as view of RootViewController - self.view = eaglView; -} - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad -{ - [super viewDidLoad]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; -} - -// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead -#ifdef __IPHONE_6_0 -- (NSUInteger)supportedInterfaceOrientations -{ - return UIInterfaceOrientationMaskAllButUpsideDown; -} -#endif - -- (BOOL)shouldAutorotate -{ - return YES; -} - -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; - - auto glview = axis::Director::getInstance()->getOpenGLView(); - - if (glview) - { - CCEAGLView* eaglview = (__bridge CCEAGLView*)glview->getEAGLView(); - - if (eaglview) - { - CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); - axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height); - } - } -} - -// fix not hide status on ios7 -- (BOOL)prefersStatusBarHidden -{ - return YES; -} - -// Controls the application's preferred home indicator auto-hiding when this view controller is shown. -- (BOOL)prefersHomeIndicatorAutoHidden -{ - return YES; -} - -- (void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -@end diff --git a/examples/SimpleSnake/proj.ios_mac/ios/exportoptions.plist b/examples/SimpleSnake/proj.ios_mac/ios/exportoptions.plist deleted file mode 100644 index 14a6dc5c20..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/exportoptions.plist +++ /dev/null @@ -1,15 +0,0 @@ - - - - - compileBitcode - - method - development - provisioningProfiles - - Bundle Identifier - Provision Prifile Name - - - diff --git a/examples/SimpleSnake/proj.ios_mac/ios/main.m b/examples/SimpleSnake/proj.ios_mac/ios/main.m deleted file mode 100644 index 62178533b7..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/ios/main.m +++ /dev/null @@ -1,7 +0,0 @@ -#import - -int main(int argc, char *argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, @"AppController"); - } -} diff --git a/examples/SimpleSnake/proj.ios_mac/mac/Icon.icns b/examples/SimpleSnake/proj.ios_mac/mac/Icon.icns deleted file mode 100644 index 2040fc6fe6..0000000000 Binary files a/examples/SimpleSnake/proj.ios_mac/mac/Icon.icns and /dev/null differ diff --git a/examples/SimpleSnake/proj.ios_mac/mac/Info.plist b/examples/SimpleSnake/proj.ios_mac/mac/Info.plist deleted file mode 100644 index 18d51ff076..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/mac/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleIconFile - Icon - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PROJECT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSApplicationCategoryType - public.app-category.games - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2013. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/examples/SimpleSnake/proj.ios_mac/mac/Prefix.pch b/examples/SimpleSnake/proj.ios_mac/mac/Prefix.pch deleted file mode 100644 index aa71e76645..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/mac/Prefix.pch +++ /dev/null @@ -1,11 +0,0 @@ -// -// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project -// - -#ifdef __OBJC__ - #import -#endif - -#ifdef __cplusplus - #include "cocos2d.h" -#endif \ No newline at end of file diff --git a/examples/SimpleSnake/proj.ios_mac/mac/main.cpp b/examples/SimpleSnake/proj.ios_mac/mac/main.cpp deleted file mode 100644 index 59748b3c5f..0000000000 --- a/examples/SimpleSnake/proj.ios_mac/mac/main.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - 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 "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_AX; - -int main(int argc, char* argv[]) -{ - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/examples/SimpleSnake/proj.linux/main.cpp b/examples/SimpleSnake/proj.linux/main.cpp deleted file mode 100644 index dd68d8f841..0000000000 --- a/examples/SimpleSnake/proj.linux/main.cpp +++ /dev/null @@ -1,39 +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 "../Classes/AppDelegate.h" - -#include -#include -#include -#include - -USING_NS_AX; - -int main(int argc, char** argv) -{ - // create the application instance - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/examples/SimpleSnake/proj.win32/build-cfg.json b/examples/SimpleSnake/proj.win32/build-cfg.json deleted file mode 100644 index aae4d7a054..0000000000 --- a/examples/SimpleSnake/proj.win32/build-cfg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "copy_resources": [ - { - "from": "../Resources", - "to": "" - } - ] -} diff --git a/examples/SimpleSnake/proj.win32/game.rc b/examples/SimpleSnake/proj.win32/game.rc deleted file mode 100644 index 1e0a2a0da2..0000000000 --- a/examples/SimpleSnake/proj.win32/game.rc +++ /dev/null @@ -1,86 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -GLFW_ICON ICON "res\\game.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "game Module\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "game\0" - VALUE "LegalCopyright", "Copyright \0" - VALUE "OriginalFilename", "game.exe\0" - VALUE "ProductName", "game Module\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04B0 - END -END - -///////////////////////////////////////////////////////////////////////////// -#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) diff --git a/examples/SimpleSnake/proj.win32/main.cpp b/examples/SimpleSnake/proj.win32/main.cpp deleted file mode 100644 index 1fdf40a681..0000000000 --- a/examples/SimpleSnake/proj.win32/main.cpp +++ /dev/null @@ -1,39 +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 "main.h" -#include "AppDelegate.h" -#include "cocos2d.h" - -USING_NS_AX; - -int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - - // create the application instance - AppDelegate app; - return Application::getInstance()->run(); -} diff --git a/examples/SimpleSnake/proj.win32/main.h b/examples/SimpleSnake/proj.win32/main.h deleted file mode 100644 index 64d684e652..0000000000 --- a/examples/SimpleSnake/proj.win32/main.h +++ /dev/null @@ -1,37 +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. - ****************************************************************************/ - -#ifndef __MAIN_H__ -#define __MAIN_H__ - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -// Windows Header Files: -#include -#include - -// C RunTime Header Files -#include "platform/CCStdC.h" - -#endif // __MAIN_H__ diff --git a/examples/SimpleSnake/proj.win32/res/game.ico b/examples/SimpleSnake/proj.win32/res/game.ico deleted file mode 100644 index feaf932a74..0000000000 Binary files a/examples/SimpleSnake/proj.win32/res/game.ico and /dev/null differ diff --git a/examples/SimpleSnake/proj.win32/resource.h b/examples/SimpleSnake/proj.win32/resource.h deleted file mode 100644 index da3599c69c..0000000000 --- a/examples/SimpleSnake/proj.win32/resource.h +++ /dev/null @@ -1,44 +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. - ****************************************************************************/ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by game.RC -// - -#define IDS_PROJNAME 100 -#define IDR_TESTJS 100 - -#define ID_FILE_NEW_WINDOW 32771 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -# ifndef APSTUDIO_READONLY_SYMBOLS -# define _APS_NEXT_RESOURCE_VALUE 201 -# define _APS_NEXT_CONTROL_VALUE 1000 -# define _APS_NEXT_SYMED_VALUE 101 -# define _APS_NEXT_COMMAND_VALUE 32775 -# endif -#endif diff --git a/examples/SimpleSnake/run.bat.in b/examples/SimpleSnake/run.bat.in deleted file mode 100644 index c77bdee819..0000000000 --- a/examples/SimpleSnake/run.bat.in +++ /dev/null @@ -1,25 +0,0 @@ -@echo off -rem !!!Don't move this file -rem usage: run.bat -rem BUILD_CFG could be Debug,Release,MinSizeRel,RelWithDebInfo - -set myDir=%~dp0 -set cacheFile=%myDir%run.bat.txt - -echo Entering run.bat directory: %myDir% - -cd /d %myDir% - -set APP_NAME=@APP_NAME@ -set BUILD_DIR=@CMAKE_BUILD_RELATIVE_DIR@ -set BUILD_CFG=%1 - -rem Determine which build config to run -if not defined BUILD_CFG if exist %cacheFile% set /p BUILD_CFG=< %cacheFile% -if not defined BUILD_CFG set /p BUILD_CFG=Please input Build config(Debug,Release,MinSizeRel,RelWithDebInfo): -if not defined BUILD_CFG set BUILD_CFG=Debug - -rem Save run config to run.bat.txt -echo %BUILD_CFG%>%cacheFile% - -start /D %myDir%Resources %BUILD_DIR%/bin/%APP_NAME%/%BUILD_CFG%/%APP_NAME%.exe