From 644b61e26131394b13307a42ab0827f3755a00c0 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Wed, 25 Jun 2014 11:58:36 +0800 Subject: [PATCH 01/19] 1. add SceneBinary to 2.x --- .../cocostudio/CCComAttribute.cpp | 68 ++- .../editor-support/cocostudio/CCComAudio.cpp | 89 ++-- cocos/editor-support/cocostudio/CCComBase.h | 12 + .../editor-support/cocostudio/CCComRender.cpp | 265 +++++++--- .../cocostudio/CCSSceneReader.cpp | 294 ++++++++++- .../cocostudio/CCSSceneReader.h | 4 + cocos/editor-support/cocostudio/CocoLoader.h | 4 +- .../editor-support/cocostudio/TriggerMng.cpp | 249 +++++++++ cocos/editor-support/cocostudio/TriggerMng.h | 3 + .../editor-support/cocostudio/TriggerObj.cpp | 105 ++++ cocos/editor-support/cocostudio/TriggerObj.h | 3 + .../CocoStudioSceneTest/SceneEditorTest.cpp | 20 +- .../CocoStudioSceneTest/TriggerCode/acts.cpp | 473 +++++++++++++++++- .../CocoStudioSceneTest/TriggerCode/acts.h | 13 +- .../CocoStudioSceneTest/TriggerCode/cons.cpp | 145 ++++++ .../CocoStudioSceneTest/TriggerCode/cons.h | 4 + 16 files changed, 1606 insertions(+), 145 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 2c4311690b..11a52a07c7 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -145,36 +145,60 @@ ComAttribute* ComAttribute::create(void) bool ComAttribute::serialize(void* r) { bool bRet = false; - do + do { - CC_BREAK_IF(r == nullptr); - rapidjson::Value *v = (rapidjson::Value *)r; - const char *className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); - const char *comName = DICTOOL->getStringValue_json(*v, "name"); - if (comName != nullptr) + CC_BREAK_IF(r == NULL); + SerData *pSerData = (SerData *)(r); + const rapidjson::Value *v = pSerData->_rData; + stExpCocoNode *pCocoNode = pSerData->_cocoNode; + const char *pClassName = NULL; + const char *pComName = NULL; + const char *pFile = NULL; + std::string strFilePath; + int nResType = 0; + if (v != NULL) { - setName(comName); + pClassName = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(pClassName == NULL); + pComName = DICTOOL->getStringValue_json(*v, "name"); + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + pFile = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(pFile == NULL); + nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(nResType != 0); + } + else if (pCocoNode != NULL) + { + pClassName = pCocoNode[1].GetValue(); + CC_BREAK_IF(pClassName == NULL); + pComName = pCocoNode[2].GetValue(); + stExpCocoNode *pfileData = pCocoNode[3].GetChildArray(); + CC_BREAK_IF(!pfileData); + pFile = pfileData[0].GetValue(); + CC_BREAK_IF(pFile == NULL); + nResType = atoi(pfileData[2].GetValue()); + CC_BREAK_IF(nResType != 0); + + } + if (pComName != NULL) + { + setName(pComName); } else { - setName(className); + setName(pClassName); } - const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - const char *file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); - std::string filePath; - if (file != nullptr) + if (pFile != NULL) { - filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); + strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); } - int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); - parse(filePath.c_str()); - bRet = true; - } while (0); - + if (parse(strFilePath.c_str())) + { + bRet = true; + } + + }while (0); return bRet; } diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index 8fedf09c0e..7e11dbf8a1 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -69,60 +69,87 @@ void ComAudio::setEnabled(bool b) bool ComAudio::serialize(void* r) { - bool bRet = false; - do + bool bRet = false; + do { - CC_BREAK_IF(r == nullptr); - rapidjson::Value *v = (rapidjson::Value *)r; - const char *className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); - const char *comName = DICTOOL->getStringValue_json(*v, "name"); - if (comName != nullptr) + CC_BREAK_IF(r == NULL); + SerData *pSerData = (SerData *)(r); + const rapidjson::Value *v = pSerData->_rData; + stExpCocoNode *pCocoNode = pSerData->_cocoNode; + const char *pClassName = NULL; + const char *pComName = NULL; + const char *pFile = NULL; + std::string strFilePath; + int nResType = 0; + bool bLoop = false; + if (v != NULL) { - setName(comName); + pClassName = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(pClassName == NULL); + pComName = DICTOOL->getStringValue_json(*v, "name"); + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + pFile = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(pFile == NULL); + nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(nResType != 0); + bLoop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; + } + else if (pCocoNode != NULL) + { + pClassName = pCocoNode[1].GetValue(); + CC_BREAK_IF(pClassName == NULL); + pComName = pCocoNode[2].GetValue(); + stExpCocoNode *pfileData = pCocoNode[4].GetChildArray(); + CC_BREAK_IF(!pfileData); + pFile = pfileData[0].GetValue(); + CC_BREAK_IF(pFile == NULL); + nResType = atoi(pfileData[2].GetValue()); + CC_BREAK_IF(nResType != 0); + bLoop = atoi(pCocoNode[5].GetValue()) != 0? true:false; + bRet = true; + } + if (pComName != NULL) + { + setName(pComName); } else { - setName(className); + setName(pClassName); } - const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - const char *file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == nullptr); - std::string filePath; - if (file != nullptr) + if (pFile != NULL) { - filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); + if (strcmp(pFile, "") == 0) + { + continue; + } + strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); } - int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(resType != 0); - if (strcmp(className, "CCBackgroundAudio") == 0) + if (strcmp(pClassName, "CCBackgroundAudio") == 0) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) // no MP3 support for CC_PLATFORM_WP8 - std::string::size_type pos = filePath.find(".mp3"); - if (pos == filePath.npos) + std::string::size_type pos = strFilePath.find(".mp3"); + if (pos == strFilePath.npos) { continue; } - filePath.replace(pos, filePath.length(), ".wav"); + strFilePath.replace(pos, strFilePath.length(), ".wav"); #endif - preloadBackgroundMusic(filePath.c_str()); - bool loop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; - setLoop(loop); - playBackgroundMusic(filePath.c_str(), loop); + preloadBackgroundMusic(strFilePath.c_str()); + setLoop(bLoop); + playBackgroundMusic(strFilePath.c_str(), bLoop); } - else if(strcmp(className, "CCComAudio") == 0) + else if(strcmp(pClassName, "CCComAudio") == 0) { - preloadEffect(filePath.c_str()); + preloadEffect(strFilePath.c_str()); } else { CC_BREAK_IF(true); } bRet = true; - } while (0); - + }while (0); return bRet; } diff --git a/cocos/editor-support/cocostudio/CCComBase.h b/cocos/editor-support/cocostudio/CCComBase.h index 461a5a4b8e..9467b7381a 100644 --- a/cocos/editor-support/cocostudio/CCComBase.h +++ b/cocos/editor-support/cocostudio/CCComBase.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include #include "DictionaryHelper.h" #include "base/ObjectFactory.h" +#include "CocoLoader.h" #define DECLARE_CLASS_COMPONENT_INFO \ @@ -45,5 +46,16 @@ THE SOFTWARE. #define CREATE_CLASS_COMPONENT_INFO(className) \ cocos2d::ObjectFactory::TInfo(#className, &className::createInstance) +struct SerData +{ + const rapidjson::Value *_rData; + cocostudio::stExpCocoNode *_cocoNode; + SerData() + { + _rData = NULL; + _cocoNode = NULL; + } + +}; #endif diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 2037518eee..474051c704 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -91,107 +91,243 @@ void ComRender::setNode(cocos2d::Node *node) bool ComRender::serialize(void* r) { bool bRet = false; - do - { - CC_BREAK_IF(r == nullptr); - rapidjson::Value *v = (rapidjson::Value *)r; - const char *className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == nullptr); - const char *comName = DICTOOL->getStringValue_json(*v, "name"); - if (comName != nullptr) + do + { + CC_BREAK_IF(r == NULL); + SerData *pSerData = (SerData *)(r); + const rapidjson::Value *v = pSerData->_rData; + stExpCocoNode *pCocoNode = pSerData->_cocoNode; + const char *pClassName = NULL; + const char *pComName = NULL; + const char *pFile = NULL; + const char *pPlist = NULL; + std::string strFilePath; + std::string strPlistPath; + int nResType = 0; + if (v != NULL) { - setName(comName); + pClassName = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(pClassName == NULL); + pComName = DICTOOL->getStringValue_json(*v, "name"); + const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); + CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); + pFile = DICTOOL->getStringValue_json(fileData, "path"); + pPlist = DICTOOL->getStringValue_json(fileData, "plistFile"); + CC_BREAK_IF(pFile == NULL && pPlist == NULL); + nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + } + else if(pCocoNode != NULL) + { + pClassName = pCocoNode[1].GetValue(); + CC_BREAK_IF(pClassName == NULL); + pComName = pCocoNode[2].GetValue(); + stExpCocoNode *pfileData = pCocoNode[4].GetChildArray(); + CC_BREAK_IF(!pfileData); + pFile = pfileData[0].GetValue(); + pPlist = pfileData[1].GetValue(); + CC_BREAK_IF(pFile == NULL && pPlist == NULL); + nResType = atoi(pfileData[2].GetValue()); + } + if (pComName != NULL) + { + setName(pComName); } else { - setName(className); + setName(pClassName); } - const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); - CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - const char *file = DICTOOL->getStringValue_json(fileData, "path"); - const char *plist = DICTOOL->getStringValue_json(fileData, "plistFile"); - CC_BREAK_IF(file == nullptr && plist == nullptr); - std::string filePath; - std::string plistPath; - if (file != nullptr) + + if (pFile != NULL) { - filePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file)); + strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); } - if (plist != nullptr) + if (pPlist != NULL) { - plistPath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(plist)); + strPlistPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pPlist)); } - int resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - if (resType == 0) + if (nResType == 0) { - if (strcmp(className, "CCSprite") == 0 && filePath.find(".png") != std::string::npos) + if (strcmp(pClassName, "CCSprite") == 0 && (strFilePath.find(".png") != strFilePath.npos || strFilePath.find(".pvr.ccz") != strFilePath.npos)) { - _render = Sprite::create(filePath.c_str()); - _render->retain(); + _render = CCSprite::create(strFilePath.c_str()); + _render->retain(); + + bRet = true; } - else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != std::string::npos) + else if(strcmp(pClassName, "CCTMXTiledMap") == 0 && strFilePath.find(".tmx") != strFilePath.npos) { - _render = TMXTiledMap::create(filePath.c_str()); - _render->retain(); + _render = CCTMXTiledMap::create(strFilePath.c_str()); + _render->retain(); + + bRet = true; } - else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != std::string::npos) + else if(strcmp(pClassName, "CCParticleSystemQuad") == 0 && strFilePath.find(".plist") != strFilePath.npos) { - _render = ParticleSystemQuad::create(filePath.c_str()); - _render->setPosition(Vec2(0.0f, 0.0f)); - _render->retain(); + _render = CCParticleSystemQuad::create(strFilePath.c_str()); + _render->setPosition(Point(0.0f, 0.0f)); + _render->retain(); + + bRet = true; } - else if(strcmp(className, "CCArmature") == 0) + else if(strcmp(pClassName, "CCArmature") == 0) { - std::string reDir = filePath; - std::string file_path = ""; - size_t pos = reDir.find_last_of('/'); + std::string file_extension = strFilePath; + size_t pos = strFilePath.find_last_of('.'); if (pos != std::string::npos) { - file_path = reDir.substr(0, pos+1); + file_extension = strFilePath.substr(pos, strFilePath.length()); + std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); } - rapidjson::Document doc; - if(!readJson(filePath.c_str(), doc)) + if (file_extension == ".JSON" || file_extension == ".EXPORTJSON") { - log("read json file[%s] error!\n", filePath.c_str()); - continue; + rapidjson::Document doc; + if(!readJson(strFilePath.c_str(), doc)) + { + log("read json file[%s] error!\n", strFilePath.c_str()); + continue; + } + const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(doc, "armature_data", 0); + const char *name = DICTOOL->getStringValue_json(subData, "name"); + ArmatureDataManager::getInstance()->addArmatureFileInfo(strFilePath.c_str()); + Armature *pAr = Armature::create(name); + _render = pAr; + _render->retain(); + const char *actionName = NULL; + if (pCocoNode != NULL) + { + actionName = pCocoNode[6].GetValue();//DICTOOL->getStringValue_json(*v, "selectedactionname"); + } + else + { + actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); + } + if (actionName != NULL && pAr->getAnimation() != NULL) + { + pAr->getAnimation()->play(actionName); + } + bRet = true; } - const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(doc, "armature_data", 0); - const char *name = DICTOOL->getStringValue_json(subData, "name"); - ArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str()); - Armature *pAr = Armature::create(name); - _render = pAr; - _render->retain(); - const char *actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); - if (actionName != nullptr && pAr->getAnimation() != nullptr) + else if (file_extension == ".CSB") { - pAr->getAnimation()->play(actionName); + ssize_t size = 0; + unsigned char *pBytes = NULL; + std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(strFilePath.c_str()); + pBytes = cocos2d::FileUtils::getInstance()->getFileData(binaryFilePath.c_str(), "rb", &size); + CC_BREAK_IF(pBytes == NULL || strcmp((char*)pBytes, "") == 0); + CocoLoader tCocoLoader; + if (tCocoLoader.ReadCocoBinBuff((char*)pBytes)) + { + stExpCocoNode *tpRootCocoNode = tCocoLoader.GetRootCocoNode(); + rapidjson::Type tType = tpRootCocoNode->GetType(&tCocoLoader); + if (rapidjson::kObjectType == tType) + { + int count = tpRootCocoNode->GetChildNum(); + stExpCocoNode *tpChildArray = tpRootCocoNode->GetChildArray(); + for (int i = 0; i < count; ++i) + { + std::string key = tpChildArray[i].GetName(&tCocoLoader); + const char *str = tpChildArray[i].GetValue(); + if (key.compare("armature_data") == 0) + { + int length = tpChildArray[i].GetChildNum(); + stExpCocoNode *armature_dataArray = tpChildArray[i].GetChildArray(); + if (length < 1) + { + continue; + } + + length = armature_dataArray[0].GetChildNum(); + stExpCocoNode *armature_data = armature_dataArray[0].GetChildArray(); + for (int j = 0; j < length; ++j) + { + std::string key1 = armature_data[j].GetName(&tCocoLoader); + const char *str1 = armature_data[j].GetValue(); + if (key.compare("name") == 0) + { + if (str1 != NULL) + { + ArmatureDataManager::getInstance()->addArmatureFileInfo(strFilePath.c_str()); + Armature *pAr = CCArmature::create(str1); + _render = pAr; + _render->retain(); + const char *actionName = NULL; + if (pCocoNode != NULL) + { + actionName = pCocoNode[6].GetValue(); + } + else + { + actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); + } + if (actionName != NULL && pAr->getAnimation() != NULL) + { + pAr->getAnimation()->play(actionName); + } + bRet = true; + } + } + } + } + } + } + } + else + { + continue; + } } + else + { + continue; + } } - else if(strcmp(className, "GUIComponent") == 0) + else if(strcmp(pClassName, "GUIComponent") == 0) { - cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str()); - _render = widget; - _render->retain(); + std::string file_extension = strFilePath; + size_t pos = strFilePath.find_last_of('.'); + if (pos != std::string::npos) + { + file_extension = strFilePath.substr(pos, strFilePath.length()); + std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); + } + if (file_extension == ".JSON" || file_extension == ".EXPORTJSON") + { + cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(strFilePath.c_str()); + _render = widget; + _render->retain(); + + bRet = true; + } + else if (file_extension == ".CSB") + { + cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromBinaryFile(strFilePath.c_str()); + _render = widget; + _render->retain(); + + bRet = true; + } } else { CC_BREAK_IF(true); } } - else if (resType == 1) + else if (nResType == 1) { - if (strcmp(className, "CCSprite") == 0) + if (strcmp(pClassName, "CCSprite") == 0) { - std::string strPngFile = plistPath; + std::string strPngFile = strPlistPath; std::string::size_type pos = strPngFile.find(".plist"); if (pos == strPngFile.npos) { continue; } strPngFile.replace(pos, strPngFile.length(), ".png"); - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath.c_str(), strPngFile.c_str()); - _render = Sprite::createWithSpriteFrameName(filePath.c_str()); - _render->retain(); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(strPlistPath.c_str(), strPngFile.c_str()); + _render = CCSprite::createWithSpriteFrameName(strFilePath.c_str()); + _render->retain(); + + bRet = true; } else { @@ -202,10 +338,9 @@ bool ComRender::serialize(void* r) { CC_BREAK_IF(true); } - bRet = true; - } while (0); - - return bRet; + } while (0); + + return bRet; } ComRender* ComRender::create(void) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 894d4aa39b..67d1bf890f 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "cocostudio/CocoStudio.h" #include "ui/CocosGUI.h" #include "audio/include/SimpleAudioEngine.h" -#include "base/ObjectFactory.h" +#include "ObjectFactory.h" using namespace cocos2d; using namespace ui; @@ -56,15 +56,120 @@ const char* SceneReader::sceneReaderVersion() cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, AttachComponentType attachComponent /*= AttachComponentType::EMPTY_NODE*/) { - _node = nullptr; - rapidjson::Document jsonDict; - do { - CC_BREAK_IF(!readJson(fileName, jsonDict)); - _node = createObject(jsonDict, nullptr, attachComponent); - TriggerMng::getInstance()->parse(jsonDict); - } while (0); - - return _node; + std::string reDir = fileName; + std::string file_extension = ""; + size_t pos = reDir.find_last_of('.'); + if (pos != std::string::npos) + { + file_extension = reDir.substr(pos, reDir.length()); + std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); + } + if (file_extension == ".JSON") + { + _node = nullptr; + rapidjson::Document jsonDict; + do { + CC_BREAK_IF(!readJson(fileName, jsonDict)); + _node = createObject(jsonDict, nullptr, attachComponent); + TriggerMng::getInstance()->parse(jsonDict); + } while (0); + + return _node; + } + else if(file_extension == ".CSB") + { + ssize_t size = 0; + unsigned char *pBytes = NULL; + do { + std::string binaryFilePath = CCFileUtils::getInstance()->fullPathForFilename(fileName); + pBytes = cocos2d::FileUtils::getInstance()->getFileData(binaryFilePath.c_str(), "rb", &size); + CC_BREAK_IF(pBytes == NULL || strcmp((char*)pBytes, "") == 0); + CocoLoader tCocoLoader; + if (tCocoLoader.ReadCocoBinBuff((char*)pBytes)) + { + stExpCocoNode *tpRootCocoNode = tCocoLoader.GetRootCocoNode(); + rapidjson::Type tType = tpRootCocoNode->GetType(&tCocoLoader); + if (rapidjson::kObjectType == tType) + { + stExpCocoNode *tpChildArray = tpRootCocoNode->GetChildArray(); + CC_BREAK_IF(tpRootCocoNode->GetChildNum() == 0); + _node = Node::create(); + int nCount = 0; + std::vector _vecComs; + ComRender *pRender = NULL; + std::string key = tpChildArray[15].GetName(&tCocoLoader); + if (key == "components") + { + nCount = tpChildArray[15].GetChildNum(); + } + stExpCocoNode *pComponents = tpChildArray[15].GetChildArray(); + SerData *data = new SerData(); + for (int i = 0; i < nCount; i++) + { + stExpCocoNode *subDict = pComponents[i].GetChildArray(); + if (subDict == NULL) + { + continue; + } + std::string key = subDict[1].GetName(&tCocoLoader); + const char *comName = subDict[1].GetValue(); + Component *pCom = NULL; + if (key == "classname" && comName != NULL) + { + pCom = createComponent(comName); + } + CCLOG("classname = %s", comName); + if (pCom != NULL) + { + data->_rData = NULL; + data->_cocoNode = subDict; + if (pCom->serialize(data)) + { + ComRender *pTRender = dynamic_cast(pCom); + if (pTRender != NULL) + { + pRender = pTRender; + } + else + { + _vecComs.push_back(pCom); + } + } + else + { + CC_SAFE_RELEASE_NULL(pCom); + } + } + if(_fnSelector != nullptr) + { + _fnSelector(pCom, (void*)(data)); + } + } + + setPropertyFromJsonDict(&tCocoLoader, tpRootCocoNode, _node); + for (std::vector::iterator iter = _vecComs.begin(); iter != _vecComs.end(); ++iter) + { + _node->addComponent(*iter); + } + + stExpCocoNode *pGameObjects = tpChildArray[11].GetChildArray(); + int length = tpChildArray[11].GetChildNum(); + for (int i = 0; i < length; ++i) + { + createObject(&tCocoLoader, &pGameObjects[i], _node, attachComponent); + } + TriggerMng::getInstance()->parse(&tCocoLoader, tpChildArray); + } + + } + }while (0); + return _node; + } + else + { + log("read file [%s] error!\n", fileName.c_str()); + } + return nullptr; } bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc) @@ -172,9 +277,12 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par } const char *comName = DICTOOL->getStringValue_json(subDict, "classname"); Component *com = this->createComponent(comName); + SerData *data = new SerData(); if (com != nullptr) { - if (com->serialize((void*)(&subDict))) + data->_rData = &subDict; + data->_cocoNode = nullptr; + if (com->serialize(data)) { ComRender *tRender = dynamic_cast(com); if (tRender == nullptr) @@ -187,9 +295,10 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par } } } + CC_SAFE_DELETE(data); if(_fnSelector != nullptr) { - _fnSelector(com, (void*)(&subDict)); + _fnSelector(com, data); } } @@ -234,6 +343,111 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par return nullptr; } + + +cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node* parent, AttachComponentType attachComponent) +{ + const char *className = NULL; + stExpCocoNode *pNodeArray = cocoNode->GetChildArray(); + std::string Key = pNodeArray[1].GetName(cocoLoader); + if (Key == "classname") + { + className = pNodeArray[1].GetValue(); + } + if(strcmp(className, "CCNode") == 0) + { + Node* gb = NULL; + std::vector _vecComs; + ComRender *pRender = NULL; + int count = 0; + std::string key = pNodeArray[13].GetName(cocoLoader); + if (key == "components") + { + count = pNodeArray[13].GetChildNum(); + } + stExpCocoNode *pComponents = pNodeArray[13].GetChildArray(); + SerData *data = new SerData(); + for (int i = 0; i < count; ++i) + { + stExpCocoNode *subDict = pComponents[i].GetChildArray(); + if (subDict == NULL) + { + continue; + } + std::string key = subDict[1].GetName(cocoLoader); + const char *comName = subDict[1].GetValue();//DICTOOL->getStringValue_json(subDict, "classname"); + Component *pCom = nullptr; + if (key == "classname" && comName != nullptr) + { + pCom = createComponent(comName); + } + CCLOG("classname = %s", comName); + if (pCom != NULL) + { + data->_rData = NULL; + data->_cocoNode = subDict; + if (pCom->serialize(data)) + { + ComRender *pTRender = dynamic_cast(pCom); + if (pTRender != NULL) + { + pRender = pTRender; + } + else + { + _vecComs.push_back(pCom); + } + } + else + { + CC_SAFE_RELEASE_NULL(pCom); + } + } + if(_fnSelector != nullptr) + { + _fnSelector(pCom, (void*)(data)); + } + } + CC_SAFE_DELETE(data); + + if (parent != nullptr) + { + if (pRender == nullptr || attachComponent == AttachComponentType::EMPTY_NODE) + { + gb = CCNode::create(); + if (pRender != nullptr) + { + _vecComs.push_back(pRender); + } + } + else + { + gb = pRender->getNode(); + gb->retain(); + pRender->setNode(NULL); + CC_SAFE_RELEASE_NULL(pRender); + } + parent->addChild(gb); + } + setPropertyFromJsonDict(cocoLoader, cocoNode, gb); + for (std::vector::iterator iter = _vecComs.begin(); iter != _vecComs.end(); ++iter) + { + gb->addComponent(*iter); + } + + stExpCocoNode *pGameObjects = pNodeArray[12].GetChildArray(); + if (pGameObjects != NULL) + { + int length = pNodeArray[12].GetChildNum(); + for (int i = 0; i < length; ++i) + { + createObject(cocoLoader, &pGameObjects[i], gb, attachComponent); + } + } + return gb; + } + return nullptr; +} void SceneReader::setTarget(const std::function& selector) { @@ -276,6 +490,62 @@ void SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d: float fRotationZ = DICTOOL->getFloatValue_json(root, "rotation"); node->setRotation(fRotationZ); } + + +void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node *node) +{ + stExpCocoNode *stChildArray = cocoNode->GetChildArray(); + float x = 0.0f, y = 0.0f, fScaleX = 1.0f, fScaleY = 1.0f, fRotationZ = 1.0f; + bool bVisible = false; + int nTag = 0, nZorder = -1; + + for (int i = 0; i < cocoNode->GetChildNum(); ++i) + { + std::string key = stChildArray[i].GetName(cocoLoader); + std::string value = stChildArray[i].GetValue(); + + if (key == "x") + { + x = atof(value.c_str()); + node->setPositionX(x); + } + else if (key == "y") + { + y = atof(value.c_str()); + node->setPositionY(y); + } + else if (key == "visible") + { + bVisible = (bool)atoi(value.c_str()); + node->setVisible(bVisible); + } + else if (key == "objecttag") + { + nTag = atoi(value.c_str()); + node->setTag(nTag); + } + else if (key == "zorder") + { + nZorder = atoi(value.c_str()); + node->setZOrder(nZorder); + } + else if(key == "scalex") + { + fScaleX = atof(value.c_str()); + node->setScaleX(fScaleX); + } + else if(key == "scaley") + { + fScaleY = atof(value.c_str()); + node->setScaleY(fScaleY); + } + else if(key == "rotation") + { + fRotationZ = atof(value.c_str()); + node->setRotation(fRotationZ); + } + } +} SceneReader* SceneReader::getInstance() { diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h index d80fa1b2d5..7d982858b2 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -76,6 +76,10 @@ private: cocos2d::Node* createObject(const rapidjson::Value& dict, cocos2d::Node* parent, AttachComponentType attachComponent); void setPropertyFromJsonDict(const rapidjson::Value& dict, cocos2d::Node *node); bool readJson(const std::string &fileName, rapidjson::Document& doc); + + cocos2d::Node* createObject(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node* parent, AttachComponentType attachComponent); + void setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node *node); + cocos2d::Node* nodeByTag(cocos2d::Node *parent, int tag); private: static SceneReader* s_sharedReader; diff --git a/cocos/editor-support/cocostudio/CocoLoader.h b/cocos/editor-support/cocostudio/CocoLoader.h index 5f59b496ee..d728b0f396 100644 --- a/cocos/editor-support/cocostudio/CocoLoader.h +++ b/cocos/editor-support/cocostudio/CocoLoader.h @@ -96,8 +96,8 @@ public: stExpCocoNode* GetChildArray(); public: - inline void ReBuild(char* cocoNodeAddr,char* pStringMemoryAddr); - void WriteJson(CocoLoader* pCoco, void* pFileName = NULL, int vLayer = 0, bool bEndNode = false, bool bParentNodeIsArray = false); + inline void ReBuild(char* cocoNodeAddr,char* pStringMemoryAddr); + void WriteJson(CocoLoader* pCoco, void* pFileName = NULL, int vLayer = 0, bool bEndNode = false, bool bParentNodeIsArray = false); }; diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index 833cf73ee4..2111a57e2e 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -104,6 +104,44 @@ void TriggerMng::parse(const rapidjson::Value &root) } } } + + +void TriggerMng::parse(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + CCLOG("%s", triggerMngVersion()); + + int count = pCocoNode[13].GetChildNum(); + stExpCocoNode *pTriggersArray = pCocoNode[13].GetChildArray(); + +#if CC_ENABLE_SCRIPT_BINDING + ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); + bool useBindings = engine != NULL; + + if (useBindings) + { + if (count > 0 ) + { + rapidjson::Document document; + buildJson(document, pCocoLoader, pCocoNode); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + engine->parseConfig(ScriptEngineProtocol::ConfigType::COCOSTUDIO, buffer.GetString()); + } + } + else +#endif // #if CC_ENABLE_SCRIPT_BINDING + { + for (int i = 0; i < count; ++i) + { + TriggerObj *obj = TriggerObj::create(); + obj->serialize(pCocoLoader, &pTriggersArray[i]); + _triggerObjs.insert(std::pair(obj->getId(), obj)); + obj->retain(); + } + } +} TriggerObj* TriggerMng::getTriggerObj(unsigned int id) const { @@ -152,6 +190,217 @@ bool TriggerMng::isEmpty(void) const return _triggerObjs.empty(); } + + void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int count = pCocoNode[13].GetChildNum(); + int length = 0; + int num = 0; + int size = 0; + int extent = 0; + int border = 0; + std::string key; + stExpCocoNode *pTriggersArray = pCocoNode[13].GetChildArray(); + + document.SetArray(); + + rapidjson::Document::AllocatorType& allocator = document.GetAllocator(); + for (int i = 0; i < count; ++i) + { + rapidjson::Value vElemItem(rapidjson::kObjectType); + + border = pTriggersArray[i].GetChildNum(); + stExpCocoNode *pTriggerArray = pTriggersArray[i].GetChildArray(); + for (int i = 0; i < border; ++i) + { + std::string key = pTriggerArray[i].GetName(pCocoLoader); + const char *str = pTriggerArray[i].GetValue(); + rapidjson::Type type = pTriggerArray[i].GetType(pCocoLoader); + + if (key.compare("actions") == 0) + { + rapidjson::Value actionsItem(rapidjson::kArrayType); + + length = pTriggerArray[i].GetChildNum(); + stExpCocoNode *pActionsArray = pTriggerArray[i].GetChildArray(); + for (int i = 0; i < length; ++i) + { + rapidjson::Value action(rapidjson::kObjectType); + + num = pActionsArray[i].GetChildNum(); + stExpCocoNode *pActionArray = pActionsArray[i].GetChildArray(); + for (int i = 0; i < num; ++i) + { + std::string key = pActionArray[i].GetName(pCocoLoader); + const char *str = pActionArray[i].GetValue(); + if (key.compare("classname") == 0) + { + if (str != NULL) + { + action.AddMember("classname", str, allocator); + } + } + else if (key.compare("dataitems") == 0) + { + rapidjson::Value dataitems(rapidjson::kArrayType); + size = pActionArray[i].GetChildNum(); + stExpCocoNode *pDataItemsArray = pActionArray[i].GetChildArray(); + for (int i = 0; i < size; ++i) + { + rapidjson::Value dataitem(rapidjson::kObjectType); + extent = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + for (int i = 0; i < extent; ++i) + { + std::string key = pDataItemArray[i].GetName(pCocoLoader); + const char *str = pDataItemArray[i].GetValue(); + if (key.compare("key") == 0) + { + if (str != NULL) + { + dataitem.AddMember("key", str, allocator); + } + } + else + { + rapidjson::Type type = pDataItemArray[i].GetType(pCocoLoader); + if (type == rapidjson::kStringType) + { + dataitem.AddMember("value", str, allocator); + } + else if(type == rapidjson::kNumberType) + { + int nV = atoi(str); + float fV = atof(str); + if (fabs(nV - fV) < 0.0000001) + { + dataitem.AddMember("value", nV, allocator); + } + else + { + dataitem.AddMember("value", fV, allocator); + } + } + } + } + dataitems.PushBack(dataitem, allocator); + } + action.AddMember("dataitems", dataitems, allocator); + } + } + actionsItem.PushBack(action, allocator); + } + + vElemItem.AddMember("actions", actionsItem, allocator); + } + else if (key.compare("conditions") == 0) + { + rapidjson::Value condsItem(rapidjson::kArrayType); + + length = pTriggerArray[i].GetChildNum(); + stExpCocoNode *pConditionsArray = pTriggerArray[i].GetChildArray(); + for (int i = 0; i < length; ++i) + { + rapidjson::Value cond(rapidjson::kObjectType); + + num = pConditionsArray[i].GetChildNum(); + stExpCocoNode *pConditionArray = pConditionsArray[i].GetChildArray(); + for (int i = 0; i < num; ++i) + { + std::string key = pConditionArray[i].GetName(pCocoLoader); + const char *str = pConditionArray[i].GetValue(); + if (key.compare("classname") == 0) + { + if (str != NULL) + { + cond.AddMember("classname", str, allocator); + } + } + else if (key.compare("dataitems") == 0) + { + rapidjson::Value dataitems(rapidjson::kArrayType); + size = pConditionArray[i].GetChildNum(); + stExpCocoNode *pDataItemsArray = pConditionArray[i].GetChildArray(); + for (int i = 0; i < size; ++i) + { + rapidjson::Value dataitem(rapidjson::kObjectType); + extent = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + for (int i = 0; i < extent; ++i) + { + std::string key = pDataItemArray[i].GetName(pCocoLoader); + const char *str = pDataItemArray[i].GetValue(); + if (key.compare("key") == 0) + { + if (str != NULL) + { + dataitem.AddMember("key", str, allocator); + } + } + else + { + rapidjson::Type type = pDataItemArray[i].GetType(pCocoLoader); + if (type == rapidjson::kStringType) + { + dataitem.AddMember("value", str, allocator); + } + else if(type == rapidjson::kNumberType) + { + int nV = atoi(str); + float fV = atof(str); + if (fabs(nV - fV) < 0.0000001) + { + dataitem.AddMember("value", nV, allocator); + } + else + { + dataitem.AddMember("value", fV, allocator); + } + } + } + } + dataitems.PushBack(dataitem, allocator); + } + cond.AddMember("dataitems", dataitems, allocator); + } + } + condsItem.PushBack(cond, allocator); + } + + vElemItem.AddMember("conditions", condsItem, allocator); + } + else if (key.compare("events") == 0) + { + rapidjson::Value eventsItem(rapidjson::kArrayType); + + length = pTriggerArray[i].GetChildNum(); + stExpCocoNode *pEventsArray = pTriggerArray[i].GetChildArray(); + for (int i = 0; i < length; ++i) + { + rapidjson::Value event(rapidjson::kObjectType); + stExpCocoNode *pEventArray = pEventsArray->GetChildArray(); + std::string key = pEventArray[0].GetName(pCocoLoader); + const char *str = pEventArray[0].GetValue(); + if (key.compare("id") == 0 && str != NULL) + { + event.AddMember("id", atoi(str), allocator); + eventsItem.PushBack(event, allocator); + } + } + vElemItem.AddMember("events", eventsItem, allocator); + } + else if (key.compare("id") == 0) + { + if (str != NULL) + { + vElemItem.AddMember("id", atoi(str), allocator); + } + } + } + document.PushBack(vElemItem, allocator); + } +} + void TriggerMng::addArmatureMovementCallBack(Armature *pAr, Ref *pTarget, SEL_MovementEventCallFunc mecf) { if (pAr == nullptr || _movementDispatches == nullptr || pTarget == nullptr || mecf == nullptr) diff --git a/cocos/editor-support/cocostudio/TriggerMng.h b/cocos/editor-support/cocostudio/TriggerMng.h index c1e8661a46..afae1d2eb5 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.h +++ b/cocos/editor-support/cocostudio/TriggerMng.h @@ -64,6 +64,7 @@ public: public: void parse(const rapidjson::Value &root); + void parse(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); void removeAll(void); cocos2d::Vector* get(unsigned int event) const; TriggerObj* getTriggerObj(unsigned int id) const; @@ -78,6 +79,8 @@ public: void dispatchEvent(cocos2d::EventCustom* tEvent); void removeEventListener(cocos2d::EventListener* listener); void addEventListenerWithFixedPriority(cocos2d::EventListener* listener, int fixedPriority); +private: + void buildJson(rapidjson::Document &document, cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); private: static TriggerMng *_sharedTriggerMng; diff --git a/cocos/editor-support/cocostudio/TriggerObj.cpp b/cocos/editor-support/cocostudio/TriggerObj.cpp index ad75ea058b..c9ddd6dc35 100755 --- a/cocos/editor-support/cocostudio/TriggerObj.cpp +++ b/cocos/editor-support/cocostudio/TriggerObj.cpp @@ -48,6 +48,11 @@ bool BaseTriggerCondition::detect() void BaseTriggerCondition::serialize(const rapidjson::Value &val) { } + +void BaseTriggerCondition::serialize(cocostudio::CocoLoader *cocoLoader, cocostudio::stExpCocoNode *cocoNode) +{ + +} void BaseTriggerCondition::removeAll() { @@ -75,6 +80,10 @@ void BaseTriggerAction::serialize(const rapidjson::Value &val) { } +void BaseTriggerAction::serialize(cocostudio::CocoLoader *cocoLoader, cocostudio::stExpCocoNode *cocoNode) +{ +} + void BaseTriggerAction::removeAll() { } @@ -231,6 +240,102 @@ void TriggerObj::serialize(const rapidjson::Value &val) } } + + void TriggerObj::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) + { + int length = pCocoNode->GetChildNum(); + int count = 0; + int num = 0; + stExpCocoNode *pTriggerObjArray = pCocoNode->GetChildArray(); + for (int i = 0; i < length; ++i) + { + std::string key = pTriggerObjArray[i].GetName(pCocoLoader); + const char* str = pTriggerObjArray[i].GetValue(); + if (key.compare("id") == 0) + { + if (str != NULL) + { + _id = atoi(str); //(unsigned int)(DICTOOL->getIntValue_json(val, "id")); + } + } + else if (key.compare("conditions") == 0) + { + count = pTriggerObjArray[i].GetChildNum(); + stExpCocoNode *pConditionsArray = pTriggerObjArray[i].GetChildArray(); + for (int i = 0; i < count; ++i) + { + num = pConditionsArray[i].GetChildNum(); + stExpCocoNode *pConditionArray = pConditionsArray[i].GetChildArray(); + const char *classname = pConditionArray[0].GetValue(); + if (classname == NULL) + { + continue; + } + BaseTriggerCondition *con = dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); + CCAssert(con != NULL, "class named classname can not implement!"); + con->serialize(pCocoLoader, &pConditionArray[1]); + con->init(); + _cons.pushBack(con); + } + } + else if (key.compare("actions") == 0) + { + count = pTriggerObjArray[i].GetChildNum(); + stExpCocoNode *pActionsArray = pTriggerObjArray[i].GetChildArray(); + for (int i = 0; i < count; ++i) + { + num = pActionsArray[i].GetChildNum(); + stExpCocoNode *pActionArray = pActionsArray[i].GetChildArray(); + const char *classname = pActionArray[0].GetValue(); + if (classname == NULL) + { + continue; + } + BaseTriggerAction *act = dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); + CCAssert(act != NULL, "class named classname can not implement!"); + act->serialize(pCocoLoader, &pActionArray[1]); + act->init(); + _acts.pushBack(act); + } + } + else if (key.compare("events") == 0) + { + count = pTriggerObjArray[i].GetChildNum(); + stExpCocoNode *pEventsArray = pTriggerObjArray[i].GetChildArray(); + for (int i = 0; i < count; ++i) + { + num = pEventsArray[i].GetChildNum(); + stExpCocoNode *pEventArray = pEventsArray[i].GetChildArray(); + const char *str = pEventArray[0].GetValue(); + if (str == NULL) + { + continue; + } + int event = atoi(str); + if (event < 0) + { + continue; + } + char* buf = new char[10]; + sprintf(buf, "%d", event); + std::string custom_event_name(buf); + CC_SAFE_DELETE_ARRAY(buf); + + EventListenerCustom* listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* evt){ + if (detect()) + { + done(); + } + }); + _listeners.pushBack(listener); + TriggerMng::getInstance()->addEventListenerWithFixedPriority(listener, 1); + } + } + } + } + + + unsigned int TriggerObj::getId() { return _id; diff --git a/cocos/editor-support/cocostudio/TriggerObj.h b/cocos/editor-support/cocostudio/TriggerObj.h index 69a7e4e168..e026cc738a 100755 --- a/cocos/editor-support/cocostudio/TriggerObj.h +++ b/cocos/editor-support/cocostudio/TriggerObj.h @@ -44,6 +44,7 @@ public: virtual bool init(); virtual bool detect(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *cocoLoader, cocostudio::stExpCocoNode *cocoNode); virtual void removeAll(); }; @@ -56,6 +57,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *cocoLoader, cocostudio::stExpCocoNode *cocoNode); virtual void removeAll(); }; @@ -72,6 +74,7 @@ public: virtual void done(); virtual void removeAll(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *cocoLoader, cocostudio::stExpCocoNode *cocoNode); unsigned int getId(); void setEnabled(bool enabled); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 708a58e0ea..44a850f4c9 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -238,7 +238,7 @@ void LoadSceneEdtiorFileTest::onExit() cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/LoadSceneEdtiorFileTest/FishJoy2.csb"); if (node == nullptr) { return nullptr; @@ -283,7 +283,7 @@ void SpriteComponentTest::onExit() cocos2d::Node* SpriteComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/SpriteComponentTest/SpriteComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/SpriteComponentTest/SpriteComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -338,7 +338,7 @@ void ArmatureComponentTest::onExit() cocos2d::Node* ArmatureComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ArmatureComponentTest/ArmatureComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ArmatureComponentTest/ArmatureComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -389,7 +389,7 @@ void UIComponentTest::onExit() cocos2d::Node* UIComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/UIComponentTest/UIComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/UIComponentTest/UIComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -460,7 +460,7 @@ void TmxMapComponentTest::onExit() cocos2d::Node* TmxMapComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TmxMapComponentTest/TmxMapComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TmxMapComponentTest/TmxMapComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -516,7 +516,7 @@ void ParticleComponentTest::onExit() cocos2d::Node* ParticleComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ParticleComponentTest/ParticleComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ParticleComponentTest/ParticleComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -567,7 +567,7 @@ void EffectComponentTest::onExit() cocos2d::Node* EffectComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/EffectComponentTest/EffectComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/EffectComponentTest/EffectComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -629,7 +629,7 @@ void BackgroundComponentTest::onExit() cocos2d::Node* BackgroundComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/BackgroundComponentTest/BackgroundComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/BackgroundComponentTest/BackgroundComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -694,7 +694,7 @@ bool AttributeComponentTest::initData() cocos2d::Node* AttributeComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/AttributeComponentTest/AttributeComponentTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/AttributeComponentTest/AttributeComponentTest.csb"); if (node == nullptr) { return nullptr; @@ -783,7 +783,7 @@ void TriggerTest::gameLogic(float dt) cocos2d::Node* TriggerTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TriggerTest/TriggerTest.json"); + Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TriggerTest/TriggerTest.csb"); if (node == nullptr) { return nullptr; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp index 4e29ed3236..d637c7c9c6 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -65,6 +65,44 @@ void PlayMusic::serialize(const rapidjson::Value &val) } } +void PlayMusic::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "componentName") + { + if (str != NULL) + { + _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); + } + + } + else if (key == "type") + { + if (str != NULL) + { + _type = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + } +} + void PlayMusic::removeAll() { } @@ -127,6 +165,50 @@ void TMoveTo::serialize(const rapidjson::Value &val) } } +void TMoveTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "x") + { + if (str != NULL) + { + _pos.x = atof(str); + } + } + else if (key == "y") + { + if (str != NULL) + { + _pos.y = atoi(str); + } + } + } +} void TMoveTo::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -205,6 +287,57 @@ void TMoveBy::serialize(const rapidjson::Value &val) } } +void TMoveBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "x") + { + if (str != NULL) + { + _pos.x = atof(str); + } + } + else if (key == "y") + { + if (str != NULL) + { + _pos.y = atof(str); + } + } + else if (key == "IsReverse") + { + if (str != NULL) + { + _reverse = atoi(str)!=0?true:false; //DICTOOL->getIntValue_json(subDict, "value") != 0? true: false; + } + } + } +} void TMoveBy::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -267,6 +400,43 @@ void TRotateTo::serialize(const rapidjson::Value &val) } } +void TRotateTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "DeltaAngle") + { + if (str != NULL) + { + _deltaAngle = atof(str); + } + } + } +} void TRotateTo::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -343,6 +513,50 @@ void TRotateBy::serialize(const rapidjson::Value &val) } } +void TRotateBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "DeltaAngle") + { + if (str != NULL) + { + _deltaAngle = atof(str); + } + } + else if (key == "IsReverse") + { + if (str != NULL) + { + _reverse = atoi(str)!=0?true:false; + } + } + } +} void TRotateBy::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -409,6 +623,50 @@ void TScaleTo::serialize(const rapidjson::Value &val) } } +void TScaleTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "ScaleX") + { + if (str != NULL) + { + _scale.x = atof(str); + } + } + else if (key == "ScaleY") + { + if (str != NULL) + { + _scale.y = atof(str); + } + } + } +} void TScaleTo::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -489,6 +747,58 @@ void TScaleBy::serialize(const rapidjson::Value &val) } } +void TScaleBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "ScaleX") + { + if (str != NULL) + { + _scale.x = atof(str); + } + } + else if (key == "ScaleY") + { + if (str != NULL) + { + _scale.y = atof(str); + } + } + else if (key == "IsReverse") + { + if (str != NULL) + { + _reverse = atoi(str)!=0?true:false; //DICTOOL->getIntValue_json(subDict, "value")!= 0? true:false; + } + continue; + } + } +} void TScaleBy::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -555,6 +865,50 @@ void TSkewTo::serialize(const rapidjson::Value &val) } } +void TSkewTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "SkewX") + { + if (str != NULL) + { + _skew.x = atof(str); + } + } + else if (key == "SkewY") + { + if (str != NULL) + { + _skew.y = atof(str); + } + } + } +} void TSkewTo::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -634,6 +988,54 @@ void TSkewBy::serialize(const rapidjson::Value &val) } } +void TSkewBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str); + } + } + else if (key == "Duration") + { + if (str != NULL) + { + _duration = atof(str); + } + + } + else if (key == "SkewX") + { + if (str != NULL) + { + _skew.x = atof(str); + } + } + else if (key == "SkewY") + { + if (str != NULL) + { + _skew.y = atof(str); + } + } + else if (key == "IsReverse") + { + _reverse = atoi(str)!=0?true:false; //DICTOOL->getIntValue_json(subDict, "value")!= 0? true:false; + } + } +} void TSkewBy::removeAll() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); @@ -700,6 +1102,36 @@ void TriggerState::serialize(const rapidjson::Value &val) } } +void TriggerState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "ID") + { + if (str != NULL) + { + _id = atoi(str); + } + } + else if (key == "State") + { + if (str != NULL) + { + _state = atoi(str); + } + } + } +} + void TriggerState::removeAll() { CCLOG("TriggerState::removeAll"); @@ -726,7 +1158,7 @@ void ArmaturePlayAction::done() { Node *node = SceneReader::getInstance()->getNodeByTag(_tag); CC_BREAK_IF(node == nullptr); - ComRender *pRender = (ComRender*)(node->getComponent(_ComName.c_str())); + ComRender *pRender = (ComRender*)(node->getComponent(_comName.c_str())); CC_BREAK_IF(pRender == nullptr); Armature *pAr = (Armature *)(pRender->getNode()); CC_BREAK_IF(pAr == nullptr); @@ -748,7 +1180,7 @@ void ArmaturePlayAction::serialize(const rapidjson::Value &val) } else if (key == "componentName") { - _ComName = DICTOOL->getStringValue_json(subDict, "value"); + _comName = DICTOOL->getStringValue_json(subDict, "value"); continue; } else if (key == "AnimationName") @@ -759,6 +1191,43 @@ void ArmaturePlayAction::serialize(const rapidjson::Value &val) } } +void ArmaturePlayAction::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "componentName") + { + if (str != NULL) + { + _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); + } + + } + else if (key == "AnimationName") + { + if (str != NULL) + { + _aniname = str; //DICTOOL->getStringValue_json(subDict, "value"); + } + } + } +} void ArmaturePlayAction::removeAll() { CCLOG("ArmaturePlayAction::removeAll"); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h index 08ffae0b2a..70b2811601 100755 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h @@ -15,6 +15,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -32,6 +33,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -50,6 +52,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -69,6 +72,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -87,6 +91,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -106,6 +111,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -124,6 +130,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -144,6 +151,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -162,6 +170,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -181,6 +190,7 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _id; @@ -197,10 +207,11 @@ public: virtual bool init(); virtual void done(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; - std::string _ComName; + std::string _comName; std::string _aniname; }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp index e0f402d587..18beb3cae4 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp @@ -47,6 +47,28 @@ void TimeElapsed::serialize(const rapidjson::Value &val) } } +void TimeElapsed::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "TotalTime") + { + if (str != NULL) + { + _totalTime = atof(str); //DICTOOL->getFloatValue_json(subDict, "value"); + } + } + } +} void TimeElapsed::removeAll() { _scheduler->unschedule(schedule_selector(TimeElapsed::update), this); @@ -125,6 +147,50 @@ void ArmatureActionState::serialize(const rapidjson::Value &val) } } +void ArmatureActionState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "componentName") + { + if (str != NULL) + { + _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); + } + + } + else if (key == "AnimationName") + { + if (str != NULL) + { + _aniname = str; //DICTOOL->getStringValue_json(subDict, "value"); + } + } + else if (key == "ActionType") + { + if (str != NULL) + { + _state = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + } +} void ArmatureActionState::removeAll() { do @@ -209,6 +275,56 @@ void NodeInRect::serialize(const rapidjson::Value &val) } } +void NodeInRect::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "originX") + { + if (str != NULL) + { + _origin.x = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "originY") + { + if (str != NULL) + { + _origin.y = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "sizeWidth") + { + if (str != NULL) + { + _size.width = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "sizeHeight") + { + if (str != NULL) + { + _size.height = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); + } + } + } +} void NodeInRect::removeAll() { CCLOG("NodeInRect::removeAll"); @@ -261,6 +377,35 @@ void NodeVisible::serialize(const rapidjson::Value &val) } } +void NodeVisible::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) +{ + int length = pCocoNode->GetChildNum(); + int count = 0; + stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(); + std::string key; + const char *str = NULL; + for (int i = 0; i < length; ++i) + { + count = pDataItemsArray[i].GetChildNum(); + stExpCocoNode *pDataItemArray = pDataItemsArray[i].GetChildArray(); + key = pDataItemArray[0].GetValue(); + str = pDataItemArray[1].GetValue(); + if (key == "Tag") + { + if (str != NULL) + { + _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); + } + } + else if (key == "Visible") + { + if (str != NULL) + { + _visible = atoi(str) != 0? true:false;//DICTOOL->getIntValue_json(subDict, "value") != 0? true:false; + } + } + } +} void NodeVisible::removeAll() { CCLOG("NodeVisible::removeAll"); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h index 6fb23a0195..2b9da0d018 100755 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h @@ -15,6 +15,7 @@ public: virtual bool init(); virtual bool detect(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); virtual void update(float dt); private: @@ -35,6 +36,7 @@ public: virtual bool init(); virtual bool detect(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID); private: @@ -56,6 +58,7 @@ public: virtual bool init(); virtual bool detect(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; @@ -73,6 +76,7 @@ public: virtual bool init(); virtual bool detect(); virtual void serialize(const rapidjson::Value &val); + virtual void serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode); virtual void removeAll(); private: int _tag; From bdf7be6fa07272eafe726682452e6ad7ea3ba710 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Wed, 25 Jun 2014 14:32:38 +0800 Subject: [PATCH 02/19] 1. add classname = "" log. --- .../cocostudio/CCSSceneReader.cpp | 1 + .../CocoStudioSceneTest/SceneEditorTest.cpp | 260 ++++++++++++------ .../CocoStudioSceneTest/SceneEditorTest.h | 36 ++- 3 files changed, 208 insertions(+), 89 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 67d1bf890f..f278c4ec68 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -277,6 +277,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par } const char *comName = DICTOOL->getStringValue_json(subDict, "classname"); Component *com = this->createComponent(comName); + CCLOG("classname = %s", comName); SerData *data = new SerData(); if (com != nullptr) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 44a850f4c9..3cf80dbca4 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -106,7 +106,7 @@ void SceneEditorTestScene::MainMenuCallback(Ref *pSender) removeAllChildren(); } - +const char* SceneEditorTestLayer::m_loadtypeStr[2] = {"change to load \nwith binary file","change to load \nwith json file"}; void SceneEditorTestLayer::onEnter() { CCLayer::onEnter(); @@ -127,6 +127,13 @@ void SceneEditorTestLayer::onEnter() addChild(l, 1, 10001); l->setPosition(Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } + m_isCsbLoad = false; + m_loadtypelb = cocos2d::Label::createWithSystemFont(m_loadtypeStr[0], "Arial", 12); + // #endif + MenuItemLabel* itemlb = CCMenuItemLabel::create(m_loadtypelb, CC_CALLBACK_1(SceneEditorTestLayer::changeLoadTypeCallback, this)); + Menu* loadtypemenu = CCMenu::create(itemlb, NULL); + loadtypemenu->setPosition(Point(VisibleRect::rightTop().x -50,VisibleRect::rightTop().y -20)); + addChild(loadtypemenu,100); // add menu backItem = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(SceneEditorTestLayer::backCallback, this) ); @@ -199,6 +206,36 @@ void SceneEditorTestLayer::draw(Renderer *renderer, const Mat4 &transform, uint3 Layer::draw(renderer, transform, flags); } +void SceneEditorTestLayer::changeLoadTypeCallback(cocos2d::Ref *pSender) +{ + m_isCsbLoad = !m_isCsbLoad; + m_loadtypelb->setString(m_loadtypeStr[(int)m_isCsbLoad]); + loadFileChangeHelper(m_filePathName); + + if(m_rootNode != NULL) + { + this->removeChild(m_rootNode); + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) + { + return ; + } + defaultPlay(); + this->addChild(m_rootNode); + } +} + +void SceneEditorTestLayer::loadFileChangeHelper(std::string& filePathName) +{ + std::string::size_type n = filePathName.find_last_of("."); + if(n == std::string::npos) + return; + filePathName = filePathName.substr(0,n); + if(m_isCsbLoad) + filePathName.append(".csb"); + else + filePathName.append(".json"); +} LoadSceneEdtiorFileTest::LoadSceneEdtiorFileTest() { @@ -238,12 +275,19 @@ void LoadSceneEdtiorFileTest::onExit() cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/LoadSceneEdtiorFileTest/FishJoy2.csb"); - if (node == nullptr) + m_filePathName = "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; //default is json + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - return node; + defaultPlay(); + return m_rootNode; +} + +void LoadSceneEdtiorFileTest::defaultPlay() +{ + } SpriteComponentTest::SpriteComponentTest() @@ -283,22 +327,29 @@ void SpriteComponentTest::onExit() cocos2d::Node* SpriteComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/SpriteComponentTest/SpriteComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/SpriteComponentTest/SpriteComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } + defaultPlay(); + + return m_rootNode; +} + + +void SpriteComponentTest::defaultPlay() +{ ActionInterval* action1 = CCBlink::create(2, 10); ActionInterval* action2 = CCBlink::create(2, 5); - ComRender *pSister1 = static_cast(node->getChildByTag(10003)->getComponent("CCSprite")); + ComRender *pSister1 = static_cast(m_rootNode->getChildByTag(10003)->getComponent("CCSprite")); pSister1->getNode()->runAction(action1); - ComRender *pSister2 = static_cast(node->getChildByTag(10004)->getComponent("CCSprite")); + ComRender *pSister2 = static_cast(m_rootNode->getChildByTag(10004)->getComponent("CCSprite")); pSister2->getNode()->runAction(action2); - - return node; } ArmatureComponentTest::ArmatureComponentTest() @@ -338,22 +389,27 @@ void ArmatureComponentTest::onExit() cocos2d::Node* ArmatureComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ArmatureComponentTest/ArmatureComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - ComRender *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("CCArmature")); - pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); + defaultPlay(); + return m_rootNode; +} - ComRender *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("CCArmature")); - pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); +void ArmatureComponentTest::defaultPlay() +{ + ComRender *pBlowFish = static_cast(m_rootNode->getChildByTag(10007)->getComponent("CCArmature")); + pBlowFish->getNode()->runAction(MoveBy::create(10.0f, Point(-1000.0f, 0))); + + ComRender *pButterflyfish = static_cast(m_rootNode->getChildByTag(10008)->getComponent("CCArmature")); + pButterflyfish->getNode()->runAction(MoveBy::create(10.0f, Point(-1000.0f, 0))); - return node; } UIComponentTest::UIComponentTest() -: _node(nullptr) { } @@ -389,20 +445,15 @@ void UIComponentTest::onExit() cocos2d::Node* UIComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/UIComponentTest/UIComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/UIComponentTest/UIComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - _node = node; - - ComRender *render = static_cast(_node->getChildByTag(10025)->getComponent("GUIComponent")); - Widget* widget = static_cast(render->getNode()); - Button* button = static_cast(widget->getChildByName("Button_156")); -// button->addTouchEventListener(this, toucheventselector(UIComponentTest::touchEvent)); - button->addTouchEventListener(CC_CALLBACK_2(UIComponentTest::touchEvent, this)); - - return node; + defaultPlay(); + + return m_rootNode; } void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) @@ -411,10 +462,10 @@ void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) { case ui::Widget::TouchEventType::BEGAN: { - ComRender *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("CCArmature")); + ComRender *pBlowFish = static_cast(m_rootNode->getChildByTag(10010)->getComponent("CCArmature")); pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); - ComRender *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("CCArmature")); + ComRender *pButterflyfish = static_cast(m_rootNode->getChildByTag(10011)->getComponent("CCArmature")); pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); } break; @@ -423,6 +474,15 @@ void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) } } +void UIComponentTest::defaultPlay() +{ + + ComRender *render = static_cast(m_rootNode->getChildByTag(10025)->getComponent("GUIComponent")); + Widget* widget = static_cast(render->getNode()); + Button* button = static_cast(widget->getChildByName("Button_156")); + button->addTouchEventListener(CC_CALLBACK_2(UIComponentTest::touchEvent, this)); +} + TmxMapComponentTest::TmxMapComponentTest() { @@ -460,24 +520,30 @@ void TmxMapComponentTest::onExit() cocos2d::Node* TmxMapComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TmxMapComponentTest/TmxMapComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - ComRender *tmxMap = static_cast(node->getChildByTag(10015)->getComponent("CCTMXTiledMap")); - 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); + defaultPlay(); + return m_rootNode; +} - ActionInterval *actionScaleToBack = ScaleTo::create(2, 1.0f, 1.0f); - ActionInterval *rotateToBack = RotateTo::create(2, 0); - ActionInterval *actionToBack = SkewTo::create(2, 0, 0); +void TmxMapComponentTest::defaultPlay() +{ + ComRender *tmxMap = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCTMXTiledMap")); + ActionInterval *actionTo = CCSkewTo::create(2, 0.f, 2.f); + ActionInterval *rotateTo = CCRotateTo::create(2, 61.0f); + ActionInterval *actionScaleTo = CCScaleTo::create(2, -0.44f, 0.47f); - tmxMap->getNode()->runAction(Sequence::create(actionTo, actionToBack, nullptr)); - tmxMap->getNode()->runAction(Sequence::create(rotateTo, rotateToBack, nullptr)); - tmxMap->getNode()->runAction(Sequence::create(actionScaleTo, actionScaleToBack, nullptr)); - return node; + ActionInterval *actionScaleToBack = CCScaleTo::create(2, 1.0f, 1.0f); + ActionInterval *rotateToBack = CCRotateTo::create(2, 0); + ActionInterval *actionToBack = CCSkewTo::create(2, 0, 0); + + tmxMap->getNode()->runAction(CCSequence::create(actionTo, actionToBack, NULL)); + tmxMap->getNode()->runAction(CCSequence::create(rotateTo, rotateToBack, NULL)); + tmxMap->getNode()->runAction(CCSequence::create(actionScaleTo, actionScaleToBack, NULL)); } ParticleComponentTest::ParticleComponentTest() @@ -516,22 +582,26 @@ void ParticleComponentTest::onExit() cocos2d::Node* ParticleComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/ParticleComponentTest/ParticleComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/ParticleComponentTest/ParticleComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } + defaultPlay(); + return m_rootNode; +} - ComRender* Particle = static_cast(node->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); - ActionInterval* jump = JumpBy::create(5, Vec2(-500,0), 50, 4); - FiniteTimeAction* action = Sequence::create( jump, jump->reverse(), nullptr); +void ParticleComponentTest::defaultPlay() +{ + ComRender* Particle = static_cast(m_rootNode->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); + ActionInterval* jump = CCJumpBy::create(5, Point(-500,0), 50, 4); + FiniteTimeAction* action = CCSequence::create( jump, jump->reverse(), NULL); Particle->getNode()->runAction(action); - return node; } EffectComponentTest::EffectComponentTest() -: _node(nullptr) { } @@ -567,16 +637,14 @@ void EffectComponentTest::onExit() cocos2d::Node* EffectComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/EffectComponentTest/EffectComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/EffectComponentTest/EffectComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - _node = node; - ComRender *render = static_cast(_node->getChildByTag(10015)->getComponent("CCArmature")); - Armature *pAr = static_cast(render->getNode()); - pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - return node; + defaultPlay(); + return m_rootNode; } void EffectComponentTest::animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID) @@ -587,12 +655,19 @@ void EffectComponentTest::animationEvent(Armature *armature, MovementEventType m { if (id.compare("Fire") == 0) { - ComAudio *pAudio = static_cast(_node->getChildByTag(10015)->getComponent("CCComAudio")); + ComAudio *pAudio = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCComAudio")); pAudio->playEffect(); } } } +void EffectComponentTest::defaultPlay() +{ + ComRender *render = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCArmature")); + Armature *pAr = static_cast(render->getNode()); + pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); +} + BackgroundComponentTest::BackgroundComponentTest() { @@ -629,20 +704,24 @@ void BackgroundComponentTest::onExit() cocos2d::Node* BackgroundComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/BackgroundComponentTest/BackgroundComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } + defaultPlay(); + return m_rootNode; +} - ComAudio *Audio = static_cast(node->getComponent("CCBackgroundAudio")); +void BackgroundComponentTest::defaultPlay() +{ + ComAudio *Audio = static_cast(m_rootNode->getComponent("CCBackgroundAudio")); Audio->playBackgroundMusic(); - return node; } AttributeComponentTest::AttributeComponentTest() -: _node(nullptr) { } @@ -663,7 +742,7 @@ void AttributeComponentTest::onEnter() { Node *root = createGameScene(); CC_BREAK_IF(!root); - initData(); + defaultPlay(); this->addChild(root, 0, 1); } while (0); } @@ -682,8 +761,8 @@ bool AttributeComponentTest::initData() bool bRet = false; rapidjson::Document doc; do { - CC_BREAK_IF(_node == nullptr); - ComAttribute *attribute = static_cast(_node->getChildByTag(10015)->getComponent("CCComAttribute")); + CC_BREAK_IF(m_rootNode == nullptr); + ComAttribute *attribute = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCComAttribute")); CC_BREAK_IF(attribute == nullptr); log("Name: %s, HP: %f, MP: %f", attribute->getString("name").c_str(), attribute->getFloat("maxHP"), attribute->getFloat("maxMP")); @@ -694,13 +773,18 @@ bool AttributeComponentTest::initData() cocos2d::Node* AttributeComponentTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/AttributeComponentTest/AttributeComponentTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/AttributeComponentTest/AttributeComponentTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - _node = node; - return node; + return m_rootNode; +} + +void AttributeComponentTest::defaultPlay() +{ + initData(); } TriggerTest::TriggerTest() @@ -783,12 +867,16 @@ void TriggerTest::gameLogic(float dt) cocos2d::Node* TriggerTest::createGameScene() { - Node *node = SceneReader::getInstance()->createNodeWithSceneFile("scenetest/TriggerTest/TriggerTest.csb"); - if (node == nullptr) + m_filePathName = "scenetest/TriggerTest/TriggerTest.json"; + m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); + if (m_rootNode == NULL) { - return nullptr; + return NULL; } - _node = node; - - return node; + + defaultPlay(); + return m_rootNode; +} +void TriggerTest::defaultPlay() +{ } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index b6d68a6593..35344ccca5 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -49,6 +49,20 @@ protected: MenuItemImage *restartItem; MenuItemImage *nextItem; MenuItemImage *backItem; + +protected: + virtual void changeLoadTypeCallback(cocos2d::Ref *pSender); + virtual void defaultPlay() = 0; // must to be overrided + void loadFileChangeHelper(std::string& filePathName ); // switch json& csb + +private: + bool m_isCsbLoad; // default is false + cocos2d::Label* m_loadtypelb; + static const char* m_loadtypeStr[2]; + +protected: + cocos2d::Node* m_rootNode; + std::string m_filePathName; }; class LoadSceneEdtiorFileTest : public SceneEditorTestLayer @@ -61,6 +75,8 @@ public: virtual void onEnter() override; virtual void onExit() override; cocos2d::Node* createGameScene(); +private: + void defaultPlay(); }; @@ -75,6 +91,8 @@ public: virtual void onExit() override; cocos2d::Node* createGameScene(); +private: + void defaultPlay(); }; class ArmatureComponentTest : public SceneEditorTestLayer @@ -88,6 +106,8 @@ public: virtual void onExit() override; cocos2d::Node* createGameScene(); +private: + void defaultPlay(); }; class UIComponentTest : public SceneEditorTestLayer @@ -102,7 +122,7 @@ public: cocos2d::Node* createGameScene(); void touchEvent(cocos2d::Ref *pSender, ui::Widget::TouchEventType type); private: - cocos2d::Node* _node; + void defaultPlay(); }; class TmxMapComponentTest : public SceneEditorTestLayer @@ -115,6 +135,8 @@ public: virtual void onEnter() override; virtual void onExit() override; cocos2d::Node* createGameScene(); +private: + void defaultPlay(); }; @@ -128,6 +150,8 @@ public: virtual void onEnter() override; virtual void onExit() override; cocos2d::Node* createGameScene(); +protected: + void defaultPlay(); }; class EffectComponentTest : public SceneEditorTestLayer @@ -142,7 +166,8 @@ public: cocos2d::Node* createGameScene(); void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID); private: - cocos2d::Node* _node; + void defaultPlay(); + }; class BackgroundComponentTest : public SceneEditorTestLayer @@ -155,6 +180,8 @@ public: virtual void onEnter() override; virtual void onExit() override; cocos2d::Node* createGameScene(); +private: + void defaultPlay(); }; class AttributeComponentTest : public SceneEditorTestLayer @@ -168,8 +195,9 @@ public: virtual void onExit() override; bool initData(); cocos2d::Node* createGameScene(); + private: - cocos2d::Node* _node; + void defaultPlay(); }; class TriggerTest : public SceneEditorTestLayer @@ -197,6 +225,8 @@ public: private: cocos2d::Node *_node; cocos2d::EventListener* _touchListener; +private: + void defaultPlay(); }; #endif // __HELLOWORLD_SCENE_H__ From 98c21f6f5788d622f9101eacde4503aa88f0bb22 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Wed, 25 Jun 2014 18:10:06 +0800 Subject: [PATCH 03/19] 1. remove Hungary style. --- .../cocostudio/CCComAttribute.cpp | 63 +++++---- .../editor-support/cocostudio/CCComAudio.cpp | 84 ++++++------ .../editor-support/cocostudio/CCComRender.cpp | 129 +++++++++--------- 3 files changed, 137 insertions(+), 139 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 11a52a07c7..5aea061c5e 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -148,52 +148,51 @@ bool ComAttribute::serialize(void* r) do { CC_BREAK_IF(r == NULL); - SerData *pSerData = (SerData *)(r); - const rapidjson::Value *v = pSerData->_rData; - stExpCocoNode *pCocoNode = pSerData->_cocoNode; - const char *pClassName = NULL; - const char *pComName = NULL; - const char *pFile = NULL; - std::string strFilePath; - int nResType = 0; + SerData *serData = (SerData *)(r); + const rapidjson::Value *v = serData->_rData; + stExpCocoNode *cocoNode = serData->_cocoNode; + const char *className = NULL; + const char *comName = NULL; + const char *file = NULL; + std::string filePath; + int resType = 0; if (v != NULL) { - pClassName = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(pClassName == NULL); - pComName = DICTOOL->getStringValue_json(*v, "name"); + className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == NULL); + comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - pFile = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(pFile == NULL); - nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(nResType != 0); + file = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(file == NULL); + resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(resType != 0); } - else if (pCocoNode != NULL) + else if (cocoNode != NULL) { - pClassName = pCocoNode[1].GetValue(); - CC_BREAK_IF(pClassName == NULL); - pComName = pCocoNode[2].GetValue(); - stExpCocoNode *pfileData = pCocoNode[3].GetChildArray(); - CC_BREAK_IF(!pfileData); - pFile = pfileData[0].GetValue(); - CC_BREAK_IF(pFile == NULL); - nResType = atoi(pfileData[2].GetValue()); - CC_BREAK_IF(nResType != 0); - + className = cocoNode[1].GetValue(); + CC_BREAK_IF(className == NULL); + comName = cocoNode[2].GetValue(); + stExpCocoNode *fileData = cocoNode[3].GetChildArray(); + CC_BREAK_IF(!fileData); + file = fileData[0].GetValue(); + CC_BREAK_IF(file == NULL); + resType = atoi(fileData[2].GetValue()); + CC_BREAK_IF(resType != 0); } - if (pComName != NULL) + if (comName != NULL) { - setName(pComName); + setName(comName); } else { - setName(pClassName); + setName(className); } - if (pFile != NULL) + if (file != NULL) { - strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); + filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } - if (parse(strFilePath.c_str())) + if (parse(filePath.c_str())) { bRet = true; } diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index 7e11dbf8a1..8632ba4e67 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -73,76 +73,76 @@ bool ComAudio::serialize(void* r) do { CC_BREAK_IF(r == NULL); - SerData *pSerData = (SerData *)(r); - const rapidjson::Value *v = pSerData->_rData; - stExpCocoNode *pCocoNode = pSerData->_cocoNode; - const char *pClassName = NULL; - const char *pComName = NULL; - const char *pFile = NULL; - std::string strFilePath; - int nResType = 0; - bool bLoop = false; + SerData *serData = (SerData *)(r); + const rapidjson::Value *v = serData->_rData; + stExpCocoNode *cocoNode = serData->_cocoNode; + const char *className = NULL; + const char *comName = NULL; + const char *file = NULL; + std::string filePath; + int resType = 0; + bool loop = false; if (v != NULL) { - pClassName = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(pClassName == NULL); - pComName = DICTOOL->getStringValue_json(*v, "name"); + className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == NULL); + comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - pFile = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(pFile == NULL); - nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); - CC_BREAK_IF(nResType != 0); - bLoop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; + file = DICTOOL->getStringValue_json(fileData, "path"); + CC_BREAK_IF(file == NULL); + resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + CC_BREAK_IF(resType != 0); + loop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; } - else if (pCocoNode != NULL) + else if (cocoNode != NULL) { - pClassName = pCocoNode[1].GetValue(); - CC_BREAK_IF(pClassName == NULL); - pComName = pCocoNode[2].GetValue(); - stExpCocoNode *pfileData = pCocoNode[4].GetChildArray(); + className = cocoNode[1].GetValue(); + CC_BREAK_IF(className == NULL); + comName = cocoNode[2].GetValue(); + stExpCocoNode *pfileData = cocoNode[4].GetChildArray(); CC_BREAK_IF(!pfileData); - pFile = pfileData[0].GetValue(); - CC_BREAK_IF(pFile == NULL); - nResType = atoi(pfileData[2].GetValue()); - CC_BREAK_IF(nResType != 0); - bLoop = atoi(pCocoNode[5].GetValue()) != 0? true:false; + file = pfileData[0].GetValue(); + CC_BREAK_IF(file == NULL); + resType = atoi(pfileData[2].GetValue()); + CC_BREAK_IF(resType != 0); + loop = atoi(cocoNode[5].GetValue()) != 0? true:false; bRet = true; } - if (pComName != NULL) + if (comName != NULL) { - setName(pComName); + setName(comName); } else { - setName(pClassName); + setName(className); } - if (pFile != NULL) + if (file != NULL) { - if (strcmp(pFile, "") == 0) + if (strcmp(file, "") == 0) { continue; } - strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); + filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } - if (strcmp(pClassName, "CCBackgroundAudio") == 0) + if (strcmp(className, "CCBackgroundAudio") == 0) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) // no MP3 support for CC_PLATFORM_WP8 - std::string::size_type pos = strFilePath.find(".mp3"); - if (pos == strFilePath.npos) + std::string::size_type pos = filePath.find(".mp3"); + if (pos == filePath.npos) { continue; } - strFilePath.replace(pos, strFilePath.length(), ".wav"); + filePath.replace(pos, filePath.length(), ".wav"); #endif - preloadBackgroundMusic(strFilePath.c_str()); - setLoop(bLoop); - playBackgroundMusic(strFilePath.c_str(), bLoop); + preloadBackgroundMusic(filePath.c_str()); + setLoop(loop); + playBackgroundMusic(filePath.c_str(), loop); } - else if(strcmp(pClassName, "CCComAudio") == 0) + else if(strcmp(className, "CCComAudio") == 0) { - preloadEffect(strFilePath.c_str()); + preloadEffect(filePath.c_str()); } else { diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 474051c704..efff4a5614 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -94,108 +94,108 @@ bool ComRender::serialize(void* r) do { CC_BREAK_IF(r == NULL); - SerData *pSerData = (SerData *)(r); - const rapidjson::Value *v = pSerData->_rData; - stExpCocoNode *pCocoNode = pSerData->_cocoNode; - const char *pClassName = NULL; - const char *pComName = NULL; - const char *pFile = NULL; - const char *pPlist = NULL; - std::string strFilePath; - std::string strPlistPath; - int nResType = 0; + SerData *serData = (SerData *)(r); + const rapidjson::Value *v = serData->_rData; + stExpCocoNode *cocoNode = serData->_cocoNode; + const char *className = NULL; + const char *comName = NULL; + const char *file = NULL; + const char *plist = NULL; + std::string filePath; + std::string plistPath; + int resType = 0; if (v != NULL) { - pClassName = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(pClassName == NULL); - pComName = DICTOOL->getStringValue_json(*v, "name"); + className = DICTOOL->getStringValue_json(*v, "classname"); + CC_BREAK_IF(className == NULL); + comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); - pFile = DICTOOL->getStringValue_json(fileData, "path"); - pPlist = DICTOOL->getStringValue_json(fileData, "plistFile"); - CC_BREAK_IF(pFile == NULL && pPlist == NULL); - nResType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); + file = DICTOOL->getStringValue_json(fileData, "path"); + plist = DICTOOL->getStringValue_json(fileData, "plistFile"); + CC_BREAK_IF(file == NULL && plist == NULL); + resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); } - else if(pCocoNode != NULL) + else if(cocoNode != NULL) { - pClassName = pCocoNode[1].GetValue(); - CC_BREAK_IF(pClassName == NULL); - pComName = pCocoNode[2].GetValue(); - stExpCocoNode *pfileData = pCocoNode[4].GetChildArray(); + className = cocoNode[1].GetValue(); + CC_BREAK_IF(className == NULL); + comName = cocoNode[2].GetValue(); + stExpCocoNode *pfileData = cocoNode[4].GetChildArray(); CC_BREAK_IF(!pfileData); - pFile = pfileData[0].GetValue(); - pPlist = pfileData[1].GetValue(); - CC_BREAK_IF(pFile == NULL && pPlist == NULL); - nResType = atoi(pfileData[2].GetValue()); + file = pfileData[0].GetValue(); + plist = pfileData[1].GetValue(); + CC_BREAK_IF(file == NULL && plist == NULL); + resType = atoi(pfileData[2].GetValue()); } - if (pComName != NULL) + if (comName != NULL) { - setName(pComName); + setName(comName); } else { - setName(pClassName); + setName(className); } - if (pFile != NULL) + if (file != NULL) { - strFilePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pFile)); + filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } - if (pPlist != NULL) + if (plist != NULL) { - strPlistPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(pPlist)); + plistPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(plist)); } - if (nResType == 0) + if (resType == 0) { - if (strcmp(pClassName, "CCSprite") == 0 && (strFilePath.find(".png") != strFilePath.npos || strFilePath.find(".pvr.ccz") != strFilePath.npos)) + if (strcmp(className, "CCSprite") == 0 && (filePath.find(".png") != filePath.npos || filePath.find(".pvr.ccz") != filePath.npos)) { - _render = CCSprite::create(strFilePath.c_str()); + _render = CCSprite::create(filePath.c_str()); _render->retain(); bRet = true; } - else if(strcmp(pClassName, "CCTMXTiledMap") == 0 && strFilePath.find(".tmx") != strFilePath.npos) + else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != filePath.npos) { - _render = CCTMXTiledMap::create(strFilePath.c_str()); + _render = CCTMXTiledMap::create(filePath.c_str()); _render->retain(); bRet = true; } - else if(strcmp(pClassName, "CCParticleSystemQuad") == 0 && strFilePath.find(".plist") != strFilePath.npos) + else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != filePath.npos) { - _render = CCParticleSystemQuad::create(strFilePath.c_str()); + _render = CCParticleSystemQuad::create(filePath.c_str()); _render->setPosition(Point(0.0f, 0.0f)); _render->retain(); bRet = true; } - else if(strcmp(pClassName, "CCArmature") == 0) + else if(strcmp(className, "CCArmature") == 0) { - std::string file_extension = strFilePath; - size_t pos = strFilePath.find_last_of('.'); + std::string file_extension = filePath; + size_t pos = filePath.find_last_of('.'); if (pos != std::string::npos) { - file_extension = strFilePath.substr(pos, strFilePath.length()); + file_extension = filePath.substr(pos, filePath.length()); std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); } if (file_extension == ".JSON" || file_extension == ".EXPORTJSON") { rapidjson::Document doc; - if(!readJson(strFilePath.c_str(), doc)) + if(!readJson(filePath.c_str(), doc)) { - log("read json file[%s] error!\n", strFilePath.c_str()); + log("read json file[%s] error!\n", filePath.c_str()); continue; } const rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(doc, "armature_data", 0); const char *name = DICTOOL->getStringValue_json(subData, "name"); - ArmatureDataManager::getInstance()->addArmatureFileInfo(strFilePath.c_str()); + ArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str()); Armature *pAr = Armature::create(name); _render = pAr; _render->retain(); const char *actionName = NULL; - if (pCocoNode != NULL) + if (cocoNode != NULL) { - actionName = pCocoNode[6].GetValue();//DICTOOL->getStringValue_json(*v, "selectedactionname"); + actionName = cocoNode[6].GetValue();//DICTOOL->getStringValue_json(*v, "selectedactionname"); } else { @@ -211,7 +211,7 @@ bool ComRender::serialize(void* r) { ssize_t size = 0; unsigned char *pBytes = NULL; - std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(strFilePath.c_str()); + std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(filePath.c_str()); pBytes = cocos2d::FileUtils::getInstance()->getFileData(binaryFilePath.c_str(), "rb", &size); CC_BREAK_IF(pBytes == NULL || strcmp((char*)pBytes, "") == 0); CocoLoader tCocoLoader; @@ -226,7 +226,6 @@ bool ComRender::serialize(void* r) for (int i = 0; i < count; ++i) { std::string key = tpChildArray[i].GetName(&tCocoLoader); - const char *str = tpChildArray[i].GetValue(); if (key.compare("armature_data") == 0) { int length = tpChildArray[i].GetChildNum(); @@ -246,14 +245,14 @@ bool ComRender::serialize(void* r) { if (str1 != NULL) { - ArmatureDataManager::getInstance()->addArmatureFileInfo(strFilePath.c_str()); + ArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str()); Armature *pAr = CCArmature::create(str1); _render = pAr; _render->retain(); const char *actionName = NULL; - if (pCocoNode != NULL) + if (cocoNode != NULL) { - actionName = pCocoNode[6].GetValue(); + actionName = cocoNode[6].GetValue(); } else { @@ -281,18 +280,18 @@ bool ComRender::serialize(void* r) continue; } } - else if(strcmp(pClassName, "GUIComponent") == 0) + else if(strcmp(className, "GUIComponent") == 0) { - std::string file_extension = strFilePath; - size_t pos = strFilePath.find_last_of('.'); + std::string file_extension = filePath; + size_t pos = filePath.find_last_of('.'); if (pos != std::string::npos) { - file_extension = strFilePath.substr(pos, strFilePath.length()); + file_extension = filePath.substr(pos, filePath.length()); std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); } if (file_extension == ".JSON" || file_extension == ".EXPORTJSON") { - cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(strFilePath.c_str()); + cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str()); _render = widget; _render->retain(); @@ -300,7 +299,7 @@ bool ComRender::serialize(void* r) } else if (file_extension == ".CSB") { - cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromBinaryFile(strFilePath.c_str()); + cocos2d::ui::Widget* widget = GUIReader::getInstance()->widgetFromBinaryFile(filePath.c_str()); _render = widget; _render->retain(); @@ -312,19 +311,19 @@ bool ComRender::serialize(void* r) CC_BREAK_IF(true); } } - else if (nResType == 1) + else if (resType == 1) { - if (strcmp(pClassName, "CCSprite") == 0) + if (strcmp(className, "CCSprite") == 0) { - std::string strPngFile = strPlistPath; + std::string strPngFile = plistPath; std::string::size_type pos = strPngFile.find(".plist"); if (pos == strPngFile.npos) { continue; } strPngFile.replace(pos, strPngFile.length(), ".png"); - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(strPlistPath.c_str(), strPngFile.c_str()); - _render = CCSprite::createWithSpriteFrameName(strFilePath.c_str()); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath.c_str(), strPngFile.c_str()); + _render = CCSprite::createWithSpriteFrameName(filePath.c_str()); _render->retain(); bRet = true; From a6d6287b29e95af96644d45236815c40443ca209 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Thu, 26 Jun 2014 10:08:17 +0800 Subject: [PATCH 04/19] 1. remove hungary style. 2. fixes build error. --- .../cocostudio/CCSSceneReader.cpp | 2 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 134 +++++++++--------- .../CocoStudioSceneTest/SceneEditorTest.h | 10 +- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index f278c4ec68..124d040f7f 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "cocostudio/CocoStudio.h" #include "ui/CocosGUI.h" #include "audio/include/SimpleAudioEngine.h" -#include "ObjectFactory.h" +#include "base/ObjectFactory.h" using namespace cocos2d; using namespace ui; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 3cf80dbca4..e560953416 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -106,7 +106,7 @@ void SceneEditorTestScene::MainMenuCallback(Ref *pSender) removeAllChildren(); } -const char* SceneEditorTestLayer::m_loadtypeStr[2] = {"change to load \nwith binary file","change to load \nwith json file"}; +const char* SceneEditorTestLayer::_loadtypeStr[2] = {"change to load \nwith binary file","change to load \nwith json file"}; void SceneEditorTestLayer::onEnter() { CCLayer::onEnter(); @@ -127,10 +127,10 @@ void SceneEditorTestLayer::onEnter() addChild(l, 1, 10001); l->setPosition(Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } - m_isCsbLoad = false; - m_loadtypelb = cocos2d::Label::createWithSystemFont(m_loadtypeStr[0], "Arial", 12); + _isCsbLoad = false; + _loadtypelb = cocos2d::Label::createWithSystemFont(_loadtypeStr[0], "Arial", 12); // #endif - MenuItemLabel* itemlb = CCMenuItemLabel::create(m_loadtypelb, CC_CALLBACK_1(SceneEditorTestLayer::changeLoadTypeCallback, this)); + MenuItemLabel* itemlb = CCMenuItemLabel::create(_loadtypelb, CC_CALLBACK_1(SceneEditorTestLayer::changeLoadTypeCallback, this)); Menu* loadtypemenu = CCMenu::create(itemlb, NULL); loadtypemenu->setPosition(Point(VisibleRect::rightTop().x -50,VisibleRect::rightTop().y -20)); addChild(loadtypemenu,100); @@ -208,20 +208,20 @@ void SceneEditorTestLayer::draw(Renderer *renderer, const Mat4 &transform, uint3 void SceneEditorTestLayer::changeLoadTypeCallback(cocos2d::Ref *pSender) { - m_isCsbLoad = !m_isCsbLoad; - m_loadtypelb->setString(m_loadtypeStr[(int)m_isCsbLoad]); - loadFileChangeHelper(m_filePathName); + _isCsbLoad = !_isCsbLoad; + _loadtypelb->setString(_loadtypeStr[(int)_isCsbLoad]); + loadFileChangeHelper(_filePath); - if(m_rootNode != NULL) + if(_rootNode != NULL) { - this->removeChild(m_rootNode); - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + this->removeChild(_rootNode); + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return ; } defaultPlay(); - this->addChild(m_rootNode); + this->addChild(_rootNode); } } @@ -231,7 +231,7 @@ void SceneEditorTestLayer::loadFileChangeHelper(std::string& filePathName) if(n == std::string::npos) return; filePathName = filePathName.substr(0,n); - if(m_isCsbLoad) + if(_isCsbLoad) filePathName.append(".csb"); else filePathName.append(".json"); @@ -275,14 +275,14 @@ void LoadSceneEdtiorFileTest::onExit() cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene() { - m_filePathName = "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; //default is json - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; //default is json + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void LoadSceneEdtiorFileTest::defaultPlay() @@ -327,16 +327,16 @@ void SpriteComponentTest::onExit() cocos2d::Node* SpriteComponentTest::createGameScene() { - m_filePathName = "scenetest/SpriteComponentTest/SpriteComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/SpriteComponentTest/SpriteComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } @@ -345,10 +345,10 @@ void SpriteComponentTest::defaultPlay() ActionInterval* action1 = CCBlink::create(2, 10); ActionInterval* action2 = CCBlink::create(2, 5); - ComRender *pSister1 = static_cast(m_rootNode->getChildByTag(10003)->getComponent("CCSprite")); + ComRender *pSister1 = static_cast(_rootNode->getChildByTag(10003)->getComponent("CCSprite")); pSister1->getNode()->runAction(action1); - ComRender *pSister2 = static_cast(m_rootNode->getChildByTag(10004)->getComponent("CCSprite")); + ComRender *pSister2 = static_cast(_rootNode->getChildByTag(10004)->getComponent("CCSprite")); pSister2->getNode()->runAction(action2); } @@ -389,22 +389,22 @@ void ArmatureComponentTest::onExit() cocos2d::Node* ArmatureComponentTest::createGameScene() { - m_filePathName = "scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void ArmatureComponentTest::defaultPlay() { - ComRender *pBlowFish = static_cast(m_rootNode->getChildByTag(10007)->getComponent("CCArmature")); + ComRender *pBlowFish = static_cast(_rootNode->getChildByTag(10007)->getComponent("CCArmature")); pBlowFish->getNode()->runAction(MoveBy::create(10.0f, Point(-1000.0f, 0))); - ComRender *pButterflyfish = static_cast(m_rootNode->getChildByTag(10008)->getComponent("CCArmature")); + ComRender *pButterflyfish = static_cast(_rootNode->getChildByTag(10008)->getComponent("CCArmature")); pButterflyfish->getNode()->runAction(MoveBy::create(10.0f, Point(-1000.0f, 0))); } @@ -445,15 +445,15 @@ void UIComponentTest::onExit() cocos2d::Node* UIComponentTest::createGameScene() { - m_filePathName = "scenetest/UIComponentTest/UIComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/UIComponentTest/UIComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) @@ -462,10 +462,10 @@ void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) { case ui::Widget::TouchEventType::BEGAN: { - ComRender *pBlowFish = static_cast(m_rootNode->getChildByTag(10010)->getComponent("CCArmature")); + ComRender *pBlowFish = static_cast(_rootNode->getChildByTag(10010)->getComponent("CCArmature")); pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); - ComRender *pButterflyfish = static_cast(m_rootNode->getChildByTag(10011)->getComponent("CCArmature")); + ComRender *pButterflyfish = static_cast(_rootNode->getChildByTag(10011)->getComponent("CCArmature")); pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); } break; @@ -477,7 +477,7 @@ void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) void UIComponentTest::defaultPlay() { - ComRender *render = static_cast(m_rootNode->getChildByTag(10025)->getComponent("GUIComponent")); + ComRender *render = static_cast(_rootNode->getChildByTag(10025)->getComponent("GUIComponent")); Widget* widget = static_cast(render->getNode()); Button* button = static_cast(widget->getChildByName("Button_156")); button->addTouchEventListener(CC_CALLBACK_2(UIComponentTest::touchEvent, this)); @@ -520,19 +520,19 @@ void TmxMapComponentTest::onExit() cocos2d::Node* TmxMapComponentTest::createGameScene() { - m_filePathName = "scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void TmxMapComponentTest::defaultPlay() { - ComRender *tmxMap = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCTMXTiledMap")); + ComRender *tmxMap = static_cast(_rootNode->getChildByTag(10015)->getComponent("CCTMXTiledMap")); ActionInterval *actionTo = CCSkewTo::create(2, 0.f, 2.f); ActionInterval *rotateTo = CCRotateTo::create(2, 61.0f); ActionInterval *actionScaleTo = CCScaleTo::create(2, -0.44f, 0.47f); @@ -582,19 +582,19 @@ void ParticleComponentTest::onExit() cocos2d::Node* ParticleComponentTest::createGameScene() { - m_filePathName = "scenetest/ParticleComponentTest/ParticleComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/ParticleComponentTest/ParticleComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void ParticleComponentTest::defaultPlay() { - ComRender* Particle = static_cast(m_rootNode->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); + ComRender* Particle = static_cast(_rootNode->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); ActionInterval* jump = CCJumpBy::create(5, Point(-500,0), 50, 4); FiniteTimeAction* action = CCSequence::create( jump, jump->reverse(), NULL); Particle->getNode()->runAction(action); @@ -637,14 +637,14 @@ void EffectComponentTest::onExit() cocos2d::Node* EffectComponentTest::createGameScene() { - m_filePathName = "scenetest/EffectComponentTest/EffectComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/EffectComponentTest/EffectComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void EffectComponentTest::animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID) @@ -655,7 +655,7 @@ void EffectComponentTest::animationEvent(Armature *armature, MovementEventType m { if (id.compare("Fire") == 0) { - ComAudio *pAudio = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCComAudio")); + ComAudio *pAudio = static_cast(_rootNode->getChildByTag(10015)->getComponent("CCComAudio")); pAudio->playEffect(); } } @@ -663,7 +663,7 @@ void EffectComponentTest::animationEvent(Armature *armature, MovementEventType m void EffectComponentTest::defaultPlay() { - ComRender *render = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCArmature")); + ComRender *render = static_cast(_rootNode->getChildByTag(10015)->getComponent("CCArmature")); Armature *pAr = static_cast(render->getNode()); pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(EffectComponentTest::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); } @@ -704,19 +704,19 @@ void BackgroundComponentTest::onExit() cocos2d::Node* BackgroundComponentTest::createGameScene() { - m_filePathName = "scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void BackgroundComponentTest::defaultPlay() { - ComAudio *Audio = static_cast(m_rootNode->getComponent("CCBackgroundAudio")); + ComAudio *Audio = static_cast(_rootNode->getComponent("CCBackgroundAudio")); Audio->playBackgroundMusic(); } @@ -761,8 +761,8 @@ bool AttributeComponentTest::initData() bool bRet = false; rapidjson::Document doc; do { - CC_BREAK_IF(m_rootNode == nullptr); - ComAttribute *attribute = static_cast(m_rootNode->getChildByTag(10015)->getComponent("CCComAttribute")); + CC_BREAK_IF(_rootNode == nullptr); + ComAttribute *attribute = static_cast(_rootNode->getChildByTag(10015)->getComponent("CCComAttribute")); CC_BREAK_IF(attribute == nullptr); log("Name: %s, HP: %f, MP: %f", attribute->getString("name").c_str(), attribute->getFloat("maxHP"), attribute->getFloat("maxMP")); @@ -773,13 +773,13 @@ bool AttributeComponentTest::initData() cocos2d::Node* AttributeComponentTest::createGameScene() { - m_filePathName = "scenetest/AttributeComponentTest/AttributeComponentTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/AttributeComponentTest/AttributeComponentTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } - return m_rootNode; + return _rootNode; } void AttributeComponentTest::defaultPlay() @@ -867,15 +867,15 @@ void TriggerTest::gameLogic(float dt) cocos2d::Node* TriggerTest::createGameScene() { - m_filePathName = "scenetest/TriggerTest/TriggerTest.json"; - m_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(m_filePathName.c_str()); - if (m_rootNode == NULL) + _filePath = "scenetest/TriggerTest/TriggerTest.json"; + _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); + if (_rootNode == NULL) { return NULL; } defaultPlay(); - return m_rootNode; + return _rootNode; } void TriggerTest::defaultPlay() { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 35344ccca5..a21187c159 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -56,13 +56,13 @@ protected: void loadFileChangeHelper(std::string& filePathName ); // switch json& csb private: - bool m_isCsbLoad; // default is false - cocos2d::Label* m_loadtypelb; - static const char* m_loadtypeStr[2]; + bool _isCsbLoad; // default is false + cocos2d::Label* _loadtypelb; + static const char* _loadtypeStr[2]; protected: - cocos2d::Node* m_rootNode; - std::string m_filePathName; + cocos2d::Node* _rootNode; + std::string _filePath; }; class LoadSceneEdtiorFileTest : public SceneEditorTestLayer From 60ea37cabcb5523b4b5dc106d76ae58b26696d85 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 30 Jun 2014 14:09:27 +0800 Subject: [PATCH 05/19] fix focus functions --- cocos/ui/UILayout.cpp | 88 +++++++------------------------------------ cocos/ui/UILayout.h | 4 +- 2 files changed, 16 insertions(+), 76 deletions(-) diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index f33591a81c..cf3f8acc7d 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -1104,7 +1104,7 @@ Vec2 Layout::getWorldCenterPoint(Widget* widget)const return widget->convertToWorldSpace(Vec2(widgetSize.width/2, widgetSize.height/2)); } -float Layout::caculateNearestDistance(Widget* baseWidget) +float Layout::calculateNearestDistance(Widget* baseWidget) { float distance = FLT_MAX; @@ -1114,7 +1114,7 @@ float Layout::caculateNearestDistance(Widget* baseWidget) Layout *layout = dynamic_cast(node); int length; if (layout) { - length = layout->caculateNearestDistance(baseWidget); + length = layout->calculateNearestDistance(baseWidget); } else { @@ -1137,7 +1137,7 @@ float Layout::caculateNearestDistance(Widget* baseWidget) return distance; } -float Layout::caculateFarestDistance(cocos2d::ui::Widget *baseWidget) +float Layout::calculateFarestDistance(cocos2d::ui::Widget *baseWidget) { float distance = -FLT_MAX; @@ -1147,7 +1147,7 @@ float Layout::caculateFarestDistance(cocos2d::ui::Widget *baseWidget) Layout *layout = dynamic_cast(node); int length; if (layout) { - length = layout->caculateFarestDistance(baseWidget); + length = layout->calculateFarestDistance(baseWidget); } else { @@ -1194,7 +1194,8 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi float distance = FLT_MAX; int found = 0; - if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT) + if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT || + direction == FocusDirection::DOWN || direction == FocusDirection::UP) { Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) @@ -1207,7 +1208,7 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi Layout *layout = dynamic_cast(w); if (layout) { - length = layout->caculateNearestDistance(baseWidget); + length = layout->calculateNearestDistance(baseWidget); } else { @@ -1225,39 +1226,7 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi return found; } - index = 0; - found = 0; - distance = FLT_MAX; - if (direction == FocusDirection::DOWN || direction == FocusDirection::UP) { - Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); - while (index < count) - { - Widget *w = dynamic_cast(this->getChildren().at(index)); - if (w && w->isFocusEnabled()) - { - Vec2 wPosition = this->getWorldCenterPoint(w); - float length; - Layout *layout = dynamic_cast(w); - if (layout) - { - length = layout->caculateNearestDistance(baseWidget); - } - else - { - length = (wPosition - widgetPosition).getLength(); - } - - if (length < distance) - { - found = index; - distance = length; - } - - } - index++; - } - return found; - } + CCASSERT(0, "invalid focus direction!!!"); return 0; } @@ -1273,7 +1242,8 @@ int Layout::findFarestChildWidgetIndex(FocusDirection direction, cocos2d::ui::Wi float distance = -FLT_MAX; int found = 0; - if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT) + if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT + || direction == FocusDirection::DOWN || direction == FocusDirection::UP) { Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) @@ -1286,7 +1256,7 @@ int Layout::findFarestChildWidgetIndex(FocusDirection direction, cocos2d::ui::Wi Layout *layout = dynamic_cast(w); if (layout) { - length = layout->caculateFarestDistance(baseWidget); + length = layout->calculateFarestDistance(baseWidget); } else { @@ -1304,39 +1274,6 @@ int Layout::findFarestChildWidgetIndex(FocusDirection direction, cocos2d::ui::Wi return found; } - index = 0; - found = 0; - distance = -FLT_MAX; - if (direction == FocusDirection::DOWN || direction == FocusDirection::UP) { - Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); - while (index < count) - { - Widget *w = dynamic_cast(this->getChildren().at(index)); - if (w && w->isFocusEnabled()) - { - Vec2 wPosition = this->getWorldCenterPoint(w); - float length; - Layout *layout = dynamic_cast(w); - if (layout) - { - length = layout->caculateFarestDistance(baseWidget); - } - else - { - length = (wPosition - widgetPosition).getLength(); - } - - if (length > distance) - { - found = index; - distance = length; - } - - } - index++; - } - return found; - } CCASSERT(0, "invalid focus direction!!!"); return 0; } @@ -1368,6 +1305,9 @@ Widget *Layout::findFirstNonLayoutWidget() Layout* layout = dynamic_cast(node); if (layout) { widget = layout->findFirstNonLayoutWidget(); + if (widget != nullptr) { + return widget; + } } else{ Widget *w = dynamic_cast(node); diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 2278e64564..e2c9798d37 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -376,7 +376,7 @@ protected: *@param the base widget which will be used to caculate the distance between the layout's children and itself *@return return the nearest distance between the baseWidget and the layout's children */ - float caculateNearestDistance(Widget* baseWidget); + float calculateNearestDistance(Widget* baseWidget); /** * caculate the farest distance between the baseWidget and the children of the layout @@ -384,7 +384,7 @@ protected: *@return return the farest distance between the baseWidget and the layout's children */ - float caculateFarestDistance(Widget* baseWidget); + float calculateFarestDistance(Widget* baseWidget); /** * when a layout pass the focus to it's child, use this method to determine which algorithm to use, nearest or farest distance algorithm or not From a3fcddde39e09b487eee23da97b1dfd340be013b Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Mon, 30 Jun 2014 17:15:55 +0800 Subject: [PATCH 06/19] 1. NULL->nullptr. 2. bRet->ret. --- .../cocostudio/CCComAttribute.cpp | 30 ++++----- .../editor-support/cocostudio/CCComAudio.cpp | 32 ++++----- .../editor-support/cocostudio/CCComRender.cpp | 66 +++++++++---------- .../cocostudio/CCSSceneReader.cpp | 42 ++++++------ 4 files changed, 85 insertions(+), 85 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index 5aea061c5e..c269dbd52d 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -144,43 +144,43 @@ ComAttribute* ComAttribute::create(void) bool ComAttribute::serialize(void* r) { - bool bRet = false; + bool ret = false; do { - CC_BREAK_IF(r == NULL); + CC_BREAK_IF(r == nullptr); SerData *serData = (SerData *)(r); const rapidjson::Value *v = serData->_rData; stExpCocoNode *cocoNode = serData->_cocoNode; - const char *className = NULL; - const char *comName = NULL; - const char *file = NULL; + const char *className = nullptr; + const char *comName = nullptr; + const char *file = nullptr; std::string filePath; int resType = 0; - if (v != NULL) + if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == NULL); + CC_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); CC_BREAK_IF(resType != 0); } - else if (cocoNode != NULL) + else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(); stExpCocoNode *fileData = cocoNode[3].GetChildArray(); CC_BREAK_IF(!fileData); file = fileData[0].GetValue(); - CC_BREAK_IF(file == NULL); + CC_BREAK_IF(file == nullptr); resType = atoi(fileData[2].GetValue()); CC_BREAK_IF(resType != 0); } - if (comName != NULL) + if (comName != nullptr) { setName(comName); } @@ -188,17 +188,17 @@ bool ComAttribute::serialize(void* r) { setName(className); } - if (file != NULL) + if (file != nullptr) { filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } if (parse(filePath.c_str())) { - bRet = true; + ret = true; } }while (0); - return bRet; + return ret; } bool ComAttribute::parse(const std::string &jsonFile) diff --git a/cocos/editor-support/cocostudio/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp index 8632ba4e67..717e8f701d 100644 --- a/cocos/editor-support/cocostudio/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -69,47 +69,47 @@ void ComAudio::setEnabled(bool b) bool ComAudio::serialize(void* r) { - bool bRet = false; + bool ret = false; do { - CC_BREAK_IF(r == NULL); + CC_BREAK_IF(r == nullptr); SerData *serData = (SerData *)(r); const rapidjson::Value *v = serData->_rData; stExpCocoNode *cocoNode = serData->_cocoNode; - const char *className = NULL; - const char *comName = NULL; - const char *file = NULL; + const char *className = nullptr; + const char *comName = nullptr; + const char *file = nullptr; std::string filePath; int resType = 0; bool loop = false; - if (v != NULL) + if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); - CC_BREAK_IF(file == NULL); + CC_BREAK_IF(file == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); CC_BREAK_IF(resType != 0); loop = DICTOOL->getIntValue_json(*v, "loop") != 0? true:false; } - else if (cocoNode != NULL) + else if (cocoNode != nullptr) { className = cocoNode[1].GetValue(); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(); stExpCocoNode *pfileData = cocoNode[4].GetChildArray(); CC_BREAK_IF(!pfileData); file = pfileData[0].GetValue(); - CC_BREAK_IF(file == NULL); + CC_BREAK_IF(file == nullptr); resType = atoi(pfileData[2].GetValue()); CC_BREAK_IF(resType != 0); loop = atoi(cocoNode[5].GetValue()) != 0? true:false; - bRet = true; + ret = true; } - if (comName != NULL) + if (comName != nullptr) { setName(comName); } @@ -117,7 +117,7 @@ bool ComAudio::serialize(void* r) { setName(className); } - if (file != NULL) + if (file != nullptr) { if (strcmp(file, "") == 0) { @@ -148,9 +148,9 @@ bool ComAudio::serialize(void* r) { CC_BREAK_IF(true); } - bRet = true; + ret = true; }while (0); - return bRet; + return ret; } ComAudio* ComAudio::create(void) diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index efff4a5614..3bc3b995b6 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -90,45 +90,45 @@ void ComRender::setNode(cocos2d::Node *node) bool ComRender::serialize(void* r) { - bool bRet = false; + bool ret = false; do { - CC_BREAK_IF(r == NULL); + CC_BREAK_IF(r == nullptr); SerData *serData = (SerData *)(r); const rapidjson::Value *v = serData->_rData; stExpCocoNode *cocoNode = serData->_cocoNode; - const char *className = NULL; - const char *comName = NULL; - const char *file = NULL; - const char *plist = NULL; + const char *className = nullptr; + const char *comName = nullptr; + const char *file = nullptr; + const char *plist = nullptr; std::string filePath; std::string plistPath; int resType = 0; - if (v != NULL) + if (v != nullptr) { className = DICTOOL->getStringValue_json(*v, "classname"); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = DICTOOL->getStringValue_json(*v, "name"); const rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, "fileData"); CC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData)); file = DICTOOL->getStringValue_json(fileData, "path"); plist = DICTOOL->getStringValue_json(fileData, "plistFile"); - CC_BREAK_IF(file == NULL && plist == NULL); + CC_BREAK_IF(file == nullptr && plist == nullptr); resType = DICTOOL->getIntValue_json(fileData, "resourceType", -1); } - else if(cocoNode != NULL) + else if(cocoNode != nullptr) { className = cocoNode[1].GetValue(); - CC_BREAK_IF(className == NULL); + CC_BREAK_IF(className == nullptr); comName = cocoNode[2].GetValue(); stExpCocoNode *pfileData = cocoNode[4].GetChildArray(); CC_BREAK_IF(!pfileData); file = pfileData[0].GetValue(); plist = pfileData[1].GetValue(); - CC_BREAK_IF(file == NULL && plist == NULL); + CC_BREAK_IF(file == nullptr && plist == nullptr); resType = atoi(pfileData[2].GetValue()); } - if (comName != NULL) + if (comName != nullptr) { setName(comName); } @@ -137,11 +137,11 @@ bool ComRender::serialize(void* r) setName(className); } - if (file != NULL) + if (file != nullptr) { filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } - if (plist != NULL) + if (plist != nullptr) { plistPath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(plist)); } @@ -152,14 +152,14 @@ bool ComRender::serialize(void* r) _render = CCSprite::create(filePath.c_str()); _render->retain(); - bRet = true; + ret = true; } else if(strcmp(className, "CCTMXTiledMap") == 0 && filePath.find(".tmx") != filePath.npos) { _render = CCTMXTiledMap::create(filePath.c_str()); _render->retain(); - bRet = true; + ret = true; } else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != filePath.npos) { @@ -167,7 +167,7 @@ bool ComRender::serialize(void* r) _render->setPosition(Point(0.0f, 0.0f)); _render->retain(); - bRet = true; + ret = true; } else if(strcmp(className, "CCArmature") == 0) { @@ -192,8 +192,8 @@ bool ComRender::serialize(void* r) Armature *pAr = Armature::create(name); _render = pAr; _render->retain(); - const char *actionName = NULL; - if (cocoNode != NULL) + const char *actionName = nullptr; + if (cocoNode != nullptr) { actionName = cocoNode[6].GetValue();//DICTOOL->getStringValue_json(*v, "selectedactionname"); } @@ -201,19 +201,19 @@ bool ComRender::serialize(void* r) { actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); } - if (actionName != NULL && pAr->getAnimation() != NULL) + if (actionName != nullptr && pAr->getAnimation() != nullptr) { pAr->getAnimation()->play(actionName); } - bRet = true; + ret = true; } else if (file_extension == ".CSB") { ssize_t size = 0; - unsigned char *pBytes = NULL; + unsigned char *pBytes = nullptr; std::string binaryFilePath = FileUtils::getInstance()->fullPathForFilename(filePath.c_str()); pBytes = cocos2d::FileUtils::getInstance()->getFileData(binaryFilePath.c_str(), "rb", &size); - CC_BREAK_IF(pBytes == NULL || strcmp((char*)pBytes, "") == 0); + CC_BREAK_IF(pBytes == nullptr || strcmp((char*)pBytes, "") == 0); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)pBytes)) { @@ -243,14 +243,14 @@ bool ComRender::serialize(void* r) const char *str1 = armature_data[j].GetValue(); if (key.compare("name") == 0) { - if (str1 != NULL) + if (str1 != nullptr) { ArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str()); Armature *pAr = CCArmature::create(str1); _render = pAr; _render->retain(); - const char *actionName = NULL; - if (cocoNode != NULL) + const char *actionName = nullptr; + if (cocoNode != nullptr) { actionName = cocoNode[6].GetValue(); } @@ -258,11 +258,11 @@ bool ComRender::serialize(void* r) { actionName = DICTOOL->getStringValue_json(*v, "selectedactionname"); } - if (actionName != NULL && pAr->getAnimation() != NULL) + if (actionName != nullptr && pAr->getAnimation() != nullptr) { pAr->getAnimation()->play(actionName); } - bRet = true; + ret = true; } } } @@ -295,7 +295,7 @@ bool ComRender::serialize(void* r) _render = widget; _render->retain(); - bRet = true; + ret = true; } else if (file_extension == ".CSB") { @@ -303,7 +303,7 @@ bool ComRender::serialize(void* r) _render = widget; _render->retain(); - bRet = true; + ret = true; } } else @@ -326,7 +326,7 @@ bool ComRender::serialize(void* r) _render = CCSprite::createWithSpriteFrameName(filePath.c_str()); _render->retain(); - bRet = true; + ret = true; } else { @@ -339,7 +339,7 @@ bool ComRender::serialize(void* r) } } while (0); - return bRet; + return ret; } ComRender* ComRender::create(void) diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 124d040f7f..39bab7ef3c 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -79,11 +79,11 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, else if(file_extension == ".CSB") { ssize_t size = 0; - unsigned char *pBytes = NULL; + unsigned char *pBytes = nullptr; do { std::string binaryFilePath = CCFileUtils::getInstance()->fullPathForFilename(fileName); pBytes = cocos2d::FileUtils::getInstance()->getFileData(binaryFilePath.c_str(), "rb", &size); - CC_BREAK_IF(pBytes == NULL || strcmp((char*)pBytes, "") == 0); + CC_BREAK_IF(pBytes == nullptr || strcmp((char*)pBytes, "") == 0); CocoLoader tCocoLoader; if (tCocoLoader.ReadCocoBinBuff((char*)pBytes)) { @@ -96,7 +96,7 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, _node = Node::create(); int nCount = 0; std::vector _vecComs; - ComRender *pRender = NULL; + ComRender *pRender = nullptr; std::string key = tpChildArray[15].GetName(&tCocoLoader); if (key == "components") { @@ -107,26 +107,26 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, for (int i = 0; i < nCount; i++) { stExpCocoNode *subDict = pComponents[i].GetChildArray(); - if (subDict == NULL) + if (subDict == nullptr) { continue; } std::string key = subDict[1].GetName(&tCocoLoader); const char *comName = subDict[1].GetValue(); - Component *pCom = NULL; - if (key == "classname" && comName != NULL) + Component *pCom = nullptr; + if (key == "classname" && comName != nullptr) { pCom = createComponent(comName); } CCLOG("classname = %s", comName); - if (pCom != NULL) + if (pCom != nullptr) { - data->_rData = NULL; + data->_rData = nullptr; data->_cocoNode = subDict; if (pCom->serialize(data)) { ComRender *pTRender = dynamic_cast(pCom); - if (pTRender != NULL) + if (pTRender != nullptr) { pRender = pTRender; } @@ -174,15 +174,15 @@ cocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName, bool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc) { - bool bRet = false; + bool ret = false; do { std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath); doc.Parse<0>(contentStr.c_str()); CC_BREAK_IF(doc.HasParseError()); - bRet = true; + ret = true; } while (0); - return bRet; + return ret; } Node* SceneReader::nodeByTag(Node *parent, int tag) @@ -348,7 +348,7 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode *cocoNode, cocos2d::Node* parent, AttachComponentType attachComponent) { - const char *className = NULL; + const char *className = nullptr; stExpCocoNode *pNodeArray = cocoNode->GetChildArray(); std::string Key = pNodeArray[1].GetName(cocoLoader); if (Key == "classname") @@ -357,9 +357,9 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode * } if(strcmp(className, "CCNode") == 0) { - Node* gb = NULL; + Node* gb = nullptr; std::vector _vecComs; - ComRender *pRender = NULL; + ComRender *pRender = nullptr; int count = 0; std::string key = pNodeArray[13].GetName(cocoLoader); if (key == "components") @@ -371,7 +371,7 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode * for (int i = 0; i < count; ++i) { stExpCocoNode *subDict = pComponents[i].GetChildArray(); - if (subDict == NULL) + if (subDict == nullptr) { continue; } @@ -383,14 +383,14 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode * pCom = createComponent(comName); } CCLOG("classname = %s", comName); - if (pCom != NULL) + if (pCom != nullptr) { - data->_rData = NULL; + data->_rData = nullptr; data->_cocoNode = subDict; if (pCom->serialize(data)) { ComRender *pTRender = dynamic_cast(pCom); - if (pTRender != NULL) + if (pTRender != nullptr) { pRender = pTRender; } @@ -425,7 +425,7 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode * { gb = pRender->getNode(); gb->retain(); - pRender->setNode(NULL); + pRender->setNode(nullptr); CC_SAFE_RELEASE_NULL(pRender); } parent->addChild(gb); @@ -437,7 +437,7 @@ cocos2d::Node* SceneReader::createObject(CocoLoader *cocoLoader, stExpCocoNode * } stExpCocoNode *pGameObjects = pNodeArray[12].GetChildArray(); - if (pGameObjects != NULL) + if (pGameObjects != nullptr) { int length = pNodeArray[12].GetChildNum(); for (int i = 0; i < length; ++i) From 9bcc66912abd6b05e8d32c037d40c7fab6cc4e23 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 30 Jun 2014 20:45:01 +0800 Subject: [PATCH 07/19] fix crash cause by std::regex --- cocos/2d/CCNode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 240bab5f60..57911385f9 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -946,7 +946,8 @@ bool Node::doEnumerate(std::string name, std::function callback) bool ret = false; for (const auto& child : _children) { - if(std::regex_match(child->_name, std::regex(searchName))) + // should add ::std::regex_constants::basic for std::regex to avoid crash on Android and windows + if(std::regex_match(child->_name, std::regex(searchName, ::std::regex_constants::basic))) { if (!needRecursive) { From 79264daf1e081a0a04a4c967680df34b545bc698 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 30 Jun 2014 20:56:59 +0800 Subject: [PATCH 08/19] fix the crash on WP8 for FastTileMapTest --- cocos/2d/CCFastTMXLayer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 0d613a6a5a..08ecff09de 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -180,7 +180,6 @@ void FastTMXLayer::onDraw(int offset, int count) GL::bindTexture2D(_texture->getName()); getGLProgramState()->apply(_modelViewTransform); - glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); From 6db8ec8aad4d1b479dc89e5bc239be4ed1f0e9b0 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 30 Jun 2014 20:58:26 +0800 Subject: [PATCH 09/19] fix crash when load pvr bgra8888 image in android. --- cocos/renderer/CCTexture2D.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 9e2e8f36db..3449f5a7a6 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -61,7 +61,7 @@ namespace { typedef Texture2D::PixelFormatInfoMap::value_type PixelFormatInfoMapValue; static const PixelFormatInfoMapValue TexturePixelFormatInfoTablesValue[] = { - PixelFormatInfoMapValue(Texture2D::PixelFormat::BGRA8888, Texture2D::PixelFormatInfo(GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, 32, false, true)), + PixelFormatInfoMapValue(Texture2D::PixelFormat::BGRA8888, Texture2D::PixelFormatInfo(GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, 32, false, true)), PixelFormatInfoMapValue(Texture2D::PixelFormat::RGBA8888, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 32, false, true)), PixelFormatInfoMapValue(Texture2D::PixelFormat::RGBA4444, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 16, false, true)), PixelFormatInfoMapValue(Texture2D::PixelFormat::RGB5A1, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 16, false, true)), @@ -1032,6 +1032,14 @@ rgba(1) -> 12345678 */ Texture2D::PixelFormat Texture2D::convertDataToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat originFormat, PixelFormat format, unsigned char** outData, ssize_t* outDataLen) { + // don't need to convert + if (format == originFormat || format == PixelFormat::AUTO) + { + *outData = (unsigned char*)data; + *outDataLen = dataLen; + return originFormat; + } + switch (originFormat) { case PixelFormat::I8: From 3eea298428dcc256c8257852b1ee703d1e962b7d Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 30 Jun 2014 21:08:43 +0800 Subject: [PATCH 10/19] unbind the VAO anyway to for safety. --- cocos/2d/CCFastTMXLayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 08ecff09de..1b456fc69b 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -180,6 +180,7 @@ void FastTMXLayer::onDraw(int offset, int count) GL::bindTexture2D(_texture->getName()); getGLProgramState()->apply(_modelViewTransform); + GL::bindVAO(0); glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); From 584e90c09746d952e56ade1a872b390cd0df6f05 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 1 Jul 2014 14:48:43 +0800 Subject: [PATCH 11/19] Rotate the frame buffer for WP8 during the snapshot --- cocos/base/ccUtils.cpp | 35 +++++++++++++++++++++++++++++++++-- cocos/platform/wp8/CCGLView.h | 1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/cocos/base/ccUtils.cpp b/cocos/base/ccUtils.cpp index da0996719a..5a025b25ec 100644 --- a/cocos/base/ccUtils.cpp +++ b/cocos/base/ccUtils.cpp @@ -72,19 +72,50 @@ void onCaptureScreen(const std::function& afterC } glPixelStorei(GL_PACK_ALIGNMENT, 1); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + // The frame buffer is always created with portrait orientation on WP8. + // So if the current device orientation is landscape, we need to rotate the frame buffer. + auto renderTargetSize = glView->getRenerTargetSize(); + CCASSERT(width * height == static_cast(renderTargetSize.width * renderTargetSize.height), "The frame size is not matched"); + glReadPixels(0, 0, (int)renderTargetSize.width, (int)renderTargetSize.height, GL_RGBA, GL_UNSIGNED_BYTE, buffer.get()); +#else glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer.get()); +#endif std::shared_ptr flippedBuffer(new GLubyte[width * height * 4], [](GLubyte* p) { CC_SAFE_DELETE_ARRAY(p); }); if (!flippedBuffer) { break; } - + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + if (width == static_cast(renderTargetSize.width)) + { + // The current device orientation is portrait. + for (int row = 0; row < height; ++row) + { + memcpy(flippedBuffer.get() + (height - row - 1) * width * 4, buffer.get() + row * width * 4, width * 4); + } + } + else + { + // The current device orientation is landscape. + for (int row = 0; row < width; ++row) + { + for (int col = 0; col < height; ++col) + { + *(int*)(flippedBuffer.get() + (height - col - 1) * width * 4 + row * 4) = *(int*)(buffer.get() + row * height * 4 + col * 4); + } + } + } +#else for (int row = 0; row < height; ++row) { memcpy(flippedBuffer.get() + (height - row - 1) * width * 4, buffer.get() + row * width * 4, width * 4); } - +#endif + std::shared_ptr image(new Image); if (image) { diff --git a/cocos/platform/wp8/CCGLView.h b/cocos/platform/wp8/CCGLView.h index 422d003122..dbcff4f36e 100644 --- a/cocos/platform/wp8/CCGLView.h +++ b/cocos/platform/wp8/CCGLView.h @@ -65,6 +65,7 @@ public: const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; + const Size& getRenerTargetSize() const { return Size(m_width, m_height); } virtual void setIMEKeyboardState(bool bOpen); void ShowKeyboard(Windows::Foundation::Rect r); From 75c77779990db6a6d2367aa385c3c10d6b45fe7f Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 1 Jul 2014 14:48:46 +0800 Subject: [PATCH 12/19] fix Effect3dSprite memory leak --- tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp | 3 --- tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 1f8a1403fd..ac8281b9f6 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -341,7 +341,6 @@ Effect3DOutline::Effect3DOutline() Effect3DOutline::~Effect3DOutline() { - CC_SAFE_RELEASE_NULL(_sprite); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); #endif @@ -371,8 +370,6 @@ void Effect3DOutline::setTarget(EffectSprite3D *sprite) if(sprite != _sprite) { - CC_SAFE_RETAIN(sprite); - CC_SAFE_RELEASE_NULL(_sprite); _sprite = sprite; auto mesh = sprite->getMesh(); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index 6695bcfc13..efb5052cc8 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -103,6 +103,7 @@ protected: Vec3 _outlineColor; float _outlineWidth; + //weak reference EffectSprite3D* _sprite; #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) EventListenerCustom* _backToForegroundListener; From abeeb9a0c701f2a7bf5e343a17e74ca28518b527 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 1 Jul 2014 14:57:10 +0800 Subject: [PATCH 13/19] fixing incorrect optimization --- cocos/platform/wp8/CCGLView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/wp8/CCGLView.h b/cocos/platform/wp8/CCGLView.h index dbcff4f36e..e9d7410c6e 100644 --- a/cocos/platform/wp8/CCGLView.h +++ b/cocos/platform/wp8/CCGLView.h @@ -65,7 +65,7 @@ public: const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; - const Size& getRenerTargetSize() const { return Size(m_width, m_height); } + Size getRenerTargetSize() const { return Size(m_width, m_height); } virtual void setIMEKeyboardState(bool bOpen); void ShowKeyboard(Windows::Foundation::Rect r); From 5ab6d5557b62e8272ca852ac32a3ce45628b9e1f Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 1 Jul 2014 07:52:35 +0000 Subject: [PATCH 14/19] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 67 ++++++++++++++++------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index c39bed7595..e84a7ed3c1 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -747,38 +747,36 @@ "cocos/platform/android/CCGLView.h", "cocos/platform/android/CCPlatformDefine.h", "cocos/platform/android/CCStdC.h", - "cocos/platform/android/ControllerDelegate/.classpath", - "cocos/platform/android/ControllerDelegate/.project", - "cocos/platform/android/ControllerDelegate/.settings/org.eclipse.jdt.core.prefs", - "cocos/platform/android/ControllerDelegate/AndroidManifest.xml", - "cocos/platform/android/ControllerDelegate/ant.properties", - "cocos/platform/android/ControllerDelegate/build.xml", - "cocos/platform/android/ControllerDelegate/proguard-project.txt", - "cocos/platform/android/ControllerDelegate/src/org/cocos2dx/lib/GameControllerDelegate.java", - "cocos/platform/android/ControllerMoga/.classpath", - "cocos/platform/android/ControllerMoga/.project", - "cocos/platform/android/ControllerMoga/.settings/org.eclipse.jdt.core.prefs", - "cocos/platform/android/ControllerMoga/AndroidManifest.xml", - "cocos/platform/android/ControllerMoga/ant.properties", - "cocos/platform/android/ControllerMoga/build.xml", - "cocos/platform/android/ControllerMoga/proguard-project.txt", - "cocos/platform/android/ControllerMoga/src/org/cocos2dx/lib/GameControllerMoga.java", - "cocos/platform/android/ControllerNibiru/.classpath", - "cocos/platform/android/ControllerNibiru/.project", - "cocos/platform/android/ControllerNibiru/.settings/org.eclipse.jdt.core.prefs", - "cocos/platform/android/ControllerNibiru/AndroidManifest.xml", - "cocos/platform/android/ControllerNibiru/ant.properties", - "cocos/platform/android/ControllerNibiru/build.xml", - "cocos/platform/android/ControllerNibiru/proguard-project.txt", - "cocos/platform/android/ControllerNibiru/src/org/cocos2dx/lib/GameControllerNibiru.java", - "cocos/platform/android/ControllerOuya/.classpath", - "cocos/platform/android/ControllerOuya/.project", - "cocos/platform/android/ControllerOuya/.settings/org.eclipse.jdt.core.prefs", - "cocos/platform/android/ControllerOuya/AndroidManifest.xml", - "cocos/platform/android/ControllerOuya/ant.properties", - "cocos/platform/android/ControllerOuya/build.xml", - "cocos/platform/android/ControllerOuya/proguard-project.txt", - "cocos/platform/android/ControllerOuya/src/org/cocos2dx/lib/GameControllerOuya.java", + "cocos/platform/android/ControllerAutoAdapter/.classpath", + "cocos/platform/android/ControllerAutoAdapter/.project", + "cocos/platform/android/ControllerAutoAdapter/.settings/org.eclipse.jdt.core.prefs", + "cocos/platform/android/ControllerAutoAdapter/AndroidManifest.xml", + "cocos/platform/android/ControllerAutoAdapter/ant.properties", + "cocos/platform/android/ControllerAutoAdapter/build.xml", + "cocos/platform/android/ControllerAutoAdapter/lint.xml", + "cocos/platform/android/ControllerAutoAdapter/proguard-project.txt", + "cocos/platform/android/ControllerAutoAdapter/project.properties", + "cocos/platform/android/ControllerAutoAdapter/src/org/cocos2dx/lib/GameControllerActivity.java", + "cocos/platform/android/ControllerAutoAdapter/src/org/cocos2dx/lib/GameControllerHelper.java", + "cocos/platform/android/ControllerAutoAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerCompat.java", + "cocos/platform/android/ControllerAutoAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV16.java", + "cocos/platform/android/ControllerAutoAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV9.java", + "cocos/platform/android/ControllerManualAdapter/.classpath", + "cocos/platform/android/ControllerManualAdapter/.project", + "cocos/platform/android/ControllerManualAdapter/.settings/org.eclipse.jdt.core.prefs", + "cocos/platform/android/ControllerManualAdapter/AndroidManifest.xml", + "cocos/platform/android/ControllerManualAdapter/ant.properties", + "cocos/platform/android/ControllerManualAdapter/build.xml", + "cocos/platform/android/ControllerManualAdapter/lint.xml", + "cocos/platform/android/ControllerManualAdapter/proguard-project.txt", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerNibiru.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerOuya.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerCompat.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV16.java", + "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV9.java", "cocos/platform/android/java/.classpath", "cocos/platform/android/java/.project", "cocos/platform/android/java/.settings/org.eclipse.jdt.core.prefs", @@ -807,11 +805,8 @@ "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerAdapter.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerHelper.java", + "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerUtils.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/inputmanagercompat/InputManagerCompat.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV16.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/inputmanagercompat/InputManagerV9.java", "cocos/platform/android/javaactivity.cpp", "cocos/platform/android/jni/DPIJni.cpp", "cocos/platform/android/jni/DPIJni.h", From cc3a9d07370c60c4dfc0d3a64833fb1ed290c401 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 1 Jul 2014 16:09:25 +0800 Subject: [PATCH 15/19] fix crash caused by std::regex() --- cocos/2d/CCNode.cpp | 36 ++-- cocos/2d/CCNode.h | 5 +- tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 194 ++++++++++-------- 3 files changed, 133 insertions(+), 102 deletions(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 57911385f9..a0905817e1 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -861,24 +861,25 @@ void Node::enumerateChildren(const std::string &name, std::function 3 && - name[length-3] == '/' && - name[length-2] == '.' && - name[length-1] == '.') - { - searchFromParent = true; - subStrlength -= 3; - } +// bool searchFromParent = false; +// if (length > 3 && +// name[length-3] == '/' && +// name[length-2] == '.' && +// name[length-1] == '.') +// { +// searchFromParent = true; +// subStrlength -= 3; +// } - // Remove '/', '//' and '/..' if exist + // Remove '/', '//' if exist std::string newName = name.substr(subStrStartPos, subStrlength); // If search from parent, then add * at first to make it match its children, which will do make - if (searchFromParent) - { - newName.insert(0, "[[:alnum:]]+/"); - } +// if (searchFromParent) +// { +// newName.insert(0, "[[:alnum:]]+/"); +// } if (searchFromRoot) { @@ -943,11 +944,14 @@ bool Node::doEnumerate(std::string name, std::function callback) needRecursive = true; } + std::hash h; + size_t hashOfName = h(searchName); bool ret = false; for (const auto& child : _children) { - // should add ::std::regex_constants::basic for std::regex to avoid crash on Android and windows - if(std::regex_match(child->_name, std::regex(searchName, ::std::regex_constants::basic))) + // TODO: regular expression support + // Android doesn't support c++ 11 regular expression well, may use external lib + if (hashOfName == child->_hashOfName && searchName.compare(child->_name) == 0) { if (!needRecursive) { diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 0a283154ce..55a26ec113 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -714,20 +714,17 @@ public: virtual Node* getChildByName(const std::string& name) const; /** Search the children of the receiving node to perform processing for nodes which share a name. * - * @param name The name to search for, support c++11 regular expression + * @param name The name to search for * Search syntax options: * `/` : When placed at the start of the search string, this indicates that the search should be performed on the tree's node. * `//`: Can only be placed at the begin of the search string. This indicates that the search should be performed on the tree's node * and be performed recursively across the entire node tree. - * `..`: The search should move up to the node's parent. Can only be placed at the end of string * `/` : When placed anywhere but the start of the search string, this indicates that the search should move to the node's children * * @code * enumerateChildren("/MyName", ...): This searches the root's children and matches any node with the name `MyName`. * enumerateChildren("//MyName", ...): This searches the root's children recursively and matches any node with the name `MyName`. - * enumerateChildren("[[:alnum:]]+", ...): This search string matches every node of its children. * enumerateChildren("/MyName", ...): This searches the node tree and matches the parent node of every node named `MyName`. - * enumerateChildren("A[[:digit:]]", ...): This searches the node's children and returns any child named `A0`, `A1`, ..., `A9` * enumerateChildren("Abby/Normal", ...): This searches the node's grandchildren and returns any node whose name is `Normal` * and whose parent is named `Abby`. * enumerateChildren("//Abby/Normal", ...): This searches the node tree and returns any node whose name is `Normal` and whose diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index fffa01f9b1..3b27fc36f0 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -1269,28 +1269,28 @@ void NodeNameTest::onEnter() // enumerateChildren() // name = regular expression int i = 0; - parent = Node::create(); - for (int i = 0; i < 100; ++i) - { - auto node = Node::create(); - sprintf(name, "node%d", i); - node->setName(name); - parent->addChild(node); - } - - i = 0; - parent->enumerateChildren("node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return false; - }); - CCAssert(i == 100, ""); - - i = 0; - parent->enumerateChildren("node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); +// parent = Node::create(); +// for (int i = 0; i < 100; ++i) +// { +// auto node = Node::create(); +// sprintf(name, "node%d", i); +// node->setName(name); +// parent->addChild(node); +// } +// +// i = 0; +// parent->enumerateChildren("node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 100, ""); +// +// i = 0; +// parent->enumerateChildren("node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return true; +// }); +// CCAssert(i == 1, ""); // enumerateChildren @@ -1326,89 +1326,119 @@ void NodeNameTest::onEnter() }); CCAssert(i == 1, ""); - i = 0; - parent->enumerateChildren("node[[:digit:]]+/node", [&i](Node* node) -> bool { - ++i; - return false; - }); - CCAssert(i == 10000, ""); - - i = 0; - parent->enumerateChildren("node[[:digit:]]+/node", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); - - // search from parent - // name is xxx/.. - i = 0; - parent->enumerateChildren("node/..", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); - - i = 0; - parent->enumerateChildren("node/..", [&i](Node* node) -> bool { - ++i; - return false; - }); - CCAssert(i == 10000, ""); - - // name = /xxx : search from root + // search from root parent = getScene(); - for (int j = 0; j < 100; j++) + for (int i = 0; i < 100; ++i) { auto node = Node::create(); - sprintf(name, "node%d", j); - node->setName(name); + node->setName("node"); parent->addChild(node); - for (int k = 0; k < 100; ++k) + for (int j = 0; j < 100; ++j) { auto child = Node::create(); - sprintf(name, "node%d", k); - child->setName(name); + child->setName("child"); node->addChild(child); } } i = 0; - enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { + parent->enumerateChildren("/node", [&i](Node* node) -> bool { ++i; return false; }); CCAssert(i == 100, ""); i = 0; - enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); - - i = 0; - enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return false; - }); - CCAssert(i == 10100, ""); // 10000(children) + 100(parent) - - i = 0; - enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); - - i = 0; - enumerateChildren("//node[[:digit:]]+/..", [&i](Node* node) -> bool { + parent->enumerateChildren("//child", [&i](Node* node) -> bool { ++i; return false; }); CCAssert(i == 10000, ""); +// i = 0; +// parent->enumerateChildren("node[[:digit:]]+/node", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 10000, ""); +// +// i = 0; +// parent->enumerateChildren("node[[:digit:]]+/node", [&i](Node* node) -> bool { +// ++i; +// return true; +// }); +// CCAssert(i == 1, ""); + + // search from parent + // name is xxx/.. +// i = 0; +// parent->enumerateChildren("node/..", [&i](Node* node) -> bool { +// ++i; +// return true; +// }); +// CCAssert(i == 1, ""); +// +// i = 0; +// parent->enumerateChildren("node/..", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 10000, ""); + + // name = /xxx : search from root +// parent = getScene(); +// for (int j = 0; j < 100; j++) +// { +// auto node = Node::create(); +// sprintf(name, "node%d", j); +// node->setName(name); +// parent->addChild(node); +// +// for (int k = 0; k < 100; ++k) +// { +// auto child = Node::create(); +// sprintf(name, "node%d", k); +// child->setName(name); +// node->addChild(child); +// } +// } +// +// i = 0; +// enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 100, ""); + +// i = 0; +// enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return true; +// }); +// CCAssert(i == 1, ""); +// +// i = 0; +// enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 10100, ""); // 10000(children) + 100(parent) +// +// i = 0; +// enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { +// ++i; +// return true; +// }); +// CCAssert(i == 1, ""); +// +// i = 0; +// enumerateChildren("//node[[:digit:]]+/..", [&i](Node* node) -> bool { +// ++i; +// return false; +// }); +// CCAssert(i == 10000, ""); + // utils::findChildren() parent = Node::create(); From d6c516b62da17310b44e9fe2cec069e93a3b86ab Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 1 Jul 2014 16:20:55 +0800 Subject: [PATCH 16/19] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 1e15fa39d9..8ea5abc716 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -32,6 +32,7 @@ cocos2d-x-3.2 ??? [FIX] UIListView: element position is changed a little when you click and up a list view without move [FIX] UIListView: element will respond to item_end event when end of scrolling a list view [FIX] UIVideo: crash when try to remove videoView(STATE_PLAYBACK_COMPLETED) on android + [FIX] WP8: crash of utils::captureScreen() cocos2d-x-3.2-alpha0 Jun.17 2014 [NEW] Console: add a command to show engine version From 0fbcbec9defd05aea7ae4b117fe8dba99f986e9b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 1 Jul 2014 16:44:10 +0800 Subject: [PATCH 17/19] Add missing file for game controller support. Fix using incorrect library project. --- .../libs/android-async-http-1.4.4.jar | Bin 0 -> 60962 bytes .../ControllerManualAdapter/project.properties | 16 ++++++++++++++++ .../proj.android/project.properties | 2 +- .../game_controller_test/AppActivity.java | 16 ++++++++-------- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 cocos/platform/android/ControllerAutoAdapter/libs/android-async-http-1.4.4.jar create mode 100644 cocos/platform/android/ControllerManualAdapter/project.properties diff --git a/cocos/platform/android/ControllerAutoAdapter/libs/android-async-http-1.4.4.jar b/cocos/platform/android/ControllerAutoAdapter/libs/android-async-http-1.4.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..75af7015db5f770102182bfc35c9e6fe167d83a7 GIT binary patch literal 60962 zcmb4qb95)swq|VGwr$(CZQHihv2B|j+jjDcopjtuI@53Notby%&Aj#ASzlG1s1ycGK!sbAbTim|{ z*nbbSe@`ectRO8RuByf$FYzcpGc6}e&#(wDOHVU5GvA`Zw8DCD0yqKrzZUz;|G#$y z`#U#vwEqtq{(G9g@B2S#>>M4PZ2nV9lz*W#b}(~sv^M)sIWYg999C{_PXB?;8i)m) z4HO8-0Rjk!;s4Jj?CR}cD)n~(Q9EmM2RAZi22(p@SJ!woT}4!3v_Iwabgi*yU}z5v zBG%#Hy(WFe;KHy};$;2s+tNLa*K50@QQugnrMnVn-*2SS9&cATF@h z*>kzvA9=3*kF%R!Z)Z2WK%t!##M+4xrNvQ4YWO~;=b_4x0bPh~Mq>IMK$T#U7EC`60%?n9}<(sCS2r(ch9xl?qLS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O&v47CHW>MccRjit}&QHq;Zr5WK>3&`XT}A=SwLCFvO3 z&BRrx7z4JO`LFGi{*H9C?cfxtj+j7e+<=jK5Fq5ok>N?L_BWiPDI3|-0<^#!j|I#t z2LWV$92uUDTE|mh7J7igJn+Z-+bI2apTyA&aC*<9EkIZgn3pg8006HUo{Rd&Gw#F8 z4aF=ij9|t`tBOxnR>T5*Km}x$0so}RZg{Nffj`o}zf!+ddDJY;KS&v#6z0cb{&?u4 zCXqd)e6;)v$}y)dYI4y-3a8DVQ;zNy)U=F;42}DL%s6(qqh^Xbq_8>u1?3ofp{4>m zq&#*0bIQ^7LQRl#$Ut-dQ^wH*)Z7<`1V7(n3CCx`K%IF}vl|@BWBC7p{LytsjR$@x z&Jl8~_%EV^qgEa@Am5=r0kB9vW;t|3cs^8J)DUckx^_wbOZR(}F0P|3f*SGbP+2$S zHHx3YCHy9qEv=`{?&5M_UMWi{GJc__JT={cz@K;r+g2g@1YJQeGAlSX&+Z6J Date: Tue, 1 Jul 2014 16:46:11 +0800 Subject: [PATCH 18/19] update test case. --- .../game_controller_test/AppActivity.java | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java b/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java index aa35d9e556..382fd95993 100644 --- a/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java +++ b/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java @@ -23,14 +23,10 @@ THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.game_controller_test; -import java.util.ArrayList; - import org.cocos2dx.lib.GameControllerActivity; //import org.cocos2dx.lib.GameControllerHelper.ControllerListener; -import android.bluetooth.BluetoothDevice; import android.os.Bundle; -import android.util.Log; public class AppActivity extends GameControllerActivity { @@ -50,53 +46,4 @@ public class AppActivity extends GameControllerActivity { //this.connectController(DRIVERTYPE_MOGA); //this.connectController(DRIVERTYPE_OUYA); } - - /*ControllerListener controllerListener = new ControllerListener() { - - @Override - public void onDownloadConfigStarted() { - Log.w("controllerListener", "onDownloadDepsFinished"); - } - - @Override - public void onDownloadConfigFinished(boolean isSuccess) { - //If download failed - Log.w("controllerListener", "onDownloadConfigFinished:" + isSuccess); - } - - @Override - public void onControllerDiscoveryStarted() { - Log.w("controllerListener", "onControllerDiscoveryStarted"); - } - - @Override - public void onControllerDiscoveryFinish(ArrayList devices) { - Log.w("controllerListener", "onControllerDiscoveryFinish"); - } - - @Override - public void onDownloadDepsStarted() { - Log.w("controllerListener", "onDownloadDepsStarted"); - } - - @Override - public void onDownloadDepsProgress(int bytesWritten, int totalSize) { - Log.w("controllerListener", "onDownloadDepsProgress"); - } - - @Override - public void onDownloadDepsFinished(boolean isSuccess) { - Log.w("controllerListener", ""); - } - - @Override - public void onInstallDriver(String filePath) { - Log.w("controllerListener", "onInstallDriver"); - } - - @Override - public void onConnectController() { - Log.w("controllerListener", "onConnectController"); - } - };*/ } From 32c88f61890b2b1877405bac04ec5c89ea15c8e2 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 1 Jul 2014 10:04:00 +0000 Subject: [PATCH 19/19] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index e84a7ed3c1..f130130767 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -769,6 +769,7 @@ "cocos/platform/android/ControllerManualAdapter/build.xml", "cocos/platform/android/ControllerManualAdapter/lint.xml", "cocos/platform/android/ControllerManualAdapter/proguard-project.txt", + "cocos/platform/android/ControllerManualAdapter/project.properties", "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java", "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java", "cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java",