diff --git a/templates/js-template-default/CMakeLists.txt b/templates/js-template-default/CMakeLists.txt new file mode 100644 index 0000000000..e9b26d4799 --- /dev/null +++ b/templates/js-template-default/CMakeLists.txt @@ -0,0 +1,299 @@ +#/**************************************************************************** +# Copyright (c) 2014 Chukong Technologies Inc. +# +# http://www.cocos2d-x.org +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# ****************************************************************************/ + +cmake_minimum_required(VERSION 2.8) + +set(APP_NAME MyGame) +project (${APP_NAME}) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cmake/Modules/") +include(CocosBuildHelpers) + +option(USE_CHIPMUNK "Use chipmunk for physics library" ON) +option(DEBUG_MODE "Debug or release?" ON) +option(BUILD_EXTENSIONS "Build extension library" ON) +option(BUILD_EDITOR_SPINE "Build editor support for spine" ON) +option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" ON) +option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" ON) +option(USE_PREBUILT_LIBS "Use prebuilt libraries in external directory" ON) + + +if(DEBUG_MODE) + set(CMAKE_BUILD_TYPE DEBUG) +else(DEBUG_MODE) + set(CMAKE_BUILD_TYPE RELEASE) +endif(DEBUG_MODE) + +set(CMAKE_C_FLAGS_DEBUG "-DCOCOS2D_DEBUG=1") +set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) + +if(WIN32) + ADD_DEFINITIONS (-D_USRDLL -DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32) + + if(MSVC) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS + -D_SCL_SECURE_NO_WARNINGS + -wd4251 -wd4244 -wd4334 + -wd4005 -wd4820 -wd4710 + -wd4514 -wd4056 -wd4996 -wd4099) + else(MSVC)#MINGW + + endif(MSVC) +elseif(APPLE) + + +else()#Linux +ADD_DEFINITIONS(-DLINUX -DCC_RESOURCE_FOLDER_LINUX="/") +endif() + + +if(NOT MSVC)# all gcc +set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1") +set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) +set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-std=c99") +set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") +endif() + +if(MINGW) + add_definitions(-DGLEW_STATIC) +endif() + + +if(USE_CHIPMUNK) + message("Using chipmunk ...") + add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=1) +elseif(USE_BOX2D) + message("Using box2d ...") + add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1) +else(USE_CHIPMUNK) + message(FATAL_ERROR "Must choose a physics library.") +endif(USE_CHIPMUNK) + +# architecture +if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +set(ARCH_DIR "64-bit") +else() +set(ARCH_DIR "32-bit") +endif() + +if(WIN32) # Win32 + set(PLATFORM_FOLDER win32) +elseif(APPLE)# osx or ios + set(PLATFORM_FOLDER mac) +else() # Assume Linux + set(PLATFORM_FOLDER linux) +endif() + +set(COCOS_EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external) + + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/ + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/base + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/2d + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/ui + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/audio/include + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/storage + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/network + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/platform + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/editor-support + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/editor-support/spine + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/editor-support/cocosbuilder + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/editor-support/cocostudio + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/deprecated + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/cocos/platform + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/extensions + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external/chipmunk/include/chipmunk + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/external/spidermonkey/include/${PLATFORM_FOLDER} + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/bindings/auto + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/bindings/manual +) + +link_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/external/spidermonkey/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR} +) + + +if(USE_PREBUILT_LIBS) + include(CocosUsePrebuiltLibs) +endif() + +# GLFW3 used on Mac, Windows and Linux desktop platforms +if(LINUX OR MACOSX OR WINDOWS) + cocos_find_package(OpenGL OPENGL REQUIRED) + + if(LINUX OR WINDOWS) + cocos_find_package(GLEW GLEW REQUIRED) + endif() + + cocos_find_package(GLFW3 GLFW3 REQUIRED) + include_directories(${GLFW3_INCLUDE_DIRS}) + + if(LINUX) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + find_package(Threads REQUIRED) + set(THREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + + #cocos_find_package(FMODEX FMODEX REQUIRED) + cocos_find_package(Fontconfig FONTCONFIG REQUIRED) + endif() + + if(WINDOWS) + cocos_find_package(Vorbis VORBIS REQUIRED) + cocos_find_package(MPG123 MPG123 REQUIRED) + cocos_find_package(OpenAL OPENAL REQUIRED) + # because FindOpenAL.cmake set include dir for '#include ' for portability (not for '#include ' + set(OPENAL_DEFINITIONS "-DOPENAL_PLAIN_INCLUDES") + endif() +endif(LINUX OR MACOSX OR WINDOWS) + +# Freetype required on all platforms +cocos_find_package(Freetype FREETYPE REQUIRED) + +# WebP required if used +if(USE_WEBP) + cocos_find_package(WebP WEBP REQUIRED) +endif(USE_WEBP) + +# Chipmunk +if(USE_CHIPMUNK) + cocos_find_package(Chipmunk CHIPMUNK REQUIRED) + add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=1) + if(IOS OR MACOSX) + # without this chipmunk will try to use apple defined geometry types, that conflicts with cocos + add_definitions(-DCP_USE_CGPOINTS=0) + endif() +else(USE_CHIPMUNK) + add_definitions(-DCC_USE_PHYSICS=0) +endif(USE_CHIPMUNK) + +# Box2d (not prebuilded, exists as source) +if(USE_BOX2D) + if(USE_PREBUILT_LIBS) + add_subdirectory(frameworks/js-bindings/cocos2d-x/external/Box2D) + set(Box2D_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external/box2d/include) + set(Box2D_LIBRARIES box2d) + else() + find_package(Box2D REQUIRED CONFIG) + # actually Box2D in next line is not a library, it is target exported from Box2DConfig.cmake + set(Box2D_LIBRARIES Box2D) + endif() + message(STATUS "Box2D include dirs: ${Box2D_INCLUDE_DIRS}") + add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1) +else() + add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=0) +endif(USE_BOX2D) + +# Tinyxml2 (not prebuilded, exists as source) +if(USE_PREBUILT_LIBS) + add_subdirectory(frameworks/js-bindings/cocos2d-x/external/tinyxml2) + set(TinyXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external/tinyxml2) + set(TinyXML2_LIBRARIES tinyxml2) +else() + cocos_find_package(TinyXML2 TinyXML2 REQUIRED) +endif() +message(STATUS "TinyXML2 include dirs: ${TinyXML2_INCLUDE_DIRS}") + +# libjpeg +cocos_find_package(JPEG JPEG REQUIRED) +cocos_find_package(ZLIB ZLIB REQUIRED) + +# minizip (we try to migrate to minizip from https://github.com/nmoinvaz/minizip) +# only msys2 currently provides package for this variant, all other +# dists have packages from zlib, thats very old for us. +# moreover our embedded version modified to quick provide +# functionality needed by cocos. +if(USE_PREBUILT_LIBS OR NOT MINGW) + add_subdirectory(frameworks/js-bindings/cocos2d-x/external/unzip) + set(MINIZIP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/cocos2d-x/external/unzip) + set(MINIZIP_LIBRARIES unzip) + message(STATUS "MINIZIP include dirs: ${MINIZIP_INCLUDE_DIRS}") +else() + cocos_find_package(MINIZIP MINIZIP REQUIRED) + # double check that we have needed functions + include(CheckLibraryExists) + check_library_exists(${MINIZIP_LIBRARIES} "unzGoToFirstFile2" "" MINIZIP_HAS_GOTOFIRSTFILE2) + if(NOT MINIZIP_HAS_GOTOFIRSTFILE2) + message(FATAL_ERROR "Minizip library on you system very old. Please use recent version from https://github.com/nmoinvaz/minizip or enable USE_PREBUILT_LIBS") + endif() + add_definitions(-DMINIZIP_FROM_SYSTEM) +endif() + +cocos_find_package(PNG PNG REQUIRED) +cocos_find_package(TIFF TIFF REQUIRED) +cocos_find_package(WEBSOCKETS WEBSOCKETS REQUIRED) +cocos_find_package(CURL CURL REQUIRED) + + +add_subdirectory(frameworks/js-bindings/cocos2d-x/external/flatbuffers) +set(FLATBUFFERS_INCLUDE_DIRS frameworks/js-bindings/cocos2d-x/external) +message(STATUS "Flatbuffers include dirs: ${FLATBUFFERS_INCLUDE_DIRS}") + + +# build xxhash +add_subdirectory(frameworks/js-bindings/cocos2d-x/external/xxhash) +include_directories(frameworks/js-bindings/cocos2d-x/external/xxhash) + +set(GAME_SRC + frameworks/runtime-src/proj.linux/main.cpp + frameworks/runtime-src/Classes/AppDelegate.cpp +) + +# cocos2d +add_subdirectory(frameworks/js-bindings/cocos2d-x/cocos) + +#jsbindings library +add_subdirectory(frameworks/js-bindings/bindings) + + +# add the executable +add_executable(${APP_NAME} + ${GAME_SRC} +) + +target_link_libraries(${APP_NAME} + jsbindings + cocos2d +) + +set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") + +set_target_properties(${APP_NAME} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}") + +pre_build(${APP_NAME} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/script + COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/res + COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/src + COMMAND ${CMAKE_COMMAND} -E remove ${APP_BIN_DIR}/*.js + COMMAND ${CMAKE_COMMAND} -E remove ${APP_BIN_DIR}/*.json + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/res ${APP_BIN_DIR}/res + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${APP_BIN_DIR}/src + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js-bindings/bindings/script ${APP_BIN_DIR}/script + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.js ${APP_BIN_DIR}/main.js + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/project.json ${APP_BIN_DIR}/project.json +) + diff --git a/templates/js-template-default/cocos-project-template.json b/templates/js-template-default/cocos-project-template.json new file mode 100644 index 0000000000..1bcef35ec9 --- /dev/null +++ b/templates/js-template-default/cocos-project-template.json @@ -0,0 +1,114 @@ +{ + "do_default":{ + "exclude_from_template":[ + "frameworks/runtime-src" + ], + "append_h5_engine":{ + "from":"web", + "to":"frameworks/cocos2d-html5" + }, + "append_file":[ + { + "from":"web/jsb_apis.js", + "to":"frameworks/cocos2d-html5/jsb_apis.js" + } + ] + }, + "do_add_native_support":{ + "append_from_template":{ + "from":"frameworks/runtime-src", + "to":"frameworks/runtime-src", + "exclude":[ + "proj.android/bin", + "proj.android/assets", + "proj.android/libs", + "proj.ios_mac/HelloJavascript.xcodeproj/project.xcworkspace", + "proj.ios_mac/HelloJavascript.xcodeproj/xcuserdata", + "proj.win32/Debug.win32", + "proj.win32/Release.win32", + "proj.win32/HelloJavascript.sdf", + "proj.win8.1-universal/HelloJavascript.sdf", + "proj.win8.1-universal/HelloJavascript.v12.suo", + "proj.win8.1-universal/ipch", + "proj.win8.1-universal/Debug", + "proj.win8.1-universal/Release", + "proj.win8.1-universal/ARM" + ] + }, + "append_x_engine":{ + "from":".", + "to":"frameworks/cocos2d-x" + }, + "project_rename":{ + "src_project_name":"HelloJavascript", + "files":[ + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj", + "frameworks/runtime-src/proj.wp8-xaml/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.wp8-xaml/App/PROJECT_NAME.csproj", + "frameworks/runtime-src/proj.wp8-xaml/AppComponent/PROJECT_NAMEComponent.vcxproj", + "frameworks/runtime-src/proj.wp8-xaml/AppComponent/PROJECT_NAMEComponent.vcxproj.filters", + "frameworks/runtime-src/proj.win8.1-universal/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems", + "frameworks/runtime-src/proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems.filters", + "frameworks/runtime-src/proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj", + "frameworks/runtime-src/proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj.filters", + "frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj", + "frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj.filters" + ] + }, + "project_replace_project_name":{ + "src_project_name":"HelloJavascript", + "files":[ + "manifest.webapp", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win32/main.cpp", + "frameworks/runtime-src/proj.wp8-xaml/App/PROJECT_NAME.csproj", + "frameworks/runtime-src/proj.wp8-xaml/App/Properties/WMAppManifest.xml", + "frameworks/runtime-src/proj.wp8-xaml/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.ios_mac/ios/main.m", + "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", + "frameworks/runtime-src/proj.win8.1-universal/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems", + "frameworks/runtime-src/proj.win8.1-universal/App.Shared/PROJECT_NAME.Shared.vcxitems.filters", + "frameworks/runtime-src/proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj", + "frameworks/runtime-src/proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj.filters", + "frameworks/runtime-src/proj.win8.1-universal/App.Windows/Package.appxmanifest", + "frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj", + "frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj.filters", + "frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest", + "frameworks/runtime-src/Classes/AppDelegate.cpp" + ] + }, + "project_replace_package_name":{ + "src_package_name":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid":{ + "src_bundle_id":"org.cocos2dx.hellojavascript", + "files":[ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] + } + } +} + diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..e4bcf44553 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -0,0 +1,143 @@ +#include "AppDelegate.h" + +#include "SimpleAudioEngine.h" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_ui_auto.hpp" +#include "jsb_cocos2dx_studio_auto.hpp" +#include "jsb_cocos2dx_builder_auto.hpp" +#include "jsb_cocos2dx_spine_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_3d_auto.hpp" +#include "jsb_cocos2dx_3d_extension_auto.hpp" +#include "3d/jsb_cocos2dx_3d_manual.h" +#include "ui/jsb_cocos2dx_ui_manual.h" +#include "cocostudio/jsb_cocos2dx_studio_manual.h" +#include "cocosbuilder/js_bindings_ccbreader.h" +#include "spine/jsb_cocos2dx_spine_manual.h" +#include "extension/jsb_cocos2dx_extension_manual.h" +#include "localstorage/js_bindings_system_registration.h" +#include "chipmunk/js_bindings_chipmunk_registration.h" +#include "jsb_opengl_registration.h" +#include "network/XMLHTTPRequest.h" +#include "network/jsb_websocket.h" +#include "network/jsb_socketio.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#include "platform/android/CCJavascriptJavaBridge.h" +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#include "platform/ios/JavaScriptObjCBridge.h" +#endif + +USING_NS_CC; +using namespace CocosDenshion; + +AppDelegate::AppDelegate() +{ +} + +AppDelegate::~AppDelegate() +{ + ScriptEngineManager::destroyInstance(); +} + +void AppDelegate::initGLContextAttrs() +{ + GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; + + GLView::setGLContextAttrs(glContextAttrs); +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + // initialize director + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if(!glview) { +#if(CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + glview = cocos2d::GLViewImpl::create("HelloJavascript"); +#else + glview = cocos2d::GLViewImpl::createWithRect("HelloJavascript", Rect(0,0,900,640)); +#endif + director->setOpenGLView(glview); +} + + // set FPS. the default value is 1.0/60 if you don't call this + director->setAnimationInterval(1.0 / 60); + + ScriptingCore* sc = ScriptingCore::getInstance(); + sc->addRegisterCallback(register_all_cocos2dx); + sc->addRegisterCallback(register_cocos2dx_js_core); + sc->addRegisterCallback(jsb_register_system); + + // extension can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_extension); + sc->addRegisterCallback(register_all_cocos2dx_extension_manual); + + // chipmunk can be commented out to reduce the package + sc->addRegisterCallback(jsb_register_chipmunk); + // opengl can be commented out to reduce the package + sc->addRegisterCallback(JSB_register_opengl); + + // builder can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_builder); + sc->addRegisterCallback(register_CCBuilderReader); + + // ui can be commented out to reduce the package, attension studio need ui module + sc->addRegisterCallback(register_all_cocos2dx_ui); + sc->addRegisterCallback(register_all_cocos2dx_ui_manual); + + // studio can be commented out to reduce the package, + sc->addRegisterCallback(register_all_cocos2dx_studio); + sc->addRegisterCallback(register_all_cocos2dx_studio_manual); + + // spine can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_spine); + sc->addRegisterCallback(register_all_cocos2dx_spine_manual); + + // XmlHttpRequest can be commented out to reduce the package + sc->addRegisterCallback(MinXmlHttpRequest::_js_register); + // websocket can be commented out to reduce the package + sc->addRegisterCallback(register_jsb_websocket); + // sokcet io can be commented out to reduce the package + sc->addRegisterCallback(register_jsb_socketio); + + // 3d can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_3d); + sc->addRegisterCallback(register_all_cocos2dx_3d_manual); + + // 3d extension can be commented out to reduce the package + sc->addRegisterCallback(register_all_cocos2dx_3d_extension); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + sc->addRegisterCallback(JavascriptJavaBridge::_js_register); +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + sc->addRegisterCallback(JavaScriptObjCBridge::_js_register); +#endif + sc->start(); + sc->runScript("script/jsb_boot.js"); + ScriptEngineProtocol *engine = ScriptingCore::getInstance(); + ScriptEngineManager::getInstance()->setScriptEngine(engine); + ScriptingCore::getInstance()->runScript("main.js"); + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + auto director = Director::getInstance(); + director->stopAnimation(); + director->getEventDispatcher()->dispatchCustomEvent("game_on_hide"); + SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); + SimpleAudioEngine::getInstance()->pauseAllEffects(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + auto director = Director::getInstance(); + director->startAnimation(); + director->getEventDispatcher()->dispatchCustomEvent("game_on_show"); + SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); + SimpleAudioEngine::getInstance()->resumeAllEffects(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h new file mode 100644 index 0000000000..fc614c95af --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h @@ -0,0 +1,47 @@ +// +// GCTestAppDelegate.h +// GCTest +// +// Created by Rohan Kuruvilla on 06/08/2012. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ + +#include "platform/CCApplication.h" +/** + @brief The cocos2d Application. + + The reason for implement as private inheritance is to hide some interface call by Director. + */ +class AppDelegate : private cocos2d::Application +{ +public: + AppDelegate(); + virtual ~AppDelegate(); + + void initGLContextAttrs() override; + + /** + @brief Implement Director and Scene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); + + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); +}; + +#endif // _APP_DELEGATE_H_ + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/.classpath b/templates/js-template-default/frameworks/runtime-src/proj.android/.classpath new file mode 100644 index 0000000000..d57ec02513 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/.project b/templates/js-template-default/frameworks/runtime-src/proj.android/.project new file mode 100644 index 0000000000..2509d6ba53 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/.project @@ -0,0 +1,50 @@ + + + HelloJavascript + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + jsjavabridge + 2 + PARENT-2-PROJECT_LOC/js-bindings/bindings/manual/platform/android/java/src + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs b/templates/js-template-default/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..b080d2ddc8 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml b/templates/js-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml new file mode 100644 index 0000000000..0aaa49d85f --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/README.md b/templates/js-template-default/frameworks/runtime-src/proj.android/README.md new file mode 100644 index 0000000000..2d13175ad0 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/README.md @@ -0,0 +1 @@ +Reference:[compilation in eclipse](https://github.com/chukong/cocos-docs/blob/master/manual/framework/html5/v3/compilation-in-eclipse/en.md) \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/ant.properties b/templates/js-template-default/frameworks/runtime-src/proj.android/ant.properties new file mode 100644 index 0000000000..f8af38bfb4 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/ant.properties @@ -0,0 +1 @@ +aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/build-cfg.json b/templates/js-template-default/frameworks/runtime-src/proj.android/build-cfg.json new file mode 100644 index 0000000000..d427ea47b6 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/build-cfg.json @@ -0,0 +1,29 @@ +{ + "ndk_module_path" :[ + "../../cocos2d-x", + "../../cocos2d-x/cocos", + "../../cocos2d-x/external" + ], + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../cocos2d-x/cocos/scripting/js-bindings/script", + "to": "script" + } + ] +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/build.xml b/templates/js-template-default/frameworks/runtime-src/proj.android/build.xml new file mode 100644 index 0000000000..b46375fda9 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py b/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py new file mode 100755 index 0000000000..31c3ef4513 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py @@ -0,0 +1,174 @@ +#!/usr/bin/python + +''' +build_native.py + +This script will copy resources to assets and build native code with NDK. +''' +import sys +import os, os.path +import shutil +from optparse import OptionParser + +def get_num_of_cpu(): + ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. + ''' + try: + platform = sys.platform + if platform == 'win32': + if 'NUMBER_OF_PROCESSORS' in os.environ: + return int(os.environ['NUMBER_OF_PROCESSORS']) + else: + return 1 + else: + from numpy.distutils import cpuinfo + return cpuinfo.cpu._getNCPUs() + except Exception: + print "Can't know cpuinfo, use default 1 cpu" + return 1 + +def check_environment_variables(): + ''' Checking the environment NDK_ROOT, which will be used for building + ''' + + try: + NDK_ROOT = os.environ['NDK_ROOT'] + except Exception: + print "NDK_ROOT not defined. Please define NDK_ROOT in your environment" + sys.exit(1) + + return NDK_ROOT + +def select_toolchain_version(ndk_root): + ret_version = "4.8" + + version_file_path = os.path.join(ndk_root, "RELEASE.TXT") + try: + versionFile = open(version_file_path) + lines = versionFile.readlines() + versionFile.close() + + version_num = None + version_char = None + pattern = r'^[a-zA-Z]+(\d+)(\w)' + for line in lines: + str_line = line.lstrip() + match = re.match(pattern, str_line) + if match: + version_num = int(match.group(1)) + version_char = match.group(2) + break + + if version_num is None: + print("Parse NDK version from file %s failed." % version_file_path) + else: + version_char = version_char.lower() + if version_num > 10 or (version_num == 10 and cmp(version_char, 'c') >= 0): + ret_version = "4.9" + + except: + print("Parse NDK version from file %s failed." % version_file_path) + + print("NDK_TOOLCHAIN_VERSION: %s" % ret_version) + if ret_version == "4.8": + print( + "Your application may crash when using c++ 11 regular expression with NDK_TOOLCHAIN_VERSION %s" % ret_version) + + return ret_version + +def do_build(cocos_root, ndk_root, app_android_root, ndk_build_param,sdk_root,build_mode): + + ndk_path = os.path.join(ndk_root, "ndk-build") + ndk_toolchain_version = select_toolchain_version(ndk_root) + + # windows should use ";" to seperate module paths + platform = sys.platform + if platform == 'win32': + ndk_module_path = 'NDK_MODULE_PATH=%s/..;%s;%s/external;%s/cocos NDK_TOOLCHAIN_VERSION=%s' % (cocos_root, cocos_root, cocos_root, cocos_root, ndk_toolchain_version) + else: + ndk_module_path = 'NDK_MODULE_PATH=%s/..:%s:%s/external:%s/cocos NDK_TOOLCHAIN_VERSION=%s' % (cocos_root, cocos_root, cocos_root, cocos_root, ndk_toolchain_version) + + num_of_cpu = get_num_of_cpu() + if ndk_build_param == None: + command = '%s -j%d -C %s NDK_DEBUG=%d %s' % (ndk_path, num_of_cpu, app_android_root, build_mode=='debug', ndk_module_path) + else: + command = '%s -j%d -C %s NDK_DEBUG=%d %s %s' % (ndk_path, num_of_cpu, app_android_root, build_mode=='debug', ndk_build_param, ndk_module_path) + print command + if os.system(command) != 0: + raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") + +def copy_files(src, dst): + + for item in os.listdir(src): + path = os.path.join(src, item) + # Android can not package the file that ends with ".gz" + if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path): + shutil.copy(path, dst) + if os.path.isdir(path): + new_dst = os.path.join(dst, item) + os.mkdir(new_dst) + copy_files(path, new_dst) + +def copy_resources(app_android_root): + + # remove app_android_root/assets if it exists + assets_dir = os.path.join(app_android_root, "assets") + if os.path.isdir(assets_dir): + shutil.rmtree(assets_dir) + + # copy resources + os.mkdir(assets_dir) + + assets_res_dir = assets_dir + "/res"; + assets_scripts_dir = assets_dir + "/src"; + assets_jsb_dir = assets_dir + "/script"; + os.mkdir(assets_res_dir); + os.mkdir(assets_scripts_dir); + os.mkdir(assets_jsb_dir); + + + shutil.copy(os.path.join(app_android_root, "../../../main.js"), assets_dir) + shutil.copy(os.path.join(app_android_root, "../../../project.json"), assets_dir) + + resources_dir = os.path.join(app_android_root, "../../../res") + copy_files(resources_dir, assets_res_dir) + + resources_dir = os.path.join(app_android_root, "../../../src") + copy_files(resources_dir, assets_scripts_dir) + + resources_dir = os.path.join(app_android_root, "../../../frameworks/js-bindings/bindings/script") + copy_files(resources_dir, assets_jsb_dir) + +def build(targets,ndk_build_param,build_mode): + + ndk_root = check_environment_variables() + sdk_root = None + + project_root = os.path.dirname(os.path.realpath(__file__)) + cocos_root = os.path.join(project_root, "..", "..", "..", "frameworks/js-bindings/cocos2d-x") + + print cocos_root + + if build_mode is None: + build_mode = 'debug' + elif build_mode != 'release': + build_mode = 'debug' + + copy_resources(project_root) + do_build(cocos_root, ndk_root, project_root,ndk_build_param,sdk_root,build_mode) + +# -------------- main -------------- +if __name__ == '__main__': + + parser = OptionParser() + parser.add_option("-n", "--ndk", dest="ndk_build_param", + help='Parameter for ndk-build') + parser.add_option("-b", "--build", dest="build_mode", + help='The build mode for NDK project, debug or release') + (opts, args) = parser.parse_args() + + try: + build(args, opts.ndk_build_param,opts.build_mode) + except Exception as e: + print e + sys.exit(1) diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Android.mk b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Android.mk new file mode 100644 index 0000000000..bf30c1d3c5 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := cocos2djs_shared + +LOCAL_MODULE_FILENAME := libcocos2djs + +LOCAL_SRC_FILES := hellojavascript/main.cpp \ + ../../Classes/AppDelegate.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes + +LOCAL_STATIC_LIBRARIES := cocos2d_js_static + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT + +include $(BUILD_SHARED_LIBRARY) + + +$(call import-module, scripting/js-bindings/proj.android) diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk new file mode 100644 index 0000000000..706af60331 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/Application.mk @@ -0,0 +1,15 @@ +APP_STL := gnustl_static + +# Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices +#APP_ABI := armeabi-v7a + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + +ifeq ($(NDK_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/proguard-project.txt b/templates/js-template-default/frameworks/runtime-src/proj.android/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/project.properties b/templates/js-template-default/frameworks/runtime-src/proj.android/project.properties new file mode 100644 index 0000000000..8e5895514b --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/project.properties @@ -0,0 +1,13 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-10 + +android.library.reference.1=../../cocos2d-x/cocos/platform/android/java diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png new file mode 100644 index 0000000000..8aa4767c2f Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png new file mode 100644 index 0000000000..17ce11a085 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png new file mode 100644 index 0000000000..3780aac46c Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/strings.xml b/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/strings.xml new file mode 100644 index 0000000000..c847de2851 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + HelloJavascript + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java b/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java new file mode 100644 index 0000000000..7bc1264c83 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java @@ -0,0 +1,42 @@ +/**************************************************************************** +Copyright (c) 2008-2010 Ricardo Quesada +Copyright (c) 2010-2012 cocos2d-x.org +Copyright (c) 2011 Zynga Inc. +Copyright (c) 2013-2014 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.javascript; + +import org.cocos2dx.lib.Cocos2dxActivity; +import org.cocos2dx.lib.Cocos2dxGLSurfaceView; + +public class AppActivity extends Cocos2dxActivity { + + @Override + public Cocos2dxGLSurfaceView onCreateView() { + Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); + // TestCpp should create stencil buffer + glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); + + return glSurfaceView; + } +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..3d9535e1ef --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -0,0 +1,966 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */; }; + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */; }; + 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; + 1AC22EDE18CA0E11007112B9 /* project.json in Resources */ = {isa = PBXBuildFile; fileRef = 1A1A081B18C9DF05005C6854 /* project.json */; }; + 1AD7E0A818C9DB93004817A6 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6BF21418C9DB5900FB0E1C /* main.js */; }; + 1AD7E0A918C9DBE3004817A6 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6BF21418C9DB5900FB0E1C /* main.js */; }; + 1AE159EC18C9DF3600FCA372 /* project.json in Resources */ = {isa = PBXBuildFile; fileRef = 1A1A081B18C9DF05005C6854 /* project.json */; }; + 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 502380DB17EBB88200990C9B /* libcurl.dylib */; }; + 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731417ECDF7A00D62437 /* Icon-29.png */; }; + 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731517ECDF7A00D62437 /* Icon-40.png */; }; + 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731617ECDF7A00D62437 /* Icon-50.png */; }; + 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731717ECDF7A00D62437 /* Icon-58.png */; }; + 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731817ECDF7A00D62437 /* Icon-80.png */; }; + 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731917ECDF7A00D62437 /* Icon-100.png */; }; + 509D4A8117EBB24E00697056 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; + 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; + 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; }; + 509D4A8A17EBB24E00697056 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + 509D4A8C17EBB24E00697056 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + 509D4A8D17EBB24E00697056 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + 509D4A8E17EBB24E00697056 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + 509D4ABC17EBB2AB00697056 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 509D4AAC17EBB2AB00697056 /* AppController.mm */; }; + 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */; }; + 509D4ABE17EBB2AB00697056 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAE17EBB2AB00697056 /* Default.png */; }; + 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AAF17EBB2AB00697056 /* Default@2x.png */; }; + 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB017EBB2AB00697056 /* Icon-57.png */; }; + 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB117EBB2AB00697056 /* Icon-72.png */; }; + 509D4AC217EBB2AB00697056 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB217EBB2AB00697056 /* Icon-76.png */; }; + 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB317EBB2AB00697056 /* Icon-114.png */; }; + 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB417EBB2AB00697056 /* Icon-120.png */; }; + 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB517EBB2AB00697056 /* Icon-144.png */; }; + 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 509D4AB617EBB2AB00697056 /* Icon-152.png */; }; + 509D4AC817EBB2AB00697056 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 509D4AB817EBB2AB00697056 /* main.m */; }; + 509D4AC917EBB2AB00697056 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 509D4ABB17EBB2AB00697056 /* RootViewController.mm */; }; + 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 509D4ACB17EBB2BE00697056 /* Icon.icns */; }; + 509D4AE717EBB81800697056 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AE617EBB81800697056 /* OpenGL.framework */; }; + 509D4AE917EBB82000697056 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AE817EBB82000697056 /* AppKit.framework */; }; + 509D4AEB17EBB82600697056 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 509D4AEA17EBB82600697056 /* IOKit.framework */; }; + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275431517C094001B78AA /* OpenGLES.framework */; }; + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754B1517C094001B78AA /* UIKit.framework */; }; + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + BA3A85EC1A724AE900924D24 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA3A85EB1A724AE900924D24 /* Security.framework */; }; + BA4E718119EB6E3F00932425 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA4E718019EB6E3E00932425 /* MediaPlayer.framework */; }; + BAEE4D841AC40C11003BEB0F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEE4D831AC40C11003BEB0F /* Security.framework */; }; + BAF426FB19484B3E002B22EF /* script in Resources */ = {isa = PBXBuildFile; fileRef = BAF426FA19484B3E002B22EF /* script */; }; + BAF426FC19484B3E002B22EF /* script in Resources */ = {isa = PBXBuildFile; fileRef = BAF426FA19484B3E002B22EF /* script */; }; + C03780EB18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; }; + C03780EC18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; }; + C037820C18BF77C500FE4F13 /* libjscocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */; }; + C037820F18BF77DE00FE4F13 /* libjscocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */; }; + C06E23CC18CEFE680093C81A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06E23CB18CEFE680093C81A /* main.cpp */; }; + C0799CB918BAE62000E9C828 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C0799CB518BAE62000E9C828 /* res */; }; + C0799CBA18BAE62000E9C828 /* res in Resources */ = {isa = PBXBuildFile; fileRef = C0799CB518BAE62000E9C828 /* res */; }; + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; }; + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; + D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061231803AB9F0077942B /* CoreMotion.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2B781780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2E9817814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1A676830180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1A676832180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1A676834180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1551A33F158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2FD617814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2CB81780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2D9B1780BDF7006731B9; + remoteInfo = "box2d Mac"; + }; + 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A03F2ED617814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4D641783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4EFC1783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4F3B178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4F9E1783876B0073F6A7; + remoteInfo = "box2d iOS"; + }; + 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A07A4FB4178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + C037820618BF76AF00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1A5410A418B785A10016A3AF; + remoteInfo = "jsbindings Mac"; + }; + C037820818BF76AF00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1A5410A518B785A10016A3AF; + remoteInfo = "jsbindings iOS"; + }; + C037820A18BF77BC00FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4FB5178387750073F6A7; + remoteInfo = "jsbindings iOS"; + }; + C037820D18BF77D100FE4F13 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F31E81781479B006731B9; + remoteInfo = "jsbindings Mac"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1A1A081B18C9DF05005C6854 /* project.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = project.json; path = ../../../project.json; sourceTree = ""; }; + 1A6BF21418C9DB5900FB0E1C /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../../main.js; sourceTree = ""; }; + 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = ""; }; + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; + 502380DB17EBB88200990C9B /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; + 5091731417ECDF7A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-29.png"; path = "ios/Icon-29.png"; sourceTree = ""; }; + 5091731517ECDF7A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-40.png"; path = "ios/Icon-40.png"; sourceTree = ""; }; + 5091731617ECDF7A00D62437 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-50.png"; path = "ios/Icon-50.png"; sourceTree = ""; }; + 5091731717ECDF7A00D62437 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-58.png"; path = "ios/Icon-58.png"; sourceTree = ""; }; + 5091731817ECDF7A00D62437 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-80.png"; path = "ios/Icon-80.png"; sourceTree = ""; }; + 5091731917ECDF7A00D62437 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-100.png"; path = "ios/Icon-100.png"; sourceTree = ""; }; + 509D4AAA17EBB24E00697056 /* HelloJavascript Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloJavascript Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 509D4AAB17EBB2AB00697056 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = ios/AppController.h; sourceTree = ""; }; + 509D4AAC17EBB2AB00697056 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppController.mm; path = ios/AppController.mm; sourceTree = ""; }; + 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "ios/Default-568h@2x.png"; sourceTree = ""; }; + 509D4AAE17EBB2AB00697056 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ios/Default.png; sourceTree = ""; }; + 509D4AAF17EBB2AB00697056 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "ios/Default@2x.png"; sourceTree = ""; }; + 509D4AB017EBB2AB00697056 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-57.png"; path = "ios/Icon-57.png"; sourceTree = ""; }; + 509D4AB117EBB2AB00697056 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "ios/Icon-72.png"; sourceTree = ""; }; + 509D4AB217EBB2AB00697056 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-76.png"; path = "ios/Icon-76.png"; sourceTree = ""; }; + 509D4AB317EBB2AB00697056 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-114.png"; path = "ios/Icon-114.png"; sourceTree = ""; }; + 509D4AB417EBB2AB00697056 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-120.png"; path = "ios/Icon-120.png"; sourceTree = ""; }; + 509D4AB517EBB2AB00697056 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-144.png"; path = "ios/Icon-144.png"; sourceTree = ""; }; + 509D4AB617EBB2AB00697056 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-152.png"; path = "ios/Icon-152.png"; sourceTree = ""; }; + 509D4AB717EBB2AB00697056 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ios/Info.plist; sourceTree = ""; }; + 509D4AB817EBB2AB00697056 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ios/main.m; sourceTree = ""; }; + 509D4AB917EBB2AB00697056 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = ios/Prefix.pch; sourceTree = ""; }; + 509D4ABA17EBB2AB00697056 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = ios/RootViewController.h; sourceTree = ""; }; + 509D4ABB17EBB2AB00697056 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RootViewController.mm; path = ios/RootViewController.mm; sourceTree = ""; }; + 509D4ACB17EBB2BE00697056 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + 509D4ACC17EBB2BE00697056 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 509D4ACE17EBB2BE00697056 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; + 509D4AE617EBB81800697056 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 509D4AE817EBB82000697056 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 509D4AEA17EBB82600697056 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + A922753D1517C094001B78AA /* HelloJavascript iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloJavascript iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + A92275431517C094001B78AA /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + A92275471517C094001B78AA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + A92275491517C094001B78AA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + A922754B1517C094001B78AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + BA3A85EB1A724AE900924D24 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + BA4E718019EB6E3E00932425 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; + BA4E718219EB6E4600932425 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/GameController.framework; sourceTree = DEVELOPER_DIR; }; + BAEE4D831AC40C11003BEB0F /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + BAF426FA19484B3E002B22EF /* script */ = {isa = PBXFileReference; lastKnownFileType = folder; name = script; path = "../../cocos2d-x/cocos/scripting/js-bindings/script"; sourceTree = ""; }; + C03780EA18BEE0E400FE4F13 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../../../src; sourceTree = ""; }; + C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../../cocos2d-x/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = ""; }; + C06E23CB18CEFE680093C81A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + C0799CB518BAE62000E9C828 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../../../res; sourceTree = ""; }; + D454520B156E22BD00887EB5 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; + D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D6B061231803AB9F0077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 509D4A8217EBB24E00697056 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BAEE4D841AC40C11003BEB0F /* Security.framework in Frameworks */, + C037820F18BF77DE00FE4F13 /* libjscocos2d Mac.a in Frameworks */, + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */, + 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */, + 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */, + 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */, + 509D4AEB17EBB82600697056 /* IOKit.framework in Frameworks */, + 509D4AE917EBB82000697056 /* AppKit.framework in Frameworks */, + 509D4AE717EBB81800697056 /* OpenGL.framework in Frameworks */, + 509D4A8A17EBB24E00697056 /* QuartzCore.framework in Frameworks */, + 509D4A8C17EBB24E00697056 /* OpenAL.framework in Frameworks */, + 509D4A8D17EBB24E00697056 /* AudioToolbox.framework in Frameworks */, + 509D4A8E17EBB24E00697056 /* AVFoundation.framework in Frameworks */, + 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */, + 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A922753A1517C094001B78AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BA3A85EC1A724AE900924D24 /* Security.framework in Frameworks */, + BA4E718119EB6E3F00932425 /* MediaPlayer.framework in Frameworks */, + C037820C18BF77C500FE4F13 /* libjscocos2d iOS.a in Frameworks */, + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */, + D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */, + 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */, + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */, + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */, + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */, + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */, + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 15628F5B15F0F5C2000CF24B /* Resources */ = { + isa = PBXGroup; + children = ( + 1A1A081B18C9DF05005C6854 /* project.json */, + 1A6BF21418C9DB5900FB0E1C /* main.js */, + C0799CB518BAE62000E9C828 /* res */, + C03780EA18BEE0E400FE4F13 /* src */, + ); + name = Resources; + sourceTree = ""; + }; + 1AC6FB35180E9ACB004C840B /* Products */ = { + isa = PBXGroup; + children = ( + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */, + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */, + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */, + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */, + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */, + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */, + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */, + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */, + ); + name = Products; + sourceTree = ""; + }; + 5091732E17ECDF8A00D62437 /* Icons */ = { + isa = PBXGroup; + children = ( + 5091731417ECDF7A00D62437 /* Icon-29.png */, + 5091731517ECDF7A00D62437 /* Icon-40.png */, + 5091731617ECDF7A00D62437 /* Icon-50.png */, + 5091731717ECDF7A00D62437 /* Icon-58.png */, + 5091731817ECDF7A00D62437 /* Icon-80.png */, + 5091731917ECDF7A00D62437 /* Icon-100.png */, + 509D4AB017EBB2AB00697056 /* Icon-57.png */, + 509D4AB117EBB2AB00697056 /* Icon-72.png */, + 509D4AB217EBB2AB00697056 /* Icon-76.png */, + 509D4AB317EBB2AB00697056 /* Icon-114.png */, + 509D4AB417EBB2AB00697056 /* Icon-120.png */, + 509D4AB517EBB2AB00697056 /* Icon-144.png */, + 509D4AB617EBB2AB00697056 /* Icon-152.png */, + ); + name = Icons; + sourceTree = ""; + }; + 509D4ACA17EBB2BE00697056 /* mac */ = { + isa = PBXGroup; + children = ( + C06E23CB18CEFE680093C81A /* main.cpp */, + 509D4ACB17EBB2BE00697056 /* Icon.icns */, + 509D4ACC17EBB2BE00697056 /* Info.plist */, + 509D4ACE17EBB2BE00697056 /* Prefix.pch */, + ); + path = mac; + sourceTree = ""; + }; + A92275321517C094001B78AA = { + isa = PBXGroup; + children = ( + C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */, + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */, + BAF426FA19484B3E002B22EF /* script */, + D4545214156E28EF00887EB5 /* Classes */, + A92275401517C094001B78AA /* Frameworks */, + D45446CC156DE73F00887EB5 /* ios */, + 509D4ACA17EBB2BE00697056 /* mac */, + A922753E1517C094001B78AA /* Products */, + 15628F5B15F0F5C2000CF24B /* Resources */, + ); + sourceTree = ""; + }; + A922753E1517C094001B78AA /* Products */ = { + isa = PBXGroup; + children = ( + A922753D1517C094001B78AA /* HelloJavascript iOS.app */, + 509D4AAA17EBB24E00697056 /* HelloJavascript Mac.app */, + ); + name = Products; + sourceTree = ""; + }; + A92275401517C094001B78AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + BAEE4D831AC40C11003BEB0F /* Security.framework */, + BA3A85EB1A724AE900924D24 /* Security.framework */, + BA4E718219EB6E4600932425 /* GameController.framework */, + BA4E718019EB6E3E00932425 /* MediaPlayer.framework */, + D6B061231803AB9F0077942B /* CoreMotion.framework */, + 502380DB17EBB88200990C9B /* libcurl.dylib */, + 509D4AEA17EBB82600697056 /* IOKit.framework */, + 509D4AE817EBB82000697056 /* AppKit.framework */, + 509D4AE617EBB81800697056 /* OpenGL.framework */, + 1A96A4F2174A3432008653A9 /* libcurl.a */, + 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */, + D454520B156E22BD00887EB5 /* libz.dylib */, + A92275411517C094001B78AA /* QuartzCore.framework */, + A92275431517C094001B78AA /* OpenGLES.framework */, + A92275451517C094001B78AA /* OpenAL.framework */, + A92275471517C094001B78AA /* AudioToolbox.framework */, + A92275491517C094001B78AA /* AVFoundation.framework */, + A922754B1517C094001B78AA /* UIKit.framework */, + A922754D1517C094001B78AA /* Foundation.framework */, + A922754F1517C094001B78AA /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C037820218BF76AF00FE4F13 /* Products */ = { + isa = PBXGroup; + children = ( + C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */, + C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */, + ); + name = Products; + sourceTree = ""; + }; + D45446CC156DE73F00887EB5 /* ios */ = { + isa = PBXGroup; + children = ( + 509D4AAB17EBB2AB00697056 /* AppController.h */, + 509D4AAC17EBB2AB00697056 /* AppController.mm */, + 509D4AAD17EBB2AB00697056 /* Default-568h@2x.png */, + 509D4AAE17EBB2AB00697056 /* Default.png */, + 509D4AAF17EBB2AB00697056 /* Default@2x.png */, + 5091732E17ECDF8A00D62437 /* Icons */, + 509D4AB717EBB2AB00697056 /* Info.plist */, + 509D4AB817EBB2AB00697056 /* main.m */, + 509D4AB917EBB2AB00697056 /* Prefix.pch */, + 509D4ABA17EBB2AB00697056 /* RootViewController.h */, + 509D4ABB17EBB2AB00697056 /* RootViewController.mm */, + ); + name = ios; + sourceTree = ""; + }; + D4545214156E28EF00887EB5 /* Classes */ = { + isa = PBXGroup; + children = ( + D4545215156E28EF00887EB5 /* AppDelegate.cpp */, + D4545216156E28EF00887EB5 /* AppDelegate.h */, + ); + name = Classes; + path = ../Classes; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 509D4A7517EBB24E00697056 /* HelloJavascript Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript Mac" */; + buildPhases = ( + 509D4A8017EBB24E00697056 /* Sources */, + 509D4A9317EBB24E00697056 /* Resources */, + 509D4A8217EBB24E00697056 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C037820E18BF77D100FE4F13 /* PBXTargetDependency */, + 1A676820180E9BF70076BC67 /* PBXTargetDependency */, + 1A676822180E9BF70076BC67 /* PBXTargetDependency */, + 1A676824180E9BF70076BC67 /* PBXTargetDependency */, + 1A676826180E9BF70076BC67 /* PBXTargetDependency */, + ); + name = "HelloJavascript Mac"; + productName = HelloJavascript; + productReference = 509D4AAA17EBB24E00697056 /* HelloJavascript Mac.app */; + productType = "com.apple.product-type.application"; + }; + A922753C1517C094001B78AA /* HelloJavascript iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript iOS" */; + buildPhases = ( + A92275391517C094001B78AA /* Sources */, + A922753A1517C094001B78AA /* Frameworks */, + A922753B1517C094001B78AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C037820B18BF77BC00FE4F13 /* PBXTargetDependency */, + 1A67682F180E9C110076BC67 /* PBXTargetDependency */, + 1A676831180E9C110076BC67 /* PBXTargetDependency */, + 1A676833180E9C110076BC67 /* PBXTargetDependency */, + 1A676835180E9C110076BC67 /* PBXTargetDependency */, + ); + name = "HelloJavascript iOS"; + productName = HelloJavascript; + productReference = A922753D1517C094001B78AA /* HelloJavascript iOS.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A92275341517C094001B78AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + TargetAttributes = { + A922753C1517C094001B78AA = { + DevelopmentTeam = MDDB52YB8L; + }; + }; + }; + buildConfigurationList = A92275371517C094001B78AA /* Build configuration list for PBXProject "HelloJavascript" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = A92275321517C094001B78AA; + productRefGroup = A922753E1517C094001B78AA /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = C037820218BF76AF00FE4F13 /* Products */; + ProjectRef = C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */; + }, + { + ProductGroup = 1AC6FB35180E9ACB004C840B /* Products */; + ProjectRef = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A922753C1517C094001B78AA /* HelloJavascript iOS */, + 509D4A7517EBB24E00697056 /* HelloJavascript Mac */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx Mac.a"; + remoteRef = 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx-extensions Mac.a"; + remoteRef = 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libchipmunk Mac.a"; + remoteRef = 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libbox2d Mac.a"; + remoteRef = 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCocosDenshion Mac.a"; + remoteRef = 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx iOS.a"; + remoteRef = 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcocos2dx-extensions iOS.a"; + remoteRef = 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libchipmunk iOS.a"; + remoteRef = 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libbox2d iOS.a"; + remoteRef = 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCocosDenshion iOS.a"; + remoteRef = 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C037820718BF76AF00FE4F13 /* libjscocos2d Mac.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjscocos2d Mac.a"; + remoteRef = C037820618BF76AF00FE4F13 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C037820918BF76AF00FE4F13 /* libjscocos2d iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjscocos2d iOS.a"; + remoteRef = C037820818BF76AF00FE4F13 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 509D4A9317EBB24E00697056 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1AC22EDE18CA0E11007112B9 /* project.json in Resources */, + 1AD7E0A918C9DBE3004817A6 /* main.js in Resources */, + C0799CBA18BAE62000E9C828 /* res in Resources */, + BAF426FC19484B3E002B22EF /* script in Resources */, + 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */, + C03780EC18BEE0E400FE4F13 /* src in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A922753B1517C094001B78AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BAF426FB19484B3E002B22EF /* script in Resources */, + 1AE159EC18C9DF3600FCA372 /* project.json in Resources */, + 1AD7E0A818C9DB93004817A6 /* main.js in Resources */, + 509D4ABE17EBB2AB00697056 /* Default.png in Resources */, + 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */, + 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */, + 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */, + 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */, + 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */, + C03780EB18BEE0E400FE4F13 /* src in Resources */, + 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */, + C0799CB918BAE62000E9C828 /* res in Resources */, + 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */, + 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */, + 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */, + 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */, + 509D4AC217EBB2AB00697056 /* Icon-76.png in Resources */, + 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */, + 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */, + 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */, + 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 509D4A8017EBB24E00697056 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 509D4A8117EBB24E00697056 /* AppDelegate.cpp in Sources */, + C06E23CC18CEFE680093C81A /* main.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A92275391517C094001B78AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 509D4AC917EBB2AB00697056 /* RootViewController.mm in Sources */, + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, + 509D4AC817EBB2AB00697056 /* main.m in Sources */, + 509D4ABC17EBB2AB00697056 /* AppController.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1A676820180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx Mac"; + targetProxy = 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676822180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions Mac"; + targetProxy = 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676824180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk Mac"; + targetProxy = 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676826180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion Mac"; + targetProxy = 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A67682F180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676831180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1A676830180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676833180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1A676832180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676835180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1A676834180E9C110076BC67 /* PBXContainerItemProxy */; + }; + C037820B18BF77BC00FE4F13 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings iOS"; + targetProxy = C037820A18BF77BC00FE4F13 /* PBXContainerItemProxy */; + }; + C037820E18BF77D100FE4F13 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings Mac"; + targetProxy = C037820D18BF77D100FE4F13 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 509D4AA817EBB24E00697056 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_MAC, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/mac $(SRCROOT)/../../cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/mac"; + }; + name = Debug; + }; + 509D4AA917EBB24E00697056 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = mac/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_MAC, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = mac/Info.plist; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/mac $(SRCROOT)/../../cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/mac"; + }; + name = Release; + }; + A92276FE1517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "COCOS2D_DEBUG=1", + USE_FILE32API, + COCOS2D_JAVASCRIPT, + CC_ENABLE_CHIPMUNK_INTEGRATION, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cocos2d-x $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/base $(SRCROOT)/../../cocos2d-x/cocos/physics $(SRCROOT)/../../cocos2d-x/cocos/math/kazmath $(SRCROOT)/../../cocos2d-x/cocos/2d $(SRCROOT)/../../cocos2d-x/cocos/gui $(SRCROOT)/../../cocos2d-x/cocos/network $(SRCROOT)/../../cocos2d-x/cocos/audio/include $(SRCROOT)/../../cocos2d-x/cocos/editor-support $(SRCROOT)/../../cocos2d-x/extensions $(SRCROOT)/../../cocos2d-x/external $(SRCROOT)/../../cocos2d-x/external/chipmunk/include/chipmunk $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/auto $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/manual"; + }; + name = Debug; + }; + A92276FF1517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ( + NDEBUG, + USE_FILE32API, + COCOS2D_JAVASCRIPT, + CC_ENABLE_CHIPMUNK_INTEGRATION, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cocos2d-x $(SRCROOT)/../../cocos2d-x/cocos $(SRCROOT)/../../cocos2d-x/cocos/base $(SRCROOT)/../../cocos2d-x/cocos/physics $(SRCROOT)/../../cocos2d-x/cocos/math/kazmath $(SRCROOT)/../../cocos2d-x/cocos/2d $(SRCROOT)/../../cocos2d-x/cocos/gui $(SRCROOT)/../../cocos2d-x/cocos/network $(SRCROOT)/../../cocos2d-x/cocos/audio/include $(SRCROOT)/../../cocos2d-x/cocos/editor-support $(SRCROOT)/../../cocos2d-x/extensions $(SRCROOT)/../../cocos2d-x/external $(SRCROOT)/../../cocos2d-x/external/chipmunk/include/chipmunk $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/auto $(SRCROOT)/../../cocos2d-x/cocos/scripting/js-bindings/manual"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A92277011517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COMPRESS_PNG_FILES = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ios/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_IPHONE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = ios/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual"; + VALID_ARCHS = "arm64 armv7"; + }; + name = Debug; + }; + A92277021517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COMPRESS_PNG_FILES = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ios/Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + CC_TARGET_OS_IPHONE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = ios/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/cocos/platform/ios $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual"; + VALID_ARCHS = "arm64 armv7"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 509D4AA717EBB24E00697056 /* Build configuration list for PBXNativeTarget "HelloJavascript Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 509D4AA817EBB24E00697056 /* Debug */, + 509D4AA917EBB24E00697056 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92275371517C094001B78AA /* Build configuration list for PBXProject "HelloJavascript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92276FE1517C097001B78AA /* Debug */, + A92276FF1517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "HelloJavascript iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92277011517C097001B78AA /* Debug */, + A92277021517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A92275341517C094001B78AA /* Project object */; +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.h b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.h new file mode 100644 index 0000000000..2e8186124e --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.h @@ -0,0 +1,35 @@ +/**************************************************************************** + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +@class RootViewController; + +@interface AppController : NSObject +{ + UIWindow *window; + RootViewController *viewController; +} + +@end + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm new file mode 100644 index 0000000000..81f19ebcdd --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm @@ -0,0 +1,144 @@ +/**************************************************************************** + Copyright (c) 2010-2013 cocos2d-x.org + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import +#import "cocos2d.h" + +#import "AppController.h" +#import "AppDelegate.h" +#import "RootViewController.h" +#import "platform/ios/CCEAGLView-ios.h" + +@implementation AppController + +#pragma mark - +#pragma mark Application lifecycle + +// cocos2d application instance +static AppDelegate s_sharedApplication; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + + // Override point for customization after application launch. + + // Add the view controller's view to the window and display. + window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH24_STENCIL8_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + [eaglView setMultipleTouchEnabled:YES]; + + // Use RootViewController manage CCEAGLView + viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; + viewController.wantsFullScreenLayout = YES; + viewController.view = eaglView; + + // Set RootViewController to window + if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) + { + // warning: addSubView doesn't work on iOS6 + [window addSubview: viewController.view]; + } + else + { + // use this method on ios6 + [window setRootViewController:viewController]; + } + + [window makeKeyAndVisible]; + + [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + + cocos2d::Application::getInstance()->run(); + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ + cocos2d::Director::getInstance()->pause(); +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ + cocos2d::Director::getInstance()->resume(); +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ + cocos2d::Application::getInstance()->applicationDidEnterBackground(); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ + cocos2d::Application::getInstance()->applicationWillEnterForeground(); +} + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ + cocos2d::Director::getInstance()->purgeCachedData(); +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png new file mode 100644 index 0000000000..66c6d1cead Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png new file mode 100644 index 0000000000..84689888a1 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png new file mode 100644 index 0000000000..ef38d4500a Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png new file mode 100644 index 0000000000..c3807861ad Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png new file mode 100644 index 0000000000..a5b49ccbb1 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png new file mode 100644 index 0000000000..1526615c02 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png new file mode 100644 index 0000000000..8aa82506d0 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png new file mode 100644 index 0000000000..0500184c86 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png new file mode 100644 index 0000000000..775685daca Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png new file mode 100644 index 0000000000..ac381bc20e Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png new file mode 100644 index 0000000000..4fcc6fddff Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png new file mode 100644 index 0000000000..f0f8b7fe98 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png new file mode 100644 index 0000000000..2c573c8df4 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png new file mode 100644 index 0000000000..8a1fa1850c Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png new file mode 100644 index 0000000000..d9c7ab446b Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist new file mode 100644 index 0000000000..59405f5dce --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist @@ -0,0 +1,98 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + Icon.png + Icon@2x.png + Icon-72.png + Icon-144.png + Icon-57.png + Icon-114.png + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon-80 + Icon-58 + Icon-29 + Icon-120 + Icon-72.png + Icon.png + Icon@2x.png + Icon-57.png + Icon-114.png + Icon-144.png + + UIPrerenderedIcon + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon-58 + Icon-29 + Icon-80 + Icon-40 + Icon-100 + Icon-50 + Icon-152 + Icon-76 + Icon-120 + Icon-72.png + Icon.png + Icon@2x.png + Icon-57.png + Icon-114.png + Icon-144.png + + UIPrerenderedIcon + + + + CFBundleIdentifier + org.cocos2dx.hellojavascript + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIPrerenderedIcon + + UIRequiredDeviceCapabilities + + accelerometer + + opengles-1 + + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationLandscapeLeft + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch new file mode 100644 index 0000000000..168ddec406 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'HelloJavascript' target in the 'HelloJavascript' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h new file mode 100644 index 0000000000..11dfc4bf88 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h @@ -0,0 +1,33 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + + +@interface RootViewController : UIViewController { + +} +- (BOOL)prefersStatusBarHidden; +@end diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm new file mode 100644 index 0000000000..2074ad8e6e --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm @@ -0,0 +1,113 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "RootViewController.h" +#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 { +} +*/ + +/* +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; +} + +*/ +// Override to allow orientations other than the default portrait orientation. +// This method is deprecated on ios6 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return UIInterfaceOrientationIsLandscape( interfaceOrientation ); +} + +// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead +- (NSUInteger) supportedInterfaceOrientations{ +#ifdef __IPHONE_6_0 + return UIInterfaceOrientationMaskAllButUpsideDown; +#endif +} + +- (BOOL) shouldAutorotate { + return YES; +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + + cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); + if (glview) + { + cocos2d::CCEGLView *eaglview = (cocos2d::CCEGLView*) glview->getEAGLView(); + + if (eaglview) + { + CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); + cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); + } + } +} + +//fix not hide status on ios7 +- (BOOL)prefersStatusBarHidden +{ + return YES; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/main.m b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/main.m new file mode 100644 index 0000000000..b1286e31be --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/ios/main.m @@ -0,0 +1,11 @@ + + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); + [pool release]; + return retVal; +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns new file mode 100644 index 0000000000..2040fc6fe6 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist new file mode 100644 index 0000000000..aa22263424 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon + CFBundleIdentifier + org.cocos2dx.hellojavascript + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_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/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch new file mode 100644 index 0000000000..46c36a7e99 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/main.cpp b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/main.cpp new file mode 100644 index 0000000000..96f027e13d --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/mac/main.cpp @@ -0,0 +1,34 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "AppDelegate.h" +#include "cocos2d.h" + +USING_NS_CC; + +int main(int argc, char *argv[]) +{ + AppDelegate app; + return Application::getInstance()->run(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.linux/main.cpp b/templates/js-template-default/frameworks/runtime-src/proj.linux/main.cpp new file mode 100644 index 0000000000..e236a953b3 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.linux/main.cpp @@ -0,0 +1,10 @@ +#include "../Classes/AppDelegate.h" + +USING_NS_CC; + +int main(int argc, char **argv) +{ + // create the application instance + AppDelegate app; + return Application::getInstance()->run(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln new file mode 100644 index 0000000000..553e546ada --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.sln @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript", "HelloJavascript.vcxproj", "{3B0B58B1-2734-488E-A542-ECEC11EB2455}" + ProjectSection(ProjectDependencies) = postProject + {39379840-825A-45A0-B363-C09FFEF864BD} = {39379840-825A-45A0-B363-C09FFEF864BD} + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{8C6B0381-B325-4D7F-B1BB-474ABACE46AC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\js-bindings\cocos2d-x\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjsbindings", "..\..\js-bindings\bindings\proj.win32\libJSBinding.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Debug|Win32.Build.0 = Debug|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.ActiveCfg = Release|Win32 + {3B0B58B1-2734-488E-A542-ECEC11EB2455}.Release|Win32.Build.0 = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 + {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 + {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.ActiveCfg = Debug|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.Build.0 = Debug|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.ActiveCfg = Release|Win32 + {39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {8C6B0381-B325-4D7F-B1BB-474ABACE46AC} + {929480E7-23C0-4DF6-8456-096D71547116} = {8C6B0381-B325-4D7F-B1BB-474ABACE46AC} + EndGlobalSection +EndGlobal diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj new file mode 100644 index 0000000000..69411b9d33 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj @@ -0,0 +1,202 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3B0B58B1-2734-488E-A542-ECEC11EB2455} + HelloJavascript + + + + Application + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + Application + Unicode + v100 + v110 + v110_xp + v120 + v120_xp + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath) + + + + _DEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)game.tlb + game.h + + + game_i.c + game_p.c + + + Disabled + $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)..\bindings\auto;$(EngineRoot)..\bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4267;4251;4244;4800;%(DisableSpecificWarnings) + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\js-bindings\external\spidermonkey\prebuilt\win32\debug-build\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\js-bindings\cocos2d-x\external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + + libcurl_imp.lib;mozjs-33.lib;ws2_32.lib;sqlite3.lib;websockets.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + xcopy "$(ProjectDir)..\..\js-bindings\bindings\script" "$(OutDir)\script" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\src" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\res" /D /E /I /F /Y +copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\" /Y +copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y + + + Copy js and resource files. + + + + + NDEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)game.tlb + game.h + + + game_i.c + game_p.c + + + $(ProjectDir)..\Classes;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\storage;$(EngineRoot)cocos\editor-support;$(EngineRoot)..\bindings\auto;$(EngineRoot)..\bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)..\external\spidermonkey\include\win32;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + MultiThreadedDLL + + + Level3 + + + 4267;4251;4244;4800;%(DisableSpecificWarnings) + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\js-bindings\external\spidermonkey\prebuilt\win32\release-build\*.*" "$(OutDir)" +xcopy /Y /Q "$(ProjectDir)..\..\js-bindings\cocos2d-x\external\websockets\prebuilt\win32\*.*" "$(OutDir)" + + + libcurl_imp.lib;mozjs-33.lib;ws2_32.lib;sqlite3.lib;websockets.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + Windows + MachineX86 + true + + + xcopy "$(ProjectDir)..\..\js-bindings\bindings\script" "$(OutDir)\script" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\src" /D /E /I /F /Y +xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\res" /D /E /I /F /Y +copy "$(ProjectDir)..\..\..\main.js" "$(OutDir)\" /Y +copy "$(ProjectDir)..\..\..\project.json" "$(OutDir)\" /Y + Copy js and resource files. + + + + + + + + + + + + + + + + + + + + {39379840-825a-45a0-b363-c09ffef864bd} + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters new file mode 100644 index 0000000000..75ce9f53fa --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/HelloJavascript.vcxproj.filters @@ -0,0 +1,42 @@ + + + + + {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest + + + {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} + + + {e93a77e1-af1e-4400-87d3-504b62ebdbb0} + + + + + win32 + + + Classes + + + + + Classes + + + win32 + + + + + + resource + + + + + resource + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/js-template-default/frameworks/runtime-src/proj.win32/build-cfg.json new file mode 100644 index 0000000000..94dadfd8ec --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/build-cfg.json @@ -0,0 +1,24 @@ +{ + "copy_resources": [ + { + "from": "../../../src", + "to": "src" + }, + { + "from": "../../../res", + "to": "res" + }, + { + "from": "../../../main.js", + "to": "" + }, + { + "from": "../../../project.json", + "to": "" + }, + { + "from": "../../js-bindings/bindings/script", + "to": "script" + } + ] +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/game.rc b/templates/js-template-default/frameworks/runtime-src/proj.win32/game.rc new file mode 100644 index 0000000000..e2df7906f7 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/game.rc @@ -0,0 +1,127 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Simplified, PRC) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Chinese (Simplified, PRC) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#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 "FileDescription", "game Module" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "game" + VALUE "LegalCopyright", "Copyright " + VALUE "OriginalFilename", "game.exe" + VALUE "ProductName", "game Module" + VALUE "ProductVersion", "1, 0, 0, 1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/main.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win32/main.cpp new file mode 100644 index 0000000000..69c3b8c9bb --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/main.cpp @@ -0,0 +1,33 @@ +#include "main.h" +#include "AppDelegate.h" + +USING_NS_CC; + +// uncomment below line, open debug console +// #define USE_WIN32_CONSOLE + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + +#ifdef USE_WIN32_CONSOLE + AllocConsole(); + freopen("CONIN$", "r", stdin); + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); +#endif + + // create the application instance + AppDelegate app; + int ret = Application::getInstance()->run(); + +#ifdef USE_WIN32_CONSOLE + FreeConsole(); +#endif + + return ret; +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/main.h b/templates/js-template-default/frameworks/runtime-src/proj.win32/main.h new file mode 100644 index 0000000000..e29aeedb3a --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/main.h @@ -0,0 +1,12 @@ +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +// Windows Header Files: +#include + +// C RunTime Header Files +#include "CCStdC.h" + +#endif // __WINMAIN_H__ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/res/game.ico b/templates/js-template-default/frameworks/runtime-src/proj.win32/res/game.ico new file mode 100644 index 0000000000..feaf932a74 Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.win32/res/game.ico differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win32/resource.h b/templates/js-template-default/frameworks/runtime-src/proj.win32/resource.h new file mode 100644 index 0000000000..920119022a --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win32/resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by game.rc +// +#define IDS_PROJNAME 100 +#define IDR_TESTJS 100 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 204 +#define _APS_NEXT_COMMAND_VALUE 32785 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml new file mode 100644 index 0000000000..2da0ff79d0 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml @@ -0,0 +1,13 @@ + + + + + cpp_tests + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.cpp new file mode 100644 index 0000000000..f4365b88c5 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.cpp @@ -0,0 +1,21 @@ +#include "App.xaml.h" +#include "OpenGLESPage.xaml.h" + +using namespace cocos2d; + +App::App() +{ + InitializeComponent(); +} + +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) +{ + if (mPage == nullptr) + { + mPage = ref new OpenGLESPage(&mOpenGLES); + } + + // Place the page in the current window and ensure that it is active. + Windows::UI::Xaml::Window::Current->Content = mPage; + Windows::UI::Xaml::Window::Current->Activate(); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.h b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.h new file mode 100644 index 0000000000..1309c610d7 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/App.xaml.h @@ -0,0 +1,19 @@ +#pragma once + +#include "app.g.h" +#include "OpenGLES.h" +#include "openglespage.xaml.h" + +namespace cocos2d +{ + ref class App sealed + { + public: + App(); + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; + + private: + OpenGLESPage^ mPage; + OpenGLES mOpenGLES; + }; +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.cpp new file mode 100644 index 0000000000..ea6d3b68c9 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.cpp @@ -0,0 +1,143 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ + +#include "Cocos2dRenderer.h" +#include "AppDelegate.h" +#include "CCGLViewImpl-winrt.h" +#include "CCApplication.h" +#include "cocos2d.h" +#include "renderer/CCTextureCache.h" + +// These are used by the shader compilation methods. +#include +#include +#include + +using namespace Platform; +using namespace Windows::UI::Core; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::Graphics::Display; + +USING_NS_CC; + + +Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, DisplayOrientations orientation, CoreDispatcher^ dispatcher, Panel^ panel) + : m_app(nullptr) + , m_width(width) + , m_height(height) + , m_dpi(dpi) + , m_dispatcher(dispatcher) + , m_panel(panel) + , m_orientation(orientation) +{ + m_app = new AppDelegate(); +} + +Cocos2dRenderer::~Cocos2dRenderer() +{ + delete m_app; +} + +void Cocos2dRenderer::Resume() +{ + auto director = cocos2d::Director::getInstance(); + auto glview = director->getOpenGLView(); + + if (!glview) + { + GLViewImpl* glview = GLViewImpl::create("Test Cpp"); + glview->setDispatcher(m_dispatcher.Get()); + glview->setPanel(m_panel.Get()); + glview->Create(static_cast(m_width), static_cast(m_height), m_dpi, m_orientation); + director->setOpenGLView(glview); + CCApplication::getInstance()->run(); + } + else + { + Application::getInstance()->applicationWillEnterForeground(); + } +} + +void Cocos2dRenderer::Pause() +{ + if (Director::getInstance()->getOpenGLView()) { + Application::getInstance()->applicationDidEnterBackground(); + //cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); + //cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent); + } +} + +void Cocos2dRenderer::DeviceLost() +{ + Pause(); + + auto director = cocos2d::Director::getInstance(); + if (director->getOpenGLView()) { + cocos2d::GL::invalidateStateCache(); + cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms(); + cocos2d::DrawPrimitives::init(); + cocos2d::VolatileTextureMgr::reloadAllTextures(); + + cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED); + director->getEventDispatcher()->dispatchEvent(&recreatedEvent); + director->setGLDefaultValues(); + + Application::getInstance()->applicationWillEnterForeground(); + cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); + } +} + + + +void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi, DisplayOrientations orientation) +{ + if (orientation != m_orientation) + { + m_orientation = orientation; + GLViewImpl::sharedOpenGLView()->UpdateOrientation(orientation); + } + + if (width != m_width || height != m_height) + { + m_width = width; + m_height = height; + GLViewImpl::sharedOpenGLView()->UpdateForWindowSizeChange(static_cast(width), static_cast(height)); + } + + if (dpi != m_dpi) + { + m_dpi = dpi; + GLViewImpl::sharedOpenGLView()->SetDPI(m_dpi); + } + + GLViewImpl::sharedOpenGLView()->ProcessEvents(); + GLViewImpl::sharedOpenGLView()->Render(); +} + +void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args) +{ + GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args); +} + +void Cocos2dRenderer::QueueKeyBoardEvent(cocos2d::Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e) +{ + //GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, e); +} + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.h b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.h new file mode 100644 index 0000000000..e38e69ce19 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/Cocos2dRenderer.h @@ -0,0 +1,55 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ +#pragma once + +#include + +#include "cocos2d.h" + + +class AppDelegate; + +namespace cocos2d +{ + class Cocos2dRenderer + { + public: + Cocos2dRenderer(int width, int height, float dpi, + Windows::Graphics::Display::DisplayOrientations orientation, + Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel); + ~Cocos2dRenderer(); + void Draw(GLsizei width, GLsizei height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation); + void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args); + void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e); + void Pause(); + void Resume(); + void DeviceLost(); + + private: + + int m_width; + int m_height; + float m_dpi; + + // The AppDelegate for the Cocos2D app + AppDelegate* m_app; + Platform::Agile m_dispatcher; + Platform::Agile m_panel; + Windows::Graphics::Display::DisplayOrientations m_orientation; + }; +} \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems new file mode 100644 index 0000000000..57fe321d30 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems @@ -0,0 +1,59 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + e956c24b-f04e-47bf-bf00-746681ae1301 + {a3ad93e4-0b2f-4c58-9181-69bed2e42e3e} + HelloJavascript + + + + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) + + + + + Designer + + + + $(MSBuildThisFileDirectory)App.xaml + + + + + $(MSBuildThisFileDirectory)OpenGLESPage.xaml + + + + $(MSBuildThisFileDirectory)App.xaml + + + Create + + + + $(MSBuildThisFileDirectory)OpenGLESPage.xaml + + + + + + + + <_CustomResource Include="$(MSBuildThisFileDirectory)..\..\Resources\**\*"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems.filters b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems.filters new file mode 100644 index 0000000000..328a801eb8 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/HelloJavascript.Shared.vcxitems.filters @@ -0,0 +1,33 @@ + + + + + + + + + + + + Classes + + + + + + + + {38ad799c-8c3c-44a2-8e41-516c8f62f556} + + + + + + + Classes + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.cpp new file mode 100644 index 0000000000..c375a709e7 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.cpp @@ -0,0 +1,239 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ + +#include "OpenGLES.h" +using namespace Platform; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; + +OpenGLES::OpenGLES() : + mEglConfig(nullptr), + mEglDisplay(EGL_NO_DISPLAY), + mEglContext(EGL_NO_CONTEXT) +{ + Initialize(); +} + +OpenGLES::~OpenGLES() +{ + Cleanup(); +} + +void OpenGLES::Initialize() +{ + const EGLint configAttributes[] = + { + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 8, + EGL_STENCIL_SIZE, 8, + EGL_NONE + }; + + const EGLint contextAttributes[] = + { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + + const EGLint defaultDisplayAttributes[] = + { + // These are the default display attributes, used to request ANGLE's D3D11 renderer. + // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+. + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + + // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices. + // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it. + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_NONE, + }; + + const EGLint fl9_3DisplayAttributes[] = + { + // These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3. + // These attributes are used if the call to eglInitialize fails with the default display attributes. + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, + EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_NONE, + }; + + const EGLint warpDisplayAttributes[] = + { + // These attributes can be used to request D3D11 WARP. + // They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes. + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_NONE, + }; + + EGLConfig config = NULL; + + // eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11. + PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast(eglGetProcAddress("eglGetPlatformDisplayEXT")); + if (!eglGetPlatformDisplayEXT) + { + throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT"); + } + + // + // To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying + // parameters passed to eglGetPlatformDisplayEXT: + // 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+. + // 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again + // using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3. + // 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again + // using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer. + // + // Note: On Windows Phone, we #ifdef out the first set of calls to eglPlatformDisplayEXT and eglInitialize. + // Windows Phones devices only support D3D11 Feature Level 9_3, but the Windows Phone emulator supports 11_0+. + // We use this #ifdef to limit the Phone emulator to Feature Level 9_3, making it behave more like + // real Windows Phone devices. + // If you wish to test Feature Level 10_0+ in the Windows Phone emulator then you should remove this #ifdef. + // + +#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) + // This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details. + mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes); + if (mEglDisplay == EGL_NO_DISPLAY) + { + throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); + } + + if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) +#endif + { + // This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on Windows Phone, or certain Windows tablets). + mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes); + if (mEglDisplay == EGL_NO_DISPLAY) + { + throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); + } + + if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) + { + // This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU (e.g. on Surface RT). + mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes); + if (mEglDisplay == EGL_NO_DISPLAY) + { + throw Exception::CreateException(E_FAIL, L"Failed to get EGL display"); + } + + if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE) + { + // If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred. + throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL"); + } + } + } + + EGLint numConfigs = 0; + if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0)) + { + throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig"); + } + + mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes); + if (mEglContext == EGL_NO_CONTEXT) + { + throw Exception::CreateException(E_FAIL, L"Failed to create EGL context"); + } +} + +void OpenGLES::Cleanup() +{ + if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT) + { + eglDestroyContext(mEglDisplay, mEglContext); + mEglContext = EGL_NO_CONTEXT; + } + + if (mEglDisplay != EGL_NO_DISPLAY) + { + eglTerminate(mEglDisplay); + mEglDisplay = EGL_NO_DISPLAY; + } +} + +void OpenGLES::Reset() +{ + Cleanup(); + Initialize(); +} + +EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize) +{ + if (!panel) + { + throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid"); + } + + EGLSurface surface = EGL_NO_SURFACE; + + const EGLint surfaceAttributes[] = + { + // EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above). + // If you have compilation issues with it then please update your Visual Studio templates. + EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE, + EGL_NONE + }; + + // Create a PropertySet and initialize with the EGLNativeWindowType. + PropertySet^ surfaceCreationProperties = ref new PropertySet(); + surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel); + + // If a render surface size is specified, add it to the surface creation properties + if (renderSurfaceSize != nullptr) + { + surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize)); + } + + surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast(surfaceCreationProperties), surfaceAttributes); + if (surface == EGL_NO_SURFACE) + { + throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface"); + } + + return surface; +} + +void OpenGLES::DestroySurface(const EGLSurface surface) +{ + if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE) + { + eglDestroySurface(mEglDisplay, surface); + } +} + +void OpenGLES::MakeCurrent(const EGLSurface surface) +{ + if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE) + { + throw Exception::CreateException(E_FAIL, L"Failed to make EGLSurface current"); + } +} + +EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface) +{ + return (eglSwapBuffers(mEglDisplay, surface)); +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.h b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.h new file mode 100644 index 0000000000..1a57b68739 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLES.h @@ -0,0 +1,51 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ + +#pragma once + +// OpenGL ES includes +#include +#include + +// EGL includes +#include +#include +#include +#include + +class OpenGLES +{ +public: + OpenGLES(); + ~OpenGLES(); + + EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize); + void DestroySurface(const EGLSurface surface); + void MakeCurrent(const EGLSurface surface); + EGLBoolean SwapBuffers(const EGLSurface surface); + void Reset(); + +private: + void Initialize(); + void Cleanup(); + +private: + EGLDisplay mEglDisplay; + EGLContext mEglContext; + EGLConfig mEglConfig; +}; diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml new file mode 100644 index 0000000000..e5b62802a5 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.cpp new file mode 100644 index 0000000000..9b59ec6fd7 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.cpp @@ -0,0 +1,330 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ + +#include "App.xaml.h" +#include "OpenGLESPage.xaml.h" + +using namespace cocos2d; +using namespace Platform; +using namespace Concurrency; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::Graphics::Display; +using namespace Windows::System::Threading; +using namespace Windows::UI::Core; +using namespace Windows::UI::Input; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +using namespace Windows::Phone::UI::Input; +#endif + +OpenGLESPage::OpenGLESPage() : + OpenGLESPage(nullptr) +{ + +} + +OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) : + mOpenGLES(openGLES), + mRenderSurface(EGL_NO_SURFACE), + mCustomRenderSurfaceSize(0,0), + mUseCustomRenderSurfaceSize(false), + m_coreInput(nullptr), + m_dpi(0.0f), + m_visible(false), + m_deviceLost(false), + m_orientation(DisplayOrientations::Landscape) +{ + InitializeComponent(); + + Windows::UI::Core::CoreWindow^ window = Windows::UI::Xaml::Window::Current->CoreWindow; + + window->VisibilityChanged += + ref new Windows::Foundation::TypedEventHandler(this, &OpenGLESPage::OnVisibilityChanged); + + swapChainPanel->SizeChanged += + ref new Windows::UI::Xaml::SizeChangedEventHandler(this, &OpenGLESPage::OnSwapChainPanelSizeChanged); + + DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); + + currentDisplayInformation->OrientationChanged += + ref new TypedEventHandler(this, &OpenGLESPage::OnOrientationChanged); + + m_orientation = currentDisplayInformation->CurrentOrientation; + + this->Loaded += + ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded); + + mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height }; + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync(); + HardwareButtons::BackPressed += ref new EventHandler(this, &OpenGLESPage::OnBackButtonPressed); +#else + // Disable all pointer visual feedback for better performance when touching. + // This is not supported on Windows Phone applications. + auto pointerVisualizationSettings = Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView(); + pointerVisualizationSettings->IsContactFeedbackEnabled = false; + pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false; +#endif + + // Register our SwapChainPanel to get independent input pointer events + auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^) + { + // The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on. + m_coreInput = swapChainPanel->CreateCoreIndependentInputSource( + Windows::UI::Core::CoreInputDeviceTypes::Mouse | + Windows::UI::Core::CoreInputDeviceTypes::Touch | + Windows::UI::Core::CoreInputDeviceTypes::Pen + ); + + // Register for pointer events, which will be raised on the background thread. + m_coreInput->PointerPressed += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerPressed); + m_coreInput->PointerMoved += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerMoved); + m_coreInput->PointerReleased += ref new TypedEventHandler(this, &OpenGLESPage::OnPointerReleased); + + // Begin processing input messages as they're delivered. + m_coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit); + }); + + // Run task on a dedicated high priority background thread. + m_inputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced); + +} + +OpenGLESPage::~OpenGLESPage() +{ + StopRenderLoop(); + DestroyRenderSurface(); +} + +void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + // The SwapChainPanel has been created and arranged in the page layout, so EGL can be initialized. + CreateRenderSurface(); + m_visible = true; + StartRenderLoop(); +} + +void OpenGLESPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerPressed, e); + } +} + +void OpenGLESPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerMoved, e); + } +} + +void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e) +{ + if (m_renderer) + { + m_renderer->QueuePointerEvent(PointerEventType::PointerReleased, e); + } +} + +void OpenGLESPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args) +{ + critical_section::scoped_lock lock(mSwapChainPanelSizeCriticalSection); + m_orientation = sender->CurrentOrientation; +} + +void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) +{ + if (args->Visible && mRenderSurface != EGL_NO_SURFACE) + { + m_visible = true; + } + else + { + m_visible = false; + } +} + +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +void OpenGLESPage::OnBackButtonPressed(Object^ sender, BackPressedEventArgs^ args) +{ + bool myAppCanNavigate = false; + if (myAppCanNavigate) + { + args->Handled = true; + } + else { + // Do nothing. Leave args->Handled set to the current value, false. + } +} +#endif + + +void OpenGLESPage::OnSwapChainPanelSizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e) +{ + // Size change events occur outside of the render thread. A lock is required when updating + // the swapchainpanel size + critical_section::scoped_lock lock(mSwapChainPanelSizeCriticalSection); + mSwapChainPanelSize = { e->NewSize.Width, e->NewSize.Height }; +} + +void OpenGLESPage::GetSwapChainPanelSize(GLsizei* width, GLsizei* height) +{ + critical_section::scoped_lock lock(mSwapChainPanelSizeCriticalSection); + // If a custom render surface size is specified, return its size instead of + // the swapchain panel size. + if (mUseCustomRenderSurfaceSize) + { + *width = static_cast(mCustomRenderSurfaceSize.Width); + *height = static_cast(mCustomRenderSurfaceSize.Height); + } + else + { + *width = static_cast(mSwapChainPanelSize.Width); + *height = static_cast(mSwapChainPanelSize.Height); + } +} + +void OpenGLESPage::CreateRenderSurface() +{ + if (mOpenGLES) + { + // + // A Custom render surface size can be specified by uncommenting the following lines. + // The render surface will be automatically scaled to fit the entire window. Using a + // smaller sized render surface can result in a performance gain. + // + //mCustomRenderSurfaceSize = Size(800, 600); + //mUseCustomRenderSurfaceSize = true; + + mRenderSurface = mOpenGLES->CreateSurface(swapChainPanel, mUseCustomRenderSurfaceSize ? &mCustomRenderSurfaceSize : nullptr); + } +} + +void OpenGLESPage::DestroyRenderSurface() +{ + if (mOpenGLES) + { + mOpenGLES->DestroySurface(mRenderSurface); + } + mRenderSurface = EGL_NO_SURFACE; +} + +void OpenGLESPage::RecoverFromLostDevice() +{ + // resets OpenGLES, recreates the render surface + DestroyRenderSurface(); + mOpenGLES->Reset(); + CreateRenderSurface(); +} + +void OpenGLESPage::StartRenderLoop() +{ + // If the render loop is already running then do not start another thread. + if (mRenderLoopWorker != nullptr && mRenderLoopWorker->Status == Windows::Foundation::AsyncStatus::Started) + { + return; + } + + DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); + m_dpi = currentDisplayInformation->LogicalDpi; + + auto dispatcher = Windows::UI::Xaml::Window::Current->CoreWindow->Dispatcher; + + // Create a task for rendering that will be run on a background thread. + auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this, dispatcher](Windows::Foundation::IAsyncAction ^ action) + { + mOpenGLES->MakeCurrent(mRenderSurface); + GLsizei panelWidth = 0; + GLsizei panelHeight = 0; + GetSwapChainPanelSize(&panelWidth, &panelHeight); + + if (m_renderer.get() == nullptr) + { + m_renderer = std::make_shared(panelWidth, panelHeight, m_dpi, m_orientation, dispatcher, swapChainPanel); + } + + m_renderer->Resume(); + + while (action->Status == Windows::Foundation::AsyncStatus::Started) + { + if (!m_visible) + { + m_renderer->Pause(); + while (!m_visible) + { + if (action->Status != Windows::Foundation::AsyncStatus::Started) + { + return; + } + Sleep(500); + } + m_renderer->Resume(); + } + + GetSwapChainPanelSize(&panelWidth, &panelHeight); + m_renderer.get()->Draw(panelWidth, panelHeight, m_dpi, m_orientation); + + // The call to eglSwapBuffers might not be successful (i.e. due to Device Lost) + // If the call fails, then we must reinitialize EGL and the GL resources. + if (mOpenGLES->SwapBuffers(mRenderSurface) != GL_TRUE) + { + m_deviceLost = true; + + // XAML objects like the SwapChainPanel must only be manipulated on the UI thread. + swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, ref new Windows::UI::Core::DispatchedHandler([=]() + { + RecoverFromLostDevice(); + }, CallbackContext::Any)); + + while(m_deviceLost) + { + if (action->Status != Windows::Foundation::AsyncStatus::Started) + { + return; + } + Sleep(500); + } + mOpenGLES->MakeCurrent(mRenderSurface); + m_renderer->DeviceLost(); + } + } + }); + + // Run task on a dedicated high priority background thread. + mRenderLoopWorker = Windows::System::Threading::ThreadPool::RunAsync(workItemHandler, Windows::System::Threading::WorkItemPriority::High, Windows::System::Threading::WorkItemOptions::TimeSliced); +} + +void OpenGLESPage::StopRenderLoop() +{ + if (mRenderLoopWorker) + { + mRenderLoopWorker->Cancel(); + mRenderLoopWorker = nullptr; + } +} \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.h b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.h new file mode 100644 index 0000000000..e0143483aa --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.h @@ -0,0 +1,82 @@ +/* +* cocos2d-x http://www.cocos2d-x.org +* +* Copyright (c) 2010-2014 - cocos2d-x community +* +* Portions Copyright (c) Microsoft Open Technologies, Inc. +* All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and limitations under the License. +*/ + +#pragma once + +#include "OpenGLES.h" +#include "OpenGLESPage.g.h" +#include +#include + +#include "Cocos2dRenderer.h" + +namespace cocos2d +{ + public ref class OpenGLESPage sealed + { + public: + OpenGLESPage(); + virtual ~OpenGLESPage(); + + internal: + OpenGLESPage(OpenGLES* openGLES); + + private: + void OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); + void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); +#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args); +#endif + void GetSwapChainPanelSize(GLsizei* width, GLsizei* height); + void CreateRenderSurface(); + void DestroyRenderSurface(); + void RecoverFromLostDevice(); + void StartRenderLoop(); + void StopRenderLoop(); + + OpenGLES* mOpenGLES; + std::shared_ptr m_renderer; + + Windows::Foundation::Size mSwapChainPanelSize; + Concurrency::critical_section mSwapChainPanelSizeCriticalSection; + + Windows::Foundation::Size mCustomRenderSurfaceSize; + bool mUseCustomRenderSurfaceSize; + + EGLSurface mRenderSurface; // This surface is associated with a swapChainPanel on the page + Windows::Foundation::IAsyncAction^ mRenderLoopWorker; + + // Track user input on a background worker thread. + Windows::Foundation::IAsyncAction^ m_inputLoopWorker; + Windows::UI::Core::CoreIndependentInputSource^ m_coreInput; + + // Independent input handling functions. + void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e); + + void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); + + float m_dpi; + std::atomic m_visible; + std::atomic m_deviceLost; + Windows::Graphics::Display::DisplayOrientations m_orientation; + + }; +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.cpp b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.cpp new file mode 100644 index 0000000000..bcb5590be1 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.h b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.h new file mode 100644 index 0000000000..8c399a075d --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/pch.h @@ -0,0 +1,13 @@ +// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include "mozilla\Char16.h" +#include "cocos2d.h" +#include "cocos-ext.h" + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj new file mode 100644 index 0000000000..e926edfc67 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj @@ -0,0 +1,201 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + {79a8fcda-4b12-4dd1-b676-ff148d651638} + cocos2d + en-US + 12.0 + true + Windows Store + 8.1 + + + + Application + true + v120 + + + Application + true + v120 + + + Application + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + Application + false + true + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TemporaryKey.pfx + True + x86 + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + Designer + + + + + + + + + + + + {bcf5546d-66a0-4998-afd6-c5514f618930} + + + {9335005f-678e-4e8e-9b84-50037216aec8} + + + {f3550fe0-c795-44f6-8feb-093eb68143ae} + + + {3b26a12d-3a44-47ea-82d2-282660fc844d} + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj.filters b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj.filters new file mode 100644 index 0000000000..bf2fa53b3c --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/HelloJavascript.Windows.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + {1a9fa652-867e-41d2-8588-962f108d2d8f} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/Package.appxmanifest b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/Package.appxmanifest new file mode 100644 index 0000000000..e22abcc6f9 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/Package.appxmanifest @@ -0,0 +1,30 @@ + + + + + HelloJavascript.Windows + dalestam + Assets\StoreLogo.png + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx new file mode 100644 index 0000000000..5ad010651a Binary files /dev/null and b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx differ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj new file mode 100644 index 0000000000..171d0a9a68 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Release + ARM + + + Release + Win32 + + + + {396fe85e-bb05-4b92-bccb-f89aed4ea41a} + cocos2d + en-US + 12.0 + true + Windows Phone + 8.1 + + + + Application + true + v120_wp81 + + + Application + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + Application + false + true + v120_wp81 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + arm + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + /bigobj /Zm200 %(AdditionalOptions) + 4453;28204;4756;%(DisableSpecificWarnings) + pch.h + $(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories) + false + + + + + Designer + + + + + + + + + + + + + {ca082ec4-17ce-430b-8207-d1e947a5d1e9} + + + {22f3b9df-1209-4574-8331-003966f562bf} + + + {cc1da216-a80d-4be4-b309-acb6af313aff} + + + {22f798d8-bfff-4754-996f-a5395343d5ec} + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj.filters b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj.filters new file mode 100644 index 0000000000..eb71f325ca --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/HelloJavascript.WindowsPhone.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {c8beb60d-689b-4aaa-9749-99bd3e2dcf75} + bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest new file mode 100644 index 0000000000..3f0809f393 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest @@ -0,0 +1,33 @@ + + + + + + HelloJavascript.WindowsPhone + dalestam + Assets\StoreLogo.png + + + 6.3.1 + 6.3.1 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln new file mode 100644 index 0000000000..babfe5f084 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/HelloJavascript.sln @@ -0,0 +1,217 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HelloJavascript", "HelloJavascript", "{36AFDE04-D127-4D84-9730-D84E3E51EAA7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript.Shared", "App.Shared\HelloJavascript.Shared.vcxitems", "{A3AD93E4-0B2F-4C58-9181-69BED2E42E3E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript.Windows", "App.Windows\HelloJavascript.Windows.vcxproj", "{79A8FCDA-4B12-4DD1-B676-FF148D651638}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloJavascript.WindowsPhone", "App.WindowsPhone\HelloJavascript.WindowsPhone.vcxproj", "{396FE85E-BB05-4B92-BCCB-F89AED4EA41A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcocos2d", "libcocos2d", "{80DA05C1-6532-4D2A-8606-EF02079B1373}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{F13CB4F7-BEE5-4368-A815-A971797387D8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libbox2d", "libbox2d", "{626C3EB8-F53B-41D0-BEA8-44EACAA1228C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libSpine", "libSpine", "{D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Shared", "..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems", "{4A3C6BA8-C227-498B-AA21-40BDA27B461F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Windows", "..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj", "{3B26A12D-3A44-47EA-82D2-282660FC844D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.WindowsPhone", "..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.WindowsPhone\libbox2d.WindowsPhone.vcxproj", "{22F798D8-BFFF-4754-996F-A5395343D5EC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems", "{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.WindowsPhone", "..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.WindowsPhone\libSpine.WindowsPhone.vcxproj", "{CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Shared", "..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems", "{5D6F020F-7E72-4494-90A0-2DF11D235DF9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.Windows", "..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Windows\libcocos2d_8_1.Windows.vcxproj", "{9335005F-678E-4E8E-9B84-50037216AEC8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_8_1.WindowsPhone", "..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.WindowsPhone\libcocos2d_8_1.WindowsPhone.vcxproj", "{22F3B9DF-1209-4574-8331-003966F562BF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libJSBinding", "libJSBinding", "{FCB0EDBB-7A20-48D0-926B-E5617D40E6E5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding.Shared", "..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.Shared\libJSBinding.Shared.vcxitems", "{BEA66276-51DD-4C53-92A8-F3D1FEA50892}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding.Windows", "..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.Windows\libJSBinding.Windows.vcxproj", "{BCF5546D-66A0-4998-AFD6-C5514F618930}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding.WindowsPhone", "..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.WindowsPhone\libJSBinding.WindowsPhone.vcxproj", "{CA082EC4-17CE-430B-8207-D1E947A5D1E9}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{9335005f-678e-4e8e-9b84-50037216aec8}*SharedItemsImports = 4 + App.Shared\HelloJavascript.Shared.vcxitems*{a3ad93e4-0b2f-4c58-9181-69bed2e42e3e}*SharedItemsImports = 9 + ..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{cc1da216-a80d-4be4-b309-acb6af313aff}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9 + App.Shared\HelloJavascript.Shared.vcxitems*{79a8fcda-4b12-4dd1-b676-ff148d651638}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9 + ..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.Shared\libJSBinding.Shared.vcxitems*{ca082ec4-17ce-430b-8207-d1e947a5d1e9}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{5d6f020f-7e72-4494-90a0-2df11d235df9}*SharedItemsImports = 9 + ..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.Shared\libJSBinding.Shared.vcxitems*{bea66276-51dd-4c53-92a8-f3d1fea50892}*SharedItemsImports = 9 + ..\..\js-bindings\bindings\proj.win8.1-universal\libJSBinding\libJSBinding.Shared\libJSBinding.Shared.vcxitems*{bcf5546d-66a0-4998-afd6-c5514f618930}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\cocos\2d\libcocos2d_8_1\libcocos2d_8_1\libcocos2d_8_1.Shared\libcocos2d_8_1.Shared.vcxitems*{22f3b9df-1209-4574-8331-003966f562bf}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{22f798d8-bfff-4754-996f-a5395343d5ec}*SharedItemsImports = 4 + ..\..\js-bindings\cocos2d-x\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4 + App.Shared\HelloJavascript.Shared.vcxitems*{396fe85e-bb05-4b92-bccb-f89aed4ea41a}*SharedItemsImports = 4 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.ActiveCfg = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Build.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|ARM.Deploy.0 = Debug|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.ActiveCfg = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Build.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|Win32.Deploy.0 = Debug|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.ActiveCfg = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Build.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Debug|x64.Deploy.0 = Debug|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.ActiveCfg = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Build.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|ARM.Deploy.0 = Release|ARM + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.ActiveCfg = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Build.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|Win32.Deploy.0 = Release|Win32 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.ActiveCfg = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Build.0 = Release|x64 + {79A8FCDA-4B12-4DD1-B676-FF148D651638}.Release|x64.Deploy.0 = Release|x64 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.ActiveCfg = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Build.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|ARM.Deploy.0 = Debug|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Build.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|Win32.Deploy.0 = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Debug|x64.ActiveCfg = Debug|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.ActiveCfg = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Build.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|ARM.Deploy.0 = Release|ARM + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.ActiveCfg = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Build.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|Win32.Deploy.0 = Release|Win32 + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A}.Release|x64.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.ActiveCfg = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.Build.0 = Debug|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.Build.0 = Debug|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.ActiveCfg = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.Build.0 = Debug|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.ActiveCfg = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.Build.0 = Release|ARM + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.ActiveCfg = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.Build.0 = Release|Win32 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.ActiveCfg = Release|x64 + {3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.Build.0 = Release|x64 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.ActiveCfg = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|ARM.Build.0 = Debug|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|Win32.Build.0 = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Debug|x64.ActiveCfg = Debug|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.ActiveCfg = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|ARM.Build.0 = Release|ARM + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.ActiveCfg = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|Win32.Build.0 = Release|Win32 + {22F798D8-BFFF-4754-996F-A5395343D5EC}.Release|x64.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.ActiveCfg = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.Build.0 = Debug|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.Build.0 = Debug|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.ActiveCfg = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.Build.0 = Debug|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.ActiveCfg = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.Build.0 = Release|ARM + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.ActiveCfg = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64 + {F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.ActiveCfg = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|ARM.Build.0 = Debug|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|Win32.Build.0 = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Debug|x64.ActiveCfg = Debug|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.ActiveCfg = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|ARM.Build.0 = Release|ARM + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.ActiveCfg = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|Win32.Build.0 = Release|Win32 + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF}.Release|x64.ActiveCfg = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.ActiveCfg = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|ARM.Build.0 = Debug|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.ActiveCfg = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|Win32.Build.0 = Debug|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.ActiveCfg = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Debug|x64.Build.0 = Debug|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.ActiveCfg = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|ARM.Build.0 = Release|ARM + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.ActiveCfg = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|Win32.Build.0 = Release|Win32 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.ActiveCfg = Release|x64 + {9335005F-678E-4E8E-9B84-50037216AEC8}.Release|x64.Build.0 = Release|x64 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.ActiveCfg = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|ARM.Build.0 = Debug|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|Win32.Build.0 = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Debug|x64.ActiveCfg = Debug|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.ActiveCfg = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|ARM.Build.0 = Release|ARM + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.ActiveCfg = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|Win32.Build.0 = Release|Win32 + {22F3B9DF-1209-4574-8331-003966F562BF}.Release|x64.ActiveCfg = Release|Win32 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|ARM.ActiveCfg = Debug|ARM + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|ARM.Build.0 = Debug|ARM + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|Win32.ActiveCfg = Debug|Win32 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|Win32.Build.0 = Debug|Win32 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|x64.ActiveCfg = Debug|x64 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Debug|x64.Build.0 = Debug|x64 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|ARM.ActiveCfg = Release|ARM + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|ARM.Build.0 = Release|ARM + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|Win32.ActiveCfg = Release|Win32 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|Win32.Build.0 = Release|Win32 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|x64.ActiveCfg = Release|x64 + {BCF5546D-66A0-4998-AFD6-C5514F618930}.Release|x64.Build.0 = Release|x64 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Debug|ARM.ActiveCfg = Debug|ARM + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Debug|ARM.Build.0 = Debug|ARM + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Debug|Win32.ActiveCfg = Debug|Win32 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Debug|Win32.Build.0 = Debug|Win32 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Debug|x64.ActiveCfg = Debug|Win32 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|ARM.ActiveCfg = Release|ARM + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|ARM.Build.0 = Release|ARM + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.ActiveCfg = Release|Win32 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|Win32.Build.0 = Release|Win32 + {CA082EC4-17CE-430B-8207-D1E947A5D1E9}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A3AD93E4-0B2F-4C58-9181-69BED2E42E3E} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {79A8FCDA-4B12-4DD1-B676-FF148D651638} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {396FE85E-BB05-4B92-BCCB-F89AED4EA41A} = {36AFDE04-D127-4D84-9730-D84E3E51EAA7} + {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} = {F13CB4F7-BEE5-4368-A815-A971797387D8} + {4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {3B26A12D-3A44-47EA-82D2-282660FC844D} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {22F798D8-BFFF-4754-996F-A5395343D5EC} = {626C3EB8-F53B-41D0-BEA8-44EACAA1228C} + {ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {F3550FE0-C795-44F6-8FEB-093EB68143AE} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {CC1DA216-A80D-4BE4-B309-ACB6AF313AFF} = {D0E32B77-3B4F-44F8-AEBC-12EE8BBF1783} + {5D6F020F-7E72-4494-90A0-2DF11D235DF9} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {9335005F-678E-4E8E-9B84-50037216AEC8} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {22F3B9DF-1209-4574-8331-003966F562BF} = {80DA05C1-6532-4D2A-8606-EF02079B1373} + {BEA66276-51DD-4C53-92A8-F3D1FEA50892} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} + {BCF5546D-66A0-4998-AFD6-C5514F618930} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} + {CA082EC4-17CE-430B-8207-D1E947A5D1E9} = {FCB0EDBB-7A20-48D0-926B-E5617D40E6E5} + EndGlobalSection +EndGlobal diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/resources.props b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/resources.props new file mode 100644 index 0000000000..4f6a4a943d --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/resources.props @@ -0,0 +1,63 @@ + + + + + + + $(EngineRoot)..\bindings\manual;$(EngineRoot)..\bindings\auto;$(EngineRoot)..\external\spidermonkey\include\$(COCOS2D_PLATFORM);$(EngineRoot)cocos\base;%(AdditionalIncludeDirectories); + + + mozjs-33.lib;%(AdditionalDependencies) + $(EngineRoot)..\external\spidermonkey\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);%(AdditionalLibraryDirectories); + + + + + $(EngineRoot)..\external\spidermonkey\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\ + + + + + true + + + + + <_CustomResource Include="..\..\..\..\res\**\*"> + Assets\Resources\res\%(RecursiveDir)%(FileName)%(Extension) + true + + + + <_CustomResource Include="..\..\..\..\src\**\*"> + Assets\Resources\src\%(RecursiveDir)%(FileName)%(Extension) + true + + + + <_CustomResource Include="..\..\..\..\frameworks\js-bindings\bindings\script\**\*"> + Assets\Resources\script\%(RecursiveDir)%(FileName)%(Extension) + true + + + + <_CustomResource Include="..\..\..\..\main.js"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + <_CustomResource Include="..\..\..\..\project.json"> + Assets\Resources\%(RecursiveDir)%(FileName)%(Extension) + true + + + + + + + + + + + diff --git a/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml new file mode 100644 index 0000000000..4e5975de2a --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml.cs b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml.cs new file mode 100644 index 0000000000..3553e5f82f --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/App.xaml.cs @@ -0,0 +1,362 @@ +using System; +using System.Diagnostics; +using System.Resources; +using System.Windows; +using System.Windows.Markup; +using System.Windows.Navigation; +using Microsoft.Phone.Controls; +using Microsoft.Phone.Shell; +using System.IO.IsolatedStorage; + +namespace cocos2d +{ + public partial class App : Application + { + /// + /// Provides easy access to the root frame of the Phone Application. + /// + /// The root frame of the Phone Application. + public static PhoneApplicationFrame RootFrame { get; private set; } + + + enum SessionType + { + None, + Home, + DeepLink + } + + // Set to Home when the app is launched from Primary tile. + // Set to DeepLink when the app is launched from Deep Link. + private SessionType sessionType = SessionType.None; + + // Set to true when the page navigation is being reset + bool wasRelaunched = false; + + // set to true when 5 min passed since the app was relaunched + bool mustClearPagestack = false; + + IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; + + + /// + /// Constructor for the Application object. + /// + public App() + { + // Global handler for uncaught exceptions. + UnhandledException += Application_UnhandledException; + + // Standard XAML initialization + InitializeComponent(); + + // Phone-specific initialization + InitializePhoneApplication(); + + // Show graphics profiling information while debugging. + if (Debugger.IsAttached) + { + // Display the current frame rate counters. + Application.Current.Host.Settings.EnableFrameRateCounter = false; + + // Show the areas of the app that are being redrawn in each frame. + //Application.Current.Host.Settings.EnableRedrawRegions = true; + + // Enable non-production analysis visualization mode, + // which shows areas of a page that are handed off to GPU with a colored overlay. + //Application.Current.Host.Settings.EnableCacheVisualization = true; + + // Prevent the screen from turning off while under the debugger by disabling + // the application's idle detection. + // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run + // and consume battery power when the user is not using the phone. + PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; + } + + } + + // Code to execute when the application is launching (eg, from Start) + // This code will not execute when the application is reactivated + private void Application_Launching(object sender, LaunchingEventArgs e) + { + + // When a new instance of the app is launched, clear all deactivation settings + RemoveCurrentDeactivationSettings(); + } + + // Code to execute when the application is activated (brought to foreground) + // This code will not execute when the application is first launched + private void Application_Activated(object sender, ActivatedEventArgs e) + { + // If some interval has passed since the app was deactivated (30 seconds in this example), + // then remember to clear the back stack of pages + mustClearPagestack = CheckDeactivationTimeStamp(); + + + // If IsApplicationInstancePreserved is not true, then set the session type to the value + // saved in isolated storage. This will make sure the session type is correct for an + // app that is being resumed after being tombstoned. + if (!e.IsApplicationInstancePreserved) + { + RestoreSessionType(); + } + + } + + // Code to execute when the application is deactivated (sent to background) + // This code will not execute when the application is closing + private void Application_Deactivated(object sender, DeactivatedEventArgs e) + { + // When the applicaiton is deactivated, save the current deactivation settings to isolated storage + SaveCurrentDeactivationSettings(); + } + + // Code to execute when the application is closing (eg, user hit Back) + // This code will not execute when the application is deactivated + private void Application_Closing(object sender, ClosingEventArgs e) + { + // When the application closes, delete any deactivation settings from isolated storage + RemoveCurrentDeactivationSettings(); + } + + // Code to execute if a navigation fails + private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) + { + if (Debugger.IsAttached) + { + // A navigation has failed; break into the debugger + Debugger.Break(); + } + } + + // Code to execute on Unhandled Exceptions + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (Debugger.IsAttached) + { + // An unhandled exception has occurred; break into the debugger + Debugger.Break(); + } + } + + #region Phone application initialization + + // Avoid double-initialization + private bool phoneApplicationInitialized = false; + + // Do not add any additional code to this method + private void InitializePhoneApplication() + { + if (phoneApplicationInitialized) + return; + + // Create the frame but don't set it as RootVisual yet; this allows the splash + // screen to remain active until the application is ready to render. + RootFrame = new PhoneApplicationFrame(); + RootFrame.Navigated += CompleteInitializePhoneApplication; + + // Handle navigation failures + RootFrame.NavigationFailed += RootFrame_NavigationFailed; + + // Handle reset requests for clearing the backstack + RootFrame.Navigated += CheckForResetNavigation; + + // Monitor deep link launching + RootFrame.Navigating += RootFrame_Navigating; + + // Ensure we don't initialize again + phoneApplicationInitialized = true; + } + + // Event handler for the Navigating event of the root frame. Use this handler to modify + // the default navigation behavior. + void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e) + { + + // If the session type is None or New, check the navigation Uri to determine if the + // navigation is a deep link or if it points to the app's main page. + if (sessionType == SessionType.None && e.NavigationMode == NavigationMode.New) + { + // This block will run if the current navigation is part of the app's intial launch + + + // Keep track of Session Type + if (e.Uri.ToString().Contains("DeepLink=true")) + { + sessionType = SessionType.DeepLink; + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + sessionType = SessionType.Home; + } + } + + + if (e.NavigationMode == NavigationMode.Reset) + { + // This block will execute if the current navigation is a relaunch. + // If so, another navigation will be coming, so this records that a relaunch just happened + // so that the next navigation can use this info. + wasRelaunched = true; + } + else if (e.NavigationMode == NavigationMode.New && wasRelaunched) + { + // This block will run if the previous navigation was a relaunch + wasRelaunched = false; + + if (e.Uri.ToString().Contains("DeepLink=true")) + { + // This block will run if the launch Uri contains "DeepLink=true" which + // was specified when the secondary tile was created in MainPage.xaml.cs + + sessionType = SessionType.DeepLink; + // The app was relaunched via a Deep Link. + // The page stack will be cleared. + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + // This block will run if the navigation Uri is the main page + if (sessionType == SessionType.DeepLink) + { + // When the app was previously launched via Deep Link and relaunched via Main Tile, we need to clear the page stack. + sessionType = SessionType.Home; + } + else + { + if (!mustClearPagestack) + { + //The app was previously launched via Main Tile and relaunched via Main Tile. Cancel the navigation to resume. + e.Cancel = true; + RootFrame.Navigated -= ClearBackStackAfterReset; + } + } + } + + mustClearPagestack = false; + } + } + // Do not add any additional code to this method + private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) + { + // Set the root visual to allow the application to render + if (RootVisual != RootFrame) + RootVisual = RootFrame; + + // Remove this handler since it is no longer needed + RootFrame.Navigated -= CompleteInitializePhoneApplication; + } + + private void CheckForResetNavigation(object sender, NavigationEventArgs e) + { + // If the app has received a 'reset' navigation, then we need to check + // on the next navigation to see if the page stack should be reset + if (e.NavigationMode == NavigationMode.Reset) + RootFrame.Navigated += ClearBackStackAfterReset; + } + + private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) + { + // Unregister the event so it doesn't get called again + RootFrame.Navigated -= ClearBackStackAfterReset; + + // Only clear the stack for 'new' (forward) and 'refresh' navigations + if (e.NavigationMode != NavigationMode.New) + return; + + // For UI consistency, clear the entire page stack + while (RootFrame.RemoveBackEntry() != null) + { + ; // do nothing + } + } + + #endregion + + // Helper method for adding or updating a key/value pair in isolated storage + public bool AddOrUpdateValue(string Key, Object value) + { + bool valueChanged = false; + + // If the key exists + if (settings.Contains(Key)) + { + // If the value has changed + if (settings[Key] != value) + { + // Store the new value + settings[Key] = value; + valueChanged = true; + } + } + // Otherwise create the key. + else + { + settings.Add(Key, value); + valueChanged = true; + } + return valueChanged; + } + + // Helper method for removing a key/value pair from isolated storage + public void RemoveValue(string Key) + { + // If the key exists + if (settings.Contains(Key)) + { + settings.Remove(Key); + } + } + + // Called when the app is deactivating. Saves the time of the deactivation and the + // session type of the app instance to isolated storage. + public void SaveCurrentDeactivationSettings() + { + if (AddOrUpdateValue("DeactivateTime", DateTimeOffset.Now)) + { + settings.Save(); + } + + if (AddOrUpdateValue("SessionType", sessionType)) + { + settings.Save(); + } + + } + + // Called when the app is launched or closed. Removes all deactivation settings from + // isolated storage + public void RemoveCurrentDeactivationSettings() + { + RemoveValue("DeactivateTime"); + RemoveValue("SessionType"); + settings.Save(); + } + + // Helper method to determine if the interval since the app was deactivated is + // greater than 30 seconds + bool CheckDeactivationTimeStamp() + { + DateTimeOffset lastDeactivated; + + if (settings.Contains("DeactivateTime")) + { + lastDeactivated = (DateTimeOffset)settings["DeactivateTime"]; + } + + var currentDuration = DateTimeOffset.Now.Subtract(lastDeactivated); + + return TimeSpan.FromSeconds(currentDuration.TotalSeconds) > TimeSpan.FromSeconds(30); + } + + // Helper method to restore the session type from isolated storage. + void RestoreSessionType() + { + if (settings.Contains("SessionType")) + { + sessionType = (SessionType)settings["SessionType"]; + } + } + + + } +} diff --git a/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/EditBox.xaml b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/EditBox.xaml new file mode 100644 index 0000000000..a1259d3268 --- /dev/null +++ b/templates/js-template-default/frameworks/runtime-src/proj.wp8-xaml/App/EditBox.xaml @@ -0,0 +1,20 @@ + + + + + + +