fixed debug

This commit is contained in:
chuanweizhang2013 2014-05-08 16:02:55 +08:00
parent ee4b6ba2bc
commit 8f7cb74dd1
3 changed files with 576 additions and 540 deletions

File diff suppressed because it is too large Load Diff

View File

@ -724,9 +724,23 @@ static void register_runtime_override_function(lua_State* tolua_S)
lua_pop(tolua_S, 1); lua_pop(tolua_S, 1);
} }
bool initRuntime(string& execufile) bool initRuntime(string& entryfile)
{ {
g_entryfile = execufile; #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#ifndef _DEBUG
return false;
#endif
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#ifdef NDEBUG
return false;
#endif
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#ifndef COCOS2D_DEBUG
return false;
#endif
#endif
g_entryfile = entryfile;
vector<string> searchPathArray; vector<string> searchPathArray;
searchPathArray=FileUtils::getInstance()->getSearchPaths(); searchPathArray=FileUtils::getInstance()->getSearchPaths();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
@ -749,6 +763,11 @@ bool initRuntime(string& execufile)
#endif #endif
g_resourcePath=replaceAll(g_resourcePath,"\\","/"); g_resourcePath=replaceAll(g_resourcePath,"\\","/");
if (g_resourcePath.at(g_resourcePath.length()-1) != '/')
{
g_resourcePath.append("/");
}
searchPathArray.insert(searchPathArray.begin(),g_resourcePath); searchPathArray.insert(searchPathArray.begin(),g_resourcePath);
FileUtils::getInstance()->setSearchPaths(searchPathArray); FileUtils::getInstance()->setSearchPaths(searchPathArray);
@ -757,17 +776,17 @@ bool initRuntime(string& execufile)
bool startRuntime() bool startRuntime()
{ {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#ifndef _DEBUG #ifndef _DEBUG
return false; return false;
#endif #endif
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #elif(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#ifdef NDEBUG #ifdef NDEBUG
return false; return false;
#endif #endif
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #elif(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#ifndef COCOS2D_DEBUG #ifndef COCOS2D_DEBUG
return false; return false;
#endif #endif
#endif #endif

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#include <string> #include <string>
using namespace std; using namespace std;
bool initRuntime(string& execufile); bool initRuntime(string& entryfile);
bool startRuntime(); bool startRuntime();
bool reloadScript(const string& modulefile); bool reloadScript(const string& modulefile);