Merge pull request #11837 from yinjimmy/simulator

simulator
This commit is contained in:
minggo 2015-05-14 14:25:30 +08:00
commit 4b82cd7052
93 changed files with 15968 additions and 12 deletions

View File

@ -6,7 +6,13 @@
"Portrait": "竖屏",
"Landscape": "横屏",
"Refresh": "刷新(重启)",
"Zoom Out": "缩放"
"Zoom Out": "缩放",
"Simulator": "模拟器",
"Open File": "打开文件",
"Open Project": "打开工程",
"Error": "错误",
"Help": "帮助(&H)",
"About": "关于(&A)"
},
"zh-Hans": {
"View": "视图",
@ -15,6 +21,9 @@
"Portrait": "竖屏",
"Landscape": "横屏",
"Refresh": "刷新(重启)",
"Zoom Out": "缩放"
"Zoom Out": "缩放",
"Simulator": "模拟器",
"Help": "帮助(&H)",
"About": "关于(&A)"
}
}

View File

@ -18,6 +18,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\..\cocos2d-x
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsimulator", "..\..\cocos2d-x\tools\simulator\libsimulator\proj.win32\libsimulator.vcxproj", "{001B324A-BB91-4E83-875C-C92F75C40857}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\..\cocos2d-x\external\bullet\proj.win32\libbullet.vcxproj", "{012DFF48-A13F-4F52-B07B-F8B9D21CE95B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32

View File

@ -31,6 +31,14 @@
#include "platform/win32/PlayerWin.h"
#include "platform/win32/PlayerMenuServiceWin.h"
// define 1 to open console ui and setup windows system menu, 0 to disable
#include "ide-support/CodeIDESupport.h"
#if (CC_CODE_IDE_DEBUG_SUPPORT > 0)
#define SIMULATOR_WITH_CONSOLE_AND_MENU 1
#else
#define SIMULATOR_WITH_CONSOLE_AND_MENU 0
#endif
USING_NS_CC;
static WNDPROC g_oldWindowProc = NULL;
@ -243,6 +251,7 @@ int SimulatorWin::run()
_app = new AppDelegate();
RuntimeEngine::getInstance()->setProjectConfig(_project);
#if (SIMULATOR_WITH_CONSOLE_AND_MENU > 0)
// create console window
if (_project.isShowConsole())
{
@ -262,6 +271,7 @@ int SimulatorWin::run()
}
}
}
#endif
// log file
if (_project.isWriteDebugLogToFile())
@ -356,9 +366,11 @@ int SimulatorWin::run()
// path for looking Lang file, Studio Default images
FileUtils::getInstance()->addSearchPath(getApplicationPath().c_str());
#if SIMULATOR_WITH_CONSOLE_AND_MENU > 0
// init player services
setupUI();
DrawMenuBar(_hwnd);
#endif
// prepare
FileUtils::getInstance()->setPopupNotify(false);
@ -367,11 +379,6 @@ int SimulatorWin::run()
g_oldWindowProc = (WNDPROC)SetWindowLong(_hwnd, GWL_WNDPROC, (LONG)SimulatorWin::windowProc);
// 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);
// startup message loop
return app->run();
}
@ -442,6 +449,10 @@ void SimulatorWin::setupUI()
scaleMenuVector.push_back(scale50Menu);
scaleMenuVector.push_back(scale25Menu);
// About
menuBar->addItem("HELP_MENU", tr("Help"));
menuBar->addItem("ABOUT_MENUITEM", tr("About"), "HELP_MENU");
menuBar->addItem("REFRESH_MENU_SEP", "-", "VIEW_MENU");
menuBar->addItem("REFRESH_MENU", tr("Refresh"), "VIEW_MENU");
@ -527,6 +538,11 @@ void SimulatorWin::setupUI()
project.changeFrameOrientationToLandscape();
_instance->openProjectWithProjectConfig(project);
}
else if (data == "ABOUT_MENUITEM")
{
onHelpAbout();
}
}
}
}
@ -725,6 +741,7 @@ LRESULT CALLBACK SimulatorWin::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
switch (uMsg)
{
case WM_SYSCOMMAND:
case WM_COMMAND:
{
if (HIWORD(wParam) == 0)
@ -754,10 +771,12 @@ LRESULT CALLBACK SimulatorWin::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
}
case WM_KEYDOWN:
{
#if (SIMULATOR_WITH_CONSOLE_AND_MENU > 0)
if (wParam == VK_F5)
{
_instance->relaunch();
}
#endif
break;
}

View File

@ -3,10 +3,9 @@
// Used by game.rc
//
#define IDS_PROJNAME 100
#define IDR_TESTLUA 100
#define IDR_MENU_COCOS 201
#define IDR_MENU_COCOS 200
#define IDD_DIALOG1 202
#define IDD_DIALOG_ABOUT 202
#define IDD_DIALOG_ABOUT 203
#define IDC_EDIT2 1001
#define ID_VIEW_SIZE 30001
#define ID_FILE_NEW_WINDOW 32771

View File

@ -0,0 +1,4 @@
{
"has_native": true,
"project_type": "lua"
}

13
tools/simulator/.project Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Simulator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>org.ccdt.cocosproject</nature>
<nature>org.eclipse.koneki.ldt.nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
{
"init_cfg":{
"isLandscape": true,
"isWindowTop": false,
"name": "simulator",
"width": 960,
"height": 640,
"entry": "",
"consolePort": 6050,
"uploadPort": 6060
}
}

View File

@ -0,0 +1,82 @@
#include "AppDelegate.h"
#include "CCLuaEngine.h"
#include "SimpleAudioEngine.h"
#include "cocos2d.h"
#include "ide-support/CodeIDESupport.h"
#include "runtime/Runtime.h"
// Lua
#include "ide-support/RuntimeLuaImpl.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);
runtimeEngine->addRuntime(RuntimeLuaImpl::create(), kRuntimeEngineLua);
auto jsRuntime = RuntimeJsImpl::create();
runtimeEngine->addRuntime(jsRuntime, kRuntimeEngineJs);
runtimeEngine->start();
// js need special debug port
if (runtimeEngine->getProjectConfig().getDebuggerType() != kCCRuntimeDebuggerNone)
{
jsRuntime->startWithDebugger();
}
// 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();
}

View File

@ -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__

View File

@ -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__ */

View File

@ -0,0 +1,299 @@
//
// 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 "js_module_register.h"
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;
JSObject *obj = JS_THIS_OBJECT(cx, vp);
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;
JSObject *obj = JS_THIS_OBJECT(cx, vp);
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<std::string> 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<std::string> originPath; // for IOS platform.
std::vector<std::string> 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, 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();
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<std::string, JSScript*> 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::getInstance()->compileScript(objectfiles[i].GetString());
}
dReplyParse.AddMember("code",0,dReplyParse.GetAllocator());
}
void RuntimeJsImpl::onReload(const rapidjson::Document &dArgParse, rapidjson::Document &dReplyParse)
{
if (dArgParse.HasMember("modulefiles")){
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(objectfiles[i].GetString(),1,dReplyParse.GetAllocator());
}
}
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);
ScriptEngineManager::getInstance()->setScriptEngine(engine);
return ScriptingCore::getInstance()->runScript(filepath.c_str());
}
#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)

View File

@ -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__) */

View File

@ -0,0 +1,341 @@
//
// RuntimeLuaImpl.cpp
// Simulator
//
//
#include "RuntimeLuaImpl.h"
#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
#include <cstdio>
#include <string>
#include "lua_debugger.h"
#include "CCLuaEngine.h"
#include "LuaBasicConversions.h"
#include "lua_module_register.h"
#include "runtime/Runtime.h"
#include "runtime/ConfigParser.h"
#include "runtime/FileServer.h"
extern std::string g_projectPath; // Runtime.cpp
USING_NS_CC;
using namespace std;
static void resetLuaModule(const string& fileName)
{
if (fileName.empty())
{
return;
}
auto engine = LuaEngine::getInstance();
LuaStack* luaStack = engine->getLuaStack();
lua_State* stack = luaStack->getLuaState();
lua_getglobal(stack, "package"); /* L: package */
lua_getfield(stack, -1, "loaded"); /* L: package loaded */
lua_pushnil(stack); /* L: lotable ?-.. nil */
while (0 != lua_next(stack, -2)) /* L: lotable ?-.. key value */
{
//CCLOG("%s - %s \n", tolua_tostring(stack, -2, ""), lua_typename(stack, lua_type(stack, -1)));
std::string key = tolua_tostring(stack, -2, "");
std::string tableKey = key;
size_t found = tableKey.rfind(".lua");
if (found != std::string::npos)
tableKey = tableKey.substr(0, found);
tableKey = replaceAll(tableKey, ".", "/");
tableKey = replaceAll(tableKey, "\\", "/");
tableKey.append(".lua");
found = fileName.rfind(tableKey);
if (0 == found || (found != std::string::npos && fileName.at(found - 1) == '/'))
{
lua_pushstring(stack, key.c_str());
lua_pushnil(stack);
if (lua_istable(stack, -5))
{
lua_settable(stack, -5);
}
}
lua_pop(stack, 1);
}
lua_pop(stack, 2);
}
bool reloadScript(const string& file)
{
auto director = Director::getInstance();
FontFNT::purgeCachedData();
if (director->getOpenGLView())
{
SpriteFrameCache::getInstance()->removeSpriteFrames();
director->getTextureCache()->removeAllTextures();
}
FileUtils::getInstance()->purgeCachedEntries();
string modulefile = file;
if (! modulefile.empty())
{
resetLuaModule(modulefile);
}
else
{
modulefile = ConfigParser::getInstance()->getEntryFile().c_str();
}
auto engine = LuaEngine::getInstance();
LuaStack* luaStack = engine->getLuaStack();
std::string require = "require \'" + modulefile + "\'";
return luaStack->executeString(require.c_str());
}
int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S)
{
int argc = 0;
cocos2d::FileUtils* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_addSearchPath'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1 || argc == 2)
{
std::string arg0;
bool arg1 = false;
ok &= luaval_to_std_string(tolua_S, 2,&arg0);
if (argc == 2)
{
ok &= luaval_to_boolean(tolua_S, 3, &arg1);
}
if(!ok)
return 0;
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(g_projectPath + arg0, arg1);
#endif
}
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "addSearchPath",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FileUtils_addSearchPath'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S)
{
int argc = 0;
cocos2d::FileUtils* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_runtime_setSearchPaths'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::vector<std::string> vecPaths, writePaths;
ok &= luaval_to_std_vector_string(tolua_S, 2, &vecPaths);
if(!ok)
return 0;
std::vector<std::string> originPath; // for IOS platform.
std::vector<std::string> projPath; // for Desktop platform.
for (size_t i = 0; i < vecPaths.size(); i++)
{
if (!FileUtils::getInstance()->isAbsolutePath(vecPaths[i]))
{
originPath.push_back(vecPaths[i]); // for IOS platform.
projPath.push_back(g_projectPath + 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);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSearchPaths",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_runtime_setSearchPaths'.",&tolua_err);
#endif
return 0;
}
static void register_runtime_override_function(lua_State* tolua_S)
{
lua_pushstring(tolua_S, "cc.FileUtils");
lua_rawget(tolua_S, LUA_REGISTRYINDEX);
if (lua_istable(tolua_S,-1)){
tolua_function(tolua_S,"addSearchPath",lua_cocos2dx_runtime_addSearchPath);
tolua_function(tolua_S,"setSearchPaths",lua_cocos2dx_runtime_setSearchPaths);
}
lua_pop(tolua_S, 1);
}
static void luaScriptLoader(std::string strDebugArg)
{
}
////////////////////////////////////////
RuntimeLuaImpl *RuntimeLuaImpl::create()
{
auto instance = new RuntimeLuaImpl();
return instance;
}
void RuntimeLuaImpl::onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse)
{
// Lua
char szDebugArg[1024] = {0};
sprintf(szDebugArg, "require('debugger')(%s,'%s')",dArgParse["debugcfg"].GetString(), "");
startScript(szDebugArg);
dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator());
}
void RuntimeLuaImpl::onReload(const rapidjson::Document &dArgParse, rapidjson::Document &dReplyParse)
{
// lua
if (dArgParse.HasMember("modulefiles"))
{
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(objectfiles[i].GetString(), 1, dReplyParse.GetAllocator());
}
}
if (0 == objectfiles.Size())
{
reloadScript("");
}
dReplyParse.AddMember("body", bodyvalue, dReplyParse.GetAllocator());
}
dReplyParse.AddMember("code", 0, dReplyParse.GetAllocator());
}
void RuntimeLuaImpl::startScript(const std::string& strDebugArg)
{
init();
auto engine = LuaEngine::getInstance();
auto stack = engine->getLuaStack();
const ProjectConfig &project = RuntimeEngine::getInstance()->getProjectConfig();
// set search path
string path = FileUtils::getInstance()->fullPathForFilename(project.getScriptFileRealPath().c_str());
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);
stack->addSearchPath(workdir.c_str());
FileUtils::getInstance()->addSearchPath(workdir);
}
// register lua engine
if (!strDebugArg.empty())
{
// open debugger.lua module
cocos2d::log("debug args = %s", strDebugArg.c_str());
luaopen_lua_debugger(engine->getLuaStack()->getLuaState());
engine->executeString(strDebugArg.c_str());
}
std::string code("require \"");
code.append(ConfigParser::getInstance()->getEntryFile().c_str());
code.append("\"");
engine->executeString(code.c_str());
}
//
// private
//
void RuntimeLuaImpl::init()
{
auto engine = LuaEngine::getInstance();
ScriptEngineManager::getInstance()->setScriptEngine(engine);
lua_module_register(engine->getLuaStack()->getLuaState());
register_runtime_override_function(engine->getLuaStack()->getLuaState());
engine->getLuaStack()->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA"));
}
#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)

View File

@ -0,0 +1,32 @@
//
// RuntimeLuaImpl.h
// Simulator
//
//
#ifndef __Simulator__RuntimeLuaImpl__
#define __Simulator__RuntimeLuaImpl__
#include "CodeIDESupport.h"
#include "cocos2d.h"
#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
#include "runtime/RuntimeProtocol.h"
class RuntimeLuaImpl : public RuntimeProtocol
{
public:
static RuntimeLuaImpl *create();
void onStartDebuger(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
void onReload(const rapidjson::Document& dArgParse, rapidjson::Document& dReplyParse);
void startScript(const std::string& strDebugArg);
private:
void init();
};
#endif // (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)
#endif /* defined(__Simulator__RuntimeLua__) */

View File

@ -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)"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
/* lua_debugger.h.h */
#ifndef __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_
#define __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_
#if __cplusplus
extern "C" {
#endif
#include "lua.h"
void luaopen_lua_debugger(lua_State* L);
/*
int luaopen_lua_m_debugger(lua_State* L);
*/
#if __cplusplus
}
#endif
#endif /* __LUA_MODULES_049C000C96FE547176CCBB7690BA01B6_H_ */

View File

@ -0,0 +1,79 @@
#ifndef __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_REGISTER_H__
#define __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_REGISTER_H__
#include "scripting/js-bindings/manual/ScriptingCore.h"
#include "jsb_cocos2dx_auto.hpp"
#include "jsb_cocos2dx_ui_auto.hpp"
#include "jsb_cocos2dx_studio_auto.hpp"
#include "jsb_cocos2dx_builder_auto.hpp"
#include "jsb_cocos2dx_spine_auto.hpp"
#include "jsb_cocos2dx_extension_auto.hpp"
#include "ui/jsb_cocos2dx_ui_manual.h"
#include "cocostudio/jsb_cocos2dx_studio_manual.h"
#include "cocosbuilder/js_bindings_ccbreader.h"
#include "spine/jsb_cocos2dx_spine_manual.h"
#include "extension/jsb_cocos2dx_extension_manual.h"
#include "localstorage/js_bindings_system_registration.h"
#include "chipmunk/js_bindings_chipmunk_registration.h"
#include "jsb_opengl_registration.h"
#include "network/XMLHTTPRequest.h"
#include "network/jsb_websocket.h"
#include "network/jsb_socketio.h"
#include "cocos2d_specifics.hpp"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "platform/android/CCJavascriptJavaBridge.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#include "platform/ios/JavaScriptObjCBridge.h"
#endif
USING_NS_CC;
int js_module_register()
{
ScriptingCore* sc = ScriptingCore::getInstance();
sc->addRegisterCallback(register_all_cocos2dx);
sc->addRegisterCallback(register_cocos2dx_js_core);
sc->addRegisterCallback(jsb_register_system);
// extension can be commented out to reduce the package
sc->addRegisterCallback(register_all_cocos2dx_extension);
sc->addRegisterCallback(register_all_cocos2dx_extension_manual);
// chipmunk can be commented out to reduce the package
sc->addRegisterCallback(jsb_register_chipmunk);
// opengl can be commented out to reduce the package
sc->addRegisterCallback(JSB_register_opengl);
// builder can be commented out to reduce the package
sc->addRegisterCallback(register_all_cocos2dx_builder);
sc->addRegisterCallback(register_CCBuilderReader);
// ui can be commented out to reduce the package, attension studio need ui module
sc->addRegisterCallback(register_all_cocos2dx_ui);
sc->addRegisterCallback(register_all_cocos2dx_ui_manual);
// studio can be commented out to reduce the package,
sc->addRegisterCallback(register_all_cocos2dx_studio);
sc->addRegisterCallback(register_all_cocos2dx_studio_manual);
// spine can be commented out to reduce the package
sc->addRegisterCallback(register_all_cocos2dx_spine);
sc->addRegisterCallback(register_all_cocos2dx_spine_manual);
// XmlHttpRequest can be commented out to reduce the package
sc->addRegisterCallback(MinXmlHttpRequest::_js_register);
// websocket can be commented out to reduce the package
sc->addRegisterCallback(register_jsb_websocket);
// sokcet io can be commented out to reduce the package
sc->addRegisterCallback(register_jsb_socketio);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
sc->addRegisterCallback(JavascriptJavaBridge::_js_register);
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS|| CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
sc->addRegisterCallback(JavaScriptObjCBridge::_js_register);
#endif
return 1;
}
#endif // __JS_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_JS_MODULE_REGISTER_H__

View File

@ -0,0 +1,31 @@
#ifndef __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__
#define __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__
#include "cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h"
#include "network/lua_cocos2dx_network_manual.h"
#include "cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h"
#include "cocostudio/lua_cocos2dx_coco_studio_manual.hpp"
#include "extension/lua_cocos2dx_extension_manual.h"
#include "ui/lua_cocos2dx_ui_manual.hpp"
#include "spine/lua_cocos2dx_spine_manual.hpp"
#include "3d/lua_cocos2dx_3d_manual.h"
#include "audioengine/lua_cocos2dx_audioengine_manual.h"
#include "lua/quick/lua_cocos2dx_quick_manual.hpp"
int lua_module_register(lua_State* L)
{
//Dont' change the module register order unless you know what your are doing
register_cocosdenshion_module(L);
register_network_module(L);
register_cocosbuilder_module(L);
register_cocostudio_module(L);
register_ui_moudle(L);
register_extension_module(L);
register_spine_module(L);
register_cocos3d_module(L);
register_audioengine_module(L);
return 1;
}
#endif // __LUA_TEMPLATE_RUNTIME_FRAMEWORKS_RUNTIME_SRC_CLASSES_LUA_MODULE_REGISTER_H__

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>simulator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -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

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cocos.apps.simulator"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="9"/>
<uses-feature android:glEsVersion="0x00020000" />
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<!-- Tell Cocos2dxActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="cocos2dlua" />
<activity android:name="org.cocos2dx.lua.AppActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

View File

@ -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

View File

@ -0,0 +1,16 @@
{
"ndk_module_path" :[
"../../../../../",
"../../../../../cocos/",
"../../../../../external",
"../../../../../cocos/scripting"
],
"copy_resources": [
],
"must_copy_resources": [
{
"from": "../../../config.json",
"to": ""
}
]
}

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="simulator" default="debug">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

View File

@ -0,0 +1,38 @@
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 \
$(LOCAL_PATH)/../../../../../../external \
$(LOCAL_PATH)/../../../../../../tools/simulator/libsimulator/lib \
$(LOCAL_PATH)/../../../../../../tools/simulator/libsimulator/lib/protobuf-lite
LOCAL_STATIC_LIBRARIES := cocos2d_lua_static
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/lua-bindings/proj.android)
$(call import-module,scripting/js-bindings/proj.android)
$(call import-module,tools/simulator/libsimulator/proj.android)

View File

@ -0,0 +1,16 @@
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

View File

@ -0,0 +1,35 @@
#include "AppDelegate.h"
#include "cocos2d.h"
#include "platform/android/jni/JniHelper.h"
#include <jni.h>
#include <android/log.h>
#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
}
}

View File

@ -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 *;
#}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">simulator</string>
</resources>

View File

@ -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();
}

View File

@ -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 <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate,UIApplicationDelegate>
{
UIWindow *window;
RootViewController *viewController;
}
@end

View File

@ -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 <UIKit/UIKit.h>
#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

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon-80</string>
<string>Icon-58</string>
<string>Icon-29</string>
<string>Icon-120</string>
<string>Icon-57.png</string>
<string>Icon-114.png</string>
<string>Icon-72.png</string>
<string>Icon-144.png</string>
</array>
<key>CFBundleIconFiles~ipad</key>
<array>
<string>Icon-58</string>
<string>Icon-29</string>
<string>Icon-80</string>
<string>Icon-40</string>
<string>Icon-100</string>
<string>Icon-50</string>
<string>Icon-152</string>
<string>Icon-76</string>
<string>Icon-120</string>
<string>Icon-57.png</string>
<string>Icon-114.png</string>
<string>Icon-72.png</string>
<string>Icon-144.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.cocos.apps.simulator</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>simulator</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.5rc0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20150314</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
</array>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<dict>
<key>accelerometer</key>
<true/>
<key>opengles-1</key>
<true/>
</dict>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
//
// Prefix header for all source files of the 'simulator' target in the 'simulator' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

View File

@ -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 <UIKit/UIKit.h>
@interface RootViewController : UIViewController {
}
- (BOOL)prefersStatusBarHidden;
@end

View File

@ -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

View File

@ -0,0 +1,6 @@
{
"remove_res" : [
"src",
"res"
]
}

View File

@ -0,0 +1,16 @@
//
// main.m
// simulator
//
// Copyright __MyCompanyName__ 2011. All rights reserved.
//
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return retVal;
}

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ConsoleWindowController">
<connections>
<outlet property="checkScroll" destination="50" id="70"/>
<outlet property="textView" destination="6" id="20"/>
<outlet property="topCheckBox" destination="60" id="69"/>
<outlet property="window" destination="1" id="3"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Console" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="40" y="40" width="854" height="400"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="854" height="400"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="-1" y="-1" width="854" height="371"/>
<clipView key="contentView" id="ddW-qo-Qe9">
<rect key="frame" x="1" y="1" width="837" height="369"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" findStyle="panel" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="6">
<rect key="frame" x="0.0" y="0.0" width="837" height="369"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="837" height="369"/>
<size key="maxSize" width="888" height="10000000"/>
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="837" height="369"/>
<size key="maxSize" width="888" height="10000000"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="7">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="8">
<rect key="frame" x="838" y="1" width="15" height="369"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="46">
<rect key="frame" x="-1" y="367" width="73" height="32"/>
<buttonCell key="cell" type="push" title="Clear" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="47">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="onClear:" target="-2" id="57"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="50">
<rect key="frame" x="731" y="376" width="113" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="109" id="56"/>
</constraints>
<buttonCell key="cell" type="check" title="scroll bottom" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="51">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="onScrollChange:" target="-2" id="59"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="60">
<rect key="frame" x="632" y="375" width="95" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="91" id="64"/>
</constraints>
<buttonCell key="cell" type="check" title="always top" bezelStyle="regularSquare" imagePosition="left" inset="2" id="61">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="onTopChange:" target="-2" id="67"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="1" id="41"/>
<constraint firstAttribute="bottom" secondItem="5" secondAttribute="bottom" constant="-1" id="42"/>
<constraint firstItem="5" firstAttribute="top" secondItem="2" secondAttribute="top" constant="30" id="43"/>
<constraint firstItem="5" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="-1" id="44"/>
<constraint firstItem="46" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="5" id="49"/>
<constraint firstItem="50" firstAttribute="baseline" secondItem="46" secondAttribute="baseline" id="52"/>
<constraint firstAttribute="trailing" secondItem="50" secondAttribute="trailing" constant="12" id="53"/>
<constraint firstItem="5" firstAttribute="top" secondItem="50" secondAttribute="bottom" constant="8" symbolic="YES" id="54"/>
<constraint firstItem="60" firstAttribute="centerY" secondItem="46" secondAttribute="centerY" id="63"/>
<constraint firstItem="50" firstAttribute="leading" secondItem="60" secondAttribute="trailing" constant="8" symbolic="YES" id="66"/>
</constraints>
</view>
<connections>
<outlet property="delegate" destination="-2" id="4"/>
</connections>
</window>
</objects>
</document>

View File

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="AppController">
<connections>
<outlet property="delegate" destination="536" id="537"/>
<outlet property="menu" destination="29" id="650"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="Simulator" id="56">
<menu key="submenu" title="Simulator" systemMenu="apple" id="57">
<items>
<menuItem title="About simulator" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="236">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
<menuItem isSeparatorItem="YES" id="143">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Services" id="131">
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide simulator" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="145">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="368"/>
</connections>
</menuItem>
<menuItem title="Show All" id="150">
<connections>
<action selector="unhideAllApplications:" target="-1" id="370"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit simulator" keyEquivalent="q" id="136">
<connections>
<action selector="onFileClose:" target="-1" id="UyZ-bV-2zL"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="Sqe-GR-erP">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="k0V-hR-upN">
<items>
<menuItem title="Undo" keyEquivalent="z" id="Ueo-Yj-fzm">
<connections>
<action selector="undo:" target="-1" id="Ex2-6U-hZI"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="x6z-iQ-VK2">
<connections>
<action selector="redo:" target="-1" id="KEx-Aj-tYn"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="COi-E7-7M4"/>
<menuItem title="Cut" keyEquivalent="x" id="NAk-12-pg4">
<connections>
<action selector="cut:" target="-1" id="Owu-Ie-Kfg"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="XOY-ya-lNt">
<connections>
<action selector="copy:" target="-1" id="aIB-pV-N2w"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="ul0-51-Ibd">
<connections>
<action selector="paste:" target="-1" id="7rk-Tb-7hI"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="Zvy-7g-x4q">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="oM4-kj-hTQ"/>
</connections>
</menuItem>
<menuItem title="Delete" id="Xyz-QC-wlG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="idJ-aN-6bB"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="4fT-JL-N6e">
<connections>
<action selector="selectAll:" target="-1" id="pAH-rW-PaD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="osB-R6-2jE"/>
<menuItem title="Find" id="bms-8x-7Yb">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="AXr-4L-lcV">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="GS8-y9-yQY">
<connections>
<action selector="performFindPanelAction:" target="-1" id="jVT-dG-Frl"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="RJc-P7-Ibq">
<connections>
<action selector="performFindPanelAction:" target="-1" id="yLp-2a-Nuk"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="f5k-Su-hK0">
<connections>
<action selector="performFindPanelAction:" target="-1" id="uoF-9Z-ef7"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="9Zj-Be-aBN">
<connections>
<action selector="performFindPanelAction:" target="-1" id="8hs-AK-0U8"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="4tD-ef-pd8">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="8xc-J0-7iQ"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83"/>
<menuItem title="Player" id="633">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Screen" id="295"/>
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="XuB-dT-g0h">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="YrK-j5-jxq">
<connections>
<action selector="performMiniaturize:" target="-1" id="3wr-0O-cTq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="0NY-jh-tsl">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Bring All to Front" id="opb-EX-EXV">
<connections>
<action selector="arrangeInFront:" target="-1" id="oT1-07-BON"/>
</connections>
</menuItem>
<menuItem title="Always On Top" keyEquivalent="a" id="nXh-Uq-d6d">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="onWindowAlwaysOnTop:" target="-1" id="IM6-Km-MGj"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="490">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="UaO-03-xh1">
<items>
<menuItem title="simulator Help" keyEquivalent="?" id="StN-Og-Ms8">
<connections>
<action selector="showHelp:" target="-1" id="l0h-I0-XAk"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<customObject id="420" customClass="NSFontManager"/>
<customObject id="536" customClass="AppController">
<connections>
<outlet property="menu" destination="29" id="550"/>
</connections>
</customObject>
</objects>
</document>

View File

@ -0,0 +1,23 @@
#import <Cocoa/Cocoa.h>
@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

View File

@ -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

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Folder</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>folder</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>csd</string>
<string>csb</string>
</array>
<key>CFBundleTypeName</key>
<string>Cocos Studio Project</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>com.cocos.apps.simulator</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Cocos Simulator</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20150314</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -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 <string>
#import <Cocoa/Cocoa.h>
#import "ConsoleWindowController.h"
#include "ProjectConfig/ProjectConfig.h"
#include "ProjectConfig/SimulatorConfig.h"
#include "AppDelegate.h"
@interface AppController : NSObject <NSApplicationDelegate, NSWindowDelegate, NSFileManagerDelegate>
{
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

View File

@ -0,0 +1,684 @@
/****************************************************************************
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 <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
#include <string>
#include <vector>
#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
{
_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<string> 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<string> 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
FileUtils::getInstance()->setDefaultResourceRootPath(tmpConfig.getProjectDir());
// parse config.json
auto parser = ConfigParser::getInstance();
auto configPath = tmpConfig.getProjectDir().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<string> 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();
// 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<player::PlayerMenuItem*> 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<AppEvent*>(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<player::PlayerMenuItem*>(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<AppEvent*>(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];
//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
{
[[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];
}
}
@end

View File

@ -0,0 +1,7 @@
{
"remove_res" : [
"src",
"res",
"config.json"
]
}

View File

@ -0,0 +1,887 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">13D65</string>
<string key="IBDocument.InterfaceBuilderVersion">5056</string>
<string key="IBDocument.AppKitVersion">1265.20</string>
<string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">5056</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSCustomObject</string>
<string>NSMenu</string>
<string>NSMenuItem</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="504381850">
<object class="NSCustomObject" id="421466433">
<string key="NSClassName">AppController</string>
</object>
<object class="NSCustomObject" id="37508903">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="622080690">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSMenu" id="126992598">
<string key="NSTitle">AMainMenu</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="511312888">
<reference key="NSMenu" ref="126992598"/>
<string key="NSTitle">Cocos-player</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<object class="NSCustomResource" key="NSOnImage" id="415077826">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuCheckmark</string>
</object>
<object class="NSCustomResource" key="NSMixedImage" id="266121528">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuMixedState</string>
</object>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="120407948"/>
<object class="NSMenu" key="NSSubmenu" id="120407948">
<string key="NSTitle">Cocos-player</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="556105195">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">About Cocos-player</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="985155827">
<reference key="NSMenu" ref="120407948"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="904425014">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">Services</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="730822112"/>
<object class="NSMenu" key="NSSubmenu" id="730822112">
<string key="NSTitle">Services</string>
<array class="NSMutableArray" key="NSMenuItems"/>
<string key="NSName">_NSServicesMenu</string>
</object>
</object>
<object class="NSMenuItem" id="982249582">
<reference key="NSMenu" ref="120407948"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="880160621">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">Hide Cocos-player</string>
<string key="NSKeyEquiv">h</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="925141027">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">Hide Others</string>
<string key="NSKeyEquiv">h</string>
<int key="NSKeyEquivModMask">1572864</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="1041874958">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">Show All</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="686832216">
<reference key="NSMenu" ref="120407948"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="389366042">
<reference key="NSMenu" ref="120407948"/>
<string key="NSTitle">Quit Cocos-player</string>
<string key="NSKeyEquiv">q</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
</array>
<string key="NSName">_NSAppleMenu</string>
</object>
</object>
<object class="NSMenuItem" id="131023520">
<reference key="NSMenu" ref="126992598"/>
<string key="NSTitle">File</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="775420212"/>
<object class="NSMenu" key="NSSubmenu" id="775420212">
<string key="NSTitle">File</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="908501198">
<reference key="NSMenu" ref="775420212"/>
<string key="NSTitle">Close</string>
<string key="NSKeyEquiv">w</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
</array>
</object>
</object>
<object class="NSMenuItem" id="570079000">
<reference key="NSMenu" ref="126992598"/>
<string key="NSTitle">View</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="449964678"/>
<object class="NSMenu" key="NSSubmenu" id="449964678">
<string key="NSTitle">View</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="280645869">
<reference key="NSMenu" ref="449964678"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="381124347">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Portait</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="243422072">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Landscape</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="109890915">
<reference key="NSMenu" ref="449964678"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="797118978">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Actual (100%)</string>
<string key="NSKeyEquiv">0</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<int key="NSTag">100</int>
</object>
<object class="NSMenuItem" id="794026245">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Zoom Out (75%)</string>
<string key="NSKeyEquiv">6</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<int key="NSTag">75</int>
</object>
<object class="NSMenuItem" id="1065433476">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Zoom Out (50%)</string>
<string key="NSKeyEquiv">5</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<int key="NSTag">50</int>
</object>
<object class="NSMenuItem" id="267605560">
<reference key="NSMenu" ref="449964678"/>
<string key="NSTitle">Zoom Out (25%)</string>
<string key="NSKeyEquiv">4</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<int key="NSTag">25</int>
</object>
</array>
</object>
</object>
<object class="NSMenuItem" id="638304486">
<reference key="NSMenu" ref="126992598"/>
<string key="NSTitle">Control</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="201383158"/>
<object class="NSMenu" key="NSSubmenu" id="201383158">
<string key="NSTitle">Control</string>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="675525235">
<reference key="NSMenu" ref="201383158"/>
<string key="NSTitle">Relaunch</string>
<string key="NSKeyEquiv">r</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
<object class="NSMenuItem" id="834755239">
<reference key="NSMenu" ref="201383158"/>
<string key="NSTitle">Keep Window Top</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
</object>
</array>
</object>
</object>
<object class="NSMenuItem" id="251430468">
<reference key="NSMenu" ref="126992598"/>
<string key="NSTitle">Help</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="415077826"/>
<reference key="NSMixedImage" ref="266121528"/>
<string key="NSAction">submenuAction:</string>
<reference key="NSTarget" ref="119598072"/>
<object class="NSMenu" key="NSSubmenu" id="119598072">
<string key="NSTitle">Help</string>
<array class="NSMutableArray" key="NSMenuItems"/>
<string key="NSName">_NSHelpMenu</string>
</object>
</object>
</array>
<string key="NSName">_NSMainMenu</string>
</object>
<object class="NSCustomObject" id="806429288">
<string key="NSClassName">NSFontManager</string>
</object>
<object class="NSCustomObject" id="234942004">
<string key="NSClassName">AppController</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<bool key="usesAutoincrementingIDs">NO</bool>
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">hide:</string>
<reference key="source" ref="622080690"/>
<reference key="destination" ref="880160621"/>
</object>
<string key="id">SGN-0p-7lH</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">hideOtherApplications:</string>
<reference key="source" ref="622080690"/>
<reference key="destination" ref="925141027"/>
</object>
<string key="id">iJd-Ba-eXG</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">unhideAllApplications:</string>
<reference key="source" ref="622080690"/>
<reference key="destination" ref="1041874958"/>
</object>
<string key="id">DR8-By-ymv</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">terminate:</string>
<reference key="source" ref="622080690"/>
<reference key="destination" ref="389366042"/>
</object>
<string key="id">DyL-yF-GYq</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="421466433"/>
<reference key="destination" ref="234942004"/>
</object>
<string key="id">537</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menu</string>
<reference key="source" ref="421466433"/>
<reference key="destination" ref="126992598"/>
</object>
<string key="id">650</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">orderFrontStandardAboutPanel:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="556105195"/>
</object>
<string key="id">tSA-7z-LPk</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onFileClose:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="908501198"/>
</object>
<string key="id">661</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenPortait:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="381124347"/>
</object>
<string key="id">667</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenLandscape:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="243422072"/>
</object>
<string key="id">647</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenZoomOut:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="797118978"/>
</object>
<string key="id">yUj-fN-Rh7</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenZoomOut:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="794026245"/>
</object>
<string key="id">yps-LZ-egB</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenZoomOut:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="1065433476"/>
</object>
<string key="id">654</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onScreenZoomOut:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="267605560"/>
</object>
<string key="id">DSu-if-D2T</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onRelaunch:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="675525235"/>
</object>
<string key="id">XXg-eJ-YSn</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">onSetTop:</string>
<reference key="source" ref="37508903"/>
<reference key="destination" ref="834755239"/>
</object>
<string key="id">jvv-x1-KeN</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menu</string>
<reference key="source" ref="234942004"/>
<reference key="destination" ref="126992598"/>
</object>
<string key="id">550</string>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<string key="id">0</string>
<array key="object" id="0"/>
<reference key="children" ref="504381850"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<string key="id">-2</string>
<reference key="object" ref="421466433"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<string key="id">-1</string>
<reference key="object" ref="37508903"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<string key="id">-3</string>
<reference key="object" ref="622080690"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<string key="id">29</string>
<reference key="object" ref="126992598"/>
<array class="NSMutableArray" key="children">
<reference ref="511312888"/>
<reference ref="131023520"/>
<reference ref="570079000"/>
<reference ref="638304486"/>
<reference ref="251430468"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<string key="id">GS6-Lb-ftA</string>
<reference key="object" ref="511312888"/>
<array class="NSMutableArray" key="children">
<reference ref="120407948"/>
</array>
<reference key="parent" ref="126992598"/>
</object>
<object class="IBObjectRecord">
<string key="id">YN2-V8-ty0</string>
<reference key="object" ref="120407948"/>
<array class="NSMutableArray" key="children">
<reference ref="556105195"/>
<reference ref="985155827"/>
<reference ref="904425014"/>
<reference ref="982249582"/>
<reference ref="880160621"/>
<reference ref="925141027"/>
<reference ref="1041874958"/>
<reference ref="686832216"/>
<reference ref="389366042"/>
</array>
<reference key="parent" ref="511312888"/>
</object>
<object class="IBObjectRecord">
<string key="id">HhF-Es-coQ</string>
<reference key="object" ref="556105195"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">OzD-Nm-tPt</string>
<reference key="object" ref="985155827"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">TOj-vg-cDm</string>
<reference key="object" ref="904425014"/>
<array class="NSMutableArray" key="children">
<reference ref="730822112"/>
</array>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">e98-We-UX5</string>
<reference key="object" ref="730822112"/>
<reference key="parent" ref="904425014"/>
</object>
<object class="IBObjectRecord">
<string key="id">muN-Hw-eeZ</string>
<reference key="object" ref="982249582"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">sH6-na-PTL</string>
<reference key="object" ref="880160621"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">XG8-CE-veT</string>
<reference key="object" ref="925141027"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">IqD-3v-zQT</string>
<reference key="object" ref="1041874958"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">GU5-eI-OTq</string>
<reference key="object" ref="686832216"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">7Z7-ot-jqY</string>
<reference key="object" ref="389366042"/>
<reference key="parent" ref="120407948"/>
</object>
<object class="IBObjectRecord">
<string key="id">83</string>
<reference key="object" ref="131023520"/>
<array class="NSMutableArray" key="children">
<reference ref="775420212"/>
</array>
<reference key="parent" ref="126992598"/>
</object>
<object class="IBObjectRecord">
<string key="id">81</string>
<reference key="object" ref="775420212"/>
<array class="NSMutableArray" key="children">
<reference ref="908501198"/>
</array>
<reference key="parent" ref="131023520"/>
</object>
<object class="IBObjectRecord">
<string key="id">611</string>
<reference key="object" ref="908501198"/>
<reference key="parent" ref="775420212"/>
</object>
<object class="IBObjectRecord">
<string key="id">295</string>
<reference key="object" ref="570079000"/>
<array class="NSMutableArray" key="children">
<reference ref="449964678"/>
</array>
<reference key="parent" ref="126992598"/>
<string key="objectName">Menu Item - View</string>
</object>
<object class="IBObjectRecord">
<string key="id">296</string>
<reference key="object" ref="449964678"/>
<array class="NSMutableArray" key="children">
<reference ref="280645869"/>
<reference ref="381124347"/>
<reference ref="243422072"/>
<reference ref="109890915"/>
<reference ref="797118978"/>
<reference ref="794026245"/>
<reference ref="1065433476"/>
<reference ref="267605560"/>
</array>
<reference key="parent" ref="570079000"/>
<string key="objectName">Menu - View</string>
</object>
<object class="IBObjectRecord">
<string key="id">579</string>
<reference key="object" ref="280645869"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">592</string>
<reference key="object" ref="381124347"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">593</string>
<reference key="object" ref="243422072"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">594</string>
<reference key="object" ref="109890915"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">595</string>
<reference key="object" ref="797118978"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">pqR-xy-5ip</string>
<reference key="object" ref="794026245"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">596</string>
<reference key="object" ref="1065433476"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">QB8-6D-hAr</string>
<reference key="object" ref="267605560"/>
<reference key="parent" ref="449964678"/>
</object>
<object class="IBObjectRecord">
<string key="id">Heh-SD-KHE</string>
<reference key="object" ref="638304486"/>
<array class="NSMutableArray" key="children">
<reference ref="201383158"/>
</array>
<reference key="parent" ref="126992598"/>
</object>
<object class="IBObjectRecord">
<string key="id">ysx-9J-ekz</string>
<reference key="object" ref="201383158"/>
<array class="NSMutableArray" key="children">
<reference ref="675525235"/>
<reference ref="834755239"/>
</array>
<reference key="parent" ref="638304486"/>
</object>
<object class="IBObjectRecord">
<string key="id">hfu-OP-8X3</string>
<reference key="object" ref="675525235"/>
<reference key="parent" ref="201383158"/>
</object>
<object class="IBObjectRecord">
<string key="id">490</string>
<reference key="object" ref="251430468"/>
<array class="NSMutableArray" key="children">
<reference ref="119598072"/>
</array>
<reference key="parent" ref="126992598"/>
</object>
<object class="IBObjectRecord">
<string key="id">491</string>
<reference key="object" ref="119598072"/>
<reference key="parent" ref="251430468"/>
</object>
<object class="IBObjectRecord">
<string key="id">420</string>
<reference key="object" ref="806429288"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<string key="id">536</string>
<reference key="object" ref="234942004"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<string key="id">CXy-V7-NaY</string>
<reference key="object" ref="834755239"/>
<reference key="parent" ref="201383158"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="-1.showNotes"/>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="-2.showNotes"/>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="-3.showNotes"/>
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="29.showNotes"/>
<string key="295.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="295.showNotes"/>
<string key="296.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="296.showNotes"/>
<string key="420.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="420.showNotes"/>
<string key="490.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="490.showNotes"/>
<string key="491.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="491.showNotes"/>
<string key="536.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="536.showNotes"/>
<string key="579.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="579.showNotes"/>
<string key="592.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="592.showNotes"/>
<string key="593.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="593.showNotes"/>
<string key="594.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="594.showNotes"/>
<string key="595.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="595.showNotes"/>
<string key="596.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="596.showNotes"/>
<string key="611.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="611.showNotes"/>
<string key="7Z7-ot-jqY.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="7Z7-ot-jqY.showNotes"/>
<string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="81.showNotes"/>
<string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="83.showNotes"/>
<string key="CXy-V7-NaY.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="GS6-Lb-ftA.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="GS6-Lb-ftA.showNotes"/>
<string key="GU5-eI-OTq.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="GU5-eI-OTq.showNotes"/>
<string key="Heh-SD-KHE.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="Heh-SD-KHE.showNotes"/>
<string key="HhF-Es-coQ.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="HhF-Es-coQ.showNotes"/>
<string key="IqD-3v-zQT.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="IqD-3v-zQT.showNotes"/>
<string key="OzD-Nm-tPt.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="OzD-Nm-tPt.showNotes"/>
<string key="QB8-6D-hAr.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="QB8-6D-hAr.showNotes"/>
<string key="TOj-vg-cDm.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="TOj-vg-cDm.showNotes"/>
<string key="XG8-CE-veT.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="XG8-CE-veT.showNotes"/>
<string key="YN2-V8-ty0.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="YN2-V8-ty0.showNotes"/>
<string key="e98-We-UX5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="e98-We-UX5.showNotes"/>
<string key="hfu-OP-8X3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="hfu-OP-8X3.showNotes"/>
<string key="muN-Hw-eeZ.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="muN-Hw-eeZ.showNotes"/>
<string key="pqR-xy-5ip.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="pqR-xy-5ip.showNotes"/>
<string key="sH6-na-PTL.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="sH6-na-PTL.showNotes"/>
<string key="ysx-9J-ekz.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="ysx-9J-ekz.showNotes"/>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="onFileClose:">id</string>
<string key="onRelaunch:">id</string>
<string key="onScreenLandscape:">id</string>
<string key="onScreenPortait:">id</string>
<string key="onScreenZoomOut:">id</string>
<string key="onSetTop:">id</string>
<string key="onViewChangeFrameSize:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="onFileClose:">
<string key="name">onFileClose:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onRelaunch:">
<string key="name">onRelaunch:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onScreenLandscape:">
<string key="name">onScreenLandscape:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onScreenPortait:">
<string key="name">onScreenPortait:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onScreenZoomOut:">
<string key="name">onScreenZoomOut:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onSetTop:">
<string key="name">onSetTop:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="onViewChangeFrameSize:">
<string key="name">onViewChangeFrameSize:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">menu</string>
<string key="NS.object.0">NSMenu</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">menu</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">menu</string>
<string key="candidateClassName">NSMenu</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">YES</bool>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<real value="1060" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<real value="1080" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="4600" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NSMenuCheckmark">{11, 11}</string>
<string key="NSMenuMixedState">{10, 3}</string>
</dictionary>
</data>
</archive>

View File

@ -0,0 +1,7 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **)argv);
}

View File

@ -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" = "总在最前方";

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="AppController">
<connections>
<outlet property="delegate" destination="536" id="537"/>
<outlet property="menu" destination="29" id="650"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="模拟器" id="56">
<menu key="submenu" title="模拟器" systemMenu="apple" id="57">
<items>
<menuItem title="关于 模拟器" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="143">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="服务" id="131">
<menu key="submenu" title="服务" systemMenu="services" id="130"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="隐藏 模拟器" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
</menuItem>
<menuItem title="隐藏其他窗口" keyEquivalent="h" id="145">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="368"/>
</connections>
</menuItem>
<menuItem title="全部显示" id="150">
<connections>
<action selector="unhideAllApplications:" target="-1" id="370"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="退出 模拟器" keyEquivalent="q" id="136">
<connections>
<action selector="onFileClose:" target="-1" id="UyZ-bV-2zL"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="编辑" id="Sqe-GR-erP">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="编辑" id="k0V-hR-upN">
<items>
<menuItem title="撤销" keyEquivalent="z" id="Ueo-Yj-fzm">
<connections>
<action selector="undo:" target="-1" id="Ex2-6U-hZI"/>
</connections>
</menuItem>
<menuItem title="重做" keyEquivalent="Z" id="x6z-iQ-VK2">
<connections>
<action selector="redo:" target="-1" id="KEx-Aj-tYn"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="COi-E7-7M4"/>
<menuItem title="剪切" keyEquivalent="x" id="NAk-12-pg4">
<connections>
<action selector="cut:" target="-1" id="Owu-Ie-Kfg"/>
</connections>
</menuItem>
<menuItem title="拷贝" keyEquivalent="c" id="XOY-ya-lNt">
<connections>
<action selector="copy:" target="-1" id="aIB-pV-N2w"/>
</connections>
</menuItem>
<menuItem title="粘贴" keyEquivalent="v" id="ul0-51-Ibd">
<connections>
<action selector="paste:" target="-1" id="7rk-Tb-7hI"/>
</connections>
</menuItem>
<menuItem title="粘贴并匹配样式" keyEquivalent="V" id="Zvy-7g-x4q">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="oM4-kj-hTQ"/>
</connections>
</menuItem>
<menuItem title="删除" id="Xyz-QC-wlG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="idJ-aN-6bB"/>
</connections>
</menuItem>
<menuItem title="选择全部" keyEquivalent="a" id="4fT-JL-N6e">
<connections>
<action selector="selectAll:" target="-1" id="pAH-rW-PaD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="osB-R6-2jE"/>
<menuItem title="查找" id="bms-8x-7Yb">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="查找" id="AXr-4L-lcV">
<items>
<menuItem title="查找" tag="1" keyEquivalent="f" id="GS8-y9-yQY">
<connections>
<action selector="performFindPanelAction:" target="-1" id="jVT-dG-Frl"/>
</connections>
</menuItem>
<menuItem title="查找下一个" tag="2" keyEquivalent="g" id="RJc-P7-Ibq">
<connections>
<action selector="performFindPanelAction:" target="-1" id="yLp-2a-Nuk"/>
</connections>
</menuItem>
<menuItem title="查找上一个" tag="3" keyEquivalent="G" id="f5k-Su-hK0">
<connections>
<action selector="performFindPanelAction:" target="-1" id="uoF-9Z-ef7"/>
</connections>
</menuItem>
<menuItem title="使用查找选择" tag="7" keyEquivalent="e" id="9Zj-Be-aBN">
<connections>
<action selector="performFindPanelAction:" target="-1" id="8hs-AK-0U8"/>
</connections>
</menuItem>
<menuItem title="跳转到选择" keyEquivalent="j" id="4tD-ef-pd8">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="8xc-J0-7iQ"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83"/>
<menuItem title="Player" id="633">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Screen" id="295"/>
<menuItem title="窗口" id="19">
<menu key="submenu" title="窗口" systemMenu="window" id="XuB-dT-g0h">
<items>
<menuItem title="最小化" keyEquivalent="m" id="YrK-j5-jxq">
<connections>
<action selector="performMiniaturize:" target="-1" id="3wr-0O-cTq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="0NY-jh-tsl">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="移到最上层" id="opb-EX-EXV">
<connections>
<action selector="arrangeInFront:" target="-1" id="oT1-07-BON"/>
</connections>
</menuItem>
<menuItem title="置顶" keyEquivalent="a" id="nXh-Uq-d6d">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="onWindowAlwaysOnTop:" target="-1" id="IM6-Km-MGj"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="帮助" id="490">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="帮助" systemMenu="help" id="UaO-03-xh1">
<items>
<menuItem title="帮助文档" keyEquivalent="?" id="StN-Og-Ms8">
<connections>
<action selector="showHelp:" target="-1" id="l0h-I0-XAk"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<customObject id="420" customClass="NSFontManager"/>
<customObject id="536" customClass="AppController">
<connections>
<outlet property="menu" destination="29" id="550"/>
</connections>
</customObject>
</objects>
</document>

File diff suppressed because it is too large Load Diff

View File

@ -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);
};

View File

@ -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": [
]
}

View File

@ -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.5beta0 (20150227)",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

View File

@ -0,0 +1,14 @@
#include "main.h"
#include "SimulatorWin.h"
#include <shellapi.h>
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
auto simulator = SimulatorWin::getInstance();
return simulator->run();
}

View File

@ -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 <windows.h>
#include <tchar.h>
#endif // __WINMAIN_H__

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -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

View File

@ -0,0 +1,67 @@

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
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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}</ProjectGuid>
<ProjectName>simulator</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\cocos\2d\cocos2dx.props" />
<Import Project="..\..\..\..\..\cocos\2d\cocos2d_headers.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\cocos\2d\cocos2dx.props" />
<Import Project="..\..\..\..\..\cocos\2d\cocos2d_headers.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
<IntDir>$(Configuration).win32\</IntDir>
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
<SourcePath>$(SourcePath);</SourcePath>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration).win32\</OutDir>
<IntDir>$(Configuration).win32\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>algorithm</ForcedIncludeFiles>
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcurl_imp.lib;lua51.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ProgramDatabaseFile>$(ProjectDir)../../../runtime/win32/$(TargetName).pdb</ProgramDatabaseFile>
<OutputFile>$(ProjectDir)../../../runtime/win32/$(TargetName)$(TargetExt)</OutputFile>
</Link>
<ResourceCompile>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<HeaderFileName>simulator.h</HeaderFileName>
<InterfaceIdentifierFileName>simulator_i.c</InterfaceIdentifierFileName>
<ProxyFileName>simulator_p.c</ProxyFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<TypeLibraryName>$(IntDir)/simulator.tlb</TypeLibraryName>
<DllDataFileName>
</DllDataFileName>
</Midl>
<PreBuildEvent>
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\Classes\ide-support\lang" "$(OutDir)"
</Command>
<Message>
</Message>
</PreBuildEvent>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<PostBuildEvent>
<Command>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"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(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)</AdditionalIncludeDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<ExceptionHandling>Sync</ExceptionHandling>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PreprocessorDefinitions>COCOS2D_DEBUG=1;WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;GLFW_EXPOSE_NATIVE_WIN32;GLFW_EXPOSE_NATIVE_WGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>algorithm</ForcedIncludeFiles>
<CompileAs>CompileAsCpp</CompileAs>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(OutDir);$(EngineRoot)external\spidermonkey\prebuilt\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcurl_imp.lib;lua51.lib;websockets.lib;mozjs-33.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
</Link>
<ResourceCompile>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<HeaderFileName>simulator.h</HeaderFileName>
<InterfaceIdentifierFileName>simulator_i.c</InterfaceIdentifierFileName>
<ProxyFileName>simulator_p.c</ProxyFileName>
<GenerateStublessProxies>true</GenerateStublessProxies>
<TypeLibraryName>$(IntDir)/simulator.tlb</TypeLibraryName>
<DllDataFileName>
</DllDataFileName>
</Midl>
<PreBuildEvent>
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
xcopy /Y /Q "$(ProjectDir)..\Classes\ide-support\lang" "$(OutDir)"
</Command>
<Message>
</Message>
</PreBuildEvent>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<PostBuildEvent>
<Command>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"
</Command>
</PostBuildEvent>
<Manifest>
<AdditionalManifestFiles>
</AdditionalManifestFiles>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Classes\AppDelegate.h" />
<ClInclude Include="..\Classes\ide-support\CodeIDESupport.h" />
<ClInclude Include="..\Classes\ide-support\lua_debugger.h" />
<ClInclude Include="..\Classes\ide-support\RuntimeJsImpl.h" />
<ClInclude Include="..\Classes\ide-support\RuntimeLuaImpl.h" />
<ClInclude Include="main.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="SimulatorWin.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Classes\AppDelegate.cpp" />
<ClCompile Include="..\Classes\ide-support\lua_debugger.c" />
<ClCompile Include="..\Classes\ide-support\RuntimeJsImpl.cpp" />
<ClCompile Include="..\Classes\ide-support\RuntimeLuaImpl.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="SimulatorWin.cpp" />
<ClCompile Include="stdafx.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="game.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="res\game.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\cocos\scripting\js-bindings\proj.win32\libjscocos2d.vcxproj">
<Project>{39379840-825a-45a0-b363-c09ffef864bd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj">
<Project>{9f2d6ce6-c893-4400-b50c-6db70cc2562f}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\libsimulator\proj.win32\libsimulator.vcxproj">
<Project>{001b324a-bb91-4e83-875c-c92f75c40857}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Classes">
<UniqueIdentifier>{fc5cb953-2953-4968-83b3-39e3ff951754}</UniqueIdentifier>
</Filter>
<Filter Include="win32">
<UniqueIdentifier>{037a9a02-b906-4cc5-ad98-304acd4e25ee}</UniqueIdentifier>
</Filter>
<Filter Include="resource">
<UniqueIdentifier>{2d1d0979-58cd-4ab6-b91c-13650158f1fa}</UniqueIdentifier>
</Filter>
<Filter Include="Classes\ide-support">
<UniqueIdentifier>{9f68f9a7-7069-4c93-94ae-942a0aa910c1}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Classes\AppDelegate.h">
<Filter>Classes</Filter>
</ClInclude>
<ClInclude Include="main.h">
<Filter>win32</Filter>
</ClInclude>
<ClInclude Include="resource.h" />
<ClInclude Include="SimulatorWin.h" />
<ClInclude Include="stdafx.h">
<Filter>win32</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>win32</Filter>
</ClInclude>
<ClInclude Include="..\Classes\ide-support\CodeIDESupport.h">
<Filter>Classes\ide-support</Filter>
</ClInclude>
<ClInclude Include="..\Classes\ide-support\lua_debugger.h">
<Filter>Classes\ide-support</Filter>
</ClInclude>
<ClInclude Include="..\Classes\ide-support\RuntimeJsImpl.h">
<Filter>Classes\ide-support</Filter>
</ClInclude>
<ClInclude Include="..\Classes\ide-support\RuntimeLuaImpl.h">
<Filter>Classes\ide-support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Classes\AppDelegate.cpp">
<Filter>Classes</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>win32</Filter>
</ClCompile>
<ClCompile Include="SimulatorWin.cpp" />
<ClCompile Include="stdafx.cpp">
<Filter>win32</Filter>
</ClCompile>
<ClCompile Include="..\Classes\ide-support\lua_debugger.c">
<Filter>Classes\ide-support</Filter>
</ClCompile>
<ClCompile Include="..\Classes\ide-support\RuntimeLuaImpl.cpp">
<Filter>Classes\ide-support</Filter>
</ClCompile>
<ClCompile Include="..\Classes\ide-support\RuntimeJsImpl.cpp">
<Filter>Classes\ide-support</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="game.rc">
<Filter>resource</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="res\game.ico" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
<LocalDebuggerWorkingDirectory Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WindowsLocalDebugger</DebuggerFlavor>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand>
</PropertyGroup>
</Project>

View File

@ -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

View File

@ -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 <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here

View File

@ -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 <SDKDDKVer.h>

View File

@ -113,7 +113,7 @@ PlayerMenuServiceWin::PlayerMenuServiceWin(HWND hwnd)
_root._commandId = 0;
// hwnd has menu
HMENU menu = GetMenu(hwnd);
HMENU menu = GetSystemMenu(hwnd, FALSE);// GetMenu(hwnd);
if (menu)
{
_root._hmenu = menu;