From 8e60bf65d9f1fe225d62e55d072067a7c128885b Mon Sep 17 00:00:00 2001 From: Rolando Abarca Date: Wed, 2 May 2012 15:50:08 -0700 Subject: [PATCH] more updates to the readme --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 158379d5bd..555c35f12b 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,19 @@ For a sneak peak, you can take a look at what's in the JS directory. ### Before hitting the "Build" button In debug mode, (when there's a `#define DEBUG` somewhere), the javascript code will be read from somewhere else and not from the JS directory -in the app bundle. To make sure this works, modify the absolute path in ScriptingCore: +in the app bundle. To make sure this works, modify the absolute path in `ScriptingCore.cpp`: ```c++ void ScriptingCore::runScript(const char *path) { #ifdef DEBUG - std::string dpath("/Users/rabarca/Desktop/testjs/testjs/"); + std::string dpath("/Users/rabarca/Desktop/testjs/testjs/"); // <~ this is what you want to modify! dpath += path; const char *realPath = dpath.c_str(); #else const char *realPath = CCFileUtils::fullPathFromRelativePath(path); #endif - unsigned char *content = NULL; - size_t contentSize = CCFileUtils::ccLoadFileIntoMemory(realPath, &content); - if (content && contentSize) { - JSBool ok; - jsval rval; - ok = JS_EvaluateScript(this->cx, this->global, (char *)content, contentSize, path, 1, &rval); - if (JSVAL_IS_NULL(rval) || rval == JSVAL_FALSE) { - CCLog("error evaluating script:\n%s", content); - } - free(content); - } + ... } ```