From 0121943c11a48fb9840ab0afd19ed959acb0da59 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Sat, 14 Sep 2013 16:34:26 +0800 Subject: [PATCH 1/5] 1. Adds SceneEditorTest hd version --- extensions/CocoStudio/Reader/CCSSceneReader.cpp | 6 ------ extensions/CocoStudio/Reader/CCSSceneReader.h | 3 ++- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 1 + .../CocoStudioSceneTest/SceneEditorTest.cpp | 9 --------- .../hd/scenetest/Images/startMenuBG.png.REMOVED.git-id | 1 + .../hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id | 1 + .../Butterflyfish/Butterflyfish0.png.REMOVED.git-id | 1 + .../fishes/blowFish/Blowfish0.png.REMOVED.git-id | 1 + 8 files changed, 7 insertions(+), 16 deletions(-) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.cpp b/extensions/CocoStudio/Reader/CCSSceneReader.cpp index 00f6f2e932..8e4fdd26c0 100644 --- a/extensions/CocoStudio/Reader/CCSSceneReader.cpp +++ b/extensions/CocoStudio/Reader/CCSSceneReader.cpp @@ -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(); diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.h b/extensions/CocoStudio/Reader/CCSSceneReader.h index aa41d1090e..c0c88ae660 100644 --- a/extensions/CocoStudio/Reader/CCSSceneReader.h +++ b/extensions/CocoStudio/Reader/CCSSceneReader.h @@ -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); diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 5b226d028b..b7be15e103 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -43,6 +43,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto resourceSize = Size(960, 640); std::vector searchPaths; searchPaths.push_back("hd"); + searchPaths.push_back("hd/scenetest"); pFileUtils->setSearchPaths(searchPaths); director->setContentScaleFactor(resourceSize.height/designSize.height); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 3478a4ae68..baec3b373d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -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; } diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id new file mode 100644 index 0000000000..500673bd71 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/Images/startMenuBG.png.REMOVED.git-id @@ -0,0 +1 @@ +93072f4e7b1943c7598a53f8796d2baafba4a5ca \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id new file mode 100644 index 0000000000..604b21ac01 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/Misc/music_logo.mp3.REMOVED.git-id @@ -0,0 +1 @@ +4b2aa3f3fbf2f96bced91d0da0e8fc2f7f863a61 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..13d9610346 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/Butterflyfish/Butterflyfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +e22c64c159404622ff93915eb9f01be011001dac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id new file mode 100644 index 0000000000..d35dbb70ac --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/fishes/blowFish/Blowfish0.png.REMOVED.git-id @@ -0,0 +1 @@ +d7d85cd75e382c2dd04ddc34ca1d07e2ffff66d5 \ No newline at end of file From acf97548149e869410fc52d9646da6753e281b62 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Sat, 14 Sep 2013 19:03:15 +0800 Subject: [PATCH 2/5] 1. add supported for 480*320 on scenetest. --- samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index b7be15e103..27e49f919d 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -37,16 +37,20 @@ bool AppDelegate::applicationDidFinishLaunching() auto designSize = Size(480, 320); auto pFileUtils = FileUtils::getInstance(); + std::vector searchPaths; if (screenSize.height > 320) { auto resourceSize = Size(960, 640); - std::vector searchPaths; searchPaths.push_back("hd"); searchPaths.push_back("hd/scenetest"); - pFileUtils->setSearchPaths(searchPaths); director->setContentScaleFactor(resourceSize.height/designSize.height); } + else + { + searchPaths.push_back("scenetest"); + } + pFileUtils->setSearchPaths(searchPaths); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); From 95236e86d94562bc246ac53f07e5ec217868e455 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Sat, 14 Sep 2013 20:49:02 +0800 Subject: [PATCH 3/5] 1. update scenetest version. --- .../startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 1 + .../startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id | 1 + samples/Cpp/TestCpp/proj.win32/main.cpp | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id new file mode 100644 index 0000000000..607f8adcb9 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton01.png.REMOVED.git-id @@ -0,0 +1 @@ +c6b8f5b59f6d563cef4a4eba19985716ff1e1f6e \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id new file mode 100644 index 0000000000..958d03a9c2 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/starMenuButton02.png.REMOVED.git-id @@ -0,0 +1 @@ +db7f2b0850ff959c24ceca59bcae78b1afcb4c80 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id new file mode 100644 index 0000000000..22c8929ad6 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id @@ -0,0 +1 @@ +9a5e05761c2f6db85e7cd8f3dcf1932b6b6eb2d8 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id new file mode 100644 index 0000000000..e303572866 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/scenetest/startMenu/Fish_UI/ui_logo_001-hd.png.REMOVED.git-id @@ -0,0 +1 @@ +d9c89ed8831db643cc80a0651e5398e26861bbd0 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.win32/main.cpp b/samples/Cpp/TestCpp/proj.win32/main.cpp index c7a804c96a..6f99d6ff17 100644 --- a/samples/Cpp/TestCpp/proj.win32/main.cpp +++ b/samples/Cpp/TestCpp/proj.win32/main.cpp @@ -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",480,320); return Application::getInstance()->run(); } From 841ea4cfdd2845d6009196a1a09e400187c4457b Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Sat, 14 Sep 2013 20:52:35 +0800 Subject: [PATCH 4/5] 1. change 480*320 to 960*640. --- samples/Cpp/TestCpp/proj.win32/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Cpp/TestCpp/proj.win32/main.cpp b/samples/Cpp/TestCpp/proj.win32/main.cpp index 6f99d6ff17..26ba4e9292 100644 --- a/samples/Cpp/TestCpp/proj.win32/main.cpp +++ b/samples/Cpp/TestCpp/proj.win32/main.cpp @@ -15,6 +15,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; EGLView* eglView = new EGLView(); - eglView->init("TestCPP",480,320); + eglView->init("TestCPP",960,640); return Application::getInstance()->run(); }