diff --git a/native/tools/simulator/.cocos-project.json b/native/tools/simulator/.cocos-project.json
new file mode 100755
index 0000000000..6e3b558228
--- /dev/null
+++ b/native/tools/simulator/.cocos-project.json
@@ -0,0 +1,4 @@
+{
+ "has_native": true,
+ "project_type": "lua"
+}
\ No newline at end of file
diff --git a/native/tools/simulator/.project b/native/tools/simulator/.project
new file mode 100755
index 0000000000..1ee849d993
--- /dev/null
+++ b/native/tools/simulator/.project
@@ -0,0 +1,13 @@
+
+
+ Simulator
+
+
+
+
+
+
+ org.ccdt.cocosproject
+ org.eclipse.koneki.ldt.nature
+
+
diff --git a/native/tools/simulator/config.json b/native/tools/simulator/config.json
new file mode 100755
index 0000000000..bf8ea7edb7
--- /dev/null
+++ b/native/tools/simulator/config.json
@@ -0,0 +1,12 @@
+{
+ "init_cfg":{
+ "isLandscape": true,
+ "isWindowTop": false,
+ "name": "simulator",
+ "width": 960,
+ "height": 640,
+ "entry": "",
+ "consolePort": 6050,
+ "uploadPort": 6060
+ }
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.cpp
new file mode 100755
index 0000000000..6c06aaa24e
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.cpp
@@ -0,0 +1,70 @@
+#include "AppDelegate.h"
+#include "SimpleAudioEngine.h"
+#include "cocos2d.h"
+#include "ide-support/CodeIDESupport.h"
+
+#include "runtime/Runtime.h"
+
+// Js
+#include "ide-support/RuntimeJsImpl.h"
+
+
+using namespace CocosDenshion;
+
+USING_NS_CC;
+using namespace std;
+
+AppDelegate::AppDelegate()
+{
+}
+
+AppDelegate::~AppDelegate()
+{
+ SimpleAudioEngine::end();
+
+ // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE
+ RuntimeEngine::getInstance()->end();
+}
+
+//if you want a different context,just modify the value of glContextAttrs
+//it will takes effect on all platforms
+void AppDelegate::initGLContextAttrs()
+{
+ //set OpenGL context attributions,now can only set six attributions:
+ //red,green,blue,alpha,depth,stencil
+ GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
+
+ GLView::setGLContextAttrs(glContextAttrs);
+}
+
+bool AppDelegate::applicationDidFinishLaunching()
+{
+ // set default FPS
+ Director::getInstance()->setAnimationInterval(1.0 / 60.0f);
+
+ auto runtimeEngine = RuntimeEngine::getInstance();
+ runtimeEngine->setEventTrackingEnable(true);
+ auto jsRuntime = RuntimeJsImpl::create();
+ runtimeEngine->addRuntime(jsRuntime, kRuntimeEngineJs);
+ runtimeEngine->start();
+
+ // Runtime end
+ cocos2d::log("iShow!");
+ return true;
+}
+
+// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
+void AppDelegate::applicationDidEnterBackground()
+{
+ Director::getInstance()->stopAnimation();
+
+ SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
+}
+
+// this function will be called when the app is active again
+void AppDelegate::applicationWillEnterForeground()
+{
+ Director::getInstance()->startAnimation();
+
+ SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.h b/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.h
new file mode 100755
index 0000000000..a2699dc754
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/AppDelegate.h
@@ -0,0 +1,40 @@
+#ifndef __APP_DELEGATE_H__
+#define __APP_DELEGATE_H__
+
+#include "cocos2d.h"
+
+/**
+@brief The cocos2d Application.
+
+The reason for implement as private inheritance is to hide some interface call by Director.
+*/
+class AppDelegate : private cocos2d::Application
+{
+public:
+ AppDelegate();
+ virtual ~AppDelegate();
+
+ virtual void initGLContextAttrs();
+
+ /**
+ @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/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h
new file mode 100755
index 0000000000..3607d3c7b3
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/CodeIDESupport.h
@@ -0,0 +1,7 @@
+#ifndef __CODE_IDE_SUPPORT_H__
+#define __CODE_IDE_SUPPORT_H__
+
+// define 1 to open Cocos Code IDE support, 0 to disable
+#define CC_CODE_IDE_DEBUG_SUPPORT 1
+
+#endif /* __CODE_IDE_SUPPORT_H__ */
diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp
new file mode 100755
index 0000000000..ecf33722fd
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp
@@ -0,0 +1,320 @@
+//
+// RuntimeJsImpl.cpp
+// Simulator
+//
+//
+
+#include "RuntimeJsImpl.h"
+
+#include "cocos2d.h" // 2dx engine
+
+#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
+
+#include "runtime/ConfigParser.h" // config
+#include "runtime/Runtime.h"
+#include "runtime/FileServer.h"
+
+// js
+#include "scripting/js-bindings/manual/ScriptingCore.h"
+#include "js_module_register.h"
+
+//#include "jsb/jsb_creator_auto.hpp"
+
+
+USING_NS_CC;
+
+static const char *RUNTIME_JS_BOOT_SCRIPT = "script/jsb_boot.js";
+
+static bool reloadScript(const string& file)
+{
+ auto director = Director::getInstance();
+ FontFNT::purgeCachedData();
+ if (director->getOpenGLView())
+ {
+ SpriteFrameCache::getInstance()->removeSpriteFrames();
+ director->getTextureCache()->removeAllTextures();
+ }
+ FileUtils::getInstance()->purgeCachedEntries();
+
+ //director->getScheduler()->unscheduleAll();
+ //director->getScheduler()->scheduleUpdate(director->getActionManager(), Scheduler::PRIORITY_SYSTEM, false);
+
+ string modulefile = file;
+ if (modulefile.empty())
+ {
+ modulefile = ConfigParser::getInstance()->getEntryFile().c_str();
+ }
+
+ return ScriptingCore::getInstance()->runScript(modulefile.c_str());
+}
+
+bool runtime_FileUtils_addSearchPath(JSContext *cx, uint32_t argc, jsval *vp)
+{
+ JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+ bool ok = true;
+ JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
+ js_proxy_t *proxy = jsb_get_js_proxy(obj);
+ cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);
+ JSB_PRECONDITION2( cobj, cx, false, "cocos2dx_FileUtils_addSearchPath : Invalid Native Object");
+ if (argc == 1 || argc == 2) {
+ std::string arg0;
+ bool arg1 = false;
+
+ ok &= jsval_to_std_string(cx, args.get(0), &arg0);
+ JSB_PRECONDITION2(ok, cx, false, "cocos2dx_FileUtils_addSearchPath : Error processing arguments");
+
+ if (argc == 2)
+ {
+ arg1 = JS::ToBoolean(JS::RootedValue(cx, args.get(1)));
+ }
+
+ if (! FileUtils::getInstance()->isAbsolutePath(arg0))
+ {
+ // add write path to search path
+ if (FileServer::getShareInstance()->getIsUsingWritePath())
+ {
+ cobj->addSearchPath(FileServer::getShareInstance()->getWritePath() + arg0, arg1);
+ } else
+ {
+ cobj->addSearchPath(arg0, arg1);
+ }
+
+#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
+ // add project path to search path
+ cobj->addSearchPath(RuntimeEngine::getInstance()->getRuntime()->getProjectPath() + arg0, arg1);
+#endif
+ }
+
+ args.rval().setUndefined();
+ return true;
+ }
+
+ JS_ReportError(cx, "cocos2dx_FileUtils_addSearchPath : wrong number of arguments: %d, was expecting %d", argc, 1);
+ return false;
+}
+
+bool runtime_FileUtils_setSearchPaths(JSContext *cx, uint32_t argc, jsval *vp)
+{
+ JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+ bool ok = true;
+ JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
+ js_proxy_t *proxy = jsb_get_js_proxy(obj);
+ cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);
+ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FileUtils_setSearchPaths : Invalid Native Object");
+ if (argc == 1) {
+ std::vector vecPaths, writePaths;
+ ok &= jsval_to_std_vector_string(cx, args.get(0), &vecPaths);
+ JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FileUtils_setSearchPaths : Error processing arguments");
+
+ std::vector originPath; // for IOS platform.
+ std::vector projPath; // for Desktop platform.
+ for (int i = 0; i < vecPaths.size(); i++)
+ {
+ if (!FileUtils::getInstance()->isAbsolutePath(vecPaths[i]))
+ {
+ originPath.push_back(vecPaths[i]); // for IOS platform.
+ projPath.push_back(RuntimeEngine::getInstance()->getRuntime()->getProjectPath()+vecPaths[i]); //for Desktop platform.
+ writePaths.push_back(FileServer::getShareInstance()->getWritePath() + vecPaths[i]);
+ }
+ }
+
+#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
+ vecPaths.insert(vecPaths.end(), projPath.begin(), projPath.end());
+#endif
+ if (FileServer::getShareInstance()->getIsUsingWritePath())
+ {
+ vecPaths.insert(vecPaths.end(), writePaths.begin(), writePaths.end());
+ } else
+ {
+ vecPaths.insert(vecPaths.end(), originPath.begin(), originPath.end());
+ }
+
+ cobj->setSearchPaths(vecPaths);
+
+ args.rval().setUndefined();
+ return true;
+ }
+
+ JS_ReportError(cx, "js_cocos2dx_FileUtils_setSearchPaths : wrong number of arguments: %d, was expecting %d", argc, 1);
+ return false;
+}
+
+void register_FileUtils(JSContext *cx, JS::HandleObject global)
+{
+ JS::RootedValue nsval(cx);
+ JS::RootedObject ns(cx);
+ JS_GetProperty(cx, global, "cc", &nsval);
+ if (nsval == JSVAL_VOID) {
+ return;
+ }
+ else {
+ ns.set(nsval.toObjectOrNull());
+ }
+ JS::RootedObject proto(cx, get_jsb_cocos2d_FileUtils_prototype());
+ JS_DefineFunction(cx, proto, "addSearchPath", runtime_FileUtils_addSearchPath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE);
+ JS_DefineFunction(cx, proto, "setSearchPaths", runtime_FileUtils_setSearchPaths, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE);
+}
+
+RuntimeJsImpl* RuntimeJsImpl::create()
+{
+ RuntimeJsImpl *instance = new RuntimeJsImpl();
+ return instance;
+}
+
+bool RuntimeJsImpl::initJsEnv()
+{
+ if (_hasStarted)
+ {
+ return true;
+ }
+
+ js_module_register();
+
+ // creator
+// ScriptingCore::getInstance()->addRegisterCallback(register_all_creator);
+
+ ScriptingCore::getInstance()->addRegisterCallback(register_FileUtils);
+ ScriptingCore::getInstance()->start();
+ _hasStarted = true;
+
+ ScriptEngineProtocol *engine = ScriptingCore::getInstance();
+ ScriptEngineManager::getInstance()->setScriptEngine(engine);
+
+ return true;
+}
+
+bool RuntimeJsImpl::startWithDebugger()
+{
+ initJsEnv();
+
+ int debugPort = 5086;
+#if(CC_PLATFORM_MAC == CC_TARGET_PLATFORM || CC_PLATFORM_WIN32 == CC_TARGET_PLATFORM)
+ debugPort = ConfigParser::getInstance()->getDebugPort();
+#endif
+ ScriptingCore::getInstance()->enableDebugger(debugPort);
+
+ return true;
+}
+
+void RuntimeJsImpl::startScript(const std::string& path)
+{
+ loadScriptFile(path);
+}
+
+void RuntimeJsImpl::onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse)
+{
+ if (loadScriptFile(ConfigParser::getInstance()->getEntryFile()))
+ {
+ dReplyParse.AddMember("code",0,dReplyParse.GetAllocator());
+ }
+ else
+ {
+ dReplyParse.AddMember("code",1,dReplyParse.GetAllocator());
+ }
+}
+
+void RuntimeJsImpl::onClearCompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse)
+{
+ if (dArgParse.HasMember("modulefiles") && dArgParse["modulefiles"].Size() != 0)
+ {
+ const rapidjson::Value& objectfiles = dArgParse["modulefiles"];
+ for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++)
+ {
+ ScriptingCore::getInstance()->cleanScript(objectfiles[i].GetString());
+ }
+ }
+ else
+ {
+ std::unordered_map filenameScript = ScriptingCore::getInstance()->getFileScript();
+ filenameScript.clear();
+ }
+
+ dReplyParse.AddMember("code",0,dReplyParse.GetAllocator());
+}
+
+void RuntimeJsImpl::onPrecompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse)
+{
+ const rapidjson::Value& objectfiles = dArgParse["modulefiles"];
+ for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++)
+ {
+ ScriptingCore* sc = ScriptingCore::getInstance();
+ JSContext* gc = sc->getGlobalContext();
+
+ sc->compileScript(objectfiles[i].GetString(),
+ JS::RootedObject(gc, sc->getGlobalObject()),
+ gc);
+ }
+
+ dReplyParse.AddMember("code",0,dReplyParse.GetAllocator());
+}
+
+void RuntimeJsImpl::onReload(const rapidjson::Document &dArgParse, rapidjson::Document &dReplyParse)
+{
+ if (dArgParse.HasMember("modulefiles")){
+ auto& allocator = dReplyParse.GetAllocator();
+ rapidjson::Value bodyvalue(rapidjson::kObjectType);
+ const rapidjson::Value& objectfiles = dArgParse["modulefiles"];
+ for (rapidjson::SizeType i = 0; i < objectfiles.Size(); i++){
+ if (!reloadScript(objectfiles[i].GetString())) {
+ bodyvalue.AddMember(rapidjson::Value(objectfiles[i].GetString(), allocator)
+ , rapidjson::Value(1)
+ , allocator);
+ }
+ }
+ if (0 == objectfiles.Size())
+ {
+ reloadScript("");
+ }
+ dReplyParse.AddMember("body", bodyvalue, dReplyParse.GetAllocator());
+ }else
+ {
+ reloadScript("");
+ }
+
+ dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator());
+}
+
+void RuntimeJsImpl::onRemove(const std::string &filename)
+{
+ ScriptingCore::getInstance()->cleanScript(filename.c_str());
+}
+
+void RuntimeJsImpl::end()
+{
+ ScriptEngineManager::destroyInstance();
+ RuntimeProtocol::end();
+}
+
+// private
+
+RuntimeJsImpl::RuntimeJsImpl()
+: _hasStarted(false)
+{
+}
+
+bool RuntimeJsImpl::loadScriptFile(const std::string& path)
+{
+ std::string filepath = path;
+ if (filepath.empty())
+ {
+ filepath = ConfigParser::getInstance()->getEntryFile();
+ }
+ CCLOG("------------------------------------------------");
+ CCLOG("LOAD Js FILE: %s", filepath.c_str());
+ CCLOG("------------------------------------------------");
+
+ initJsEnv();
+ auto engine = ScriptingCore::getInstance();
+ engine->runScript(RUNTIME_JS_BOOT_SCRIPT);
+
+ // if (RuntimeEngine::getInstance()->getProjectConfig().getDebuggerType() != kCCRuntimeDebuggerNone)
+ // {
+ this->startWithDebugger();
+ // }
+
+ ScriptEngineManager::getInstance()->setScriptEngine(engine);
+ return ScriptingCore::getInstance()->runScript(filepath.c_str());
+}
+
+
+#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h
new file mode 100755
index 0000000000..d324f3fea2
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.h
@@ -0,0 +1,39 @@
+//
+// RuntimeJsImpl.h
+// Simulator
+//
+//
+
+#ifndef __Simulator__RuntimeJsImpl__
+#define __Simulator__RuntimeJsImpl__
+
+#include "CodeIDESupport.h"
+#include "cocos2d.h"
+
+#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
+#include "runtime/RuntimeProtocol.h"
+
+class RuntimeJsImpl : public RuntimeProtocol
+{
+public:
+ static RuntimeJsImpl* create();
+
+ void startScript(const std::string& file);
+ void onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
+ void onClearCompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
+ void onPrecompile(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
+ void onReload(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
+ void onRemove(const std::string &filename);
+ void end();
+
+ bool startWithDebugger();
+private:
+ RuntimeJsImpl();
+ bool initJsEnv();
+ bool loadScriptFile(const std::string& file);
+ bool _hasStarted;
+};
+
+#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
+
+#endif /* defined(__Simulator__RuntimeLua__) */
diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang
new file mode 100755
index 0000000000..1c13dacd89
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/lang
@@ -0,0 +1,29 @@
+{
+ "zh-CN": {
+ "View": "视图(&V)",
+ "Exit": "退出(&X)",
+ "File": "文件(&F)",
+ "Portrait": "竖屏",
+ "Landscape": "横屏",
+ "Refresh": "刷新(重启)",
+ "Zoom Out": "缩放",
+ "Simulator": "模拟器",
+ "Open File": "打开文件",
+ "Open Project": "打开工程",
+ "Error": "错误",
+ "Help": "帮助(&H)",
+ "About": "关于(&A)"
+ },
+ "zh-Hans": {
+ "View": "视图",
+ "Exit": "退出",
+ "File": "文件",
+ "Portrait": "竖屏",
+ "Landscape": "横屏",
+ "Refresh": "刷新(重启)",
+ "Zoom Out": "缩放",
+ "Simulator": "模拟器",
+ "Help": "帮助(&H)",
+ "About": "关于(&A)"
+ }
+}
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/.classpath b/native/tools/simulator/frameworks/runtime-src/proj.android/.classpath
new file mode 100755
index 0000000000..d57ec02513
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/.classpath
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/.project b/native/tools/simulator/frameworks/runtime-src/proj.android/.project
new file mode 100755
index 0000000000..b593ae59ff
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/.project
@@ -0,0 +1,33 @@
+
+
+ simulator
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs b/native/tools/simulator/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000000..b080d2ddc8
--- /dev/null
+++ b/native/tools/simulator/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/native/tools/simulator/frameworks/runtime-src/proj.android/AndroidManifest.xml b/native/tools/simulator/frameworks/runtime-src/proj.android/AndroidManifest.xml
new file mode 100755
index 0000000000..5068cd5af3
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/AndroidManifest.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/ant.properties b/native/tools/simulator/frameworks/runtime-src/proj.android/ant.properties
new file mode 100755
index 0000000000..6bad1d5c60
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/ant.properties
@@ -0,0 +1,21 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked into Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+key.alias.password=android
+key.store.password=android
+key.store=/Users/jryin/.android/debug.keystore
+key.alias=androiddebugkey
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/build-cfg.json b/native/tools/simulator/frameworks/runtime-src/proj.android/build-cfg.json
new file mode 100755
index 0000000000..4d56ca71ea
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/build-cfg.json
@@ -0,0 +1,16 @@
+{
+ "ndk_module_path" :[
+ "../../../../../",
+ "../../../../../cocos/",
+ "../../../../../external",
+ "../../../../../cocos/scripting"
+ ],
+ "copy_resources": [
+ ],
+ "must_copy_resources": [
+ {
+ "from": "../../../config.json",
+ "to": ""
+ }
+ ]
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/build.xml b/native/tools/simulator/frameworks/runtime-src/proj.android/build.xml
new file mode 100755
index 0000000000..e6cd82c5ec
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/build.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk
new file mode 100755
index 0000000000..37da6d563f
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Android.mk
@@ -0,0 +1,37 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := cocos2dlua_shared
+
+LOCAL_MODULE_FILENAME := libcocos2dlua
+
+ifeq ($(COCOS_SIMULATOR_BUILD),1)
+LOCAL_ARM_MODE := arm
+endif
+
+FILE_LIST := hellolua/main.cpp
+FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
+FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.cpp)
+FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/ide-support/*.c)
+
+LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+$(LOCAL_PATH)/../../Classes/protobuf-lite \
+$(LOCAL_PATH)/../../Classes/runtime \
+$(LOCAL_PATH)/../../Classes/jsb \
+$(LOCAL_PATH)/../../Classes \
+$(LOCAL_PATH)/../../../../../../external \
+$(LOCAL_PATH)/../../../../../../tools/simulator/libsimulator/lib \
+$(LOCAL_PATH)/../../../../../../tools/simulator/libsimulator/lib/protobuf-lite
+
+LOCAL_STATIC_LIBRARIES := cocos2d_simulator_static
+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)
+$(call import-module,tools/simulator/libsimulator/proj.android)
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk
new file mode 100755
index 0000000000..18cecb0948
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/Application.mk
@@ -0,0 +1,17 @@
+APP_STL := gnustl_static
+
+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_CPPFLAGS += -DCOCOS2D_DEBUG=1
+ APP_OPTIM := release
+endif
+
+COCOS_SIMULATOR_BUILD := 1
+USE_ARM_MODE := 1
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp
new file mode 100755
index 0000000000..ff9c646e95
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp
@@ -0,0 +1,35 @@
+#include "AppDelegate.h"
+#include "cocos2d.h"
+#include "platform/android/jni/JniHelper.h"
+#include
+#include
+#include "runtime/ConfigParser.h"
+#include "ide-support/CodeIDESupport.h"
+
+#define LOG_TAG "main"
+#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
+
+using namespace cocos2d;
+
+void cocos_android_app_init (JNIEnv* env, jobject thiz) {
+ LOGD("cocos_android_app_init");
+ AppDelegate *pAppDelegate = new AppDelegate();
+}
+
+extern "C"
+{
+ bool Java_org_cocos2dx_lua_AppActivity_nativeIsLandScape(JNIEnv *env, jobject thisz)
+ {
+ return ConfigParser::getInstance()->isLanscape();
+ }
+
+ bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz)
+ {
+#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
+ return true;
+#else
+ return false;
+#endif
+ }
+}
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/proguard-project.txt b/native/tools/simulator/frameworks/runtime-src/proj.android/proguard-project.txt
new file mode 100755
index 0000000000..f2fe1559a2
--- /dev/null
+++ b/native/tools/simulator/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/native/tools/simulator/frameworks/runtime-src/proj.android/project.properties b/native/tools/simulator/frameworks/runtime-src/proj.android/project.properties
new file mode 100755
index 0000000000..1cca50dba7
--- /dev/null
+++ b/native/tools/simulator/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=../../../../../cocos/platform/android/java
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png
new file mode 100755
index 0000000000..8aa4767c2f
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png
new file mode 100755
index 0000000000..17ce11a085
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png
new file mode 100755
index 0000000000..3780aac46c
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/res/values/strings.xml b/native/tools/simulator/frameworks/runtime-src/proj.android/res/values/strings.xml
new file mode 100755
index 0000000000..e41378172b
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+
+ simulator
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java b/native/tools/simulator/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java
new file mode 100755
index 0000000000..e678b3ce41
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.android/src/org/cocos2dx/lua/AppActivity.java
@@ -0,0 +1,130 @@
+/****************************************************************************
+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.lua;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Enumeration;
+import java.util.ArrayList;
+
+import org.cocos2dx.lib.Cocos2dxActivity;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.ActivityInfo;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.text.format.Formatter;
+import android.util.Log;
+import android.view.WindowManager;
+import android.widget.Toast;
+
+
+public class AppActivity extends Cocos2dxActivity{
+
+ static String hostIPAdress = "0.0.0.0";
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if(nativeIsLandScape()) {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
+ } else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
+ }
+
+ //2.Set the format of window
+
+ // Check the wifi is opened when the native is debug.
+ if(nativeIsDebug())
+ {
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ if(!isNetworkConnected())
+ {
+ AlertDialog.Builder builder=new AlertDialog.Builder(this);
+ builder.setTitle("Warning");
+ builder.setMessage("Please open WIFI for debuging...");
+ builder.setPositiveButton("OK",new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+ finish();
+ System.exit(0);
+ }
+ });
+
+ builder.setNegativeButton("Cancel", null);
+ builder.setCancelable(true);
+ builder.show();
+ }
+ }
+ hostIPAdress = getHostIpAddress();
+ }
+ private boolean isNetworkConnected() {
+ ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+ if (cm != null) {
+ NetworkInfo networkInfo = cm.getActiveNetworkInfo();
+ ArrayList networkTypes = new ArrayList();
+ networkTypes.add(ConnectivityManager.TYPE_WIFI);
+ try {
+ networkTypes.add(ConnectivityManager.class.getDeclaredField("TYPE_ETHERNET").getInt(null));
+ } catch (NoSuchFieldException nsfe) {
+ }
+ catch (IllegalAccessException iae) {
+ throw new RuntimeException(iae);
+ }
+ if (networkInfo != null && networkTypes.contains(networkInfo.getType())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getHostIpAddress() {
+ WifiManager wifiMgr = (WifiManager) getSystemService(WIFI_SERVICE);
+ WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
+ int ip = wifiInfo.getIpAddress();
+ return ((ip & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF) + "." + ((ip >>>= 8) & 0xFF));
+ }
+
+ public static String getLocalIpAddress() {
+ return hostIPAdress;
+ }
+
+ private static native boolean nativeIsLandScape();
+ private static native boolean nativeIsDebug();
+
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/AppController.h b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/AppController.h
new file mode 100755
index 0000000000..34545808e4
--- /dev/null
+++ b/native/tools/simulator/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/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm
new file mode 100755
index 0000000000..396f92ca30
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm
@@ -0,0 +1,148 @@
+/****************************************************************************
+ 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
+{
+
+ cocos2d::Application *app = cocos2d::Application::getInstance();
+ app->initGLContextAttrs();
+ cocos2d::GLViewImpl::convertAttrs();
+
+ // Override point for customization after application launch.
+
+ // Add the view controller's view to the window and display.
+ window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
+ CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds]
+ pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat
+ depthFormat: cocos2d::GLViewImpl::_depthFormat
+ 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);
+
+ app->run();
+ return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+ 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/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png
new file mode 100755
index 0000000000..66c6d1cead
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png
new file mode 100755
index 0000000000..a0f61ec8e6
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-667h@2x.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png
new file mode 100755
index 0000000000..dadccee686
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default-736h@3x.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png
new file mode 100755
index 0000000000..dcb80725de
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png
new file mode 100755
index 0000000000..84689888a1
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png
new file mode 100755
index 0000000000..ef38d4500a
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png
new file mode 100755
index 0000000000..c3807861ad
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png
new file mode 100755
index 0000000000..a5b49ccbb1
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png
new file mode 100755
index 0000000000..1526615c02
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png
new file mode 100755
index 0000000000..8aa82506d0
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png
new file mode 100755
index 0000000000..0500184c86
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png
new file mode 100755
index 0000000000..775685daca
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png
new file mode 100755
index 0000000000..ac381bc20e
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png
new file mode 100755
index 0000000000..4fcc6fddff
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png
new file mode 100755
index 0000000000..f0f8b7fe98
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png
new file mode 100755
index 0000000000..2c573c8df4
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png
new file mode 100755
index 0000000000..8a1fa1850c
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png
new file mode 100755
index 0000000000..d9c7ab446b
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Info.plist b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Info.plist
new file mode 100755
index 0000000000..7037667ac7
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Info.plist
@@ -0,0 +1,157 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleDisplayName
+ ${PRODUCT_NAME}
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIconFile
+
+ CFBundleIconFiles
+
+ Icon-80
+ Icon-58
+ Icon-29
+ Icon-120
+ Icon-57.png
+ Icon-114.png
+ Icon-72.png
+ Icon-144.png
+
+ CFBundleIconFiles~ipad
+
+ Icon-58
+ Icon-29
+ Icon-80
+ Icon-40
+ Icon-100
+ Icon-50
+ Icon-152
+ Icon-76
+ Icon-120
+ Icon-57.png
+ Icon-114.png
+ Icon-72.png
+ Icon-144.png
+
+ CFBundleIdentifier
+ com.cocos.apps.simulator
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ simulator
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 3.5rc0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 20150314
+ LSRequiresIPhoneOS
+
+ UILaunchImages
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default
+ UILaunchImageOrientation
+ Portrait
+ UILaunchImageSize
+ {320, 480}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default
+ UILaunchImageOrientation
+ Landscape
+ UILaunchImageSize
+ {320, 480}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-568h
+ UILaunchImageOrientation
+ Portrait
+ UILaunchImageSize
+ {320, 568}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-568h
+ UILaunchImageOrientation
+ Landscape
+ UILaunchImageSize
+ {320, 568}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-667h
+ UILaunchImageOrientation
+ Portrait
+ UILaunchImageSize
+ {375, 667}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-667h
+ UILaunchImageOrientation
+ Landscape
+ UILaunchImageSize
+ {375, 667}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-736h
+ UILaunchImageOrientation
+ Portrait
+ UILaunchImageSize
+ {414, 736}
+
+
+ UILaunchImageMinimumOSVersion
+ 8.0
+ UILaunchImageName
+ Default-736h
+ UILaunchImageOrientation
+ Landscape
+ UILaunchImageSize
+ {414, 736}
+
+
+ UIPrerenderedIcon
+
+ UIRequiredDeviceCapabilities
+
+ accelerometer
+
+ opengles-1
+
+
+ UIStatusBarHidden
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch
new file mode 100755
index 0000000000..5ec7dfe43e
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'simulator' target in the 'simulator' project
+//
+
+#ifdef __OBJC__
+ #import
+ #import
+#endif
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h
new file mode 100755
index 0000000000..11dfc4bf88
--- /dev/null
+++ b/native/tools/simulator/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/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm
new file mode 100755
index 0000000000..5bc929e35f
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm
@@ -0,0 +1,127 @@
+/****************************************************************************
+ 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"
+#include "runtime/ConfigParser.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 {
+ if (ConfigParser::getInstance()->isLanscape()) {
+ return UIInterfaceOrientationIsLandscape( interfaceOrientation );
+ }else{
+ return UIInterfaceOrientationIsPortrait( interfaceOrientation );
+ }
+}
+
+// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
+- (NSUInteger) supportedInterfaceOrientations{
+#ifdef __IPHONE_6_0
+ if (ConfigParser::getInstance()->isLanscape()) {
+ return UIInterfaceOrientationMaskLandscape;
+ }else{
+ return UIInterfaceOrientationMaskPortraitUpsideDown;
+ }
+#endif
+}
+
+- (BOOL) shouldAutorotate {
+ if (ConfigParser::getInstance()->isLanscape()) {
+ return YES;
+ }else{
+ return NO;
+ }
+}
+
+- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
+ [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+
+ cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
+
+ if (glview)
+ {
+ CCEAGLView *eaglview = (CCEAGLView*) 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/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json
new file mode 100755
index 0000000000..e93fceb246
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/build-cfg.json
@@ -0,0 +1,6 @@
+{
+ "remove_res" : [
+ "src",
+ "res"
+ ]
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/main.m b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/main.m
new file mode 100755
index 0000000000..39146b5c74
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/ios/main.m
@@ -0,0 +1,16 @@
+//
+// main.m
+// simulator
+//
+// Copyright __MyCompanyName__ 2011. All rights reserved.
+//
+
+#import
+
+int main(int argc, char *argv[]) {
+
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
+ [pool release];
+ return retVal;
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/ConsoleWindow.xib b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/ConsoleWindow.xib
new file mode 100755
index 0000000000..1cc9932310
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/ConsoleWindow.xib
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib
new file mode 100755
index 0000000000..95349511fa
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Base.lproj/MainMenu.xib
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.h b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.h
new file mode 100755
index 0000000000..7b1c06d215
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.h
@@ -0,0 +1,23 @@
+
+#import
+
+@interface ConsoleWindowController : NSWindowController
+{
+ NSTextView *textView;
+ IBOutlet NSButton *checkScroll;
+ IBOutlet NSButton *topCheckBox;
+ NSMutableArray *linesCount;
+ NSUInteger traceCount;
+}
+
+@property (assign) IBOutlet NSTextView *textView;
+
+- (void) trace:(NSString*)msg;
+- (IBAction)onClear:(id)sender;
+- (IBAction)onScrollChange:(id)sender;
+- (IBAction)onTopChange:(id)sender;
+
+@end
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.m b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.m
new file mode 100755
index 0000000000..aa56938433
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/ConsoleWindowController.m
@@ -0,0 +1,100 @@
+
+#import "ConsoleWindowController.h"
+
+@interface ConsoleWindowController ()
+
+@end
+
+#define SKIP_LINES_COUNT 3
+#define MAX_LINE_LEN 4096
+#define MAX_LINES_COUNT 200
+
+@implementation ConsoleWindowController
+@synthesize textView;
+
+- (id)initWithWindow:(NSWindow *)window
+{
+ self = [super initWithWindow:window];
+ if (self)
+ {
+ // Initialization code here.
+ linesCount = [[NSMutableArray arrayWithCapacity:MAX_LINES_COUNT + 1] retain];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [linesCount release];
+ [super dealloc];
+}
+
+- (void)windowDidLoad
+{
+ [super windowDidLoad];
+ // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+}
+
+- (void) trace:(NSString*)msg
+{
+ if (traceCount >= SKIP_LINES_COUNT && [msg length] > MAX_LINE_LEN)
+ {
+ msg = [NSString stringWithFormat:@"%@ ...", [msg substringToIndex:MAX_LINE_LEN - 4]];
+ }
+ traceCount++;
+ NSFont *font = [NSFont fontWithName:@"Monaco" size:12.0];
+ NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
+ NSAttributedString *string = [[NSAttributedString alloc] initWithString:msg attributes:attrsDictionary];
+ NSNumber *len = [NSNumber numberWithUnsignedInteger:[string length]];
+ [linesCount addObject:len];
+
+ NSTextStorage *storage = [textView textStorage];
+ [storage beginEditing];
+ [storage appendAttributedString:string];
+
+ if ([linesCount count] >= MAX_LINES_COUNT)
+ {
+ len = [linesCount objectAtIndex:0];
+ [storage deleteCharactersInRange:NSMakeRange(0, [len unsignedIntegerValue])];
+ [linesCount removeObjectAtIndex:0];
+ }
+
+ [storage endEditing];
+ [self changeScroll];
+}
+
+- (void) changeScroll
+{
+ BOOL scroll = [checkScroll state] == NSOnState;
+ if(scroll)
+ {
+ [self.textView scrollRangeToVisible: NSMakeRange(self.textView.string.length, 0)];
+ }
+}
+
+- (IBAction)onClear:(id)sender
+{
+ NSTextStorage *storage = [textView textStorage];
+ [storage setAttributedString:[[[NSAttributedString alloc] initWithString:@""] autorelease]];
+}
+
+- (IBAction)onScrollChange:(id)sender
+{
+ [self changeScroll];
+}
+
+- (IBAction)onTopChange:(id)sender
+{
+ BOOL isTop = [topCheckBox state] == NSOnState;
+ if(isTop)
+ {
+ [self.window setLevel:NSFloatingWindowLevel];
+ }
+ else
+ {
+ [self.window setLevel:NSNormalWindowLevel];
+ }
+}
+
+@end
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns
new file mode 100755
index 0000000000..2040fc6fe6
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Info.plist b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Info.plist
new file mode 100755
index 0000000000..70c8595a30
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Info.plist
@@ -0,0 +1,60 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeName
+ Folder
+ CFBundleTypeOSTypes
+
+ folder
+
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ csd
+ csb
+
+ CFBundleTypeName
+ Cocos Studio Project
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleExecutable
+ ${EXECUTABLE_NAME}
+ CFBundleIconFile
+ Icon
+ CFBundleIdentifier
+ com.cocos.apps.simulator
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Cocos Simulator
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 3.10
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 20151106
+ LSApplicationCategoryType
+ public.app-category.utilities
+ LSMinimumSystemVersion
+ ${MACOSX_DEPLOYMENT_TARGET}
+ NSHumanReadableCopyright
+ Copyright © 2015. All rights reserved.
+ NSMainNibFile
+ MainMenu
+ NSPrincipalClass
+ NSApplication
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch
new file mode 100755
index 0000000000..46c36a7e99
--- /dev/null
+++ b/native/tools/simulator/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/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h
new file mode 100755
index 0000000000..ce9cc7f82d
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.h
@@ -0,0 +1,59 @@
+/****************************************************************************
+ 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
+#import
+
+#import "ConsoleWindowController.h"
+#include "ProjectConfig/ProjectConfig.h"
+#include "ProjectConfig/SimulatorConfig.h"
+#include "AppDelegate.h"
+
+@interface AppController : NSObject
+{
+ NSWindow *_window;
+ NSMenu *menu;
+
+ AppDelegate *_app;
+ ProjectConfig _project;
+ int _debugLogFile;
+ std::string _entryPath;
+
+ //log file
+ ConsoleWindowController *_consoleController;
+ NSFileHandle *_fileHandle;
+
+ //console pipe
+ NSPipe *_pipe;
+ NSFileHandle *_pipeReadHandle;
+}
+
+@property (nonatomic, assign) IBOutlet NSMenu* menu;
+
+-(BOOL)application:(NSApplication*)app openFile:(NSString*)path;
+-(IBAction)onFileClose:(id)sender;
+-(IBAction)onWindowAlwaysOnTop:(id)sender;
+
+@end
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm
new file mode 100755
index 0000000000..b05e2ebd6f
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm
@@ -0,0 +1,735 @@
+/****************************************************************************
+ 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
+#include
+#include
+#include
+#include
+
+#import "SimulatorApp.h"
+#include "AppDelegate.h"
+#include "glfw3.h"
+#include "glfw3native.h"
+#include "runtime/Runtime.h"
+#include "runtime/ConfigParser.h"
+
+#include "cocos2d.h"
+#include "CodeIDESupport.h"
+
+#include "platform/mac/PlayerMac.h"
+#include "AppEvent.h"
+#include "AppLang.h"
+
+
+#if (GLFW_VERSION_MAJOR >= 3) && (GLFW_VERSION_MINOR >= 1)
+#define PLAYER_SUPPORT_DROP 1
+#else
+#define PLAYER_SUPPORT_DROP 0
+#endif
+
+using namespace std;
+using namespace cocos2d;
+
+static id SIMULATOR = nullptr;
+@implementation AppController
+
+@synthesize menu;
+
+std::string getCurAppPath(void)
+{
+ return [[[NSBundle mainBundle] bundlePath] UTF8String];
+}
+
+std::string getCurAppName(void)
+{
+ string appName = [[[NSProcessInfo processInfo] processName] UTF8String];
+ int found = appName.find(" ");
+ if (found!=std::string::npos)
+ appName = appName.substr(0,found);
+
+ return appName;
+}
+
+#if (PLAYER_SUPPORT_DROP > 0)
+static void glfwDropFunc(GLFWwindow *window, int count, const char **files)
+{
+ AppEvent forwardEvent(kAppEventDropName, APP_EVENT_DROP);
+ std::string firstFile(files[0]);
+ forwardEvent.setDataString(firstFile);
+
+ Director::getInstance()->getEventDispatcher()->dispatchEvent(&forwardEvent);
+}
+#endif
+
+-(void) dealloc
+{
+ Director::getInstance()->end();
+ player::PlayerProtocol::getInstance()->purgeInstance();
+ [super dealloc];
+}
+
+#pragma mark -
+#pragma delegates
+
+-(BOOL)application:(NSApplication*)app openFile:(NSString*)path
+{
+ NSFileManager *fm = [NSFileManager defaultManager];
+ BOOL isDirectory = NO;
+ if (![fm fileExistsAtPath:path isDirectory:&isDirectory])
+ {
+ return NO;
+ }
+
+ if (isDirectory)
+ {
+ // check src folder
+ if ([fm fileExistsAtPath:[path stringByAppendingString:@"/src/main.lua"]])
+ {
+ _project.setProjectDir([path cStringUsingEncoding:NSUTF8StringEncoding]);
+ _entryPath = "$(PROJDIR)/src/main.lua";
+ }
+ else if ([fm fileExistsAtPath:[path stringByAppendingString:@"/src/main.js"]])
+ {
+ _project.setProjectDir([path cStringUsingEncoding:NSUTF8StringEncoding]);
+ _entryPath = "$(PROJDIR)/src/main.js";
+ }
+ }
+ else
+ {
+ _project.setProjectDir([path cStringUsingEncoding:NSUTF8StringEncoding]);
+ _entryPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
+ }
+
+ return YES;
+}
+
+-(void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ SIMULATOR = self;
+ player::PlayerMac::create();
+
+ _debugLogFile = 0;
+
+ [self parseCocosProjectConfig:&_project];
+ [self updateProjectFromCommandLineArgs:&_project];
+
+ if (_entryPath.length())
+ {
+ _project.setScriptFile(_entryPath);
+ }
+
+ [self createWindowAndGLView];
+ [self startup];
+}
+
+#pragma mark -
+#pragma mark functions
+
+- (BOOL) windowShouldClose:(id)sender
+{
+ return YES;
+}
+
+- (void) windowWillClose:(NSNotification *)notification
+{
+ [[NSRunningApplication currentApplication] terminate];
+}
+
+- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
+{
+ return YES;
+}
+
+- (NSMutableArray*) makeCommandLineArgsFromProjectConfig
+{
+ return [self makeCommandLineArgsFromProjectConfig:kProjectConfigAll];
+}
+
+- (NSMutableArray*) makeCommandLineArgsFromProjectConfig:(unsigned int)mask
+{
+ _project.setWindowOffset(Vec2(_window.frame.origin.x, _window.frame.origin.y));
+ vector args = _project.makeCommandLineVector();
+ NSMutableArray *commandArray = [NSMutableArray arrayWithCapacity:args.size()];
+ for (auto &path : args)
+ {
+ [commandArray addObject:[NSString stringWithUTF8String:path.c_str()]];
+ }
+ return commandArray;
+}
+
+- (void) parseCocosProjectConfig:(ProjectConfig*)config
+{
+ // get project directory
+ ProjectConfig tmpConfig;
+ NSArray *nsargs = [[NSProcessInfo processInfo] arguments];
+ long n = [nsargs count];
+ if (n >= 2)
+ {
+ vector args;
+ for (int i = 0; i < [nsargs count]; ++i)
+ {
+ string arg = [[nsargs objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding];
+ if (arg.length()) args.push_back(arg);
+ }
+
+ if (args.size() && args.at(1).at(0) == '/')
+ {
+ // FIXME:
+ // for Code IDE before RC2
+ tmpConfig.setProjectDir(args.at(1));
+ }
+
+ tmpConfig.parseCommandLine(args);
+ }
+
+ // set project directory as search root path
+ string solutionDir = tmpConfig.getProjectDir();
+ string spath = solutionDir;
+ if (!solutionDir.empty())
+ {
+ for (int i = 0; i < solutionDir.size(); ++i)
+ {
+ if (solutionDir[i] == '\\')
+ {
+ solutionDir[i] = '/';
+ }
+ }
+
+ spath = solutionDir;
+ if (spath[spath.length() - 1] == '/') {
+ spath = spath.substr(0, spath.length() - 1);
+ }
+ string strExtention = FileUtils::getInstance()->getFileExtension(spath);
+ int pos = -1;
+ if(strExtention.compare(".csd") == 0)
+ {
+ pos = spath.rfind('/');
+ if(pos > 0)
+ spath = spath.substr(0, pos);
+ }
+ pos = spath.rfind('/');
+ if(pos > 0)
+ spath = spath.substr(0, pos+1);
+ FileUtils::getInstance()->addSearchPath(spath);
+
+ FileUtils::getInstance()->setDefaultResourceRootPath(solutionDir);
+ FileUtils::getInstance()->addSearchPath(solutionDir);
+ FileUtils::getInstance()->addSearchPath(tmpConfig.getProjectDir());
+ }
+ else
+ {
+ FileUtils::getInstance()->setDefaultResourceRootPath(tmpConfig.getProjectDir());
+ }
+
+ // parse config.json
+ auto parser = ConfigParser::getInstance();
+ auto configPath = spath.append(CONFIG_FILE);
+ if(!FileUtils::getInstance()->isFileExist(configPath))
+ configPath = solutionDir.append(CONFIG_FILE);
+ parser->readConfig(configPath);
+
+ // set information
+ config->setConsolePort(parser->getConsolePort());
+ config->setFileUploadPort(parser->getUploadPort());
+ config->setFrameSize(parser->getInitViewSize());
+ if (parser->isLanscape())
+ {
+ config->changeFrameOrientationToLandscape();
+ }
+ else
+ {
+ config->changeFrameOrientationToPortait();
+ }
+ config->setScriptFile(parser->getEntryFile());
+}
+
+- (void) updateProjectFromCommandLineArgs:(ProjectConfig*)config
+{
+ NSArray *nsargs = [[NSProcessInfo processInfo] arguments];
+ long n = [nsargs count];
+ if (n >= 2)
+ {
+ vector args;
+ for (int i = 0; i < [nsargs count]; ++i)
+ {
+ string arg = [[nsargs objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding];
+ if (arg.length()) args.push_back(arg);
+ }
+
+ if (args.size() && args.at(1).at(0) == '/')
+ {
+ // for Code IDE before RC2
+ config->setProjectDir(args.at(1));
+ config->setDebuggerType(kCCRuntimeDebuggerCodeIDE);
+ }
+ config->parseCommandLine(args);
+ }
+}
+
+- (bool) launch:(NSArray*)args
+{
+ NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
+ NSMutableDictionary *configuration = [NSMutableDictionary dictionaryWithObject:args forKey:NSWorkspaceLaunchConfigurationArguments];
+ NSError *error = [[[NSError alloc] init] autorelease];
+ [[NSWorkspace sharedWorkspace] launchApplicationAtURL:url
+ options:NSWorkspaceLaunchNewInstance
+ configuration:configuration
+ error:&error];
+
+ if (error.code != 0)
+ {
+ NSLog(@"Failed to launch app: %@", [error localizedDescription]);
+ }
+ return (error.code==0);
+}
+
+- (void) relaunch:(NSArray*)args
+{
+ if ([self launch:args])
+ {
+ [[NSApplication sharedApplication] terminate:self];
+ }
+ else
+ {
+ NSLog(@"RELAUNCH: %@", args);
+ }
+}
+
+- (void) relaunch
+{
+ [self relaunch:[self makeCommandLineArgsFromProjectConfig]];
+}
+
+- (float) titleBarHeight
+{
+ NSRect frame = NSMakeRect (0, 0, 100, 100);
+
+ NSRect contentRect;
+ contentRect = [NSWindow contentRectForFrameRect: frame
+ styleMask: NSTitledWindowMask];
+
+ return (frame.size.height - contentRect.size.height);
+
+}
+
+- (void) createWindowAndGLView
+{
+ GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
+ GLView::setGLContextAttrs(glContextAttrs);
+
+ // create console window **MUST** before create opengl view
+#if (CC_CODE_IDE_DEBUG_SUPPORT == 1)
+ if (_project.isShowConsole())
+ {
+ [self openConsoleWindow];
+ CCLOG("%s\n",Configuration::getInstance()->getInfo().c_str());
+ }
+#endif
+ float frameScale = _project.getFrameScale();
+
+ // get frame size
+ cocos2d::Size frameSize = _project.getFrameSize();
+ ConfigParser::getInstance()->setInitViewSize(frameSize);
+
+ // check screen workarea size
+ NSRect workarea = [NSScreen mainScreen].visibleFrame;
+ float workareaWidth = workarea.size.width;
+ float workareaHeight = workarea.size.height - [self titleBarHeight];
+ CCLOG("WORKAREA WIDTH %0.2f, HEIGHT %0.2f", workareaWidth, workareaHeight);
+ while (true && frameScale > 0.25f)
+ {
+ if (frameSize.width * frameScale > workareaWidth || frameSize.height * frameScale > workareaHeight)
+ {
+ frameScale = frameScale - 0.25f;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if (frameScale < 0.25f) frameScale = 0.25f;
+ _project.setFrameScale(frameScale);
+ CCLOG("FRAME SCALE = %0.2f", frameScale);
+
+ // check window offset
+ Vec2 pos = _project.getWindowOffset();
+ if (pos.x < 0) pos.x = 0;
+ if (pos.y < 0) pos.y = 0;
+
+ // create opengl view
+ const cocos2d::Rect frameRect = cocos2d::Rect(0, 0, frameSize.width, frameSize.height);
+ std::stringstream title;
+ title << "Cocos Simulator (" << _project.getFrameScale() * 100 << "%)";
+ GLViewImpl *eglView = GLViewImpl::createWithRect(title.str(), frameRect, frameScale);
+
+ auto director = Director::getInstance();
+ director->setOpenGLView(eglView);
+
+ _window = eglView->getCocoaWindow();
+ [[NSApplication sharedApplication] setDelegate: self];
+ [_window center];
+
+ [self setZoom:_project.getFrameScale()];
+ if (pos.x != 0 && pos.y != 0)
+ {
+ [_window setFrameOrigin:NSMakePoint(pos.x, pos.y)];
+ }
+
+#if (PLAYER_SUPPORT_DROP > 0)
+ glfwSetDropCallback(eglView->getWindow(), glfwDropFunc);
+#endif
+}
+
+- (void) adjustEditMenuIndex
+{
+ NSApplication *thisApp = [NSApplication sharedApplication];
+ NSMenu *mainMenu = [thisApp mainMenu];
+
+ NSMenuItem *editMenuItem = [mainMenu itemWithTitle:@"Edit"];
+ if (editMenuItem)
+ {
+ NSUInteger index = 2;
+ if (index > [mainMenu itemArray].count)
+ index = [mainMenu itemArray].count;
+ [[editMenuItem menu] removeItem:editMenuItem];
+ [mainMenu insertItem:editMenuItem atIndex:index];
+ }
+}
+- (void) startup
+{
+ FileUtils::getInstance()->setPopupNotify(false);
+
+ _project.dump();
+
+ const string projectDir = _project.getProjectDir();
+ if (projectDir.length())
+ {
+ FileUtils::getInstance()->setDefaultResourceRootPath(projectDir);
+ if (_project.isWriteDebugLogToFile())
+ {
+ [self writeDebugLogToFile:_project.getDebugLogFilePath()];
+ }
+ }
+
+ const string writablePath = _project.getWritableRealPath();
+ if (writablePath.length())
+ {
+ FileUtils::getInstance()->setWritablePath(writablePath.c_str());
+ }
+
+ // path for looking Lang file, Studio Default images
+ NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
+ FileUtils::getInstance()->addSearchPath(resourcePath.UTF8String);
+
+ // app
+ _app = new AppDelegate();
+
+ [self setupUI];
+ [self adjustEditMenuIndex];
+
+ RuntimeEngine::getInstance()->setProjectConfig(_project);
+ Application::getInstance()->run();
+// CC_SAFE_DELETE(_app);
+ // After run, application needs to be terminated immediately.
+ [NSApp terminate: self];
+}
+
+- (void) setupUI
+{
+ auto menuBar = player::PlayerProtocol::getInstance()->getMenuService();
+
+ // VIEW
+ menuBar->addItem("VIEW_MENU", tr("View"));
+ SimulatorConfig *config = SimulatorConfig::getInstance();
+ int current = config->checkScreenSize(_project.getFrameSize());
+ for (int i = 0; i < config->getScreenSizeCount(); i++)
+ {
+ SimulatorScreenSize size = config->getScreenSize(i);
+ std::stringstream menuId;
+ menuId << "VIEWSIZE_ITEM_MENU_" << i;
+ auto menuItem = menuBar->addItem(menuId.str(), size.title.c_str(), "VIEW_MENU");
+
+ if (i == current)
+ {
+ menuItem->setChecked(true);
+ }
+ }
+
+ menuBar->addItem("DIRECTION_MENU_SEP", "-", "VIEW_MENU");
+ menuBar->addItem("DIRECTION_PORTRAIT_MENU", tr("Portrait"), "VIEW_MENU")
+ ->setChecked(_project.isPortraitFrame());
+ menuBar->addItem("DIRECTION_LANDSCAPE_MENU", tr("Landscape"), "VIEW_MENU")
+ ->setChecked(_project.isLandscapeFrame());
+
+ menuBar->addItem("VIEW_SCALE_MENU_SEP", "-", "VIEW_MENU");
+
+ std::vector scaleMenuVector;
+ auto scale100Menu = menuBar->addItem("VIEW_SCALE_MENU_100", tr("Zoom Out").append(" (100%)"), "VIEW_MENU");
+ scale100Menu->setShortcut("super+0");
+
+ auto scale75Menu = menuBar->addItem("VIEW_SCALE_MENU_75", tr("Zoom Out").append(" (75%)"), "VIEW_MENU");
+ scale75Menu->setShortcut("super+7");
+
+ auto scale50Menu = menuBar->addItem("VIEW_SCALE_MENU_50", tr("Zoom Out").append(" (50%)"), "VIEW_MENU");
+ scale50Menu->setShortcut("super+6");
+
+ auto scale25Menu = menuBar->addItem("VIEW_SCALE_MENU_25", tr("Zoom Out").append(" (25%)"), "VIEW_MENU");
+ scale25Menu->setShortcut("super+5");
+
+ int frameScale = int(_project.getFrameScale() * 100);
+ if (frameScale == 100)
+ {
+ scale100Menu->setChecked(true);
+ }
+ else if (frameScale == 75)
+ {
+ scale75Menu->setChecked(true);
+ }
+ else if (frameScale == 50)
+ {
+ scale50Menu->setChecked(true);
+ }
+ else if (frameScale == 25)
+ {
+ scale25Menu->setChecked(true);
+ }
+ else
+ {
+ scale100Menu->setChecked(true);
+ }
+
+ scaleMenuVector.push_back(scale100Menu);
+ scaleMenuVector.push_back(scale75Menu);
+ scaleMenuVector.push_back(scale50Menu);
+ scaleMenuVector.push_back(scale25Menu);
+
+ menuBar->addItem("REFRESH_MENU_SEP", "-", "VIEW_MENU");
+ menuBar->addItem("REFRESH_MENU", tr("Refresh"), "VIEW_MENU")->setShortcut("super+r");
+
+ ProjectConfig &project = _project;
+ auto dispatcher = Director::getInstance()->getEventDispatcher();
+ auto window = _window;
+ dispatcher->addEventListenerWithFixedPriority(EventListenerCustom::create(kAppEventName, [&project, scaleMenuVector, window](EventCustom* event){
+ auto menuEvent = dynamic_cast(event);
+ if (menuEvent)
+ {
+ rapidjson::Document dArgParse;
+ dArgParse.Parse<0>(menuEvent->getDataString().c_str());
+ if (dArgParse.HasMember("name"))
+ {
+ string strcmd = dArgParse["name"].GetString();
+
+ if (strcmd == "menuClicked")
+ {
+ player::PlayerMenuItem *menuItem = static_cast(menuEvent->getUserData());
+ if (menuItem)
+ {
+ if (menuItem->isChecked())
+ {
+ return ;
+ }
+
+ string data = dArgParse["data"].GetString();
+ if ((data == "CLOSE_MENU") || (data == "EXIT_MENU"))
+ {
+ Director::getInstance()->end();
+ }
+ else if (data == "REFRESH_MENU")
+ {
+ [SIMULATOR relaunch];
+ }
+ else if (data.find("VIEW_SCALE_MENU_") == 0) // begin with VIEW_SCALE_MENU_
+ {
+ string tmp = data.erase(0, strlen("VIEW_SCALE_MENU_"));
+ float scale = atof(tmp.c_str()) / 100.0f;
+ [SIMULATOR setZoom:scale];
+
+ // update scale menu state
+ for (auto &it : scaleMenuVector)
+ {
+ it->setChecked(false);
+ }
+ menuItem->setChecked(true);
+ }
+ else if (data.find("VIEWSIZE_ITEM_MENU_") == 0) // begin with VIEWSIZE_ITEM_MENU_
+ {
+ string tmp = data.erase(0, strlen("VIEWSIZE_ITEM_MENU_"));
+ int index = atoi(tmp.c_str());
+ SimulatorScreenSize size = SimulatorConfig::getInstance()->getScreenSize(index);
+
+ if (project.isLandscapeFrame())
+ {
+ std::swap(size.width, size.height);
+ }
+
+ project.setFrameSize(cocos2d::Size(size.width, size.height));
+ [SIMULATOR relaunch];
+ }
+ else if (data == "DIRECTION_PORTRAIT_MENU")
+ {
+ project.changeFrameOrientationToPortait();
+ [SIMULATOR relaunch];
+ }
+ else if (data == "DIRECTION_LANDSCAPE_MENU")
+ {
+ project.changeFrameOrientationToLandscape();
+ [SIMULATOR relaunch];
+ }
+ }
+ }
+ }
+ }
+ }), 1);
+
+ // drop
+ AppDelegate *app = _app;
+ auto listener = EventListenerCustom::create(kAppEventDropName, [&project, app](EventCustom* event)
+ {
+ AppEvent *dropEvent = dynamic_cast(event);
+ if (dropEvent)
+ {
+ string dirPath = dropEvent->getDataString() + "/";
+ string configFilePath = dirPath + CONFIG_FILE;
+
+ if (FileUtils::getInstance()->isDirectoryExist(dirPath) &&
+ FileUtils::getInstance()->isFileExist(configFilePath))
+ {
+ // parse config.json
+ ConfigParser::getInstance()->readConfig(configFilePath);
+
+ project.setProjectDir(dirPath);
+ project.setScriptFile(ConfigParser::getInstance()->getEntryFile());
+ project.setWritablePath(dirPath);
+
+ RuntimeEngine::getInstance()->setProjectConfig(project);
+// app->setProjectConfig(project);
+// app->reopenProject();
+ }
+ }
+ });
+ dispatcher->addEventListenerWithFixedPriority(listener, 1);
+}
+
+- (void) openConsoleWindow
+{
+ if (!_consoleController)
+ {
+ _consoleController = [[ConsoleWindowController alloc] initWithWindowNibName:@"ConsoleWindow"];
+ }
+ [_consoleController.window orderFrontRegardless];
+
+ //set console pipe
+ _pipe = [NSPipe pipe] ;
+ _pipeReadHandle = [_pipe fileHandleForReading] ;
+
+ int outfd = [[_pipe fileHandleForWriting] fileDescriptor];
+ if (dup2(outfd, fileno(stderr)) != fileno(stderr) || dup2(outfd, fileno(stdout)) != fileno(stdout))
+ {
+ perror("Unable to redirect output");
+ // [self showAlert:@"Unable to redirect output to console!" withTitle:@"player error"];
+ }
+ else
+ {
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleNotification:) name: NSFileHandleReadCompletionNotification object: _pipeReadHandle] ;
+ [_pipeReadHandle readInBackgroundAndNotify] ;
+ }
+}
+
+- (bool) writeDebugLogToFile:(const string)path
+{
+ if (_debugLogFile) return true;
+ //log to file
+ if(_fileHandle) return true;
+ NSString *fPath = [NSString stringWithCString:path.c_str() encoding:[NSString defaultCStringEncoding]];
+ [[NSFileManager defaultManager] createFileAtPath:fPath contents:nil attributes:nil] ;
+ _fileHandle = [NSFileHandle fileHandleForWritingAtPath:fPath];
+ [_fileHandle retain];
+ return true;
+}
+
+- (void)handleNotification:(NSNotification *)note
+{
+ //NSLog(@"Received notification: %@", note);
+ [_pipeReadHandle readInBackgroundAndNotify] ;
+ NSData *data = [[note userInfo] objectForKey:NSFileHandleNotificationDataItem];
+ NSString *str = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
+
+ if (str)
+ {
+ //show log to console
+ [_consoleController trace:str];
+ if(_fileHandle!=nil)
+ {
+ [_fileHandle writeData:[str dataUsingEncoding:NSUTF8StringEncoding]];
+ }
+ }
+}
+
+- (void) setZoom:(float)scale
+{
+ Director::getInstance()->getOpenGLView()->setFrameZoomFactor(scale);
+ _project.setFrameScale(scale);
+ std::stringstream title;
+ title << "Cocos " << tr("Simulator") << " (" << _project.getFrameScale() * 100 << "%)";
+ [_window setTitle:[NSString stringWithUTF8String:title.str().c_str()]];
+}
+
+- (BOOL) applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag
+{
+ return NO;
+}
+
+#pragma mark -
+
+-(IBAction)onFileClose:(id)sender
+{
+ CC_SAFE_DELETE(_app);
+ [[NSApplication sharedApplication] terminate:self];
+}
+
+-(IBAction)onWindowAlwaysOnTop:(id)sender
+{
+ NSInteger state = [sender state];
+
+ if (state == NSOffState)
+ {
+ [_window setLevel:NSFloatingWindowLevel];
+ [sender setState:NSOnState];
+ }
+ else
+ {
+ [_window setLevel:NSNormalWindowLevel];
+ [sender setState:NSOffState];
+ }
+}
+
+- (void)applicationWillTerminate:(NSNotification *)notification
+{
+ CC_SAFE_DELETE(_app);
+ [[NSApplication sharedApplication] terminate:self];
+}
+
+@end
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json
new file mode 100755
index 0000000000..7a138cb477
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/build-cfg.json
@@ -0,0 +1,7 @@
+{
+ "remove_res" : [
+ "src",
+ "res",
+ "config.json"
+ ]
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/en.lproj/MainMenu.xib b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/en.lproj/MainMenu.xib
new file mode 100755
index 0000000000..a803574695
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/en.lproj/MainMenu.xib
@@ -0,0 +1,887 @@
+
+
+
+ 1060
+ 13D65
+ 5056
+ 1265.20
+ 698.00
+
+
+ NSCustomObject
+ NSMenu
+ NSMenuItem
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppController
+ NSObject
+
+ id
+ id
+ id
+ id
+ id
+ id
+ id
+
+
+
+ onFileClose:
+ id
+
+
+ onRelaunch:
+ id
+
+
+ onScreenLandscape:
+ id
+
+
+ onScreenPortait:
+ id
+
+
+ onScreenZoomOut:
+ id
+
+
+ onSetTop:
+ id
+
+
+ onViewChangeFrameSize:
+ id
+
+
+
+ menu
+ NSMenu
+
+
+ menu
+
+ menu
+ NSMenu
+
+
+
+ IBProjectSource
+ ./Classes/AppController.h
+
+
+
+
+ 0
+ IBCocoaFramework
+ YES
+
+ com.apple.InterfaceBuilder.CocoaPlugin.macosx
+
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin.macosx
+
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3
+
+
+ YES
+ 3
+
+ {11, 11}
+ {10, 3}
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/main.m b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/main.m
new file mode 100755
index 0000000000..658f0c14ee
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/main.m
@@ -0,0 +1,7 @@
+
+#import
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **)argv);
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/ConsoleWindow.strings b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/ConsoleWindow.strings
new file mode 100755
index 0000000000..f9518fdfd4
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/ConsoleWindow.strings
@@ -0,0 +1,12 @@
+
+/* Class = "NSWindow"; title = "Console"; ObjectID = "1"; */
+"1.title" = "控制台";
+
+/* Class = "NSButtonCell"; title = "Clear"; ObjectID = "47"; */
+"47.title" = "清除";
+
+/* Class = "NSButtonCell"; title = "scroll bottom"; ObjectID = "51"; */
+"51.title" = "自动滚动";
+
+/* Class = "NSButtonCell"; title = "always top"; ObjectID = "61"; */
+"61.title" = "总在最前方";
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib
new file mode 100755
index 0000000000..b610cf20e9
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/zh-Hans.lproj/MainMenu.xib
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj
new file mode 100755
index 0000000000..4cde2a4eeb
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj
@@ -0,0 +1,954 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 15427CD3198F221400DC375D /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */; };
+ 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */; };
+ 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; };
+ 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; };
+ 1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; };
+ 3EEEDB61197107C0006A9FF8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EEEDB60197107C0006A9FF8 /* MediaPlayer.framework */; };
+ 5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; };
+ 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; };
+ 5023811A17EBBCAC00990C9B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810A17EBBCAC00990C9B /* Default.png */; };
+ 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810B17EBBCAC00990C9B /* Default@2x.png */; };
+ 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810D17EBBCAC00990C9B /* Icon-120.png */; };
+ 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810E17EBBCAC00990C9B /* Icon-144.png */; };
+ 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810F17EBBCAC00990C9B /* Icon-152.png */; };
+ 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811017EBBCAC00990C9B /* Icon-57.png */; };
+ 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811117EBBCAC00990C9B /* Icon-72.png */; };
+ 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811217EBBCAC00990C9B /* Icon-76.png */; };
+ 5023812417EBBCAC00990C9B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5023811417EBBCAC00990C9B /* main.m */; };
+ 5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023811717EBBCAC00990C9B /* RootViewController.mm */; };
+ 5023813317EBBCE400990C9B /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F293BB7E15EB831F00256477 /* AppDelegate.cpp */; };
+ 5023813717EBBCE400990C9B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; };
+ 5023813E17EBBCE400990C9B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };
+ 5023814017EBBCE400990C9B /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };
+ 5023814117EBBCE400990C9B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; };
+ 5023814417EBBCE400990C9B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D815EB7BE500256477 /* Foundation.framework */; };
+ 5023814517EBBCE400990C9B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3DA15EB7BE500256477 /* CoreGraphics.framework */; };
+ 5023817617EBBE3400990C9B /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5023817217EBBE3400990C9B /* Icon.icns */; };
+ 5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5023817917EBBE8300990C9B /* OpenGLES.framework */; };
+ 50805AAF17EBBEAA004CFAD3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50805AAE17EBBEAA004CFAD3 /* UIKit.framework */; };
+ 5091733617ECE17A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733017ECE17A00D62437 /* Icon-29.png */; };
+ 5091733717ECE17A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733117ECE17A00D62437 /* Icon-40.png */; };
+ 5091733817ECE17A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733217ECE17A00D62437 /* Icon-50.png */; };
+ 5091733917ECE17A00D62437 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733317ECE17A00D62437 /* Icon-58.png */; };
+ 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733417ECE17A00D62437 /* Icon-80.png */; };
+ 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733517ECE17A00D62437 /* Icon-100.png */; };
+ 50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */; };
+ 50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */; };
+ 50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */; };
+ 5200BECA1A53D9A500AC45E4 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5200BEC91A53D9A500AC45E4 /* Security.framework */; };
+ 521A8E7019F0C3D200D177D7 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6E19F0C3D200D177D7 /* Default-667h@2x.png */; };
+ 521A8E7119F0C3D200D177D7 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */; };
+ 87A2EC1E1AB34BEE00513747 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87A2EC1D1AB34BEE00513747 /* Security.framework */; };
+ 9FB5D5F91A691342002361CA /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D5F81A691342002361CA /* libsqlite3.dylib */; };
+ 9FB5D6081A691774002361CA /* libjscocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D5D61A68FA00002361CA /* libjscocos2d iOS.a */; };
+ 9FB5D60A1A6917D8002361CA /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D6091A6917D8002361CA /* libsqlite3.dylib */; };
+ 9FB5D60E1A691A02002361CA /* libjscocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FB5D5D41A68FA00002361CA /* libjscocos2d Mac.a */; };
+ 9FB6C05F1A69815100945236 /* lang in Resources */ = {isa = PBXBuildFile; fileRef = 9FB6C0571A69815100945236 /* lang */; };
+ 9FB6C0621A69815100945236 /* RuntimeJsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FB6C05A1A69815100945236 /* RuntimeJsImpl.cpp */; };
+ 9FB6C0631A69815100945236 /* RuntimeJsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FB6C05A1A69815100945236 /* RuntimeJsImpl.cpp */; };
+ 9FD6FC0B1A5D27870028EDC6 /* libsimulator Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */; settings = {ATTRIBUTES = (Required, ); }; };
+ 9FD6FC0C1A5D278E0028EDC6 /* libsimulator iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */; };
+ 9FD6FC731A5D2A820028EDC6 /* ConsoleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */; };
+ 9FFC07361A4A764100AED399 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9FFC07341A4A764100AED399 /* MainMenu.xib */; };
+ C05D1C121923449100B808A4 /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = C05D1C111923449100B808A4 /* config.json */; };
+ C05D1C131923449100B808A4 /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = C05D1C111923449100B808A4 /* config.json */; };
+ C07828F818B4D72E00BD2287 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C07828F418B4D72E00BD2287 /* main.m */; };
+ C07828FA18B4D72E00BD2287 /* SimulatorApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = C07828F718B4D72E00BD2287 /* SimulatorApp.mm */; };
+ D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; };
+ DA96489E1A70F925001F41E8 /* ConsoleWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA9648A01A70F925001F41E8 /* ConsoleWindow.xib */; };
+ ED545A981B68A2D300C3958E /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ED545A971B68A2D300C3958E /* libiconv.dylib */; };
+ ED545A9A1B68A2DA00C3958E /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ED545A991B68A2DA00C3958E /* libiconv.dylib */; };
+ F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };
+ F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };
+ F293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; };
+ F293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D415EB7BE500256477 /* AVFoundation.framework */; };
+ F293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D815EB7BE500256477 /* Foundation.framework */; };
+ F293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3DA15EB7BE500256477 /* CoreGraphics.framework */; };
+ F293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F293BB7E15EB831F00256477 /* AppDelegate.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 1551A33F158F2AB200E66CFE;
+ remoteInfo = "cocos2dx Mac";
+ };
+ 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = A07A4D641783777C0073F6A7;
+ remoteInfo = "cocos2dx iOS";
+ };
+ 15D1F3081994BBCA00302043 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = A07A4C241783777C0073F6A7;
+ remoteInfo = "libcocos2d iOS";
+ };
+ 9F78A2531A89B7EA00EB22E3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = A07A4FB5178387750073F6A7;
+ remoteInfo = "libjscocos2d iOS";
+ };
+ 9FB5D5D31A68FA00002361CA /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 1A5410A418B785A10016A3AF;
+ remoteInfo = "libjscocos2d Mac";
+ };
+ 9FB5D5D51A68FA00002361CA /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 1A5410A518B785A10016A3AF;
+ remoteInfo = "libjscocos2d iOS";
+ };
+ 9FB5D5E81A69054A002361CA /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = A03F31E81781479B006731B9;
+ remoteInfo = "libjscocos2d Mac";
+ };
+ 9FD6FC071A5D26580028EDC6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 9F7214351A5C271F00DAED06;
+ remoteInfo = libsimulator;
+ };
+ 9FD6FC091A5D26580028EDC6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 9F7214851A5C28BA00DAED06;
+ remoteInfo = libsimulator_iOS;
+ };
+ 9FF504CB1A5EB19500AFDA55 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 9F7214841A5C28BA00DAED06;
+ remoteInfo = libsimulator_iOS;
+ };
+ 9FF504CF1A5EB19900AFDA55 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 9F7214341A5C271F00DAED06;
+ remoteInfo = libsimulator;
+ };
+ C0A2F04018975FF80072A7AB /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 1551A33E158F2AB200E66CFE;
+ remoteInfo = "cocos2dx Mac";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; };
+ 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; };
+ 1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ 3EB51526195187AF006966AA /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ 3EEEDB60197107C0006A9FF8 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
+ 5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; };
+ 5023810817EBBCAC00990C9B /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; };
+ 5023810917EBBCAC00990C9B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
+ 5023810A17EBBCAC00990C9B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; };
+ 5023810B17EBBCAC00990C9B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; };
+ 5023810C17EBBCAC00990C9B /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = ""; };
+ 5023810D17EBBCAC00990C9B /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-120.png"; sourceTree = ""; };
+ 5023810E17EBBCAC00990C9B /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = ""; };
+ 5023810F17EBBCAC00990C9B /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-152.png"; sourceTree = ""; };
+ 5023811017EBBCAC00990C9B /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = ""; };
+ 5023811117EBBCAC00990C9B /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; };
+ 5023811217EBBCAC00990C9B /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-76.png"; sourceTree = ""; };
+ 5023811317EBBCAC00990C9B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 5023811417EBBCAC00990C9B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ 5023811517EBBCAC00990C9B /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; };
+ 5023811617EBBCAC00990C9B /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; };
+ 5023811717EBBCAC00990C9B /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = ""; };
+ 5023816B17EBBCE400990C9B /* Simulator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Simulator.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5023817217EBBE3400990C9B /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; };
+ 5023817317EBBE3400990C9B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 5023817517EBBE3400990C9B /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; };
+ 5023817917EBBE8300990C9B /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
+ 50805AAE17EBBEAA004CFAD3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+ 5091733017ECE17A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-29.png"; sourceTree = ""; };
+ 5091733117ECE17A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-40.png"; sourceTree = ""; };
+ 5091733217ECE17A00D62437 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-50.png"; sourceTree = ""; };
+ 5091733317ECE17A00D62437 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-58.png"; sourceTree = ""; };
+ 5091733417ECE17A00D62437 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-80.png"; sourceTree = ""; };
+ 5091733517ECE17A00D62437 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-100.png"; sourceTree = ""; };
+ 50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
+ 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+ 5200BEC91A53D9A500AC45E4 /* 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; };
+ 521A8E6E19F0C3D200D177D7 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = ""; };
+ 521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = ""; };
+ 87A2EC1D1AB34BEE00513747 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
+ 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../../../../../cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = ""; };
+ 9FB5D5F81A691342002361CA /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
+ 9FB5D6091A6917D8002361CA /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/lib/libsqlite3.dylib; sourceTree = DEVELOPER_DIR; };
+ 9FB6C0561A69815100945236 /* CodeIDESupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeIDESupport.h; sourceTree = ""; };
+ 9FB6C0571A69815100945236 /* lang */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lang; sourceTree = ""; };
+ 9FB6C05A1A69815100945236 /* RuntimeJsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeJsImpl.cpp; sourceTree = ""; };
+ 9FB6C05B1A69815100945236 /* RuntimeJsImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeJsImpl.h; sourceTree = ""; };
+ 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libsimulator.xcodeproj; path = ../../../libsimulator/proj.ios_mac/libsimulator.xcodeproj; sourceTree = ""; };
+ 9FD6FC701A5D2A820028EDC6 /* ConsoleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleWindowController.h; sourceTree = ""; };
+ 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleWindowController.m; sourceTree = ""; };
+ 9FFC07351A4A764100AED399 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
+ 9FFC07371A4A765100AED399 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.xib"; sourceTree = ""; };
+ C05D1C111923449100B808A4 /* config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = config.json; path = ../../../config.json; sourceTree = ""; };
+ C07828F418B4D72E00BD2287 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ C07828F618B4D72E00BD2287 /* SimulatorApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatorApp.h; sourceTree = ""; };
+ C07828F718B4D72E00BD2287 /* SimulatorApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimulatorApp.mm; sourceTree = ""; };
+ D6B061341803AC000077942B /* 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; };
+ DA96489F1A70F925001F41E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ConsoleWindow.xib; sourceTree = ""; };
+ DA9648A31A70F93D001F41E8 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ConsoleWindow.strings"; sourceTree = ""; };
+ ED545A971B68A2D300C3958E /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/lib/libiconv.dylib; sourceTree = DEVELOPER_DIR; };
+ ED545A991B68A2DA00C3958E /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
+ F293B3C815EB7BE500256477 /* Simulator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Simulator.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ F293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ F293B3CE15EB7BE500256477 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+ F293B3D015EB7BE500256477 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
+ F293B3D215EB7BE500256477 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
+ F293B3D415EB7BE500256477 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ F293B3D615EB7BE500256477 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ F293B3D815EB7BE500256477 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ F293B3DA15EB7BE500256477 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ F293BB7E15EB831F00256477 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; };
+ F293BB7F15EB831F00256477 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 5023813617EBBCE400990C9B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ ED545A9A1B68A2DA00C3958E /* libiconv.dylib in Frameworks */,
+ 87A2EC1E1AB34BEE00513747 /* Security.framework in Frameworks */,
+ 9FB5D60E1A691A02002361CA /* libjscocos2d Mac.a in Frameworks */,
+ 9FB5D5F91A691342002361CA /* libsqlite3.dylib in Frameworks */,
+ 9FD6FC0B1A5D27870028EDC6 /* libsimulator Mac.a in Frameworks */,
+ 15427CEE198F24AF00DC375D /* libcocos2d Mac.a in Frameworks */,
+ 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */,
+ 50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */,
+ 50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */,
+ 50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */,
+ 5023813717EBBCE400990C9B /* libz.dylib in Frameworks */,
+ 5023813E17EBBCE400990C9B /* QuartzCore.framework in Frameworks */,
+ 5023814017EBBCE400990C9B /* OpenAL.framework in Frameworks */,
+ 5023814117EBBCE400990C9B /* AudioToolbox.framework in Frameworks */,
+ 5023814417EBBCE400990C9B /* Foundation.framework in Frameworks */,
+ 5023814517EBBCE400990C9B /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F293B3C515EB7BE500256477 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ ED545A981B68A2D300C3958E /* libiconv.dylib in Frameworks */,
+ 9FB5D60A1A6917D8002361CA /* libsqlite3.dylib in Frameworks */,
+ 9FB5D6081A691774002361CA /* libjscocos2d iOS.a in Frameworks */,
+ 9FD6FC0C1A5D278E0028EDC6 /* libsimulator iOS.a in Frameworks */,
+ 5200BECA1A53D9A500AC45E4 /* Security.framework in Frameworks */,
+ 15427CD3198F221400DC375D /* libcocos2d iOS.a in Frameworks */,
+ 3EEEDB61197107C0006A9FF8 /* MediaPlayer.framework in Frameworks */,
+ D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */,
+ 1AF4C403178663F200122817 /* libz.dylib in Frameworks */,
+ 50805AAF17EBBEAA004CFAD3 /* UIKit.framework in Frameworks */,
+ 5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */,
+ F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */,
+ F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */,
+ F293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */,
+ F293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */,
+ F293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */,
+ F293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 15A8A4041834BDA200142BE0 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */,
+ 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 5023810617EBBCAC00990C9B /* ios */ = {
+ isa = PBXGroup;
+ children = (
+ 521A8E6E19F0C3D200D177D7 /* Default-667h@2x.png */,
+ 521A8E6F19F0C3D200D177D7 /* Default-736h@3x.png */,
+ 5023810717EBBCAC00990C9B /* AppController.h */,
+ 5023810817EBBCAC00990C9B /* AppController.mm */,
+ 5023810917EBBCAC00990C9B /* Default-568h@2x.png */,
+ 5023810A17EBBCAC00990C9B /* Default.png */,
+ 5023810B17EBBCAC00990C9B /* Default@2x.png */,
+ 5091734A17ECE18300D62437 /* Icons */,
+ 5023811317EBBCAC00990C9B /* Info.plist */,
+ 5023811417EBBCAC00990C9B /* main.m */,
+ 5023811517EBBCAC00990C9B /* Prefix.pch */,
+ 5023811617EBBCAC00990C9B /* RootViewController.h */,
+ 5023811717EBBCAC00990C9B /* RootViewController.mm */,
+ );
+ path = ios;
+ sourceTree = "";
+ };
+ 5023817117EBBE3400990C9B /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ DA9648A01A70F925001F41E8 /* ConsoleWindow.xib */,
+ 9FD6FC701A5D2A820028EDC6 /* ConsoleWindowController.h */,
+ 9FD6FC711A5D2A820028EDC6 /* ConsoleWindowController.m */,
+ 5023817217EBBE3400990C9B /* Icon.icns */,
+ 9FFC07341A4A764100AED399 /* MainMenu.xib */,
+ C07828F418B4D72E00BD2287 /* main.m */,
+ C07828F618B4D72E00BD2287 /* SimulatorApp.h */,
+ C07828F718B4D72E00BD2287 /* SimulatorApp.mm */,
+ 5023817317EBBE3400990C9B /* Info.plist */,
+ 5023817517EBBE3400990C9B /* Prefix.pch */,
+ );
+ path = mac;
+ sourceTree = "";
+ };
+ 5091734A17ECE18300D62437 /* Icons */ = {
+ isa = PBXGroup;
+ children = (
+ 5091733017ECE17A00D62437 /* Icon-29.png */,
+ 5091733117ECE17A00D62437 /* Icon-40.png */,
+ 5091733217ECE17A00D62437 /* Icon-50.png */,
+ 5091733317ECE17A00D62437 /* Icon-58.png */,
+ 5091733417ECE17A00D62437 /* Icon-80.png */,
+ 5091733517ECE17A00D62437 /* Icon-100.png */,
+ 5023810C17EBBCAC00990C9B /* Icon-114.png */,
+ 5023810D17EBBCAC00990C9B /* Icon-120.png */,
+ 5023810E17EBBCAC00990C9B /* Icon-144.png */,
+ 5023810F17EBBCAC00990C9B /* Icon-152.png */,
+ 5023811017EBBCAC00990C9B /* Icon-57.png */,
+ 5023811117EBBCAC00990C9B /* Icon-72.png */,
+ 5023811217EBBCAC00990C9B /* Icon-76.png */,
+ );
+ name = Icons;
+ sourceTree = "";
+ };
+ 9FB5D5CF1A68F9FF002361CA /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 9FB5D5D41A68FA00002361CA /* libjscocos2d Mac.a */,
+ 9FB5D5D61A68FA00002361CA /* libjscocos2d iOS.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 9FB6C0551A69815100945236 /* ide-support */ = {
+ isa = PBXGroup;
+ children = (
+ 9FB6C0561A69815100945236 /* CodeIDESupport.h */,
+ 9FB6C0571A69815100945236 /* lang */,
+ 9FB6C05A1A69815100945236 /* RuntimeJsImpl.cpp */,
+ 9FB6C05B1A69815100945236 /* RuntimeJsImpl.h */,
+ );
+ name = "ide-support";
+ path = "../Classes/ide-support";
+ sourceTree = "";
+ };
+ 9FD6FC031A5D26580028EDC6 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */,
+ 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ F293B3BD15EB7BE500256477 = {
+ isa = PBXGroup;
+ children = (
+ 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */,
+ 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */,
+ 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */,
+ 5023810617EBBCAC00990C9B /* ios */,
+ 5023817117EBBE3400990C9B /* mac */,
+ F293BB7C15EB830F00256477 /* Classes */,
+ F293B3CB15EB7BE500256477 /* Frameworks */,
+ F293B3C915EB7BE500256477 /* Products */,
+ F293BC4615EB859D00256477 /* Resources */,
+ );
+ sourceTree = "";
+ };
+ F293B3C915EB7BE500256477 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ F293B3C815EB7BE500256477 /* Simulator.app */,
+ 5023816B17EBBCE400990C9B /* Simulator.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ F293B3CB15EB7BE500256477 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ ED545A991B68A2DA00C3958E /* libiconv.dylib */,
+ ED545A971B68A2D300C3958E /* libiconv.dylib */,
+ 87A2EC1D1AB34BEE00513747 /* Security.framework */,
+ 9FB5D6091A6917D8002361CA /* libsqlite3.dylib */,
+ 9FB5D5F81A691342002361CA /* libsqlite3.dylib */,
+ 5200BEC91A53D9A500AC45E4 /* Security.framework */,
+ 3EEEDB60197107C0006A9FF8 /* MediaPlayer.framework */,
+ 3EB51526195187AF006966AA /* CFNetwork.framework */,
+ 15A8A4871834C90E00142BE0 /* libcurl.dylib */,
+ D6B061341803AC000077942B /* CoreMotion.framework */,
+ 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */,
+ 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */,
+ 50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */,
+ 50805AAE17EBBEAA004CFAD3 /* UIKit.framework */,
+ 5023817917EBBE8300990C9B /* OpenGLES.framework */,
+ 1AF4C402178663F200122817 /* libz.dylib */,
+ F293B3CC15EB7BE500256477 /* QuartzCore.framework */,
+ F293B3CE15EB7BE500256477 /* OpenGLES.framework */,
+ F293B3D015EB7BE500256477 /* OpenAL.framework */,
+ F293B3D215EB7BE500256477 /* AudioToolbox.framework */,
+ F293B3D415EB7BE500256477 /* AVFoundation.framework */,
+ F293B3D615EB7BE500256477 /* UIKit.framework */,
+ F293B3D815EB7BE500256477 /* Foundation.framework */,
+ F293B3DA15EB7BE500256477 /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ F293BB7C15EB830F00256477 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 9FB6C0551A69815100945236 /* ide-support */,
+ F293BB7E15EB831F00256477 /* AppDelegate.cpp */,
+ F293BB7F15EB831F00256477 /* AppDelegate.h */,
+ );
+ name = Classes;
+ sourceTree = "";
+ };
+ F293BC4615EB859D00256477 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ C05D1C111923449100B808A4 /* config.json */,
+ );
+ name = Resources;
+ path = ../Resources;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 5023812617EBBCE400990C9B /* Simulator Mac */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5023816817EBBCE400990C9B /* Build configuration list for PBXNativeTarget "Simulator Mac" */;
+ buildPhases = (
+ 5023813117EBBCE400990C9B /* Sources */,
+ 5023813617EBBCE400990C9B /* Frameworks */,
+ 5023814617EBBCE400990C9B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 9FB5D5E91A69054A002361CA /* PBXTargetDependency */,
+ 9FF504D01A5EB19900AFDA55 /* PBXTargetDependency */,
+ C0A2F04118975FF80072A7AB /* PBXTargetDependency */,
+ );
+ name = "Simulator Mac";
+ productName = simulator;
+ productReference = 5023816B17EBBCE400990C9B /* Simulator.app */;
+ productType = "com.apple.product-type.application";
+ };
+ F293B3C715EB7BE500256477 /* Simulator iOS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget "Simulator iOS" */;
+ buildPhases = (
+ F293B3C415EB7BE500256477 /* Sources */,
+ F293B3C515EB7BE500256477 /* Frameworks */,
+ F293B3C615EB7BE500256477 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 9F78A2541A89B7EA00EB22E3 /* PBXTargetDependency */,
+ 9FF504CC1A5EB19500AFDA55 /* PBXTargetDependency */,
+ 15D1F3091994BBCA00302043 /* PBXTargetDependency */,
+ );
+ name = "Simulator iOS";
+ productName = simulator;
+ productReference = F293B3C815EB7BE500256477 /* Simulator.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ F293B3BF15EB7BE500256477 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0500;
+ TargetAttributes = {
+ F293B3C715EB7BE500256477 = {
+ DevelopmentTeam = AWRL7A5V7U;
+ };
+ };
+ };
+ buildConfigurationList = F293B3C215EB7BE500256477 /* Build configuration list for PBXProject "simulator" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ "zh-Hans",
+ );
+ mainGroup = F293B3BD15EB7BE500256477;
+ productRefGroup = F293B3C915EB7BE500256477 /* Products */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 9FB5D5CF1A68F9FF002361CA /* Products */;
+ ProjectRef = 9FB5D5CE1A68F9FF002361CA /* cocos2d_js_bindings.xcodeproj */;
+ },
+ {
+ ProductGroup = 15A8A4041834BDA200142BE0 /* Products */;
+ ProjectRef = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;
+ },
+ {
+ ProductGroup = 9FD6FC031A5D26580028EDC6 /* Products */;
+ ProjectRef = 9FD6FC021A5D26580028EDC6 /* libsimulator.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ F293B3C715EB7BE500256477 /* Simulator iOS */,
+ 5023812617EBBCE400990C9B /* Simulator Mac */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 15A8A4171834BDA200142BE0 /* libcocos2d Mac.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libcocos2d Mac.a";
+ remoteRef = 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 15A8A4251834BDA200142BE0 /* libcocos2d iOS.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libcocos2d iOS.a";
+ remoteRef = 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 9FB5D5D41A68FA00002361CA /* libjscocos2d Mac.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libjscocos2d Mac.a";
+ remoteRef = 9FB5D5D31A68FA00002361CA /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 9FB5D5D61A68FA00002361CA /* libjscocos2d iOS.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libjscocos2d iOS.a";
+ remoteRef = 9FB5D5D51A68FA00002361CA /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 9FD6FC081A5D26580028EDC6 /* libsimulator Mac.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libsimulator Mac.a";
+ remoteRef = 9FD6FC071A5D26580028EDC6 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 9FD6FC0A1A5D26580028EDC6 /* libsimulator iOS.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libsimulator iOS.a";
+ remoteRef = 9FD6FC091A5D26580028EDC6 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 5023814617EBBCE400990C9B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 9FB6C05F1A69815100945236 /* lang in Resources */,
+ DA96489E1A70F925001F41E8 /* ConsoleWindow.xib in Resources */,
+ 5023817617EBBE3400990C9B /* Icon.icns in Resources */,
+ 9FFC07361A4A764100AED399 /* MainMenu.xib in Resources */,
+ C05D1C131923449100B808A4 /* config.json in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F293B3C615EB7BE500256477 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */,
+ 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */,
+ 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */,
+ 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */,
+ 5091733617ECE17A00D62437 /* Icon-29.png in Resources */,
+ 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */,
+ 5091733917ECE17A00D62437 /* Icon-58.png in Resources */,
+ 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,
+ 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,
+ 521A8E7019F0C3D200D177D7 /* Default-667h@2x.png in Resources */,
+ 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */,
+ 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */,
+ 5091733717ECE17A00D62437 /* Icon-40.png in Resources */,
+ 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */,
+ 5023811A17EBBCAC00990C9B /* Default.png in Resources */,
+ 5091733817ECE17A00D62437 /* Icon-50.png in Resources */,
+ 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */,
+ C05D1C121923449100B808A4 /* config.json in Resources */,
+ 521A8E7119F0C3D200D177D7 /* Default-736h@3x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 5023813117EBBCE400990C9B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C07828FA18B4D72E00BD2287 /* SimulatorApp.mm in Sources */,
+ 9FB6C0631A69815100945236 /* RuntimeJsImpl.cpp in Sources */,
+ 5023813317EBBCE400990C9B /* AppDelegate.cpp in Sources */,
+ 9FD6FC731A5D2A820028EDC6 /* ConsoleWindowController.m in Sources */,
+ C07828F818B4D72E00BD2287 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F293B3C415EB7BE500256477 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */,
+ 9FB6C0621A69815100945236 /* RuntimeJsImpl.cpp in Sources */,
+ F293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */,
+ 5023812417EBBCAC00990C9B /* main.m in Sources */,
+ 5023811817EBBCAC00990C9B /* AppController.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 15D1F3091994BBCA00302043 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "libcocos2d iOS";
+ targetProxy = 15D1F3081994BBCA00302043 /* PBXContainerItemProxy */;
+ };
+ 9F78A2541A89B7EA00EB22E3 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "libjscocos2d iOS";
+ targetProxy = 9F78A2531A89B7EA00EB22E3 /* PBXContainerItemProxy */;
+ };
+ 9FB5D5E91A69054A002361CA /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "libjscocos2d Mac";
+ targetProxy = 9FB5D5E81A69054A002361CA /* PBXContainerItemProxy */;
+ };
+ 9FF504CC1A5EB19500AFDA55 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = libsimulator_iOS;
+ targetProxy = 9FF504CB1A5EB19500AFDA55 /* PBXContainerItemProxy */;
+ };
+ 9FF504D01A5EB19900AFDA55 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = libsimulator;
+ targetProxy = 9FF504CF1A5EB19900AFDA55 /* PBXContainerItemProxy */;
+ };
+ C0A2F04118975FF80072A7AB /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "cocos2dx Mac";
+ targetProxy = C0A2F04018975FF80072A7AB /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 9FFC07341A4A764100AED399 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 9FFC07351A4A764100AED399 /* Base */,
+ 9FFC07371A4A765100AED399 /* zh-Hans */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "";
+ };
+ DA9648A01A70F925001F41E8 /* ConsoleWindow.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DA96489F1A70F925001F41E8 /* Base */,
+ DA9648A31A70F93D001F41E8 /* zh-Hans */,
+ );
+ name = ConsoleWindow.xib;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 5023816917EBBCE400990C9B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = mac/Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ GLFW_EXPOSE_NATIVE_COCOA,
+ GLFW_EXPOSE_NATIVE_NSGL,
+ CC_TARGET_OS_MAC,
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/../Classes",
+ "$(SRCROOT)/../../../libsimulator/lib",
+ "$(SRCROOT)/../../../libsimulator/lib/protobuf-lite",
+ );
+ INFOPLIST_FILE = mac/Info.plist;
+ LIBRARY_SEARCH_PATHS = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_LDFLAGS = (
+ "-image_base",
+ 100000000,
+ "-pagezero_size",
+ 10000,
+ );
+ PRODUCT_NAME = Simulator;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../../../cocos/platform/mac $(SRCROOT)/../../../../../external/mac/include $(SRCROOT)/../../../../../external/mac/include/glfw3 $(SRCROOT)/../../../../../external/mac/include/spidermonkey $(SRCROOT)/../../../../../external/sources";
+ VALID_ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ };
+ name = Debug;
+ };
+ 5023816A17EBBCE400990C9B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = mac/Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ GLFW_EXPOSE_NATIVE_COCOA,
+ GLFW_EXPOSE_NATIVE_NSGL,
+ CC_TARGET_OS_MAC,
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/../Classes",
+ "$(SRCROOT)/../../../libsimulator/lib",
+ "$(SRCROOT)/../../../libsimulator/lib/protobuf-lite",
+ );
+ INFOPLIST_FILE = mac/Info.plist;
+ LIBRARY_SEARCH_PATHS = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_LDFLAGS = (
+ "-image_base",
+ 100000000,
+ "-pagezero_size",
+ 10000,
+ );
+ PRODUCT_NAME = Simulator;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../../../cocos/platform/mac $(SRCROOT)/../../../../../external/mac/include $(SRCROOT)/../../../../../external/mac/include/glfw3 $(SRCROOT)/../../../../../external/mac/include/spidermonkey $(SRCROOT)/../../../../../external/sources";
+ VALID_ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ };
+ name = Release;
+ };
+ F293B6C215EB7BEA00256477 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ 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,
+ "CC_LUA_ENGINE_ENABLED=1",
+ "CC_ENABLE_CHIPMUNK_INTEGRATION=1",
+ COCOS2D_JAVASCRIPT,
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = "";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../../../ $(SRCROOT)/../../../../../cocos $(SRCROOT)/../../../../../cocos/base $(SRCROOT)/../../../../../cocos/physics $(SRCROOT)/../../../../../cocos/math/kazmath $(SRCROOT)/../../../../../cocos/2d $(SRCROOT)/../../../../../cocos/ui $(SRCROOT)/../../../../../cocos/network $(SRCROOT)/../../../../../cocos/audio/include $(SRCROOT)/../../../../../cocos/editor-support $(SRCROOT)/../../../../../extensions $(SRCROOT)/../../../../../external $(SRCROOT)/../../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../../external/lua/luajit/include $(SRCROOT)/../../../../../external/lua/tolua $(SRCROOT)/../../../../../cocos/scripting/lua-bindings/manual $(SRCROOT)/../../../../../cocos/scripting/lua-bindings/auto $(SRCROOT)/../../../../../cocos/scripting/js-bindings/auto $(SRCROOT)/../../../../../cocos/scripting/js-bindings/manual $(SRCROOT)/../../../../../external/spidermonkey/include/mac";
+ VALID_ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ };
+ name = Debug;
+ };
+ F293B6C315EB7BEA00256477 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "COCOS2D_DEBUG=1",
+ USE_FILE32API,
+ "CC_LUA_ENGINE_ENABLED=1",
+ "CC_ENABLE_CHIPMUNK_INTEGRATION=1",
+ COCOS2D_JAVASCRIPT,
+ NDEBUG,
+ );
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = "";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../../../../ $(SRCROOT)/../../../../../cocos $(SRCROOT)/../../../../../cocos/base $(SRCROOT)/../../../../../cocos/physics $(SRCROOT)/../../../../../cocos/math/kazmath $(SRCROOT)/../../../../../cocos/2d $(SRCROOT)/../../../../../cocos/ui $(SRCROOT)/../../../../../cocos/network $(SRCROOT)/../../../../../cocos/audio/include $(SRCROOT)/../../../../../cocos/editor-support $(SRCROOT)/../../../../../extensions $(SRCROOT)/../../../../../external $(SRCROOT)/../../../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../../../external/lua/luajit/include $(SRCROOT)/../../../../../external/lua/tolua $(SRCROOT)/../../../../../cocos/scripting/lua-bindings/manual $(SRCROOT)/../../../../../cocos/scripting/lua-bindings/auto $(SRCROOT)/../../../../../cocos/scripting/js-bindings/auto $(SRCROOT)/../../../../../cocos/scripting/js-bindings/manual $(SRCROOT)/../../../../../external/spidermonkey/include/mac";
+ VALIDATE_PRODUCT = YES;
+ VALID_ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ };
+ name = Release;
+ };
+ F293B6C515EB7BEA00256477 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ARCHS = (
+ armv7,
+ arm64,
+ );
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COMPRESS_PNG_FILES = NO;
+ ENABLE_BITCODE = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ios/Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ CC_TARGET_OS_IPHONE,
+ "$(inherited)",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/../Classes",
+ "$(SRCROOT)/../../../libsimulator/lib",
+ "$(SRCROOT)/../../../libsimulator/lib/protobuf-lite",
+ );
+ INFOPLIST_FILE = ios/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
+ LIBRARY_SEARCH_PATHS = "";
+ PRODUCT_NAME = Simulator;
+ PROVISIONING_PROFILE = "";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../../../cocos/platform/ios $(SRCROOT)/../../../../../external/sources $(SRCROOT)/../../../../../external/ios/include $(SRCROOT)/../../../../../external/ios/include/spidermonkey";
+ VALID_ARCHS = "armv7 arm64";
+ };
+ name = Debug;
+ };
+ F293B6C615EB7BEA00256477 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = YES;
+ ARCHS = (
+ armv7,
+ arm64,
+ );
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COMPRESS_PNG_FILES = NO;
+ ENABLE_BITCODE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ios/Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ CC_TARGET_OS_IPHONE,
+ "$(inherited)",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/../Classes",
+ "$(SRCROOT)/../../../libsimulator/lib",
+ "$(SRCROOT)/../../../libsimulator/lib/protobuf-lite",
+ );
+ INFOPLIST_FILE = ios/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
+ LIBRARY_SEARCH_PATHS = "";
+ PRODUCT_NAME = Simulator;
+ PROVISIONING_PROFILE = "";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../../../cocos/platform/ios $(SRCROOT)/../../../../../external/sources $(SRCROOT)/../../../../../external/ios/include $(SRCROOT)/../../../../../external/ios/include/spidermonkey";
+ VALID_ARCHS = "armv7 arm64";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 5023816817EBBCE400990C9B /* Build configuration list for PBXNativeTarget "Simulator Mac" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5023816917EBBCE400990C9B /* Debug */,
+ 5023816A17EBBCE400990C9B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ F293B3C215EB7BE500256477 /* Build configuration list for PBXProject "simulator" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F293B6C215EB7BEA00256477 /* Debug */,
+ F293B6C315EB7BEA00256477 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ F293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget "Simulator iOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F293B6C515EB7BEA00256477 /* Debug */,
+ F293B6C615EB7BEA00256477 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = F293B3BF15EB7BE500256477 /* Project object */;
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.cpp b/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.cpp
new file mode 100755
index 0000000000..adc0d77bd6
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.cpp
@@ -0,0 +1,1086 @@
+
+#pragma comment(lib, "comctl32.lib")
+#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
+
+#include "stdafx.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "SimulatorWin.h"
+
+#include "glfw3.h"
+#include "glfw3native.h"
+
+#include "AppEvent.h"
+#include "AppLang.h"
+#include "runtime/ConfigParser.h"
+#include "runtime/Runtime.h"
+
+#include "platform/win32/PlayerWin.h"
+#include "platform/win32/PlayerMenuServiceWin.h"
+
+#include "resource.h"
+
+USING_NS_CC;
+
+static WNDPROC g_oldWindowProc = NULL;
+INT_PTR CALLBACK AboutDialogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LOGFONT lf;
+ HFONT hFont;
+
+ UNREFERENCED_PARAMETER(lParam);
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ ZeroMemory(&lf, sizeof(LOGFONT));
+ lf.lfHeight = 24;
+ lf.lfWeight = 200;
+ _tcscpy(lf.lfFaceName, _T("Arial"));
+
+ hFont = CreateFontIndirect(&lf);
+ if ((HFONT)0 != hFont)
+ {
+ SendMessage(GetDlgItem(hDlg, IDC_ABOUT_TITLE), WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
+ }
+ return (INT_PTR)TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+ {
+ EndDialog(hDlg, LOWORD(wParam));
+ return (INT_PTR)TRUE;
+ }
+ break;
+ }
+ return (INT_PTR)FALSE;
+}
+void onHelpAbout()
+{
+ DialogBox(GetModuleHandle(NULL),
+ MAKEINTRESOURCE(IDD_DIALOG_ABOUT),
+ Director::getInstance()->getOpenGLView()->getWin32Window(),
+ AboutDialogCallback);
+}
+
+void shutDownApp()
+{
+ auto glview = dynamic_cast (Director::getInstance()->getOpenGLView());
+ HWND hWnd = glview->getWin32Window();
+ ::SendMessage(hWnd, WM_CLOSE, NULL, NULL);
+}
+
+std::string getCurAppPath(void)
+{
+ TCHAR szAppDir[MAX_PATH] = {0};
+ if (!GetModuleFileName(NULL, szAppDir, MAX_PATH))
+ return "";
+ int nEnd = 0;
+ for (int i = 0; szAppDir[i]; i++)
+ {
+ if (szAppDir[i] == '\\')
+ nEnd = i;
+ }
+ szAppDir[nEnd] = 0;
+ int iLen = 2 * wcslen(szAppDir);
+ char* chRtn = new char[iLen + 1];
+ wcstombs(chRtn, szAppDir, iLen + 1);
+ std::string strPath = chRtn;
+ delete[] chRtn;
+ chRtn = NULL;
+ char fuldir[MAX_PATH] = {0};
+ _fullpath(fuldir, strPath.c_str(), MAX_PATH);
+ return fuldir;
+}
+
+static bool stringEndWith(const std::string str, const std::string needle)
+{
+ if (str.length() >= needle.length())
+ {
+ return (0 == str.compare(str.length() - needle.length(), needle.length(), needle));
+ }
+ return false;
+}
+
+static void initGLContextAttrs()
+{
+ //set OpenGL context attributions,now can only set six attributions:
+ //red,green,blue,alpha,depth,stencil
+ GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
+
+ GLView::setGLContextAttrs(glContextAttrs);
+}
+
+SimulatorWin *SimulatorWin::_instance = nullptr;
+
+SimulatorWin *SimulatorWin::getInstance()
+{
+ if (!_instance)
+ {
+ _instance = new SimulatorWin();
+ }
+ return _instance;
+}
+
+SimulatorWin::SimulatorWin()
+ : _app(nullptr)
+ , _hwnd(NULL)
+ , _hwndConsole(NULL)
+ , _writeDebugLogFile(nullptr)
+{
+}
+
+SimulatorWin::~SimulatorWin()
+{
+ CC_SAFE_DELETE(_app);
+ if (_writeDebugLogFile)
+ {
+ fclose(_writeDebugLogFile);
+ }
+}
+
+void SimulatorWin::quit()
+{
+ Director::getInstance()->end();
+}
+
+void SimulatorWin::relaunch()
+{
+ _project.setWindowOffset(Vec2(getPositionX(), getPositionY()));
+ openNewPlayerWithProjectConfig(_project);
+
+ quit();
+}
+
+void SimulatorWin::openNewPlayer()
+{
+ openNewPlayerWithProjectConfig(_project);
+}
+
+void SimulatorWin::openNewPlayerWithProjectConfig(const ProjectConfig &config)
+{
+ static long taskid = 100;
+ stringstream buf;
+ buf << taskid++;
+
+ string commandLine;
+ commandLine.append(getApplicationExePath());
+ commandLine.append(" ");
+ commandLine.append(config.makeCommandLine());
+
+ CCLOG("SimulatorWin::openNewPlayerWithProjectConfig(): %s", commandLine.c_str());
+
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx
+ SECURITY_ATTRIBUTES sa = {0};
+ sa.nLength = sizeof(sa);
+
+ PROCESS_INFORMATION pi = {0};
+ STARTUPINFO si = {0};
+ si.cb = sizeof(STARTUPINFO);
+
+#define MAX_COMMAND 1024 // lenth of commandLine is always beyond MAX_PATH
+
+ WCHAR command[MAX_COMMAND];
+ memset(command, 0, sizeof(command));
+ MultiByteToWideChar(CP_UTF8, 0, commandLine.c_str(), -1, command, MAX_COMMAND);
+
+ BOOL success = CreateProcess(NULL,
+ command, // command line
+ NULL, // process security attributes
+ NULL, // primary thread security attributes
+ FALSE, // handles are inherited
+ 0, // creation flags
+ NULL, // use parent's environment
+ NULL, // use parent's current directory
+ &si, // STARTUPINFO pointer
+ &pi); // receives PROCESS_INFORMATION
+
+ if (!success)
+ {
+ CCLOG("PlayerTaskWin::run() - create process failed, for execute %s", commandLine.c_str());
+ }
+}
+
+void SimulatorWin::openProjectWithProjectConfig(const ProjectConfig &config)
+{
+ openNewPlayerWithProjectConfig(config);
+ quit();
+}
+
+int SimulatorWin::getPositionX()
+{
+ RECT rect;
+ GetWindowRect(_hwnd, &rect);
+ return rect.left;
+}
+
+int SimulatorWin::getPositionY()
+{
+ RECT rect;
+ GetWindowRect(_hwnd, &rect);
+ return rect.top;
+}
+
+int SimulatorWin::run()
+{
+ INITCOMMONCONTROLSEX InitCtrls;
+ InitCtrls.dwSize = sizeof(InitCtrls);
+ InitCtrls.dwICC = ICC_WIN95_CLASSES;
+ InitCommonControlsEx(&InitCtrls);
+
+ parseCocosProjectConfig(_project);
+
+ // load project config from command line args
+ vector args;
+ for (int i = 0; i < __argc; ++i)
+ {
+ wstring ws(__wargv[i]);
+ string s;
+ s.assign(ws.begin(), ws.end());
+ args.push_back(s);
+ }
+ _project.parseCommandLine(args);
+
+ if (_project.getProjectDir().empty())
+ {
+ if (args.size() == 2)
+ {
+ // for Code IDE before RC2
+ _project.setProjectDir(args.at(1));
+ _project.setDebuggerType(kCCRuntimeDebuggerCodeIDE);
+ }
+ }
+
+ // create the application instance
+ _app = new AppDelegate();
+ RuntimeEngine::getInstance()->setProjectConfig(_project);
+
+ // create console window
+ if (_project.isShowConsole())
+ {
+ AllocConsole();
+ _hwndConsole = GetConsoleWindow();
+ if (_hwndConsole != NULL)
+ {
+ ShowWindow(_hwndConsole, SW_SHOW);
+ BringWindowToTop(_hwndConsole);
+ freopen("CONOUT$", "wt", stdout);
+ freopen("CONOUT$", "wt", stderr);
+
+ HMENU hmenu = GetSystemMenu(_hwndConsole, FALSE);
+ if (hmenu != NULL)
+ {
+ DeleteMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
+ }
+ }
+ }
+
+ // log file
+ if (_project.isWriteDebugLogToFile())
+ {
+ const string debugLogFilePath = _project.getDebugLogFilePath();
+ _writeDebugLogFile = fopen(debugLogFilePath.c_str(), "w");
+ if (!_writeDebugLogFile)
+ {
+ CCLOG("Cannot create debug log file %s", debugLogFilePath.c_str());
+ }
+ }
+
+ // set environments
+ SetCurrentDirectoryA(_project.getProjectDir().c_str());
+ FileUtils::getInstance()->setDefaultResourceRootPath(_project.getProjectDir());
+ FileUtils::getInstance()->setWritablePath(_project.getWritableRealPath().c_str());
+
+ // check screen DPI
+ HDC screen = GetDC(0);
+ int dpi = GetDeviceCaps(screen, LOGPIXELSX);
+ ReleaseDC(0, screen);
+
+ // set scale with DPI
+ // 96 DPI = 100 % scaling
+ // 120 DPI = 125 % scaling
+ // 144 DPI = 150 % scaling
+ // 192 DPI = 200 % scaling
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx#dpi_and_the_desktop_scaling_factor
+ //
+ // enable DPI-Aware with DeclareDPIAware.manifest
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx#declaring_dpi_awareness
+ float screenScale = 1.0f;
+ if (dpi >= 120 && dpi < 144)
+ {
+ screenScale = 1.25f;
+ }
+ else if (dpi >= 144 && dpi < 192)
+ {
+ screenScale = 1.5f;
+ }
+ else if (dpi >= 192)
+ {
+ screenScale = 2.0f;
+ }
+ CCLOG("SCREEN DPI = %d, SCREEN SCALE = %0.2f", dpi, screenScale);
+
+ // check scale
+ Size frameSize = _project.getFrameSize();
+ float frameScale = 1.0f;
+ if (_project.isRetinaDisplay())
+ {
+ frameSize.width *= screenScale;
+ frameSize.height *= screenScale;
+ }
+ else
+ {
+ frameScale = screenScale;
+ }
+
+ // check screen workarea
+ RECT workareaSize;
+ if (SystemParametersInfo(SPI_GETWORKAREA, NULL, &workareaSize, NULL))
+ {
+ float workareaWidth = fabsf(workareaSize.right - workareaSize.left);
+ float workareaHeight = fabsf(workareaSize.bottom - workareaSize.top);
+ float frameBorderCX = GetSystemMetrics(SM_CXSIZEFRAME);
+ float frameBorderCY = GetSystemMetrics(SM_CYSIZEFRAME);
+ workareaWidth -= frameBorderCX * 2;
+ workareaHeight -= (frameBorderCY * 2 + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU));
+ CCLOG("WORKAREA WIDTH %0.2f, HEIGHT %0.2f", workareaWidth, workareaHeight);
+ while (true && frameScale > 0.25f)
+ {
+ if (frameSize.width * frameScale > workareaWidth || frameSize.height * frameScale > workareaHeight)
+ {
+ frameScale = frameScale - 0.25f;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if (frameScale < 0.25f) frameScale = 0.25f;
+ }
+ _project.setFrameScale(frameScale);
+ CCLOG("FRAME SCALE = %0.2f", frameScale);
+
+ // create opengl view
+ const Rect frameRect = Rect(0, 0, frameSize.width, frameSize.height);
+ ConfigParser::getInstance()->setInitViewSize(frameSize);
+ const bool isResize = _project.isResizeWindow();
+ std::stringstream title;
+ title << "Cocos Simulator (" << _project.getFrameScale() * 100 << "%)";
+ initGLContextAttrs();
+ auto glview = GLViewImpl::createWithRect(title.str(), frameRect, frameScale);
+ _hwnd = glview->getWin32Window();
+ player::PlayerWin::createWithHwnd(_hwnd);
+ DragAcceptFiles(_hwnd, TRUE);
+ //SendMessage(_hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon);
+ //SendMessage(_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon);
+ //FreeResource(icon);
+
+ // path for looking Lang file, Studio Default images
+ FileUtils::getInstance()->addSearchPath(getApplicationPath().c_str());
+
+ auto director = Director::getInstance();
+ director->setOpenGLView(glview);
+
+ director->setAnimationInterval(1.0 / 60.0);
+
+ // set window position
+ if (_project.getProjectDir().length())
+ {
+ setZoom(_project.getFrameScale());
+ }
+ Vec2 pos = _project.getWindowOffset();
+ if (pos.x != 0 && pos.y != 0)
+ {
+ RECT rect;
+ GetWindowRect(_hwnd, &rect);
+ if (pos.x < 0)
+ pos.x = 0;
+ if (pos.y < 0)
+ pos.y = 0;
+ MoveWindow(_hwnd, pos.x, pos.y, rect.right - rect.left, rect.bottom - rect.top, FALSE);
+ }
+
+ // init player services
+ setupUI();
+ DrawMenuBar(_hwnd);
+
+ // prepare
+ FileUtils::getInstance()->setPopupNotify(false);
+ _project.dump();
+ auto app = Application::getInstance();
+
+ g_oldWindowProc = (WNDPROC)SetWindowLong(_hwnd, GWL_WNDPROC, (LONG)SimulatorWin::windowProc);
+
+ // update window title
+ updateWindowTitle();
+
+ // startup message loop
+ int ret = app->run();
+ CC_SAFE_DELETE(_app);
+ return ret;
+}
+
+// services
+
+void SimulatorWin::setupUI()
+{
+ auto menuBar = player::PlayerProtocol::getInstance()->getMenuService();
+
+ // FILE
+ menuBar->addItem("FILE_MENU", tr("File"));
+ menuBar->addItem("OPEN_FILE_MENU", tr("Open File") + "...", "FILE_MENU");
+ menuBar->addItem("OPEN_PROJECT_MENU", tr("Open Project") + "...", "FILE_MENU");
+ menuBar->addItem("FILE_MENU_SEP1", "-", "FILE_MENU");
+ menuBar->addItem("EXIT_MENU", tr("Exit"), "FILE_MENU");
+
+ // VIEW
+ menuBar->addItem("VIEW_MENU", tr("View"));
+ SimulatorConfig *config = SimulatorConfig::getInstance();
+ int current = config->checkScreenSize(_project.getFrameSize());
+ for (int i = 0; i < config->getScreenSizeCount(); i++)
+ {
+ SimulatorScreenSize size = config->getScreenSize(i);
+ std::stringstream menuId;
+ menuId << "VIEWSIZE_ITEM_MENU_" << i;
+ auto menuItem = menuBar->addItem(menuId.str(), size.title.c_str(), "VIEW_MENU");
+
+ if (i == current)
+ {
+ menuItem->setChecked(true);
+ }
+ }
+
+ // About
+ menuBar->addItem("HELP_MENU", tr("Help"));
+ menuBar->addItem("ABOUT_MENUITEM", tr("About"), "HELP_MENU");
+
+ menuBar->addItem("DIRECTION_MENU_SEP", "-", "VIEW_MENU");
+ menuBar->addItem("DIRECTION_PORTRAIT_MENU", tr("Portrait"), "VIEW_MENU")
+ ->setChecked(_project.isPortraitFrame());
+ menuBar->addItem("DIRECTION_LANDSCAPE_MENU", tr("Landscape"), "VIEW_MENU")
+ ->setChecked(_project.isLandscapeFrame());
+
+ menuBar->addItem("VIEW_SCALE_MENU_SEP", "-", "VIEW_MENU");
+ std::vector scaleMenuVector;
+ auto scale200Menu = menuBar->addItem("VIEW_SCALE_MENU_200", tr("Zoom Out").append(" (200%)"), "VIEW_MENU");
+ auto scale175Menu = menuBar->addItem("VIEW_SCALE_MENU_175", tr("Zoom Out").append(" (175%)"), "VIEW_MENU");
+ auto scale150Menu = menuBar->addItem("VIEW_SCALE_MENU_150", tr("Zoom Out").append(" (150%)"), "VIEW_MENU");
+ auto scale125Menu = menuBar->addItem("VIEW_SCALE_MENU_125", tr("Zoom Out").append(" (125%)"), "VIEW_MENU");
+ auto scale100Menu = menuBar->addItem("VIEW_SCALE_MENU_100", tr("Zoom Out").append(" (100%)"), "VIEW_MENU");
+ auto scale75Menu = menuBar->addItem("VIEW_SCALE_MENU_75", tr("Zoom Out").append(" (75%)"), "VIEW_MENU");
+ auto scale50Menu = menuBar->addItem("VIEW_SCALE_MENU_50", tr("Zoom Out").append(" (50%)"), "VIEW_MENU");
+ auto scale25Menu = menuBar->addItem("VIEW_SCALE_MENU_25", tr("Zoom Out").append(" (25%)"), "VIEW_MENU");
+ int frameScale = int(_project.getFrameScale() * 100);
+
+ if (frameScale == 200)
+ {
+ scale200Menu->setChecked(true);
+ }
+ else if (frameScale == 175)
+ {
+ scale175Menu->setChecked(true);
+ }
+ else if (frameScale == 150)
+ {
+ scale150Menu->setChecked(true);
+ }
+ else if (frameScale == 125)
+ {
+ scale125Menu->setChecked(true);
+ }
+ else if (frameScale == 100)
+ {
+ scale100Menu->setChecked(true);
+ }
+ else if (frameScale == 75)
+ {
+ scale75Menu->setChecked(true);
+ }
+ else if (frameScale == 50)
+ {
+ scale50Menu->setChecked(true);
+ }
+ else if (frameScale == 25)
+ {
+ scale25Menu->setChecked(true);
+ }
+ else
+ {
+ scale100Menu->setChecked(true);
+ }
+
+ scaleMenuVector.push_back(scale200Menu);
+ scaleMenuVector.push_back(scale175Menu);
+ scaleMenuVector.push_back(scale150Menu);
+ scaleMenuVector.push_back(scale125Menu);
+ scaleMenuVector.push_back(scale100Menu);
+ scaleMenuVector.push_back(scale75Menu);
+ scaleMenuVector.push_back(scale50Menu);
+ scaleMenuVector.push_back(scale25Menu);
+
+ menuBar->addItem("REFRESH_MENU_SEP", "-", "VIEW_MENU");
+ menuBar->addItem("REFRESH_MENU", tr("Refresh"), "VIEW_MENU");
+
+ HWND &hwnd = _hwnd;
+ ProjectConfig &project = _project;
+ auto dispatcher = Director::getInstance()->getEventDispatcher();
+ dispatcher->addEventListenerWithFixedPriority(EventListenerCustom::create("APP.EVENT", [&project, &hwnd, scaleMenuVector](EventCustom* event){
+ auto menuEvent = dynamic_cast(event);
+ if (menuEvent)
+ {
+ rapidjson::Document dArgParse;
+ dArgParse.Parse<0>(menuEvent->getDataString().c_str());
+ if (dArgParse.HasMember("name"))
+ {
+ string strcmd = dArgParse["name"].GetString();
+
+ if (strcmd == "menuClicked")
+ {
+ player::PlayerMenuItem *menuItem = static_cast(menuEvent->getUserData());
+ if (menuItem)
+ {
+ if (menuItem->isChecked())
+ {
+ return;
+ }
+
+ string data = dArgParse["data"].GetString();
+
+ if ((data == "CLOSE_MENU") || (data == "EXIT_MENU"))
+ {
+ _instance->quit();
+ }
+ else if (data == "REFRESH_MENU")
+ {
+ _instance->relaunch();
+ }
+ else if (data.find("VIEW_SCALE_MENU_") == 0) // begin with VIEW_SCALE_MENU_
+ {
+ string tmp = data.erase(0, strlen("VIEW_SCALE_MENU_"));
+ float scale = atof(tmp.c_str()) / 100.0f;
+ project.setFrameScale(scale);
+
+ _instance->setZoom(scale);
+
+ // update scale menu state
+ for (auto &it : scaleMenuVector)
+ {
+ it->setChecked(false);
+ }
+ menuItem->setChecked(true);
+
+ // update window title
+ _instance->updateWindowTitle();
+
+ // update window size
+ RECT rect;
+ GetWindowRect(hwnd, &rect);
+ MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + GetSystemMetrics(SM_CYMENU), FALSE);
+
+ // fix: can not update window on some windows system
+ ::SendMessage(hwnd, WM_MOVE, NULL, NULL);
+ }
+ else if (data.find("VIEWSIZE_ITEM_MENU_") == 0) // begin with VIEWSIZE_ITEM_MENU_
+ {
+ string tmp = data.erase(0, strlen("VIEWSIZE_ITEM_MENU_"));
+ int index = atoi(tmp.c_str());
+ SimulatorScreenSize size = SimulatorConfig::getInstance()->getScreenSize(index);
+
+ if (project.isLandscapeFrame())
+ {
+ std::swap(size.width, size.height);
+ }
+
+ project.setFrameSize(cocos2d::Size(size.width, size.height));
+ project.setWindowOffset(cocos2d::Vec2(_instance->getPositionX(), _instance->getPositionY()));
+ _instance->openProjectWithProjectConfig(project);
+ }
+ else if (data == "DIRECTION_PORTRAIT_MENU")
+ {
+ project.changeFrameOrientationToPortait();
+ _instance->openProjectWithProjectConfig(project);
+ }
+ else if (data == "DIRECTION_LANDSCAPE_MENU")
+ {
+ project.changeFrameOrientationToLandscape();
+ _instance->openProjectWithProjectConfig(project);
+ }
+ else if (data == "OPEN_FILE_MENU")
+ {
+ auto fileDialog = player::PlayerProtocol::getInstance()->getFileDialogService();
+ stringstream extensions;
+ extensions << "All Support File|config.json,*.csd,*csd;"
+ << "Project Config File|config.json;"
+ << "Cocos Studio File|*.csd;"
+ << "Cocos Studio Binary File|*.csb";
+ auto entry = fileDialog->openFile(tr("Choose File"), "", extensions.str());
+
+ _instance->onOpenFile(entry);
+ }
+ else if (data == "OPEN_PROJECT_MENU")
+ {
+ auto fileDialog = player::PlayerProtocol::getInstance()->getFileDialogService();
+ auto path = fileDialog->openDirectory(tr("Choose Folder"), "");
+
+ _instance->onOpenProjectFolder(path);
+ }
+ else if (data == "ABOUT_MENUITEM")
+ {
+ onHelpAbout();
+ }
+ }
+ }
+ }
+ }
+ }), 1);
+
+ AppDelegate *app = _app;
+ auto listener = EventListenerCustom::create(kAppEventDropName, [&project, app](EventCustom* event)
+ {
+ AppEvent *dropEvent = dynamic_cast(event);
+ if (dropEvent)
+ {
+ string dirPath = dropEvent->getDataString() + "/";
+ string configFilePath = dirPath + CONFIG_FILE;
+
+ if (FileUtils::getInstance()->isDirectoryExist(dirPath) &&
+ FileUtils::getInstance()->isFileExist(configFilePath))
+ {
+ // parse config.json
+ ConfigParser::getInstance()->readConfig(configFilePath);
+
+ project.setProjectDir(dirPath);
+ project.setScriptFile(ConfigParser::getInstance()->getEntryFile());
+ project.setWritablePath(dirPath);
+
+ RuntimeEngine::getInstance()->setProjectConfig(project);
+ }
+ }
+ });
+ dispatcher->addEventListenerWithFixedPriority(listener, 1);
+}
+
+void SimulatorWin::setZoom(float frameScale)
+{
+ _project.setFrameScale(frameScale);
+ cocos2d::Director::getInstance()->getOpenGLView()->setFrameZoomFactor(frameScale);
+}
+
+void SimulatorWin::updateWindowTitle()
+{
+ std::stringstream title;
+ title << "Cocos " << tr("Simulator") << " (" << _project.getFrameScale() * 100 << "%)";
+ std::u16string u16title;
+ cocos2d::StringUtils::UTF8ToUTF16(title.str(), u16title);
+ SetWindowText(_hwnd, (LPCTSTR)u16title.c_str());
+}
+
+// debug log
+void SimulatorWin::writeDebugLog(const char *log)
+{
+ if (!_writeDebugLogFile) return;
+
+ fputs(log, _writeDebugLogFile);
+ fputc('\n', _writeDebugLogFile);
+ fflush(_writeDebugLogFile);
+}
+
+void SimulatorWin::parseCocosProjectConfig(ProjectConfig &config)
+{
+ // get project directory
+ ProjectConfig tmpConfig;
+ // load project config from command line args
+ vector args;
+ for (int i = 0; i < __argc; ++i)
+ {
+ wstring ws(__wargv[i]);
+ string s;
+ s.assign(ws.begin(), ws.end());
+ args.push_back(s);
+ }
+
+ if (args.size() >= 2)
+ {
+ if (args.size() && args.at(1).at(0) == '/')
+ {
+ // FIXME:
+ // for Code IDE before RC2
+ tmpConfig.setProjectDir(args.at(1));
+ }
+
+ tmpConfig.parseCommandLine(args);
+ }
+
+ // set project directory as search root path
+ string solutionDir = tmpConfig.getProjectDir();
+ if (!solutionDir.empty())
+ {
+ for (int i = 0; i < solutionDir.size(); ++i)
+ {
+ if (solutionDir[i] == '\\')
+ {
+ solutionDir[i] = '/';
+ }
+ }
+ int nPos = -1;
+ if (solutionDir[solutionDir.length() - 1] == '/')
+ nPos = solutionDir.rfind('/', solutionDir.length() - 2);
+ else
+ nPos = solutionDir.rfind('/');
+ if (nPos > 0)
+ solutionDir = solutionDir.substr(0, nPos + 1);
+ FileUtils::getInstance()->setDefaultResourceRootPath(solutionDir);
+ FileUtils::getInstance()->addSearchPath(solutionDir);
+ FileUtils::getInstance()->addSearchPath(tmpConfig.getProjectDir().c_str());
+ }
+ else
+ {
+ FileUtils::getInstance()->setDefaultResourceRootPath(tmpConfig.getProjectDir().c_str());
+ }
+
+ // parse config.json
+ auto parser = ConfigParser::getInstance();
+ auto configPath = solutionDir.append(CONFIG_FILE);
+ parser->readConfig(configPath);
+
+ // set information
+ config.setConsolePort(parser->getConsolePort());
+ config.setFileUploadPort(parser->getUploadPort());
+ config.setFrameSize(parser->getInitViewSize());
+ if (parser->isLanscape())
+ {
+ config.changeFrameOrientationToLandscape();
+ }
+ else
+ {
+ config.changeFrameOrientationToPortait();
+ }
+ config.setScriptFile(parser->getEntryFile());
+}
+
+//
+// D:\aaa\bbb\ccc\ddd\abc.txt --> D:/aaa/bbb/ccc/ddd/abc.txt
+//
+std::string SimulatorWin::convertPathFormatToUnixStyle(const std::string& path)
+{
+ std::string ret = path;
+ int len = ret.length();
+ for (int i = 0; i < len; ++i)
+ {
+ if (ret[i] == '\\')
+ {
+ ret[i] = '/';
+ }
+ }
+ return ret;
+}
+
+//
+// @return: C:/Users/win8/Documents/
+//
+std::string SimulatorWin::getUserDocumentPath()
+{
+ TCHAR filePath[MAX_PATH];
+ SHGetSpecialFolderPath(NULL, filePath, CSIDL_PERSONAL, FALSE);
+ int length = 2 * wcslen(filePath);
+ char* tempstring = new char[length + 1];
+ wcstombs(tempstring, filePath, length + 1);
+ string userDocumentPath(tempstring);
+ delete [] tempstring;
+
+ userDocumentPath = convertPathFormatToUnixStyle(userDocumentPath);
+ userDocumentPath.append("/");
+
+ return userDocumentPath;
+}
+
+//
+// convert Unicode/LocalCode TCHAR to Utf8 char
+//
+char* SimulatorWin::convertTCharToUtf8(const TCHAR* src)
+{
+#ifdef UNICODE
+ WCHAR* tmp = (WCHAR*)src;
+ size_t size = wcslen(src) * 3 + 1;
+ char* dest = new char[size];
+ memset(dest, 0, size);
+ WideCharToMultiByte(CP_UTF8, 0, tmp, -1, dest, size, NULL, NULL);
+ return dest;
+#else
+ char* tmp = (char*)src;
+ uint32 size = strlen(tmp) + 1;
+ WCHAR* dest = new WCHAR[size];
+ memset(dest, 0, sizeof(WCHAR)*size);
+ MultiByteToWideChar(CP_ACP, 0, src, -1, dest, (int)size); // convert local code to unicode.
+
+ size = wcslen(dest) * 3 + 1;
+ char* dest2 = new char[size];
+ memset(dest2, 0, size);
+ WideCharToMultiByte(CP_UTF8, 0, dest, -1, dest2, size, NULL, NULL); // convert unicode to utf8.
+ delete[] dest;
+ return dest2;
+#endif
+}
+
+//
+std::string SimulatorWin::getApplicationExePath()
+{
+ TCHAR szFileName[MAX_PATH];
+ GetModuleFileName(NULL, szFileName, MAX_PATH);
+ std::u16string u16ApplicationName;
+ char *applicationExePath = convertTCharToUtf8(szFileName);
+ std::string path(applicationExePath);
+ CC_SAFE_FREE(applicationExePath);
+
+ return path;
+}
+
+std::string SimulatorWin::getApplicationPath()
+{
+ std::string path = getApplicationExePath();
+ size_t pos;
+ while ((pos = path.find_first_of("\\")) != std::string::npos)
+ {
+ path.replace(pos, 1, "/");
+ }
+ size_t p = path.find_last_of("/");
+ string workdir;
+ if (p != path.npos)
+ {
+ workdir = path.substr(0, p);
+ }
+
+ return workdir;
+}
+
+LRESULT CALLBACK SimulatorWin::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (!_instance) return 0;
+
+ switch (uMsg)
+ {
+ case WM_SYSCOMMAND:
+ case WM_COMMAND:
+ {
+ if (HIWORD(wParam) == 0)
+ {
+ // menu
+ WORD menuId = LOWORD(wParam);
+ auto menuService = dynamic_cast (player::PlayerProtocol::getInstance()->getMenuService());
+ auto menuItem = menuService->getItemByCommandId(menuId);
+ if (menuItem)
+ {
+ AppEvent event("APP.EVENT", APP_EVENT_MENU);
+
+ std::stringstream buf;
+ buf << "{\"data\":\"" << menuItem->getMenuId().c_str() << "\"";
+ buf << ",\"name\":" << "\"menuClicked\"" << "}";
+ event.setDataString(buf.str());
+ event.setUserData(menuItem);
+ Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
+ }
+
+ if (menuId == ID_HELP_ABOUT)
+ {
+ onHelpAbout();
+ }
+ }
+ break;
+ }
+ case WM_KEYDOWN:
+ {
+ if (wParam == VK_F5)
+ {
+ _instance->relaunch();
+ }
+ break;
+ }
+
+ case WM_COPYDATA:
+ {
+ PCOPYDATASTRUCT pMyCDS = (PCOPYDATASTRUCT)lParam;
+ if (pMyCDS->dwData == 1)
+ {
+ const char *szBuf = (const char*)(pMyCDS->lpData);
+ SimulatorWin::getInstance()->writeDebugLog(szBuf);
+ break;
+ }
+ }
+
+ case WM_DESTROY:
+ {
+ DragAcceptFiles(hWnd, FALSE);
+ break;
+ }
+
+ case WM_DROPFILES:
+ {
+ HDROP hDrop = (HDROP)wParam;
+
+ const int count = DragQueryFileW(hDrop, 0xffffffff, NULL, 0);
+
+ if (count > 0)
+ {
+ int fileIndex = 0;
+
+ const UINT length = DragQueryFileW(hDrop, fileIndex, NULL, 0);
+ WCHAR* buffer = (WCHAR*)calloc(length + 1, sizeof(WCHAR));
+
+ DragQueryFileW(hDrop, fileIndex, buffer, length + 1);
+ char *utf8 = SimulatorWin::convertTCharToUtf8(buffer);
+ std::string firstFile(utf8);
+ CC_SAFE_FREE(utf8);
+ DragFinish(hDrop);
+
+ _instance->onDrop(firstFile);
+ }
+ } // WM_DROPFILES
+
+ }
+ return g_oldWindowProc(hWnd, uMsg, wParam, lParam);
+}
+
+void SimulatorWin::onOpenFile(const std::string &filePath)
+{
+ string entry = filePath;
+ if (entry.empty()) return;
+
+ if (stringEndWith(entry, "config.json") || stringEndWith(entry, ".csb") || stringEndWith(entry, ".csd"))
+ {
+ replaceAll(entry, "\\", "/");
+ size_t p = entry.find_last_of("/");
+ if (p != entry.npos)
+ {
+ string workdir = entry.substr(0, p);
+ _project.setProjectDir(workdir);
+ }
+
+ _project.setScriptFile(entry);
+ if (stringEndWith(entry, CONFIG_FILE))
+ {
+ ConfigParser::getInstance()->readConfig(entry);
+ _project.setScriptFile(ConfigParser::getInstance()->getEntryFile());
+ }
+ openProjectWithProjectConfig(_project);
+ }
+ else
+ {
+ auto title = tr("Open File") + tr("Error");
+ auto msg = tr("Only support") + " config.json;*.csb;*.csd";
+ auto msgBox = player::PlayerProtocol::getInstance()->getMessageBoxService();
+ msgBox->showMessageBox(title, msg);
+ }
+}
+
+/*
+1. find @folderPath/config.json
+2. get project name from file: @folderPath/folderName.ccs
+3. find @folderPath/cocosstudio/MainScene.csd
+4. find @folderPath/cocosstudio/MainScene.csb
+*/
+void SimulatorWin::onOpenProjectFolder(const std::string &folderPath)
+{
+ string path = folderPath;
+ if (!path.empty())
+ {
+ replaceAll(path, "\\", "/");
+
+ auto fileUtils = FileUtils::getInstance();
+ bool foundProjectFile = false;
+ // 1. check config.json
+ auto configPath = path + "/" + CONFIG_FILE;
+ if (fileUtils->isFileExist(configPath))
+ {
+ ConfigParser::getInstance()->readConfig(configPath);
+ _project.setProjectDir(path);
+ _project.setScriptFile(ConfigParser::getInstance()->getEntryFile());
+ foundProjectFile = true;
+ }
+ // check ccs project
+ else
+ {
+ // 2.
+ if (path.at(path.size() - 1) == '/') path.erase(path.size() - 1);
+ ssize_t pos = path.find_last_of('/');
+ if (pos != std::string::npos)
+ {
+ auto folderName = path.substr(path.find_last_of('/'), path.size());
+ auto ccsFilePath = path + folderName + ".ccs";
+ if (fileUtils->isFileExist(ccsFilePath))
+ {
+ auto fileContent = fileUtils->getStringFromFile(ccsFilePath);
+
+ string matchString("isFileExist(csdFilePath))
+ {
+ _project.setProjectDir(path);
+ _project.setScriptFile(csdFilePath);
+ foundProjectFile = true;
+ }
+ // 4.
+ else if (fileUtils->isFileExist(csbFilePath))
+ {
+ _project.setProjectDir(path);
+ _project.setScriptFile(csbFilePath);
+ foundProjectFile = true;
+ }
+ }
+ }
+
+ if (foundProjectFile)
+ {
+ openProjectWithProjectConfig(_project);
+ }
+ else
+ {
+ auto title = tr("Open Project") + tr("Error");
+ auto msgBox = player::PlayerProtocol::getInstance()->getMessageBoxService();
+ msgBox->showMessageBox(title, tr("Can not find project"));
+ }
+ }
+}
+
+void SimulatorWin::onDrop(const std::string &path)
+{
+ auto fileUtils = FileUtils::getInstance();
+ if (fileUtils->isDirectoryExist(path))
+ {
+ onOpenProjectFolder(path);
+ }
+ else if (fileUtils->isFileExist(path))
+ {
+ onOpenFile(path);
+ }
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.h b/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.h
new file mode 100755
index 0000000000..dce617ffd9
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include "stdafx.h"
+#include "Resource.h"
+#include "cocos2d.h"
+#include "AppDelegate.h"
+#include "ProjectConfig/ProjectConfig.h"
+#include "ProjectConfig/SimulatorConfig.h"
+
+class SimulatorWin
+{
+public:
+ static SimulatorWin *getInstance();
+ virtual ~SimulatorWin();
+ int run();
+
+ virtual void quit();
+ virtual void relaunch();
+ virtual void openNewPlayer();
+ virtual void openNewPlayerWithProjectConfig(const ProjectConfig &config);
+ virtual void openProjectWithProjectConfig(const ProjectConfig &config);
+
+ virtual int getPositionX();
+ virtual int getPositionY();
+protected:
+ SimulatorWin();
+
+ static SimulatorWin *_instance;
+ ProjectConfig _project;
+ HWND _hwnd;
+ HWND _hwndConsole;
+ AppDelegate *_app;
+ FILE *_writeDebugLogFile;
+
+ //
+ void setupUI();
+ void setZoom(float frameScale);
+ void updateWindowTitle();
+
+ // debug log
+ void writeDebugLog(const char *log);
+ void parseCocosProjectConfig(ProjectConfig &config);
+
+ //
+ void onOpenFile(const std::string &filePath);
+ void onOpenProjectFolder(const std::string &folderPath);
+ void onDrop(const std::string &path);
+
+ // helper
+ std::string convertPathFormatToUnixStyle(const std::string& path);
+ std::string getUserDocumentPath();
+ std::string getApplicationExePath();
+ std::string getApplicationPath();
+ static char* convertTCharToUtf8(const TCHAR* src);
+
+ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+};
+
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/build-cfg.json b/native/tools/simulator/frameworks/runtime-src/proj.win32/build-cfg.json
new file mode 100755
index 0000000000..07c6788bbf
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/build-cfg.json
@@ -0,0 +1,22 @@
+{
+ "copy_resources": [
+ {
+ "from": "../../../src",
+ "to": "src"
+ },
+ {
+ "from": "../../../res",
+ "to": "res"
+ },
+ {
+ "from": "../../../config.json",
+ "to": ""
+ },
+ {
+ "from": "../Classes/ide-support/lang",
+ "to": ""
+ }
+ ],
+ "must_copy_resources": [
+ ]
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/game.rc b/native/tools/simulator/frameworks/runtime-src/proj.win32/game.rc
new file mode 100755
index 0000000000..65a3d825ec
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/game.rc
@@ -0,0 +1,201 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.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 ""winres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MENU_COCOS MENU
+BEGIN
+ POPUP "°ïÖú(&H)"
+ BEGIN
+ MENUITEM "¹ØÓÚ(&A)", ID_HELP_ABOUT
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG_ABOUT DIALOGEX 0, 0, 243, 134
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About Simulator"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CTEXT "Version 3.10 (20151222)",IDC_ABOUT_VERSION,35,70,173,17
+ CTEXT "Cocos Simulator",IDC_ABOUT_TITLE,35,49,173,17
+ CTEXT "Copyright (C) 2015. All rights reserved.",IDC_STATIC,35,94,173,17
+ ICON "GLFW_ICON",IDC_STATIC,111,15,20,20
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_DIALOG_ABOUT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 236
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 127
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // Chinese (Simplified, PRC) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MENU_COCOS MENU
+BEGIN
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About ...", ID_HELP_ABOUT
+ END
+END
+
+#endif // English 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/native/tools/simulator/frameworks/runtime-src/proj.win32/main.cpp b/native/tools/simulator/frameworks/runtime-src/proj.win32/main.cpp
new file mode 100755
index 0000000000..e034aa1575
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/main.cpp
@@ -0,0 +1,13 @@
+#include "main.h"
+#include "SimulatorWin.h"
+#include
+
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine,
+ int nCmdShow)
+{
+ UNREFERENCED_PARAMETER(hPrevInstance);
+ UNREFERENCED_PARAMETER(lpCmdLine);
+ return SimulatorWin::getInstance()->run();
+}
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/main.h b/native/tools/simulator/frameworks/runtime-src/proj.win32/main.h
new file mode 100755
index 0000000000..d756fd1e57
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/main.h
@@ -0,0 +1,10 @@
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+// Windows Header Files:
+#include
+#include
+
+#endif // __WINMAIN_H__
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/res/game.ico b/native/tools/simulator/frameworks/runtime-src/proj.win32/res/game.ico
new file mode 100755
index 0000000000..feaf932a74
Binary files /dev/null and b/native/tools/simulator/frameworks/runtime-src/proj.win32/res/game.ico differ
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/resource.h b/native/tools/simulator/frameworks/runtime-src/proj.win32/resource.h
new file mode 100755
index 0000000000..88a519df74
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/resource.h
@@ -0,0 +1,39 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by game.rc
+//
+#define IDS_PROJNAME 100
+#define IDR_MENU_COCOS 200
+#define IDD_DIALOG1 202
+#define IDD_DIALOG_ABOUT 203
+#define IDC_ABOUT_TITLE 1000
+#define IDC_EDIT2 1001
+#define IDC_ABOUT_VERSION 1001
+#define ID_VIEW_SIZE 30001
+#define ID_FILE_NEW_WINDOW 32771
+#define ID_VIEW_PORTRAIT 32775
+#define ID_VIEW_LANDSCAPE 32776
+#define ID_VIEW_CUSTOM 32777
+#define ID_HELP_ABOUT 32778
+#define ID_FILE_EXIT 32779
+#define ID_Menu 32780
+#define ID_Menu32781 32781
+#define ID_TEST_RESET 32782
+#define ID_CONTROL 32783
+#define ID_CONTROL_RELOAD 32784
+#define ID_VIEW_ZOOMOUT100 32785
+#define ID_VIEW_ZOOMOUT75 32786
+#define ID_VIEW_ZOOMOUT50 32787
+#define ID_VIEW_ZOOMOUT25 32788
+#define ID_CONTROL_TOP 32793
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 201
+#define _APS_NEXT_COMMAND_VALUE 32794
+#define _APS_NEXT_CONTROL_VALUE 1002
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln
new file mode 100755
index 0000000000..1e67890410
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.sln
@@ -0,0 +1,73 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30501.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simulator", "simulator.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
+ ProjectSection(ProjectDependencies) = postProject
+ {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\..\..\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluacocos2d", "..\..\..\..\..\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj", "{9F2D6CE6-C893-4400-B50C-6DB70CC2562F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\..\..\..\..\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\..\..\..\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsimulator", "..\..\..\libsimulator\proj.win32\libsimulator.vcxproj", "{001B324A-BB91-4E83-875C-C92F75C40857}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjscocos2d", "..\..\..\..\..\cocos\scripting\js-bindings\proj.win32\libjscocos2d.vcxproj", "{39379840-825A-45A0-B363-C09FFEF864BD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\..\..\..\..\external\bullet\proj.win32\libbullet.vcxproj", "{012DFF48-A13F-4F52-B07B-F8B9D21CE95B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\..\..\..\..\external\recast\proj.win32\librecast.vcxproj", "{41E34993-647E-4282-8384-4AB1AE31A452}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32
+ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32
+ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.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
+ {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Debug|Win32.Build.0 = Debug|Win32
+ {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.Release|Win32.ActiveCfg = Release|Win32
+ {9F2D6CE6-C893-4400-B50C-6DB70CC2562F}.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
+ {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
+ {001B324A-BB91-4E83-875C-C92F75C40857}.Debug|Win32.ActiveCfg = Debug|Win32
+ {001B324A-BB91-4E83-875C-C92F75C40857}.Debug|Win32.Build.0 = Debug|Win32
+ {001B324A-BB91-4E83-875C-C92F75C40857}.Release|Win32.ActiveCfg = Release|Win32
+ {001B324A-BB91-4E83-875C-C92F75C40857}.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
+ {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Debug|Win32.Build.0 = Debug|Win32
+ {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.ActiveCfg = Release|Win32
+ {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.Build.0 = Release|Win32
+ {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.ActiveCfg = Debug|Win32
+ {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.Build.0 = Debug|Win32
+ {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.ActiveCfg = Release|Win32
+ {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj
new file mode 100755
index 0000000000..7e619a6376
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj
@@ -0,0 +1,251 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}
+ simulator
+
+
+
+ Application
+ true
+ Unicode
+ v110
+ v120
+ v140
+ v140_xp
+
+
+ Application
+ false
+ Unicode
+ v110
+ v120
+ v140
+ v140_xp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(SolutionDir)$(Configuration).win32\
+ $(Configuration).win32\
+ true
+ $(IncludePath)
+ $(SourcePath);
+ AllRules.ruleset
+
+
+ $(SolutionDir)$(Configuration).win32\
+ $(Configuration).win32\
+ false
+
+
+ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)
+
+
+ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)
+
+
+
+ $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\runtime;$(ProjectDir)..\Classes\ide-support;$(EngineRoot)cocos\base;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)tools\simulator\libsimulator\lib;$(EngineRoot)tools\simulator\libsimulator\lib\protobuf-lite;$(EngineRoot)extensions;$(EngineRoot);%(AdditionalIncludeDirectories)
+ NotUsing
+ Level3
+ MultiThreadedDebugDLL
+ false
+ ProgramDatabase
+ EnableFastChecks
+ Disabled
+ WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRLUASTATIC;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions)
+ 4267;4251;4244;%(DisableSpecificWarnings)
+ true
+ $(IntDir)vc$(PlatformToolsetVersion).pdb
+ algorithm
+ CompileAsCpp
+
+
+ Windows
+ MachineX86
+ true
+ $(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories)
+ libcurl_imp.lib;websockets.lib;mozjs-33.lib;libbox2d.lib;libSpine.lib;%(AdditionalDependencies)
+ $(ProjectDir)../../../runtime/win32/$(TargetName).pdb
+ $(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt)
+ libcmt.lib;%(IgnoreSpecificDefaultLibraries)
+
+
+ 0x0409
+ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories)
+ _DEBUG;%(PreprocessorDefinitions)
+
+
+ false
+ Win32
+ _DEBUG;%(PreprocessorDefinitions)
+ simulator.h
+ simulator_i.c
+ simulator_p.c
+ true
+ $(IntDir)/simulator.tlb
+
+
+
+
+ if not exist "$(OutDir)" mkdir "$(OutDir)"
+
+xcopy /Y /Q "$(ProjectDir)..\Classes\ide-support\lang" "$(OutDir)"
+
+
+
+
+
+
+
+
+
+ if not exist "$(ProjectDir)..\..\..\runtime" mkdir "$(ProjectDir)..\..\..\runtime"
+
+if not exist "$(ProjectDir)..\..\..\runtime\win32" mkdir "$(ProjectDir)..\..\..\runtime\win32"
+
+xcopy /Y /Q "$(OutDir)*.dll" "$(ProjectDir)..\..\..\runtime\win32"
+xcopy /Y /Q "$(OutDir)*.exe" "$(ProjectDir)..\..\..\runtime\win32"
+xcopy /Y /Q "$(OutDir)lang" "$(ProjectDir)..\..\..\runtime\win32"
+
+
+
+
+
+ $(ProjectDir)..\Classes;$(ProjectDir)..\Classes\runtime;$(EngineRoot)cocos\base;$(EngineRoot)tools\simulator\libsimulator\lib\protobuf-lite;$(EngineRoot)external\win32-specific\zlib\include;$(EngineRoot)cocos\scripting\lua-bindings\auto;$(EngineRoot)cocos\scripting\lua-bindings\manual;$(EngineRoot)cocos\scripting\js-bindings\auto;$(EngineRoot)cocos\scripting\js-bindings\manual;$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\lua\lua;$(EngineRoot)external\lua\tolua;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;$(EngineRoot)external\curl\include\win32;$(EngineRoot)external\spidermonkey\include\win32;$(EngineRoot)tools\simulator\libsimulator\lib;$(EngineRoot);%(AdditionalIncludeDirectories)
+ NotUsing
+ Level3
+ MultiThreadedDLL
+ Sync
+ ProgramDatabase
+ COCOS2D_DEBUG=1;WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;_USRLUASTATIC;_USRJSSTATIC;_USRLIBSIMSTATIC;%(PreprocessorDefinitions)
+ 4267;4251;4244;%(DisableSpecificWarnings)
+ true
+ $(IntDir)vc$(PlatformToolsetVersion).pdb
+ algorithm
+ CompileAsCpp
+ Default
+ true
+
+
+ Windows
+ MachineX86
+ $(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories)
+ libcurl_imp.lib;websockets.lib;mozjs-33.lib;libbox2d.lib;libSpine.lib;%(AdditionalDependencies)
+ false
+ $(OutDir)$(ProjectName).exe
+ libcmt.lib;%(IgnoreSpecificDefaultLibraries)
+
+
+ 0x0409
+ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories)
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+ false
+ Win32
+ NDEBUG;%(PreprocessorDefinitions)
+ simulator.h
+ simulator_i.c
+ simulator_p.c
+ true
+ $(IntDir)/simulator.tlb
+
+
+
+
+ if not exist "$(OutDir)" mkdir "$(OutDir)"
+
+xcopy /Y /Q "$(ProjectDir)..\Classes\ide-support\lang" "$(OutDir)"
+
+
+
+
+
+
+
+
+
+ if not exist "$(ProjectDir)..\..\..\runtime" mkdir "$(ProjectDir)..\..\..\runtime"
+
+if not exist "$(ProjectDir)..\..\..\runtime\win32" mkdir "$(ProjectDir)..\..\..\runtime\win32"
+
+xcopy /Y /Q "$(OutDir)*.dll" "$(ProjectDir)..\..\..\runtime\win32"
+xcopy /Y /Q "$(OutDir)*.exe" "$(ProjectDir)..\..\..\runtime\win32"
+xcopy /Y /Q "$(OutDir)lang" "$(ProjectDir)..\..\..\runtime\win32"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {39379840-825a-45a0-b363-c09ffef864bd}
+
+
+ {9f2d6ce6-c893-4400-b50c-6db70cc2562f}
+
+
+ {001b324a-bb91-4e83-875c-c92f75c40857}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.filters b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.filters
new file mode 100755
index 0000000000..1681fc7e83
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.filters
@@ -0,0 +1,89 @@
+
+
+
+
+ {fc5cb953-2953-4968-83b3-39e3ff951754}
+
+
+ {037a9a02-b906-4cc5-ad98-304acd4e25ee}
+
+
+ {2d1d0979-58cd-4ab6-b91c-13650158f1fa}
+
+
+ {9f68f9a7-7069-4c93-94ae-942a0aa910c1}
+
+
+ {2dfb9946-38e9-419b-bfb4-c544c01af16e}
+
+
+
+
+ Classes
+
+
+ win32
+
+
+
+
+ win32
+
+
+ win32
+
+
+ Classes\ide-support
+
+
+ Classes\ide-support
+
+
+ Classes\ide-support
+
+
+ Classes\ide-support
+
+
+ Classes\jsb
+
+
+ Classes
+
+
+
+
+ Classes
+
+
+ win32
+
+
+
+ win32
+
+
+ Classes\ide-support
+
+
+ Classes\ide-support
+
+
+ Classes\ide-support
+
+
+ Classes\jsb
+
+
+ Classes
+
+
+
+
+ resource
+
+
+
+
+
+
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.user b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.user
new file mode 100755
index 0000000000..0786ac218a
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/simulator.vcxproj.user
@@ -0,0 +1,18 @@
+
+
+
+ false
+ $(OutDir)
+ WindowsLocalDebugger
+ WindowsLocalDebugger
+
+
+ $(OutDir)
+ $(TargetPath)
+
+
+
+
+ $(TargetPath)
+
+
\ No newline at end of file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.cpp b/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.cpp
new file mode 100755
index 0000000000..b8b9773e01
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// player.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.h b/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.h
new file mode 100755
index 0000000000..bb80440ee2
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/stdafx.h
@@ -0,0 +1,21 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include
+
+// C RunTime Header Files
+#include
+#include
+#include
+#include
+
+
+// TODO: reference additional headers your program requires here
diff --git a/native/tools/simulator/frameworks/runtime-src/proj.win32/targetver.h b/native/tools/simulator/frameworks/runtime-src/proj.win32/targetver.h
new file mode 100755
index 0000000000..87c0086de7
--- /dev/null
+++ b/native/tools/simulator/frameworks/runtime-src/proj.win32/targetver.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// Including SDKDDKVer.h defines the highest available Windows platform.
+
+// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
+// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
+
+#include
diff --git a/native/tools/simulator/libsimulator/lib/AppEvent.cpp b/native/tools/simulator/libsimulator/lib/AppEvent.cpp
new file mode 100755
index 0000000000..85dfe64aac
--- /dev/null
+++ b/native/tools/simulator/libsimulator/lib/AppEvent.cpp
@@ -0,0 +1,33 @@
+//
+// AppEvent.cpp
+// Simulator
+//
+//
+
+#include "AppEvent.h"
+
+AppEvent::AppEvent(const std::string& eventName, int type)
+: EventCustom(eventName)
+, _eventName(eventName)
+{
+ setEventType(type);
+}
+
+void AppEvent::setEventType(int type)
+{
+ _eventType = type;
+}
+int AppEvent::getEventType()
+{
+ return _eventType;
+}
+
+void AppEvent::setDataString(std::string data)
+{
+ _dataString = data;
+}
+
+std::string AppEvent::getDataString()
+{
+ return _dataString;
+}
\ No newline at end of file
diff --git a/native/tools/simulator/libsimulator/lib/AppEvent.h b/native/tools/simulator/libsimulator/lib/AppEvent.h
new file mode 100755
index 0000000000..f284313ee8
--- /dev/null
+++ b/native/tools/simulator/libsimulator/lib/AppEvent.h
@@ -0,0 +1,48 @@
+//
+// AppEvent.h
+// Simulator
+//
+//
+
+#ifndef __Simulator__AppEvent__
+#define __Simulator__AppEvent__
+
+#include
+#include "cocos2d.h"
+
+// encode / decode json
+#include "json/document.h"
+#include "json/filestream.h"
+#include "json/stringbuffer.h"
+#include "json/writer.h"
+#include "SimulatorExport.h"
+
+enum
+{
+ APP_EVENT_MENU = 1,
+ APP_EVENT_DROP = 2
+};
+
+#define kAppEventDropName "APP.EVENT.DROP"
+#define kAppEventName "APP.EVENT"
+
+class CC_LIBSIM_DLL AppEvent : public cocos2d::EventCustom
+{
+public:
+ /** Constructor */
+ AppEvent(const std::string& eventName, int type);
+
+ /** Gets event name */
+ inline const std::string& getEventName() const { return _eventName; };
+
+ void setEventType(int type);
+ int getEventType();
+ void setDataString(std::string data);
+ std::string getDataString();
+protected:
+ std::string _eventName;
+ std::string _dataString;
+ int _eventType;
+};
+
+#endif /* defined(__Simulator__AppEvent__) */
diff --git a/native/tools/simulator/libsimulator/lib/AppLang.cpp b/native/tools/simulator/libsimulator/lib/AppLang.cpp
new file mode 100755
index 0000000000..b5a95494eb
--- /dev/null
+++ b/native/tools/simulator/libsimulator/lib/AppLang.cpp
@@ -0,0 +1,75 @@
+//
+// AppLang.cpp
+// Simulator
+//
+
+#include "AppLang.h"
+
+USING_NS_CC;
+
+AppLang::AppLang()
+ : _hasInit(false)
+{
+ _localizationFileName = "lang";
+}
+
+void AppLang::readLocalizationFile()
+{
+ if (!_hasInit)
+ {
+ _hasInit = true;
+
+ auto fileUtils = FileUtils::getInstance();
+
+ if (!fileUtils->isFileExist(_localizationFileName))
+ {
+ cocos2d::log("[WARNING]:not find %s", _localizationFileName.c_str());
+ return;
+ }
+ auto fullFilePath = fileUtils->fullPathForFilename(_localizationFileName);
+ std::string fileContent = FileUtils::getInstance()->getStringFromFile(fullFilePath);
+ if(fileContent.empty())
+ return;
+
+ if (_docRootjson.Parse<0>(fileContent.c_str()).HasParseError())
+ {
+ cocos2d::log("[WARNING]:read json file %s failed because of %d", _localizationFileName.c_str(), _docRootjson.GetParseError());
+ return;
+ }
+ }
+}
+
+AppLang* AppLang::getInstance()
+{
+ static AppLang *lang = nullptr;
+ if (!lang)
+ {
+ lang = new AppLang;
+ lang->readLocalizationFile();
+ }
+ return lang;
+}
+
+std::string AppLang::getString(const std::string &lang, const std::string &key)
+{
+ std::string tmpKey = key;
+ const char *ckey = tmpKey.c_str();
+
+ std::string tmpLang = lang;
+ const char *langKey = tmpLang.c_str();
+
+ if (!_docRootjson.IsObject())
+ {
+ return key;
+ }
+
+ if (_docRootjson.HasMember(langKey))
+ {
+ const rapidjson::Value& v = _docRootjson[langKey];
+ if (v.HasMember(ckey))
+ {
+ return v[ckey].GetString();
+ }
+ }
+ return key;
+}
diff --git a/native/tools/simulator/libsimulator/lib/AppLang.h b/native/tools/simulator/libsimulator/lib/AppLang.h
new file mode 100755
index 0000000000..8884c9eaae
--- /dev/null
+++ b/native/tools/simulator/libsimulator/lib/AppLang.h
@@ -0,0 +1,34 @@
+//
+// AppLang.h
+// Simulator
+//
+
+#ifndef __Simulator__AppLang__
+#define __Simulator__AppLang__
+
+#include "cocos2d.h"
+#include