Merge pull request #3597 from chengstory/#4560

SceneEditorTest He version
This commit is contained in:
James Chen 2013-09-15 20:23:05 -07:00
commit e31c4f008d
13 changed files with 18 additions and 19 deletions

View File

@ -49,12 +49,6 @@ NS_CC_EXT_BEGIN
cocos2d::Node *pNode = NULL;
do {
CC_BREAK_IF(pszFileName == NULL);
std::string strFileName(pszFileName);
if (std::string::npos != strFileName.find_last_of('/'))
{
strFileName = strFileName.substr(0, strFileName.find_last_of('/') + 1);
cocos2d::CCFileUtils::getInstance()->addSearchPath(strFileName.c_str());
}
pData = (char*)(cocos2d::CCFileUtils::getInstance()->getFileData(pszFileName, "r", &size));
CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0);
cs::JsonDictionary *jsonDict = new cs::JsonDictionary();

View File

@ -49,7 +49,8 @@ public:
void purgeSceneReader();
static const char* sceneReaderVersion();
cocos2d::Node* createNodeWithSceneFile(const char *pszFileName);
private:
private:
cocos2d::Node* createObject(cs::JsonDictionary * inputFiles, cocos2d::Node* parent);
void setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict);

View File

@ -37,15 +37,20 @@ bool AppDelegate::applicationDidFinishLaunching()
auto designSize = Size(480, 320);
auto pFileUtils = FileUtils::getInstance();
std::vector<std::string> searchPaths;
if (screenSize.height > 320)
{
auto resourceSize = Size(960, 640);
std::vector<std::string> searchPaths;
searchPaths.push_back("hd");
pFileUtils->setSearchPaths(searchPaths);
searchPaths.push_back("hd/scenetest");
director->setContentScaleFactor(resourceSize.height/designSize.height);
}
else
{
searchPaths.push_back("scenetest");
}
pFileUtils->setSearchPaths(searchPaths);
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);

View File

@ -63,12 +63,6 @@ cocos2d::Node* SceneEditorTestLayer::createGameScene()
return NULL;
}
_curNode = pNode;
//fishes
/*cocos2d::extension::armature::Armature *pBlowFish = getFish(10008, "blowFish");
cocos2d::extension::armature::Armature *pButterFlyFish = getFish(10009, "butterFlyFish");
pBlowFish->getAnimation()->playByIndex(0);
pButterFlyFish->getAnimation()->playByIndex(0);*/
MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SceneEditorTestLayer::toExtensionsMainLayer, this));
itemBack->setColor(Color3B(255, 255, 255));
@ -79,9 +73,6 @@ cocos2d::Node* SceneEditorTestLayer::createGameScene()
pNode->addChild(menuBack);
//ui action
//cocos2d::extension::UIActionManager::shareManager()->PlayActionByName("startMenu_1.json","Animation1");
return pNode;
}

View File

@ -0,0 +1 @@
93072f4e7b1943c7598a53f8796d2baafba4a5ca

View File

@ -0,0 +1 @@
4b2aa3f3fbf2f96bced91d0da0e8fc2f7f863a61

View File

@ -0,0 +1 @@
e22c64c159404622ff93915eb9f01be011001dac

View File

@ -0,0 +1 @@
d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5

View File

@ -0,0 +1 @@
c6b8f5b59f6d563cef4a4eba19985716ff1e1f6e

View File

@ -0,0 +1 @@
db7f2b0850ff959c24ceca59bcae78b1afcb4c80

View File

@ -0,0 +1 @@
9a5e05761c2f6db85e7cd8f3dcf1932b6b6eb2d8

View File

@ -0,0 +1 @@
d9c89ed8831db643cc80a0651e5398e26861bbd0

View File

@ -15,6 +15,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
// create the application instance
AppDelegate app;
EGLView* eglView = new EGLView();
eglView->init("TestCPP",900,640);
eglView->init("TestCPP",960,640);
return Application::getInstance()->run();
}