From e08e4ce0f8ec95393b9c3f09fcf61051bae929a4 Mon Sep 17 00:00:00 2001 From: chengstory Date: Fri, 3 Jan 2014 02:21:36 +0800 Subject: [PATCH] fixed #3480 add search paths. --- .../cocostudio/CCSSceneReader.cpp | 4 ++++ samples/Cpp/TestCpp/Classes/AppDelegate.cpp | 21 ++++++++++++++++++- .../CocoStudioSceneTest/SceneEditorTest.cpp | 6 ++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index fa3a80b939..2df5e0b151 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -362,6 +362,10 @@ namespace cocostudio { pAudio->setFile(pPath.c_str()); const bool bLoop = (DICTOOL->getIntValue_json(subDict, "loop") != 0); pAudio->setLoop(bLoop); + if (pComName != NULL) + { + pAudio->setName(pComName); + } gb->addComponent(pAudio); if (pComName != NULL) { diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 3968a54656..7b6abad014 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -45,11 +45,30 @@ bool AppDelegate::applicationDidFinishLaunching() auto resourceSize = Size(960, 640); searchPaths.push_back("hd"); searchPaths.push_back("hd/scenetest"); + searchPaths.push_back("hd/scenetest/ArmatureComponentTest"); + searchPaths.push_back("hd/scenetest/AttributeComponentTest"); + searchPaths.push_back("hd/scenetest/BackgroundComponentTest"); + searchPaths.push_back("hd/scenetest/EffectComponentTest"); + searchPaths.push_back("hd/scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("hd/scenetest/ParticleComponentTest"); + searchPaths.push_back("hd/scenetest/SpriteComponentTest"); + searchPaths.push_back("hd/scenetest/TmxMapComponentTest"); + searchPaths.push_back("hd/scenetest/UIComponentTest"); + searchPaths.push_back("hd/scenetest/TriggerTest"); director->setContentScaleFactor(resourceSize.height/designSize.height); } else { - searchPaths.push_back("scenetest"); + searchPaths.push_back("scenetest/ArmatureComponentTest"); + searchPaths.push_back("scenetest/AttributeComponentTest"); + searchPaths.push_back("scenetest/BackgroundComponentTest"); + searchPaths.push_back("scenetest/EffectComponentTest"); + searchPaths.push_back("scenetest/loadSceneEdtiorFileTest"); + searchPaths.push_back("scenetest/ParticleComponentTest"); + searchPaths.push_back("scenetest/SpriteComponentTest"); + searchPaths.push_back("scenetest/TmxMapComponentTest"); + searchPaths.push_back("scenetest/UIComponentTest"); + searchPaths.push_back("scenetest/TriggerTest"); } pFileUtils->setSearchPaths(searchPaths); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 01306f5ad1..ef842d863d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -245,7 +245,6 @@ cocos2d::Node* loadSceneEdtiorFileTest::createGameScene() { return nullptr; } - ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); return node; } @@ -474,7 +473,7 @@ cocos2d::Node* TmxMapComponentTest::createGameScene() { return nullptr; } - TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("TMXTiledMap")->getNode()); + TMXTiledMap *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("CCTMXTiledMap")->getNode()); ActionInterval *actionTo = SkewTo::create(2, 0.f, 2.f); ActionInterval *rotateTo = RotateTo::create(2, 61.0f); ActionInterval *actionScaleTo = ScaleTo::create(2, -0.44f, 0.47f); @@ -586,7 +585,7 @@ cocos2d::Node* EffectComponentTest::createGameScene() return nullptr; } _node = node; - Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("Armature")->getNode()); + Armature *pAr = static_cast(_node->getChildByTag(10015)->getComponent("CCArmature")->getNode()); pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); return node; } @@ -648,7 +647,6 @@ cocos2d::Node* BackgroundComponentTest::createGameScene() { return nullptr; } - ActionManagerEx::getInstance()->playActionByName("startMenu_1.json","Animation1"); ComAudio *Audio = static_cast(node->getComponent("CCBackgroundAudio")); Audio->playBackgroundMusic();