From 1115d0d3f909dd0363e787c8721de63c3ec422bc Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Mon, 9 Sep 2013 19:51:26 +0800 Subject: [PATCH] 1. merge scenereader Armature merge to cocos2dx 3.0. --- extensions/Android.mk | 65 +- .../Json/CSContentJsonDictionary.cpp | 375 ----- .../Armature}/CCArmature.cpp | 0 .../Armature}/CCArmature.h | 0 .../Armature}/CCBone.cpp | 0 .../Armature}/CCBone.h | 0 .../animation/CCArmatureAnimation.cpp | 0 .../Armature}/animation/CCArmatureAnimation.h | 0 .../Armature}/animation/CCProcessBase.cpp | 0 .../Armature}/animation/CCProcessBase.h | 0 .../Armature}/animation/CCTween.cpp | 0 .../Armature}/animation/CCTween.h | 0 .../Armature}/datas/CCDatas.cpp | 2 +- .../Armature}/datas/CCDatas.h | 0 .../Armature}/display/CCBatchNode.cpp | 0 .../Armature}/display/CCBatchNode.h | 0 .../Armature}/display/CCDecorativeDisplay.cpp | 0 .../Armature}/display/CCDecorativeDisplay.h | 0 .../Armature}/display/CCDisplayFactory.cpp | 0 .../Armature}/display/CCDisplayFactory.h | 0 .../Armature}/display/CCDisplayManager.cpp | 0 .../Armature}/display/CCDisplayManager.h | 0 .../Armature}/display/CCShaderNode.cpp | 0 .../Armature}/display/CCShaderNode.h | 0 .../Armature}/display/CCSkin.cpp | 0 .../Armature}/display/CCSkin.h | 0 .../external_tool/CCTexture2DMutable.cpp | 0 .../external_tool/CCTexture2DMutable.h | 0 .../Armature}/external_tool/GLES-Render.cpp | 0 .../Armature}/external_tool/GLES-Render.h | 0 .../Armature}/external_tool/sigslot.h | 0 .../Armature}/physics/CCColliderDetector.cpp | 0 .../Armature}/physics/CCColliderDetector.h | 0 .../Armature}/physics/CCPhysicsWorld.cpp | 0 .../Armature}/physics/CCPhysicsWorld.h | 0 .../Armature}/utils/CCArmatureDataManager.cpp | 0 .../Armature}/utils/CCArmatureDataManager.h | 0 .../Armature}/utils/CCArmatureDefine.h | 0 .../Armature}/utils/CCConstValue.h | 0 .../Armature}/utils/CCDataReaderHelper.cpp | 44 +- .../Armature}/utils/CCDataReaderHelper.h | 22 +- .../utils/CCSpriteFrameCacheHelper.cpp | 0 .../utils/CCSpriteFrameCacheHelper.h | 0 .../Armature}/utils/CCTransformHelp.cpp | 0 .../Armature}/utils/CCTransformHelp.h | 0 .../Armature}/utils/CCTweenFunction.cpp | 0 .../Armature}/utils/CCTweenFunction.h | 0 .../Armature}/utils/CCUtilMath.cpp | 0 .../Armature}/utils/CCUtilMath.h | 0 .../Components/CCComAttribute.cpp | 9 + .../Components/CCComAttribute.h | 3 + .../Components/CCComAudio.cpp | 21 + .../{ => CocoStudio}/Components/CCComAudio.h | 7 + .../Components/CCComController.cpp | 0 .../Components/CCComController.h | 0 .../CocoStudio/Components/CCComRender.cpp | 79 + .../CocoStudio/Components/CCComRender.h | 53 + .../Components/CCInputDelegate.cpp | 0 .../Components/CCInputDelegate.h | 0 .../Json/CSContentJsonDictionary.cpp | 388 +++++ .../Json/CSContentJsonDictionary.h | 17 +- .../CocoStudio/Json/DictionaryHelper.cpp | 289 ++++ extensions/CocoStudio/Json/DictionaryHelper.h | 72 + .../Json/lib_json/autolink.h | 0 .../Json/lib_json/config.h | 0 .../Json/lib_json/features.h | 0 .../Json/lib_json/forwards.h | 0 .../Json/lib_json/json_batchallocator.h | 0 .../Json/lib_json/json_internalarray.inl | 0 .../Json/lib_json/json_internalmap.inl | 0 .../Json/lib_json/json_lib.h | 0 .../Json/lib_json/json_reader.cpp | 0 .../Json/lib_json/json_tool.h | 0 .../Json/lib_json/json_value.cpp | 14 +- .../Json/lib_json/json_valueiterator.inl | 0 .../Json/lib_json/json_writer.cpp | 0 .../Json/lib_json/reader.h | 0 .../Json/lib_json/sconscript | 0 .../Json/lib_json/value.h | 0 .../Json/lib_json/writer.h | 0 .../CocoStudio/Reader/CCSSceneReader.cpp | 397 +++++ extensions/CocoStudio/Reader/CCSSceneReader.h | 56 + extensions/cocos-ext.h | 31 +- extensions/proj.win32/libExtensions.vcxproj | 151 +- .../proj.win32/libExtensions.vcxproj.filters | 1493 +++++++++-------- 85 files changed, 2329 insertions(+), 1259 deletions(-) delete mode 100644 extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.cpp rename extensions/{CCArmature => CocoStudio/Armature}/CCArmature.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/CCArmature.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/CCBone.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/CCBone.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCArmatureAnimation.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCArmatureAnimation.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCProcessBase.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCProcessBase.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCTween.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/animation/CCTween.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/datas/CCDatas.cpp (99%) rename extensions/{CCArmature => CocoStudio/Armature}/datas/CCDatas.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCBatchNode.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCBatchNode.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDecorativeDisplay.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDecorativeDisplay.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDisplayFactory.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDisplayFactory.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDisplayManager.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCDisplayManager.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCShaderNode.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCShaderNode.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCSkin.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/display/CCSkin.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/external_tool/CCTexture2DMutable.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/external_tool/CCTexture2DMutable.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/external_tool/GLES-Render.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/external_tool/GLES-Render.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/external_tool/sigslot.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/physics/CCColliderDetector.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/physics/CCColliderDetector.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/physics/CCPhysicsWorld.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/physics/CCPhysicsWorld.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCArmatureDataManager.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCArmatureDataManager.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCArmatureDefine.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCConstValue.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCDataReaderHelper.cpp (95%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCDataReaderHelper.h (85%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCSpriteFrameCacheHelper.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCSpriteFrameCacheHelper.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCTransformHelp.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCTransformHelp.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCTweenFunction.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCTweenFunction.h (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCUtilMath.cpp (100%) rename extensions/{CCArmature => CocoStudio/Armature}/utils/CCUtilMath.h (100%) rename extensions/{ => CocoStudio}/Components/CCComAttribute.cpp (96%) rename extensions/{ => CocoStudio}/Components/CCComAttribute.h (95%) rename extensions/{ => CocoStudio}/Components/CCComAudio.cpp (94%) rename extensions/{ => CocoStudio}/Components/CCComAudio.h (94%) rename extensions/{ => CocoStudio}/Components/CCComController.cpp (100%) rename extensions/{ => CocoStudio}/Components/CCComController.h (100%) create mode 100644 extensions/CocoStudio/Components/CCComRender.cpp create mode 100644 extensions/CocoStudio/Components/CCComRender.h rename extensions/{ => CocoStudio}/Components/CCInputDelegate.cpp (100%) rename extensions/{ => CocoStudio}/Components/CCInputDelegate.h (100%) create mode 100644 extensions/CocoStudio/Json/CSContentJsonDictionary.cpp rename extensions/{CCArmature/external_tool => CocoStudio}/Json/CSContentJsonDictionary.h (87%) create mode 100644 extensions/CocoStudio/Json/DictionaryHelper.cpp create mode 100644 extensions/CocoStudio/Json/DictionaryHelper.h rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/autolink.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/config.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/features.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/forwards.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_batchallocator.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_internalarray.inl (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_internalmap.inl (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_lib.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_reader.cpp (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_tool.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_value.cpp (99%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_valueiterator.inl (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/json_writer.cpp (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/reader.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/sconscript (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/value.h (100%) rename extensions/{CCArmature/external_tool => CocoStudio}/Json/lib_json/writer.h (100%) create mode 100644 extensions/CocoStudio/Reader/CCSSceneReader.cpp create mode 100644 extensions/CocoStudio/Reader/CCSSceneReader.h diff --git a/extensions/Android.mk b/extensions/Android.mk index bead6fce42..6d07ce4349 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -8,32 +8,7 @@ LOCAL_MODULE_FILENAME := libextension LOCAL_SRC_FILES := \ CCDeprecated-ext.cpp \ AssetsManager/AssetsManager.cpp \ -CCArmature/CCArmature.cpp \ -CCArmature/CCBone.cpp \ -CCArmature/animation/CCArmatureAnimation.cpp \ -CCArmature/animation/CCProcessBase.cpp \ -CCArmature/animation/CCTween.cpp \ -CCArmature/datas/CCDatas.cpp \ -CCArmature/display/CCBatchNode.cpp \ -CCArmature/display/CCDecorativeDisplay.cpp \ -CCArmature/display/CCDisplayFactory.cpp \ -CCArmature/display/CCDisplayManager.cpp \ -CCArmature/display/CCShaderNode.cpp \ -CCArmature/display/CCSkin.cpp \ -CCArmature/external_tool/CCTexture2DMutable.cpp \ -CCArmature/external_tool/GLES-Render.cpp \ -CCArmature/external_tool/Json/CSContentJsonDictionary.cpp \ -CCArmature/external_tool/Json/lib_json/json_reader.cpp \ -CCArmature/external_tool/Json/lib_json/json_value.cpp \ -CCArmature/external_tool/Json/lib_json/json_writer.cpp \ -CCArmature/physics/CCColliderDetector.cpp \ -CCArmature/physics/CCPhysicsWorld.cpp \ -CCArmature/utils/CCArmatureDataManager.cpp \ -CCArmature/utils/CCDataReaderHelper.cpp \ -CCArmature/utils/CCSpriteFrameCacheHelper.cpp \ -CCArmature/utils/CCTransformHelp.cpp \ -CCArmature/utils/CCTweenFunction.cpp \ -CCArmature/utils/CCUtilMath.cpp \ + CCBReader/CCBAnimationManager.cpp \ CCBReader/CCBFileLoader.cpp \ CCBReader/CCBKeyframe.cpp \ @@ -56,11 +31,7 @@ CCBReader/CCNodeLoaderLibrary.cpp \ CCBReader/CCParticleSystemQuadLoader.cpp \ CCBReader/CCScale9SpriteLoader.cpp \ CCBReader/CCScrollViewLoader.cpp \ -CCBReader/CCSpriteLoader.cpp \ -Components/CCComAttribute.cpp \ -Components/CCComAudio.cpp \ -Components/CCComController.cpp \ -Components/CCInputDelegate.cpp \ +CCBReader/CCSpriteLoader.cpp GUI/CCControlExtension/CCControl.cpp \ GUI/CCControlExtension/CCControlButton.cpp \ GUI/CCControlExtension/CCControlColourPicker.cpp \ @@ -89,6 +60,38 @@ network/SocketIO.cpp \ network/WebSocket.cpp \ physics_nodes/CCPhysicsDebugNode.cpp \ physics_nodes/CCPhysicsSprite.cpp \ +CocoStudio/Armature/CCArmature.cpp \ +CocoStudio/Armature/CCBone.cpp \ +CocoStudio/Armature/animation/CCArmatureAnimation.cpp \ +CocoStudio/Armature/animation/CCProcessBase.cpp \ +CocoStudio/Armature/animation/CCTween.cpp \ +CocoStudio/Armature/datas/CCDatas.cpp \ +CocoStudio/Armature/display/CCBatchNode.cpp \ +CocoStudio/Armature/display/CCDecorativeDisplay.cpp \ +CocoStudio/Armature/display/CCDisplayFactory.cpp \ +CocoStudio/Armature/display/CCDisplayManager.cpp \ +CocoStudio/Armature/display/CCSkin.cpp \ +CocoStudio/Armature/external_tool/CCTexture2DMutable.cpp \ +CocoStudio/Armature/external_tool/GLES-Render.cpp \ +CocoStudio/Armature/physics/CCColliderDetector.cpp \ +CocoStudio/Armature/physics/CCPhysicsWorld.cpp \ +CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ +CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ +CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ +CocoStudio/Armature/utils/CCTransformHelp.cpp \ +CocoStudio/Armature/utils/CCTweenFunction.cpp \ +CocoStudio/Armature/utils/CCUtilMath.cpp \ +CocoStudio/Components/CCComAttribute.cpp \ +CocoStudio/Components/CCComAudio.cpp \ +CocoStudio/Components/CCComController.cpp \ +CocoStudio/Components/CCComRender.cpp \ +CocoStudio/Components/CCInputDelegate.cpp \ +CocoStudio/Json/CSContentJsonDictionary.cpp \ +CocoStudio/Json/DictionaryHelper.cpp \ +CocoStudio/Json/lib_json/json_value.cpp \ +CocoStudio/Json/lib_json/json_reader.cpp \ +CocoStudio/Json/lib_json/json_writer.cpp \ +CocoStudio/Reader/CCSSceneReader.cpp \ spine/Animation.cpp \ spine/AnimationState.cpp \ spine/AnimationStateData.cpp \ diff --git a/extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.cpp b/extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.cpp deleted file mode 100644 index b8ece40388..0000000000 --- a/extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (c) 2012 Chukong Technologies, Inc. - * - * http://www.cocostudio.com - * http://tools.cocoachina.com - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to the - * following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include "CSContentJsonDictionary.h" - -namespace cs { - - CSJsonDictionary::CSJsonDictionary() - { - _value.clear(); - } - - - CSJsonDictionary::~CSJsonDictionary() - { - _value.clear(); - } - - - void CSJsonDictionary::initWithDescription(const char *pszDescription) - { - CSJson::Reader cReader; - _value.clear(); - if (pszDescription && *pszDescription) - { - std::string strValue = pszDescription; - cReader.parse(strValue, _value, false); - } - } - - - void CSJsonDictionary::initWithValue(CSJson::Value& value) - { - _value = value; - } - - - void CSJsonDictionary::insertItem(const char *pszKey, int nValue) - { - _value[pszKey] = nValue; - } - - - void CSJsonDictionary::insertItem(const char *pszKey, double fValue) - { - _value[pszKey] = fValue; - } - - - void CSJsonDictionary::insertItem(const char *pszKey, const char * pszValue) - { - _value[pszKey] = pszValue; - } - - void CSJsonDictionary::insertItem(const char *pszKey, bool bValue) - { - _value[pszKey] = bValue; - } - - void CSJsonDictionary::insertItem(const char *pszKey, CSJsonDictionary * subDictionary) - { - if (subDictionary) - _value[pszKey] = subDictionary->_value; - } - - - bool CSJsonDictionary::deleteItem(const char *pszKey) - { - if(!_value.isMember(pszKey)) - return false; - - _value.removeMember(pszKey); - - return true; - } - - - void CSJsonDictionary::cleanUp() - { - _value.clear(); - } - - - bool CSJsonDictionary::isKeyValidate(const char *pszKey) - { - return _value.isMember(pszKey); - } - - - int CSJsonDictionary::getItemIntValue(const char *pszKey, int nDefaultValue) - { - if (!isKeyValidate(pszKey, _value) || !_value[pszKey].isNumeric()) - return nDefaultValue; - - return _value[pszKey].asInt(); - } - - - double CSJsonDictionary::getItemFloatValue(const char *pszKey, double fDefaultValue) - { - if (!isKeyValidate(pszKey, _value) || !_value[pszKey].isNumeric()) - return fDefaultValue; - - return _value[pszKey].asDouble(); - } - - - const char * CSJsonDictionary::getItemStringValue(const char *pszKey) - { - if (!isKeyValidate(pszKey, _value) || !_value[pszKey].isString()) - return NULL; - - return _value[pszKey].asCString(); - } - - bool CSJsonDictionary::getItemBoolvalue(const char *pszKey, bool bDefaultValue) - { - if (!isKeyValidate(pszKey, _value) || !_value[pszKey].isBool()) - return bDefaultValue; - - return _value[pszKey].asBool(); - } - - - CSJsonDictionary * CSJsonDictionary::getSubDictionary(const char *pszKey) - { - CSJsonDictionary * pNewDictionary; - if (!isKeyValidate(pszKey, _value) || (!_value[pszKey].isArray() && - !_value[pszKey].isObject() && - !_value[pszKey].isConvertibleTo(CSJson::arrayValue) && - !_value[pszKey].isConvertibleTo(CSJson::objectValue))) - { - pNewDictionary = NULL; - } - else - { - pNewDictionary = new CSJsonDictionary(); - pNewDictionary->initWithValue(_value[pszKey]); - } - return pNewDictionary; - } - - - std::string CSJsonDictionary::getDescription() - { - std::string strReturn = _value.toStyledString(); - return strReturn; - } - - - bool CSJsonDictionary::insertItemToArray(const char *pszArrayKey, int nValue) - { - CSJson::Value array; - if(_value.isMember(pszArrayKey)) - { - if (!_value[pszArrayKey].isArray() && !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) - return false; - - array = _value[pszArrayKey]; - } - - array.append(nValue); - _value[pszArrayKey] = array; - - return true; - } - - - bool CSJsonDictionary::insertItemToArray(const char *pszArrayKey, double fValue) - { - CSJson::Value array; - if(_value.isMember(pszArrayKey)) - { - if (!_value[pszArrayKey].isArray() && !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) - return false; - - array = _value[pszArrayKey]; - } - - array.append(fValue); - _value[pszArrayKey] = array; - - return true; - } - - - bool CSJsonDictionary::insertItemToArray(const char *pszArrayKey, const char * pszValue) - { - CSJson::Value array; - if(_value.isMember(pszArrayKey)) - { - if (!_value[pszArrayKey].isArray() && !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) - return false; - - array = _value[pszArrayKey]; - } - - array.append(pszValue); - _value[pszArrayKey] = array; - - return true; - } - - - bool CSJsonDictionary::insertItemToArray(const char *pszArrayKey, CSJsonDictionary * subDictionary) - { - CSJson::Value array; - if(_value.isMember(pszArrayKey)) - { - if (!_value[pszArrayKey].isArray() && !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) - return false; - - array = _value[pszArrayKey]; - } - - array.append(subDictionary->_value); - _value[pszArrayKey] = array; - - return true; - } - - - int CSJsonDictionary::getItemCount() - { - return _value.size(); - } - - - DicItemType CSJsonDictionary::getItemType(int nIndex) - { - return (DicItemType)_value[nIndex].type(); - } - - - DicItemType CSJsonDictionary::getItemType(const char *pszKey) - { - return (DicItemType)_value[pszKey].type(); - } - - std::vector CSJsonDictionary::getAllMemberNames() - { - return _value.getMemberNames(); - } - - - int CSJsonDictionary::getArrayItemCount(const char *pszArrayKey) - { - int nRet = 0; - if (!isKeyValidate(pszArrayKey, _value) || - (!_value[pszArrayKey].isArray() && !_value[pszArrayKey].isObject() && - !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue) && !_value[pszArrayKey].isConvertibleTo(CSJson::objectValue))) - { - nRet = 0; - } - else - { - CSJson::Value arrayValue = _value[pszArrayKey]; - nRet = arrayValue.size(); - } - - return nRet; - } - - - int CSJsonDictionary::getIntValueFromArray(const char *pszArrayKey, int nIndex, int nDefaultValue) - { - int nRet = nDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); - if (arrayValue) - { - if ((*arrayValue)[nIndex].isNumeric()) - nRet = (*arrayValue)[nIndex].asInt(); - } - - return nRet; - } - - - double CSJsonDictionary::getFloatValueFromArray(const char *pszArrayKey, int nIndex, double fDefaultValue) - { - double fRet = fDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); - if (arrayValue) - { - if ((*arrayValue)[nIndex].isNumeric()) - fRet = (*arrayValue)[nIndex].asDouble(); - } - - return fRet; - } - - - const char * CSJsonDictionary::getStringValueFromArray(const char *pszArrayKey, int nIndex) - { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); - if (arrayValue) - { - if ((*arrayValue)[nIndex].isString()) - return (*arrayValue)[nIndex].asCString(); - } - - return NULL; - } - - - CSJsonDictionary * CSJsonDictionary::getSubItemFromArray(const char *pszArrayKey, int nIndex) - { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); - if (arrayValue) - { - if ((*arrayValue)[nIndex].isArray() || (*arrayValue)[nIndex].isObject()) - { - CSJsonDictionary * pNewDictionary = new CSJsonDictionary(); - pNewDictionary->initWithValue((*arrayValue)[nIndex]); - return pNewDictionary; - } - } - - return NULL; - } - - - DicItemType CSJsonDictionary::getItemTypeFromArray(const char *pszArrayKey, int nIndex) - { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); - if (arrayValue) - return (DicItemType)((*arrayValue)[nIndex].type()); - - return (DicItemType)CSJson::nullValue; - } - - - inline bool CSJsonDictionary::isKeyValidate(const char *pszKey, CSJson::Value& root) - { - if (root.isNull() || !root.isMember(pszKey)) - return false; - - return true; - } - - - inline CSJson::Value * CSJsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) - { - if (!isKeyValidate(pszArrayKey, _value) && !_value[pszArrayKey].isArray() && !_value[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) - return NULL; - if (!_value[pszArrayKey].isValidIndex(nIndex)) - return NULL; - - return &_value[pszArrayKey]; - } -} diff --git a/extensions/CCArmature/CCArmature.cpp b/extensions/CocoStudio/Armature/CCArmature.cpp similarity index 100% rename from extensions/CCArmature/CCArmature.cpp rename to extensions/CocoStudio/Armature/CCArmature.cpp diff --git a/extensions/CCArmature/CCArmature.h b/extensions/CocoStudio/Armature/CCArmature.h similarity index 100% rename from extensions/CCArmature/CCArmature.h rename to extensions/CocoStudio/Armature/CCArmature.h diff --git a/extensions/CCArmature/CCBone.cpp b/extensions/CocoStudio/Armature/CCBone.cpp similarity index 100% rename from extensions/CCArmature/CCBone.cpp rename to extensions/CocoStudio/Armature/CCBone.cpp diff --git a/extensions/CCArmature/CCBone.h b/extensions/CocoStudio/Armature/CCBone.h similarity index 100% rename from extensions/CCArmature/CCBone.h rename to extensions/CocoStudio/Armature/CCBone.h diff --git a/extensions/CCArmature/animation/CCArmatureAnimation.cpp b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp similarity index 100% rename from extensions/CCArmature/animation/CCArmatureAnimation.cpp rename to extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp diff --git a/extensions/CCArmature/animation/CCArmatureAnimation.h b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.h similarity index 100% rename from extensions/CCArmature/animation/CCArmatureAnimation.h rename to extensions/CocoStudio/Armature/animation/CCArmatureAnimation.h diff --git a/extensions/CCArmature/animation/CCProcessBase.cpp b/extensions/CocoStudio/Armature/animation/CCProcessBase.cpp similarity index 100% rename from extensions/CCArmature/animation/CCProcessBase.cpp rename to extensions/CocoStudio/Armature/animation/CCProcessBase.cpp diff --git a/extensions/CCArmature/animation/CCProcessBase.h b/extensions/CocoStudio/Armature/animation/CCProcessBase.h similarity index 100% rename from extensions/CCArmature/animation/CCProcessBase.h rename to extensions/CocoStudio/Armature/animation/CCProcessBase.h diff --git a/extensions/CCArmature/animation/CCTween.cpp b/extensions/CocoStudio/Armature/animation/CCTween.cpp similarity index 100% rename from extensions/CCArmature/animation/CCTween.cpp rename to extensions/CocoStudio/Armature/animation/CCTween.cpp diff --git a/extensions/CCArmature/animation/CCTween.h b/extensions/CocoStudio/Armature/animation/CCTween.h similarity index 100% rename from extensions/CCArmature/animation/CCTween.h rename to extensions/CocoStudio/Armature/animation/CCTween.h diff --git a/extensions/CCArmature/datas/CCDatas.cpp b/extensions/CocoStudio/Armature/datas/CCDatas.cpp similarity index 99% rename from extensions/CCArmature/datas/CCDatas.cpp rename to extensions/CocoStudio/Armature/datas/CCDatas.cpp index e6330873bb..95863980db 100644 --- a/extensions/CCArmature/datas/CCDatas.cpp +++ b/extensions/CocoStudio/Armature/datas/CCDatas.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCDatas.h" -#include "CCArmature/utils/CCUtilMath.h" +#include "../utils/CCUtilMath.h" namespace cocos2d { namespace extension { namespace armature { diff --git a/extensions/CCArmature/datas/CCDatas.h b/extensions/CocoStudio/Armature/datas/CCDatas.h similarity index 100% rename from extensions/CCArmature/datas/CCDatas.h rename to extensions/CocoStudio/Armature/datas/CCDatas.h diff --git a/extensions/CCArmature/display/CCBatchNode.cpp b/extensions/CocoStudio/Armature/display/CCBatchNode.cpp similarity index 100% rename from extensions/CCArmature/display/CCBatchNode.cpp rename to extensions/CocoStudio/Armature/display/CCBatchNode.cpp diff --git a/extensions/CCArmature/display/CCBatchNode.h b/extensions/CocoStudio/Armature/display/CCBatchNode.h similarity index 100% rename from extensions/CCArmature/display/CCBatchNode.h rename to extensions/CocoStudio/Armature/display/CCBatchNode.h diff --git a/extensions/CCArmature/display/CCDecorativeDisplay.cpp b/extensions/CocoStudio/Armature/display/CCDecorativeDisplay.cpp similarity index 100% rename from extensions/CCArmature/display/CCDecorativeDisplay.cpp rename to extensions/CocoStudio/Armature/display/CCDecorativeDisplay.cpp diff --git a/extensions/CCArmature/display/CCDecorativeDisplay.h b/extensions/CocoStudio/Armature/display/CCDecorativeDisplay.h similarity index 100% rename from extensions/CCArmature/display/CCDecorativeDisplay.h rename to extensions/CocoStudio/Armature/display/CCDecorativeDisplay.h diff --git a/extensions/CCArmature/display/CCDisplayFactory.cpp b/extensions/CocoStudio/Armature/display/CCDisplayFactory.cpp similarity index 100% rename from extensions/CCArmature/display/CCDisplayFactory.cpp rename to extensions/CocoStudio/Armature/display/CCDisplayFactory.cpp diff --git a/extensions/CCArmature/display/CCDisplayFactory.h b/extensions/CocoStudio/Armature/display/CCDisplayFactory.h similarity index 100% rename from extensions/CCArmature/display/CCDisplayFactory.h rename to extensions/CocoStudio/Armature/display/CCDisplayFactory.h diff --git a/extensions/CCArmature/display/CCDisplayManager.cpp b/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp similarity index 100% rename from extensions/CCArmature/display/CCDisplayManager.cpp rename to extensions/CocoStudio/Armature/display/CCDisplayManager.cpp diff --git a/extensions/CCArmature/display/CCDisplayManager.h b/extensions/CocoStudio/Armature/display/CCDisplayManager.h similarity index 100% rename from extensions/CCArmature/display/CCDisplayManager.h rename to extensions/CocoStudio/Armature/display/CCDisplayManager.h diff --git a/extensions/CCArmature/display/CCShaderNode.cpp b/extensions/CocoStudio/Armature/display/CCShaderNode.cpp similarity index 100% rename from extensions/CCArmature/display/CCShaderNode.cpp rename to extensions/CocoStudio/Armature/display/CCShaderNode.cpp diff --git a/extensions/CCArmature/display/CCShaderNode.h b/extensions/CocoStudio/Armature/display/CCShaderNode.h similarity index 100% rename from extensions/CCArmature/display/CCShaderNode.h rename to extensions/CocoStudio/Armature/display/CCShaderNode.h diff --git a/extensions/CCArmature/display/CCSkin.cpp b/extensions/CocoStudio/Armature/display/CCSkin.cpp similarity index 100% rename from extensions/CCArmature/display/CCSkin.cpp rename to extensions/CocoStudio/Armature/display/CCSkin.cpp diff --git a/extensions/CCArmature/display/CCSkin.h b/extensions/CocoStudio/Armature/display/CCSkin.h similarity index 100% rename from extensions/CCArmature/display/CCSkin.h rename to extensions/CocoStudio/Armature/display/CCSkin.h diff --git a/extensions/CCArmature/external_tool/CCTexture2DMutable.cpp b/extensions/CocoStudio/Armature/external_tool/CCTexture2DMutable.cpp similarity index 100% rename from extensions/CCArmature/external_tool/CCTexture2DMutable.cpp rename to extensions/CocoStudio/Armature/external_tool/CCTexture2DMutable.cpp diff --git a/extensions/CCArmature/external_tool/CCTexture2DMutable.h b/extensions/CocoStudio/Armature/external_tool/CCTexture2DMutable.h similarity index 100% rename from extensions/CCArmature/external_tool/CCTexture2DMutable.h rename to extensions/CocoStudio/Armature/external_tool/CCTexture2DMutable.h diff --git a/extensions/CCArmature/external_tool/GLES-Render.cpp b/extensions/CocoStudio/Armature/external_tool/GLES-Render.cpp similarity index 100% rename from extensions/CCArmature/external_tool/GLES-Render.cpp rename to extensions/CocoStudio/Armature/external_tool/GLES-Render.cpp diff --git a/extensions/CCArmature/external_tool/GLES-Render.h b/extensions/CocoStudio/Armature/external_tool/GLES-Render.h similarity index 100% rename from extensions/CCArmature/external_tool/GLES-Render.h rename to extensions/CocoStudio/Armature/external_tool/GLES-Render.h diff --git a/extensions/CCArmature/external_tool/sigslot.h b/extensions/CocoStudio/Armature/external_tool/sigslot.h similarity index 100% rename from extensions/CCArmature/external_tool/sigslot.h rename to extensions/CocoStudio/Armature/external_tool/sigslot.h diff --git a/extensions/CCArmature/physics/CCColliderDetector.cpp b/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp similarity index 100% rename from extensions/CCArmature/physics/CCColliderDetector.cpp rename to extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp diff --git a/extensions/CCArmature/physics/CCColliderDetector.h b/extensions/CocoStudio/Armature/physics/CCColliderDetector.h similarity index 100% rename from extensions/CCArmature/physics/CCColliderDetector.h rename to extensions/CocoStudio/Armature/physics/CCColliderDetector.h diff --git a/extensions/CCArmature/physics/CCPhysicsWorld.cpp b/extensions/CocoStudio/Armature/physics/CCPhysicsWorld.cpp similarity index 100% rename from extensions/CCArmature/physics/CCPhysicsWorld.cpp rename to extensions/CocoStudio/Armature/physics/CCPhysicsWorld.cpp diff --git a/extensions/CCArmature/physics/CCPhysicsWorld.h b/extensions/CocoStudio/Armature/physics/CCPhysicsWorld.h similarity index 100% rename from extensions/CCArmature/physics/CCPhysicsWorld.h rename to extensions/CocoStudio/Armature/physics/CCPhysicsWorld.h diff --git a/extensions/CCArmature/utils/CCArmatureDataManager.cpp b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp similarity index 100% rename from extensions/CCArmature/utils/CCArmatureDataManager.cpp rename to extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp diff --git a/extensions/CCArmature/utils/CCArmatureDataManager.h b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h similarity index 100% rename from extensions/CCArmature/utils/CCArmatureDataManager.h rename to extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h diff --git a/extensions/CCArmature/utils/CCArmatureDefine.h b/extensions/CocoStudio/Armature/utils/CCArmatureDefine.h similarity index 100% rename from extensions/CCArmature/utils/CCArmatureDefine.h rename to extensions/CocoStudio/Armature/utils/CCArmatureDefine.h diff --git a/extensions/CCArmature/utils/CCConstValue.h b/extensions/CocoStudio/Armature/utils/CCConstValue.h similarity index 100% rename from extensions/CCArmature/utils/CCConstValue.h rename to extensions/CocoStudio/Armature/utils/CCConstValue.h diff --git a/extensions/CCArmature/utils/CCDataReaderHelper.cpp b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp similarity index 95% rename from extensions/CCArmature/utils/CCDataReaderHelper.cpp rename to extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp index f0c33086f3..99442e5bb7 100644 --- a/extensions/CCArmature/utils/CCDataReaderHelper.cpp +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp @@ -807,14 +807,14 @@ void DataReaderHelper::addDataFromJson(const char *filePath) void DataReaderHelper::addDataFromJsonCache(const char *fileContent) { - cs::CSJsonDictionary json; + cs::JsonDictionary json; json.initWithDescription(fileContent); // Decode armatures int length = json.getArrayItemCount(ARMATURE_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); + cs::JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); ArmatureData *armatureData = decodeArmature(*armatureDic); ArmatureDataManager::sharedArmatureDataManager()->addArmatureData(armatureData->name.c_str(), armatureData); @@ -825,7 +825,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent) length = json.getArrayItemCount(ANIMATION_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); + cs::JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); AnimationData *animationData = decodeAnimation(*animationDic); ArmatureDataManager::sharedArmatureDataManager()->addAnimationData(animationData->name.c_str(), animationData); @@ -836,7 +836,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent) length = json.getArrayItemCount(TEXTURE_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); + cs::JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); TextureData *textureData = decodeTexture(*textureDic); ArmatureDataManager::sharedArmatureDataManager()->addTextureData(textureData->name.c_str(), textureData); @@ -844,7 +844,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent) } } -ArmatureData *DataReaderHelper::decodeArmature(cs::CSJsonDictionary &json) +ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) { ArmatureData *armatureData = ArmatureData::create(); @@ -857,7 +857,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::CSJsonDictionary &json) int length = json.getArrayItemCount(BONE_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); armatureData->addBoneData(decodeBone(*dic)); delete dic; @@ -866,7 +866,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::CSJsonDictionary &json) return armatureData; } -BoneData *DataReaderHelper::decodeBone(cs::CSJsonDictionary &json) +BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) { BoneData *boneData = BoneData::create(); @@ -888,7 +888,7 @@ BoneData *DataReaderHelper::decodeBone(cs::CSJsonDictionary &json) for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); boneData->addDisplayData(decodeBoneDisplay(*dic)); delete dic; @@ -897,7 +897,7 @@ BoneData *DataReaderHelper::decodeBone(cs::CSJsonDictionary &json) return boneData; } -DisplayData *DataReaderHelper::decodeBoneDisplay(cs::CSJsonDictionary &json) +DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) { DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE); @@ -963,7 +963,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::CSJsonDictionary &json) return displayData; } -AnimationData *DataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json) +AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) { AnimationData *aniData = AnimationData::create(); @@ -977,7 +977,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json) for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); aniData->addMovement(decodeMovement(*dic)); delete dic; @@ -986,7 +986,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json) return aniData; } -MovementData *DataReaderHelper::decodeMovement(cs::CSJsonDictionary &json) +MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) { MovementData *movementData = MovementData::create(); @@ -1005,7 +1005,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::CSJsonDictionary &json) int length = json.getArrayItemCount(MOVEMENT_BONE_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); movementData->addMovementBoneData(decodeMovementBone(*dic)); delete dic; @@ -1014,7 +1014,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::CSJsonDictionary &json) return movementData; } -MovementBoneData *DataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &json) +MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) { MovementBoneData *movementBoneData = MovementBoneData::create(); @@ -1030,7 +1030,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &jso int length = json.getArrayItemCount(FRAME_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); FrameData *frameData = decodeFrame(*dic); movementBoneData->addFrameData(frameData); //movementBoneData->duration += frameData->duration; @@ -1041,7 +1041,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &jso return movementBoneData; } -FrameData *DataReaderHelper::decodeFrame(cs::CSJsonDictionary &json) +FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json) { FrameData *frameData = FrameData::create(); @@ -1060,7 +1060,7 @@ FrameData *DataReaderHelper::decodeFrame(cs::CSJsonDictionary &json) return frameData; } -TextureData *DataReaderHelper::decodeTexture(cs::CSJsonDictionary &json) +TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) { TextureData *textureData = TextureData::create(); @@ -1078,7 +1078,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::CSJsonDictionary &json) int length = json.getArrayItemCount(CONTOUR_DATA); for (int i = 0; i < length; i++) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); textureData->contourDataList->addObject(decodeContour(*dic)); delete dic; @@ -1087,14 +1087,14 @@ TextureData *DataReaderHelper::decodeTexture(cs::CSJsonDictionary &json) return textureData; } -ContourData *DataReaderHelper::decodeContour(cs::CSJsonDictionary &json) +ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) { ContourData *contourData = ContourData::create(); int length = json.getArrayItemCount(VERTEX_POINT); for (int i = length - 1; i >= 0; i--) { - cs::CSJsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); + cs::JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); ContourVertex2F *vertex = new ContourVertex2F(0, 0); @@ -1110,7 +1110,7 @@ ContourData *DataReaderHelper::decodeContour(cs::CSJsonDictionary &json) return contourData; } -void DataReaderHelper::decodeNode(BaseData *node, cs::CSJsonDictionary &json) +void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) { node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale; node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale; @@ -1121,7 +1121,7 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::CSJsonDictionary &json) node->scaleX = json.getItemFloatValue(A_SCALE_X, 1); node->scaleY = json.getItemFloatValue(A_SCALE_Y, 1); - cs::CSJsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); + cs::JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); if (colorDic) { diff --git a/extensions/CCArmature/utils/CCDataReaderHelper.h b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.h similarity index 85% rename from extensions/CCArmature/utils/CCDataReaderHelper.h rename to extensions/CocoStudio/Armature/utils/CCDataReaderHelper.h index 7e16e35ad3..69d310623b 100644 --- a/extensions/CCArmature/utils/CCDataReaderHelper.h +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "../datas/CCDatas.h" #include "../utils/CCConstValue.h" #include "../CCArmature.h" -#include "../external_tool/Json/CSContentJsonDictionary.h" +#include "../../Json/CSContentJsonDictionary.h" namespace tinyxml2 { class XMLElement; } @@ -110,20 +110,20 @@ public: static void addDataFromJson(const char *filePath); static void addDataFromJsonCache(const char *fileContent); - static ArmatureData *decodeArmature(cs::CSJsonDictionary &json); - static BoneData *decodeBone(cs::CSJsonDictionary &json); - static DisplayData *decodeBoneDisplay(cs::CSJsonDictionary &json); + static ArmatureData *decodeArmature(cs::JsonDictionary &json); + static BoneData *decodeBone(cs::JsonDictionary &json); + static DisplayData *decodeBoneDisplay(cs::JsonDictionary &json); - static AnimationData *decodeAnimation(cs::CSJsonDictionary &json); - static MovementData *decodeMovement(cs::CSJsonDictionary &json); - static MovementBoneData *decodeMovementBone(cs::CSJsonDictionary &json); - static FrameData *decodeFrame(cs::CSJsonDictionary &json); + static AnimationData *decodeAnimation(cs::JsonDictionary &json); + static MovementData *decodeMovement(cs::JsonDictionary &json); + static MovementBoneData *decodeMovementBone(cs::JsonDictionary &json); + static FrameData *decodeFrame(cs::JsonDictionary &json); - static TextureData *decodeTexture(cs::CSJsonDictionary &json); + static TextureData *decodeTexture(cs::JsonDictionary &json); - static ContourData *decodeContour(cs::CSJsonDictionary &json); + static ContourData *decodeContour(cs::JsonDictionary &json); - static void decodeNode(BaseData *node, cs::CSJsonDictionary &json); + static void decodeNode(BaseData *node, cs::JsonDictionary &json); }; }}} // namespace cocos2d { namespace extension { namespace armature { diff --git a/extensions/CCArmature/utils/CCSpriteFrameCacheHelper.cpp b/extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp similarity index 100% rename from extensions/CCArmature/utils/CCSpriteFrameCacheHelper.cpp rename to extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp diff --git a/extensions/CCArmature/utils/CCSpriteFrameCacheHelper.h b/extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.h similarity index 100% rename from extensions/CCArmature/utils/CCSpriteFrameCacheHelper.h rename to extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.h diff --git a/extensions/CCArmature/utils/CCTransformHelp.cpp b/extensions/CocoStudio/Armature/utils/CCTransformHelp.cpp similarity index 100% rename from extensions/CCArmature/utils/CCTransformHelp.cpp rename to extensions/CocoStudio/Armature/utils/CCTransformHelp.cpp diff --git a/extensions/CCArmature/utils/CCTransformHelp.h b/extensions/CocoStudio/Armature/utils/CCTransformHelp.h similarity index 100% rename from extensions/CCArmature/utils/CCTransformHelp.h rename to extensions/CocoStudio/Armature/utils/CCTransformHelp.h diff --git a/extensions/CCArmature/utils/CCTweenFunction.cpp b/extensions/CocoStudio/Armature/utils/CCTweenFunction.cpp similarity index 100% rename from extensions/CCArmature/utils/CCTweenFunction.cpp rename to extensions/CocoStudio/Armature/utils/CCTweenFunction.cpp diff --git a/extensions/CCArmature/utils/CCTweenFunction.h b/extensions/CocoStudio/Armature/utils/CCTweenFunction.h similarity index 100% rename from extensions/CCArmature/utils/CCTweenFunction.h rename to extensions/CocoStudio/Armature/utils/CCTweenFunction.h diff --git a/extensions/CCArmature/utils/CCUtilMath.cpp b/extensions/CocoStudio/Armature/utils/CCUtilMath.cpp similarity index 100% rename from extensions/CCArmature/utils/CCUtilMath.cpp rename to extensions/CocoStudio/Armature/utils/CCUtilMath.cpp diff --git a/extensions/CCArmature/utils/CCUtilMath.h b/extensions/CocoStudio/Armature/utils/CCUtilMath.h similarity index 100% rename from extensions/CCArmature/utils/CCUtilMath.h rename to extensions/CocoStudio/Armature/utils/CCUtilMath.h diff --git a/extensions/Components/CCComAttribute.cpp b/extensions/CocoStudio/Components/CCComAttribute.cpp similarity index 96% rename from extensions/Components/CCComAttribute.cpp rename to extensions/CocoStudio/Components/CCComAttribute.cpp index 314cf2e426..30505ab486 100644 --- a/extensions/Components/CCComAttribute.cpp +++ b/extensions/CocoStudio/Components/CCComAttribute.cpp @@ -28,12 +28,14 @@ NS_CC_EXT_BEGIN ComAttribute::ComAttribute(void) : _attributes(NULL) +, _jsonDict(NULL) { _name = "ComAttribute"; } ComAttribute::~ComAttribute(void) { + CC_SAFE_DELETE(_jsonDict); CC_SAFE_RELEASE(_attributes); } @@ -41,6 +43,8 @@ bool ComAttribute::init() { _attributes = Dictionary::create(); _attributes->retain(); + + _jsonDict = new cs::JsonDictionary(); return true; } @@ -180,4 +184,9 @@ Object* ComAttribute::getObject(const char *key) const return _attributes->objectForKey(key); } +cs::JsonDictionary* ComAttribute::getDict() const +{ + return _jsonDict; +} + NS_CC_EXT_END diff --git a/extensions/Components/CCComAttribute.h b/extensions/CocoStudio/Components/CCComAttribute.h similarity index 95% rename from extensions/Components/CCComAttribute.h rename to extensions/CocoStudio/Components/CCComAttribute.h index 3e0855b1d0..3f714f4824 100644 --- a/extensions/Components/CCComAttribute.h +++ b/extensions/CocoStudio/Components/CCComAttribute.h @@ -28,6 +28,7 @@ THE SOFTWARE. #include "cocos2d.h" #include "ExtensionMacros.h" #include +#include "../Json/CSContentJsonDictionary.h" NS_CC_EXT_BEGIN @@ -55,8 +56,10 @@ public: const char* getCString(const char *key) const; Object* getObject(const char *key) const; + cs::JsonDictionary* getDict() const; private: Dictionary *_attributes; + cs::JsonDictionary *_jsonDict; }; diff --git a/extensions/Components/CCComAudio.cpp b/extensions/CocoStudio/Components/CCComAudio.cpp similarity index 94% rename from extensions/Components/CCComAudio.cpp rename to extensions/CocoStudio/Components/CCComAudio.cpp index 93a55b594e..87afa64348 100644 --- a/extensions/Components/CCComAudio.cpp +++ b/extensions/CocoStudio/Components/CCComAudio.cpp @@ -28,6 +28,8 @@ THE SOFTWARE. NS_CC_EXT_BEGIN ComAudio::ComAudio(void) +: _filePath("") +, _loop(false) { _name = "Audio"; } @@ -201,5 +203,24 @@ void ComAudio::unloadEffect(const char *pszFilePath) CocosDenshion::SimpleAudioEngine::getInstance()->unloadEffect(pszFilePath); } +void ComAudio::setFile(const char* pszFilePath) +{ + _filePath.assign(pszFilePath); +} + +void ComAudio::setLoop(bool bLoop) +{ + _loop = bLoop; +} + +const char* ComAudio::getFile() +{ + return _filePath.c_str(); +} + +bool ComAudio::isLoop() +{ + return _loop; +} NS_CC_EXT_END diff --git a/extensions/Components/CCComAudio.h b/extensions/CocoStudio/Components/CCComAudio.h similarity index 94% rename from extensions/Components/CCComAudio.h rename to extensions/CocoStudio/Components/CCComAudio.h index ebf7c38bed..0360bcaac0 100644 --- a/extensions/Components/CCComAudio.h +++ b/extensions/CocoStudio/Components/CCComAudio.h @@ -71,6 +71,13 @@ public: void stopAllEffects(); void preloadEffect(const char* pszFilePath); void unloadEffect(const char* pszFilePath); + void setFile(const char* pszFilePath); + const char* getFile(); + void setLoop(bool bLoop); + bool isLoop(); +private: + std::string _filePath; + bool _loop; }; NS_CC_EXT_END diff --git a/extensions/Components/CCComController.cpp b/extensions/CocoStudio/Components/CCComController.cpp similarity index 100% rename from extensions/Components/CCComController.cpp rename to extensions/CocoStudio/Components/CCComController.cpp diff --git a/extensions/Components/CCComController.h b/extensions/CocoStudio/Components/CCComController.h similarity index 100% rename from extensions/Components/CCComController.h rename to extensions/CocoStudio/Components/CCComController.h diff --git a/extensions/CocoStudio/Components/CCComRender.cpp b/extensions/CocoStudio/Components/CCComRender.cpp new file mode 100644 index 0000000000..4dbc18c464 --- /dev/null +++ b/extensions/CocoStudio/Components/CCComRender.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "CCComRender.h" + +NS_CC_EXT_BEGIN + +ComRender::ComRender(void) +: _render(NULL) +{ + +} + + +ComRender::ComRender(cocos2d::Node *node, const char *comName) +{ + _render = node; + _name.assign(comName); +} + +ComRender::~ComRender(void) +{ + _render = NULL; +} + +void ComRender::onEnter() +{ + if (_owner != NULL) + { + _owner->addChild(_render); + } +} + +void ComRender::onExit() +{ + _render = NULL; +} + +cocos2d::Node* ComRender::getNode() +{ + return _render; +} + +ComRender* ComRender::create(cocos2d::Node *pNode, const char *comName) +{ + ComRender * pRet = new ComRender(pNode, comName); + if (pRet != NULL && pRet->init()) + { + pRet->autorelease(); + } + else + { + CC_SAFE_DELETE(pRet); + } + return pRet; +} + +NS_CC_EXT_END diff --git a/extensions/CocoStudio/Components/CCComRender.h b/extensions/CocoStudio/Components/CCComRender.h new file mode 100644 index 0000000000..2be80d6d81 --- /dev/null +++ b/extensions/CocoStudio/Components/CCComRender.h @@ -0,0 +1,53 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __CC_EXTENTIONS_CCCOMNODE_H__ +#define __CC_EXTENTIONS_CCCOMNODE_H__ + +#include "cocos2d.h" +#include "cocos-ext.h" +#include "ExtensionMacros.h" + +NS_CC_EXT_BEGIN + +class ComRender : public cocos2d::Component +{ +protected: + ComRender(void); + ComRender(cocos2d::Node *node, const char *comName); + virtual ~ComRender(void); + +public: + virtual void onEnter(); + virtual void onExit(); + cocos2d::Node* getNode(); + + static ComRender* create(cocos2d::Node *pNode, const char *comName); + +private: + cocos2d::Node *_render; +}; + +NS_CC_EXT_END +#endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/extensions/Components/CCInputDelegate.cpp b/extensions/CocoStudio/Components/CCInputDelegate.cpp similarity index 100% rename from extensions/Components/CCInputDelegate.cpp rename to extensions/CocoStudio/Components/CCInputDelegate.cpp diff --git a/extensions/Components/CCInputDelegate.h b/extensions/CocoStudio/Components/CCInputDelegate.h similarity index 100% rename from extensions/Components/CCInputDelegate.h rename to extensions/CocoStudio/Components/CCInputDelegate.h diff --git a/extensions/CocoStudio/Json/CSContentJsonDictionary.cpp b/extensions/CocoStudio/Json/CSContentJsonDictionary.cpp new file mode 100644 index 0000000000..afb37dc624 --- /dev/null +++ b/extensions/CocoStudio/Json/CSContentJsonDictionary.cpp @@ -0,0 +1,388 @@ +/* + * Copyright (c) 2012 Chukong Technologies, Inc. + * + * http://www.cocostudio.com + * http://tools.cocoachina.com + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "CSContentJsonDictionary.h" + +namespace cs { + + JsonDictionary::JsonDictionary() + { + m_cValue.clear(); + } + + + JsonDictionary::~JsonDictionary() + { + m_cValue.clear(); + } + + + void JsonDictionary::initWithDescription(const char *pszDescription) + { + CSJson::Reader cReader; + m_cValue.clear(); + if (pszDescription && *pszDescription) + { + std::string strValue = pszDescription; + cReader.parse(strValue, m_cValue, false); + } + } + + + void JsonDictionary::initWithValue(CSJson::Value& value) + { + m_cValue = value; + } + + + void JsonDictionary::insertItem(const char *pszKey, int nValue) + { + m_cValue[pszKey] = nValue; + } + + + void JsonDictionary::insertItem(const char *pszKey, double fValue) + { + m_cValue[pszKey] = fValue; + } + + + void JsonDictionary::insertItem(const char *pszKey, const char * pszValue) + { + m_cValue[pszKey] = pszValue; + } + + void JsonDictionary::insertItem(const char *pszKey, bool bValue) + { + m_cValue[pszKey] = bValue; + } + + void JsonDictionary::insertItem(const char *pszKey, JsonDictionary * subDictionary) + { + if (subDictionary) + m_cValue[pszKey] = subDictionary->m_cValue; + } + + + bool JsonDictionary::deleteItem(const char *pszKey) + { + if(!m_cValue.isMember(pszKey)) + return false; + + m_cValue.removeMember(pszKey); + + return true; + } + + + void JsonDictionary::cleanUp() + { + m_cValue.clear(); + } + + + bool JsonDictionary::isKeyValidate(const char *pszKey) + { + return m_cValue.isMember(pszKey); + } + + + int JsonDictionary::getItemIntValue(const char *pszKey, int nDefaultValue) + { + if (!isKeyValidate(pszKey, m_cValue) || !m_cValue[pszKey].isNumeric()) + return nDefaultValue; + + return m_cValue[pszKey].asInt(); + } + + + double JsonDictionary::getItemFloatValue(const char *pszKey, double fDefaultValue) + { + if (!isKeyValidate(pszKey, m_cValue) || !m_cValue[pszKey].isNumeric()) + return fDefaultValue; + + return m_cValue[pszKey].asDouble(); + } + + + const char * JsonDictionary::getItemStringValue(const char *pszKey) + { + if (!isKeyValidate(pszKey, m_cValue) || !m_cValue[pszKey].isString()) + return NULL; + + return m_cValue[pszKey].asCString(); + } + + bool JsonDictionary::getItemBoolvalue(const char *pszKey, bool bDefaultValue) + { + if (!isKeyValidate(pszKey, m_cValue) || !m_cValue[pszKey].isBool()) + return bDefaultValue; + + return m_cValue[pszKey].asBool(); + } + + + JsonDictionary * JsonDictionary::getSubDictionary(const char *pszKey) + { + JsonDictionary * pNewDictionary; + if (!isKeyValidate(pszKey, m_cValue) || (!m_cValue[pszKey].isArray() && + !m_cValue[pszKey].isObject() && + !m_cValue[pszKey].isConvertibleTo(CSJson::arrayValue) && + !m_cValue[pszKey].isConvertibleTo(CSJson::objectValue))) + { + pNewDictionary = NULL; + } + else + { + pNewDictionary = new JsonDictionary(); + pNewDictionary->initWithValue(m_cValue[pszKey]); + } + return pNewDictionary; + } + + + std::string JsonDictionary::getDescription() + { + std::string strReturn = m_cValue.toStyledString(); + return strReturn; + } + + + bool JsonDictionary::insertItemToArray(const char *pszArrayKey, int nValue) + { + CSJson::Value array; + if(m_cValue.isMember(pszArrayKey)) + { + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + return false; + + array = m_cValue[pszArrayKey]; + } + + array.append(nValue); + m_cValue[pszArrayKey] = array; + + return true; + } + + + bool JsonDictionary::insertItemToArray(const char *pszArrayKey, double fValue) + { + CSJson::Value array; + if(m_cValue.isMember(pszArrayKey)) + { + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + return false; + + array = m_cValue[pszArrayKey]; + } + + array.append(fValue); + m_cValue[pszArrayKey] = array; + + return true; + } + + + bool JsonDictionary::insertItemToArray(const char *pszArrayKey, const char * pszValue) + { + CSJson::Value array; + if(m_cValue.isMember(pszArrayKey)) + { + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + return false; + + array = m_cValue[pszArrayKey]; + } + + array.append(pszValue); + m_cValue[pszArrayKey] = array; + + return true; + } + + + bool JsonDictionary::insertItemToArray(const char *pszArrayKey, JsonDictionary * subDictionary) + { + CSJson::Value array; + if(m_cValue.isMember(pszArrayKey)) + { + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + return false; + + array = m_cValue[pszArrayKey]; + } + + array.append(subDictionary->m_cValue); + m_cValue[pszArrayKey] = array; + + return true; + } + + + int JsonDictionary::getItemCount() + { + return m_cValue.size(); + } + + + DicItemType JsonDictionary::getItemType(int nIndex) + { + return (DicItemType)m_cValue[nIndex].type(); + } + + + DicItemType JsonDictionary::getItemType(const char *pszKey) + { + return (DicItemType)m_cValue[pszKey].type(); + } + + std::vector JsonDictionary::getAllMemberNames() + { + return m_cValue.getMemberNames(); + } + + + int JsonDictionary::getArrayItemCount(const char *pszArrayKey) + { + int nRet = 0; + if (!isKeyValidate(pszArrayKey, m_cValue) || + (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isObject() && + !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue) && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::objectValue))) + { + nRet = 0; + } + else + { + CSJson::Value arrayValue = m_cValue[pszArrayKey]; + nRet = arrayValue.size(); + } + + return nRet; + } + + + int JsonDictionary::getIntValueFromArray(const char *pszArrayKey, int nIndex, int nDefaultValue) + { + int nRet = nDefaultValue; + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + { + if ((*arrayValue)[nIndex].isNumeric()) + nRet = (*arrayValue)[nIndex].asInt(); + } + + return nRet; + } + + + double JsonDictionary::getFloatValueFromArray(const char *pszArrayKey, int nIndex, double fDefaultValue) + { + double fRet = fDefaultValue; + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + { + if ((*arrayValue)[nIndex].isNumeric()) + fRet = (*arrayValue)[nIndex].asDouble(); + } + + return fRet; + } + + bool JsonDictionary::getBoolValueFromArray(const char *pszArrayKey, int nIndex, bool bDefaultValue) + { + bool bRet = bDefaultValue; + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + { + if ((*arrayValue)[nIndex].isNumeric()) + bRet = (*arrayValue)[nIndex].asBool(); + } + + return bRet; + } + + + const char * JsonDictionary::getStringValueFromArray(const char *pszArrayKey, int nIndex) + { + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + { + if ((*arrayValue)[nIndex].isString()) + return (*arrayValue)[nIndex].asCString(); + } + + return NULL; + } + + + JsonDictionary * JsonDictionary::getSubItemFromArray(const char *pszArrayKey, int nIndex) + { + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + { + if ((*arrayValue)[nIndex].isArray() || (*arrayValue)[nIndex].isObject()) + { + JsonDictionary * pNewDictionary = new JsonDictionary(); + pNewDictionary->initWithValue((*arrayValue)[nIndex]); + return pNewDictionary; + } + } + + return NULL; + } + + + DicItemType JsonDictionary::getItemTypeFromArray(const char *pszArrayKey, int nIndex) + { + CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + if (arrayValue) + return (DicItemType)((*arrayValue)[nIndex].type()); + + return (DicItemType)CSJson::nullValue; + } + + + inline bool JsonDictionary::isKeyValidate(const char *pszKey, CSJson::Value& root) + { + if (root.isNull() || !root.isMember(pszKey)) + return false; + + return true; + } + + + inline CSJson::Value * JsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) + { + if (!isKeyValidate(pszArrayKey, m_cValue) && !m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + return NULL; + if (!m_cValue[pszArrayKey].isValidIndex(nIndex)) + return NULL; + + return &m_cValue[pszArrayKey]; + } +} diff --git a/extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.h b/extensions/CocoStudio/Json/CSContentJsonDictionary.h similarity index 87% rename from extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.h rename to extensions/CocoStudio/Json/CSContentJsonDictionary.h index 1d95f8c8b0..3908e71545 100644 --- a/extensions/CCArmature/external_tool/Json/CSContentJsonDictionary.h +++ b/extensions/CocoStudio/Json/CSContentJsonDictionary.h @@ -46,18 +46,18 @@ namespace cs { EDIC_TYPEOBJECT }DicItemType; - class CSJsonDictionary + class JsonDictionary { public: - CSJsonDictionary(); - ~CSJsonDictionary(); + JsonDictionary(); + ~JsonDictionary(); public: void initWithDescription(const char *pszDescription); void insertItem(const char *pszKey, int nValue); void insertItem(const char *pszKey, double fValue); void insertItem(const char *pszKey, const char * pszValue); - void insertItem(const char *pszKey, CSJsonDictionary * subDictionary); + void insertItem(const char *pszKey, JsonDictionary * subDictionary); void insertItem(const char *pszKey, bool bValue); bool deleteItem(const char *pszKey); void cleanUp(); @@ -67,20 +67,21 @@ namespace cs { double getItemFloatValue(const char *pszKey, double fDefaultValue); const char * getItemStringValue(const char *pszKey); bool getItemBoolvalue(const char *pszKey, bool bDefaultValue); - CSJsonDictionary * getSubDictionary(const char *pszKey); + JsonDictionary * getSubDictionary(const char *pszKey); std::string getDescription(); bool insertItemToArray(const char *pszArrayKey, int nValue); bool insertItemToArray(const char *pszArrayKey, double fValue); bool insertItemToArray(const char *pszArrayKey, const char * pszValue); - bool insertItemToArray(const char *pszArrayKey, CSJsonDictionary * subDictionary); + bool insertItemToArray(const char *pszArrayKey, JsonDictionary * subDictionary); int getArrayItemCount(const char *pszArrayKey); int getIntValueFromArray(const char *pszArrayKey, int nIndex, int nDefaultValue); double getFloatValueFromArray(const char *pszArrayKey, int nIndex, double fDefaultValue); + bool getBoolValueFromArray(const char *pszArrayKey, int nIndex, bool bDefaultValue); const char * getStringValueFromArray(const char *pszArrayKey, int nIndex); - CSJsonDictionary *getSubItemFromArray(const char *pszArrayKey, int nIndex); + JsonDictionary *getSubItemFromArray(const char *pszArrayKey, int nIndex); DicItemType getItemTypeFromArray(const char *pszArrayKey, int nIndex); int getItemCount(); @@ -89,7 +90,7 @@ namespace cs { std::vector getAllMemberNames(); protected: - CSJson::Value _value; + CSJson::Value m_cValue; private: void initWithValue(CSJson::Value& value); diff --git a/extensions/CocoStudio/Json/DictionaryHelper.cpp b/extensions/CocoStudio/Json/DictionaryHelper.cpp new file mode 100644 index 0000000000..db93ba1563 --- /dev/null +++ b/extensions/CocoStudio/Json/DictionaryHelper.cpp @@ -0,0 +1,289 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "DictionaryHelper.h" + +NS_CC_EXT_BEGIN + +static DictionaryHelper* sharedHelper = NULL; + +DictionaryHelper::DictionaryHelper() +{ + +} + +DictionaryHelper::~DictionaryHelper() +{ + +} + +DictionaryHelper* DictionaryHelper::shareHelper() +{ + if (!sharedHelper) { + sharedHelper = new DictionaryHelper(); + } + return sharedHelper; +} + +void DictionaryHelper::purgeDictionaryHelper() +{ + CC_SAFE_DELETE(sharedHelper); +} + +cocos2d::Dictionary* DictionaryHelper::getSubDictionary(cocos2d::Dictionary* root,const char* key) +{ + if (!root) { + return NULL; + } + cocos2d::Object* obj = root->objectForKey(key); + if (!obj) { + return NULL; + } + return (cocos2d::Dictionary*)(obj); +} + +int DictionaryHelper::getIntValue(cocos2d::Dictionary* root,const char* key) +{ + if (!root) { + return 0; + } + cocos2d::Object* obj = root->objectForKey(key); + if (!obj) { + return 0; + } + + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->intValue(); +} + +float DictionaryHelper::getFloatValue(cocos2d::Dictionary* root,const char* key) +{ + if (!root) { + return 0.0; + } + cocos2d::Object* obj = root->objectForKey(key); + if (!obj) { + return 0.0f; + } + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->floatValue(); +} + +const char* DictionaryHelper::getStringValue(cocos2d::Dictionary* root,const char* key) +{ + if (!root) { + return NULL; + } + cocos2d::Object* obj = root->objectForKey(key); + if (!obj) { + return NULL; + } + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->_string.c_str(); +} + +bool DictionaryHelper::getBooleanValue(cocos2d::Dictionary* root,const char* key) +{ + return this->getIntValue(root, key); +} + +cocos2d::Array* DictionaryHelper::getArrayValue(cocos2d::Dictionary *root, const char *key) +{ + if (!root) { + return NULL; + } + cocos2d::Object* obj = root->objectForKey(key); + if (!obj) { + return NULL; + } + cocos2d::Array* array = (cocos2d::Array*)(obj); + return array; +} + +cocos2d::Object* DictionaryHelper::checkObjectExist(cocos2d::Dictionary *root, const char *key) +{ + if (!root) { + return NULL; + } + return root->objectForKey(key); +} + +int DictionaryHelper::objectToIntValue(cocos2d::Object *obj) +{ + if (!obj) + { + return 0; + } + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->intValue(); +} + +float DictionaryHelper::objectToFloatValue(cocos2d::Object *obj) +{ + if (!obj) + { + return 0.0f; + } + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->floatValue(); +} + +const char* DictionaryHelper::objectToStringValue(cocos2d::Object *obj) +{ + if (!obj) + { + return NULL; + } + cocos2d::String* cstr = (cocos2d::String*)(obj); + return cstr->_string.c_str(); +} + +bool DictionaryHelper::objectToBooleanValue(cocos2d::Object *obj) +{ + if (!obj) + { + return 0; + } + return this->objectToIntValue(obj); +} + +cocos2d::Array* DictionaryHelper::objectToCCArray(cocos2d::Object *obj) +{ + if (!obj) + { + return NULL; + } + cocos2d::Array* array = (cocos2d::Array*)(obj); + return array; +} + +cs::JsonDictionary* DictionaryHelper::getSubDictionary_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return NULL; + } + return root->getSubDictionary(key); +} + +int DictionaryHelper::getIntValue_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return 0; + } + return root->getItemIntValue(key, 0); +} + +float DictionaryHelper::getFloatValue_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return 0.0f; + } + return root->getItemFloatValue(key, 0.0); +} + +const char* DictionaryHelper::getStringValue_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return NULL; + } + return root->getItemStringValue(key); +} + +bool DictionaryHelper::getBooleanValue_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return 0; + } + return root->getItemBoolvalue(key, false); +} + +int DictionaryHelper::getArrayCount_json(cs::JsonDictionary* root,const char* key) +{ + if (!root) + { + return 0; + } + return root->getArrayItemCount(key); +} + +int DictionaryHelper::getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +{ + if (!root) + { + return 0; + } + return root->getIntValueFromArray(arrayKey, idx, 0); +} + +float DictionaryHelper::getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +{ + if (!root) + { + return 0.0f; + } + return root->getFloatValueFromArray(arrayKey, idx, 0.0); +} + +bool DictionaryHelper::getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +{ + if (!root) + { + return false; + } + return root->getBoolValueFromArray(arrayKey, idx, false); +} + +const char* DictionaryHelper::getStringValueFromArray_json(cs::JsonDictionary *root, const char *arrayKey, int idx) +{ + if (!root) + { + return NULL; + } + return root->getStringValueFromArray(arrayKey, idx); +} + +cs::JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +{ + if (!root) + { + return NULL; + } + return root->getSubItemFromArray(arrayKey, idx); +} + +bool DictionaryHelper::checkObjectExist_json(cs::JsonDictionary *root, const char *key) +{ + if (!root) + { + return false; + } + return root->isKeyValidate(key); +} + +NS_CC_EXT_END \ No newline at end of file diff --git a/extensions/CocoStudio/Json/DictionaryHelper.h b/extensions/CocoStudio/Json/DictionaryHelper.h new file mode 100644 index 0000000000..e63e3173e2 --- /dev/null +++ b/extensions/CocoStudio/Json/DictionaryHelper.h @@ -0,0 +1,72 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __DICTIONARYHELPER_H__ +#define __DICTIONARYHELPER_H__ + +#include "cocos2d.h" +#include "cocos-ext.h" +#include "ExtensionMacros.h" + +#define DICTOOL DictionaryHelper::shareHelper() + +NS_CC_EXT_BEGIN + +class DictionaryHelper +{ +public: + DictionaryHelper(); + ~DictionaryHelper(); + static DictionaryHelper* shareHelper(); + static void purgeDictionaryHelper(); + cocos2d::CCDictionary* getSubDictionary(cocos2d::CCDictionary* root,const char* key); + int getIntValue(cocos2d::CCDictionary* root,const char* key); + float getFloatValue(cocos2d::CCDictionary* root,const char* key); + const char* getStringValue(cocos2d::CCDictionary* root,const char* key); + bool getBooleanValue(cocos2d::CCDictionary* root,const char* key); + cocos2d::CCArray* getArrayValue(cocos2d::CCDictionary* root,const char* key); + cocos2d::CCObject* checkObjectExist(cocos2d::CCDictionary* root,const char* key); + int objectToIntValue(cocos2d::CCObject* obj); + float objectToFloatValue(cocos2d::CCObject* obj); + const char* objectToStringValue(cocos2d::CCObject* obj); + bool objectToBooleanValue(cocos2d::CCObject* obj); + cocos2d::CCArray* objectToCCArray(cocos2d::CCObject* obj); + + cs::JsonDictionary* getSubDictionary_json(cs::JsonDictionary* root,const char* key); + int getIntValue_json(cs::JsonDictionary* root,const char* key); + float getFloatValue_json(cs::JsonDictionary* root,const char* key); + const char* getStringValue_json(cs::JsonDictionary* root,const char* key); + bool getBooleanValue_json(cs::JsonDictionary* root,const char* key); + int getArrayCount_json(cs::JsonDictionary* root,const char* key); + int getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); + float getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); + bool getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); + const char* getStringValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); + cs::JsonDictionary* getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); + bool checkObjectExist_json(cs::JsonDictionary* root,const char* key); +}; + +NS_CC_EXT_END + +#endif /* defined(__CocoGUI__DictionaryHelper__) */ diff --git a/extensions/CCArmature/external_tool/Json/lib_json/autolink.h b/extensions/CocoStudio/Json/lib_json/autolink.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/autolink.h rename to extensions/CocoStudio/Json/lib_json/autolink.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/config.h b/extensions/CocoStudio/Json/lib_json/config.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/config.h rename to extensions/CocoStudio/Json/lib_json/config.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/features.h b/extensions/CocoStudio/Json/lib_json/features.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/features.h rename to extensions/CocoStudio/Json/lib_json/features.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/forwards.h b/extensions/CocoStudio/Json/lib_json/forwards.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/forwards.h rename to extensions/CocoStudio/Json/lib_json/forwards.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_batchallocator.h b/extensions/CocoStudio/Json/lib_json/json_batchallocator.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_batchallocator.h rename to extensions/CocoStudio/Json/lib_json/json_batchallocator.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_internalarray.inl b/extensions/CocoStudio/Json/lib_json/json_internalarray.inl similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_internalarray.inl rename to extensions/CocoStudio/Json/lib_json/json_internalarray.inl diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_internalmap.inl b/extensions/CocoStudio/Json/lib_json/json_internalmap.inl similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_internalmap.inl rename to extensions/CocoStudio/Json/lib_json/json_internalmap.inl diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_lib.h b/extensions/CocoStudio/Json/lib_json/json_lib.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_lib.h rename to extensions/CocoStudio/Json/lib_json/json_lib.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_reader.cpp b/extensions/CocoStudio/Json/lib_json/json_reader.cpp similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_reader.cpp rename to extensions/CocoStudio/Json/lib_json/json_reader.cpp diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_tool.h b/extensions/CocoStudio/Json/lib_json/json_tool.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_tool.h rename to extensions/CocoStudio/Json/lib_json/json_tool.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_value.cpp b/extensions/CocoStudio/Json/lib_json/json_value.cpp similarity index 99% rename from extensions/CCArmature/external_tool/Json/lib_json/json_value.cpp rename to extensions/CocoStudio/Json/lib_json/json_value.cpp index 0090a5279d..e62b9c36a1 100644 --- a/extensions/CCArmature/external_tool/Json/lib_json/json_value.cpp +++ b/extensions/CocoStudio/Json/lib_json/json_value.cpp @@ -480,7 +480,12 @@ Value::~Value() #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: - delete value_.map_; + if (value_.map_ != NULL) + { + value_.map_->clear(); + delete value_.map_; + value_.map_ = NULL; + } break; #else case arrayValue: @@ -1028,12 +1033,17 @@ Value::clear() case arrayValue: case objectValue: // value_.map_->clear(); - if (!value_.map_) + if (value_.map_ != NULL) { value_.map_->clear(); delete value_.map_; value_.map_ = NULL; } + if (value_.string_ != NULL) + { + delete value_.string_; + value_.string_ = NULL; + } break; #else case arrayValue: diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_valueiterator.inl b/extensions/CocoStudio/Json/lib_json/json_valueiterator.inl similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_valueiterator.inl rename to extensions/CocoStudio/Json/lib_json/json_valueiterator.inl diff --git a/extensions/CCArmature/external_tool/Json/lib_json/json_writer.cpp b/extensions/CocoStudio/Json/lib_json/json_writer.cpp similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/json_writer.cpp rename to extensions/CocoStudio/Json/lib_json/json_writer.cpp diff --git a/extensions/CCArmature/external_tool/Json/lib_json/reader.h b/extensions/CocoStudio/Json/lib_json/reader.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/reader.h rename to extensions/CocoStudio/Json/lib_json/reader.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/sconscript b/extensions/CocoStudio/Json/lib_json/sconscript similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/sconscript rename to extensions/CocoStudio/Json/lib_json/sconscript diff --git a/extensions/CCArmature/external_tool/Json/lib_json/value.h b/extensions/CocoStudio/Json/lib_json/value.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/value.h rename to extensions/CocoStudio/Json/lib_json/value.h diff --git a/extensions/CCArmature/external_tool/Json/lib_json/writer.h b/extensions/CocoStudio/Json/lib_json/writer.h similarity index 100% rename from extensions/CCArmature/external_tool/Json/lib_json/writer.h rename to extensions/CocoStudio/Json/lib_json/writer.h diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.cpp b/extensions/CocoStudio/Reader/CCSSceneReader.cpp new file mode 100644 index 0000000000..e4abe0e35d --- /dev/null +++ b/extensions/CocoStudio/Reader/CCSSceneReader.cpp @@ -0,0 +1,397 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "CCSSceneReader.h" +#include "cocos-ext.h" + +NS_CC_EXT_BEGIN + + SceneReader* SceneReader::s_sharedReader = NULL; + + SceneReader::SceneReader() + { + } + + SceneReader::~SceneReader() + { + } + + const char* SceneReader::sceneReaderVersion() + { + return "0.1.0.0"; + } + + cocos2d::Node* SceneReader::createNodeWithSceneFile(const char* pszFileName) + { + unsigned long size = 0; + const char* pData = 0; + cocos2d::Node *pNode = NULL; + do { + CC_BREAK_IF(pszFileName == NULL); + std::string strFileName(pszFileName); + if (std::string::npos != strFileName.find_last_of('/')) + { + strFileName = strFileName.substr(0, strFileName.find_last_of('/') + 1); + cocos2d::CCFileUtils::sharedFileUtils()->addSearchPath(strFileName.c_str()); + } + pData = (char*)(cocos2d::CCFileUtils::sharedFileUtils()->getFileData(pszFileName, "r", &size)); + CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0); + cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + jsonDict->initWithDescription(pData); + pNode = createObject(jsonDict,NULL); + CC_SAFE_DELETE(jsonDict); + } while (0); + + return pNode; + } + + Node* SceneReader::createObject(cs::JsonDictionary * inputFiles, Node* parenet) + { + const char *className = inputFiles->getItemStringValue("classname"); + if(strcmp(className, "CCNode") == 0) + { + Node* gb = NULL; + if(NULL == parenet) + { + gb = Node::create(); + } + else + { + gb = Node::create(); + parenet->addChild(gb); + } + + setPropertyFromJsonDict(gb, inputFiles); + + int count = inputFiles->getArrayItemCount("components"); + for (int i = 0; i < count; i++) + { + cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); + if (!subDict) + { + CC_SAFE_DELETE(subDict); + break; + } + const char *comName = subDict->getItemStringValue("classname"); + const char *pComName = subDict->getItemStringValue("name"); + + cs::JsonDictionary *fileData = subDict->getSubDictionary("fileData"); + std::string pPath; + std::string pPlistFile; + int nResType = 0; + if (fileData != NULL) + { + const char *file = fileData->getItemStringValue("path"); + nResType = fileData->getItemIntValue("resourceType", -1); + const char *plistFile = fileData->getItemStringValue("plistFile"); + if (file != NULL) + { + pPath.append(cocos2d::CCFileUtils::sharedFileUtils()->fullPathForFilename(file)); + } + + if (plistFile != NULL) + { + pPlistFile.append(cocos2d::CCFileUtils::sharedFileUtils()->fullPathForFilename(plistFile)); + } + CC_SAFE_DELETE(fileData); + } + + if (comName != NULL && strcmp(comName, "CCSprite") == 0) + { + cocos2d::Sprite *pSprite = NULL; + + if (nResType == 0) + { + if (pPath.find(".png") == pPath.npos) + { + continue; + } + pSprite = Sprite::create(pPath.c_str()); + } + else if (nResType == 1) + { + std::string pngFile = pPlistFile; + std::string::size_type pos = pngFile.find(".plist"); + if (pos == pPath.npos) + { + continue; + } + pngFile.replace(pos, pngFile.length(), ".png"); + CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); + pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); + } + else + { + continue; + } + + ComRender *pRender = ComRender::create(pSprite, "CCSprite"); + if (pComName != NULL) + { + pRender->setName(pComName); + } + + gb->addComponent(pRender); + } + else if(comName != NULL && strcmp(comName, "CCTMXTiledMap") == 0) + { + cocos2d::TMXTiledMap *pTmx = NULL; + if (nResType == 0) + { + if (pPath.find(".tmx") == pPath.npos) + { + continue; + } + pTmx = TMXTiledMap::create(pPath.c_str()); + } + else + { + continue; + } + + ComRender *pRender = ComRender::create(pTmx, "CCTMXTiledMap"); + if (pComName != NULL) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + } + else if(comName != NULL && strcmp(comName, "CCParticleSystemQuad") == 0) + { + std::string::size_type pos = pPath.find(".plist"); + if (pos == pPath.npos) + { + continue; + } + + cocos2d::ParticleSystemQuad *pParticle = NULL; + if (nResType == 0) + { + pParticle = ParticleSystemQuad::create(pPath.c_str()); + } + else + { + CCLog("unknown resourcetype on CCParticleSystemQuad!"); + } + + pParticle->setPosition(0, 0); + ComRender *pRender = ComRender::create(pParticle, "CCParticleSystemQuad"); + if (pComName != NULL) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + } + else if(comName != NULL && strcmp(comName, "CCArmature") == 0) + { + continue; + if (nResType != 0) + { + continue; + } + std::string reDir = pPath; + std::string file_path = ""; + size_t pos = reDir.find_last_of('/'); + if (pos != std::string::npos) + { + file_path = reDir.substr(0, pos+1); + } + unsigned long size = 0; + const char *des = (char*)(cocos2d::FileUtils::sharedFileUtils()->getFileData(pPath.c_str(),"r" , &size)); + cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + jsonDict->initWithDescription(des); + if(NULL == des || strcmp(des, "") == 0) + { + CCLog("read json file[%s] error!\n", pPath.c_str()); + } + + int childrenCount = DICTOOL->getArrayCount_json(jsonDict, "armature_data"); + cs::JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); + const char *name = DICTOOL->getStringValue_json(subData, "name"); + + childrenCount = DICTOOL->getArrayCount_json(jsonDict, "config_file_path"); + for (int i = 0; i < childrenCount; ++i) + { + const char* plist = DICTOOL->getStringValueFromArray_json(jsonDict, "config_file_path", i); + std::string plistpath; + plistpath += file_path; + plistpath.append(plist); + cocos2d::CCDictionary *root = CCDictionary::createWithContentsOfFile(plistpath.c_str()); + CCDictionary* metadata = DICTOOL->getSubDictionary(root, "metadata"); + const char* textureFileName = DICTOOL->getStringValue(metadata, "textureFileName"); + + std::string textupath; + textupath += file_path; + textupath.append(textureFileName); + + cocos2d::extension::armature::CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); + + } + + cocos2d::extension::armature::Armature *pAr = cocos2d::extension::armature::Armature::create(name); + ComRender *pRender = ComRender::create(pAr, "CCArmature"); + if (pComName != NULL) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + + const char *actionName = subDict->getItemStringValue("selectedactionname"); + if (actionName != NULL && pAr->getAnimation() != NULL) + { + pAr->getAnimation()->play(actionName); + } + + CC_SAFE_DELETE(jsonDict); + CC_SAFE_DELETE(subData); + CC_SAFE_DELETE_ARRAY(des); + } + else if(comName != NULL && strcmp(comName, "CCComAudio") == 0) + { + CCComAudio *pAudio = NULL; + if (nResType == 0) + { + pAudio = CCComAudio::create(); + } + else + { + continue; + } + pAudio->preloadEffect(pPath.c_str()); + gb->addComponent(pAudio); + } + else if(comName != NULL && strcmp(comName, "CCComAttribute") == 0) + { + ComAttribute *pAttribute = NULL; + if (nResType == 0) + { + pAttribute = ComAttribute::create(); + unsigned long size = 0; + const char* pData = 0; + pData = (char*)(cocos2d::CCFileUtils::sharedFileUtils()->getFileData(pPath.c_str(), "r", &size)); + if(pData != NULL && strcmp(pData, "") != 0) + { + pAttribute->getDict()->initWithDescription(pData); + } + } + else + { + CCLog("unknown resourcetype on CCComAttribute!"); + continue; + } + gb->addComponent(pAttribute); + } + else if (comName != NULL && strcmp(comName, "CCBackgroundAudio") == 0) + { + ComAudio *pAudio = NULL; + if (nResType == 0) + { + pAudio = CCComAudio::create(); + } + else + { + continue; + } + pAudio->preloadBackgroundMusic(pPath.c_str()); + pAudio->setFile(pPath.c_str()); + bool bLoop = subDict->getItemIntValue("loop", 0); + pAudio->setLoop(bLoop); + gb->addComponent(pAudio); + pAudio->playBackgroundMusic(pPath.c_str(), bLoop); + } + else if(comName != NULL && strcmp(comName, "GUIComponent") == 0) + { + /* cocos2d::extension::UILayer *pLayer = cocos2d::extension::UILayer::create(); + pLayer->scheduleUpdate(); + UIWidget* widget=cocos2d::extension::UIHelper::instance()->createWidgetFromJsonFile(pPath.c_str()); + pLayer->addWidget(widget); + CCComRender *pRender = CCComRender::create(pLayer, "GUIComponent"); + if (pComName != NULL) + { + pRender->setName(pComName); + } + gb->addComponent(pRender);*/ + } + + CC_SAFE_DELETE(subDict); + } + + for (int i = 0; i < inputFiles->getArrayItemCount("gameobjects"); i++) + { + cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("gameobjects", i); + if (!subDict) + { + break; + } + createObject(subDict, gb); + CC_SAFE_DELETE(subDict); + } + + return gb; + } + + return NULL; + } + + + void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict) + { + int x = dict->getItemIntValue("x", 0); + int y = dict->getItemIntValue("y", 0); + node->setPosition(ccp(x, y)); + + bool bVisible = (bool)(dict->getItemIntValue("visible", 1)); + node->setVisible(bVisible); + + int nTag = dict->getItemIntValue("objecttag", -1); + node->setTag(nTag); + + int nZorder = dict->getItemIntValue("zorder", 0); + node->setZOrder(nZorder); + + float fScaleX = dict->getItemFloatValue("scalex", 1.0); + float fScaleY = dict->getItemFloatValue("scaley", 1.0); + node->setScaleX(fScaleX); + node->setScaleY(fScaleY); + + float fRotationZ = dict->getItemIntValue("rotation", 0); + node->setRotation(fRotationZ); + } + + SceneReader* SceneReader::sharedSceneReader() + { + if (s_sharedReader == NULL) + { + s_sharedReader = new SceneReader(); + } + return s_sharedReader; + } + + void SceneReader::purgeSceneReader() + { + CC_SAFE_DELETE(s_sharedReader); + cocos2d::extension::DictionaryHelper::shareHelper()->purgeDictionaryHelper(); + } + +NS_CC_EXT_END diff --git a/extensions/CocoStudio/Reader/CCSSceneReader.h b/extensions/CocoStudio/Reader/CCSSceneReader.h new file mode 100644 index 0000000000..0595509cf0 --- /dev/null +++ b/extensions/CocoStudio/Reader/CCSSceneReader.h @@ -0,0 +1,56 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CCSSCENEREADER_H__ +#define __CCSSCENEREADER_H__ + +#include "cocos2d.h" +#include "cocos-ext.h" +#include "ExtensionMacros.h" + +NS_CC_EXT_BEGIN + + class SceneReader + { + public: + SceneReader(void); + ~SceneReader(void); + + public: + static SceneReader* sharedSceneReader(); + void purgeSceneReader(); + static const char* sceneReaderVersion(); + cocos2d::Node* createNodeWithSceneFile(const char *pszFileName); + private: + cocos2d::Node* createObject(cs::JsonDictionary * inputFiles, cocos2d::Node* parent); + void setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict); + + private: + static SceneReader* s_sharedReader; + }; + + +NS_CC_EXT_END + +#endif diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 716f269065..761372c1d4 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -50,9 +50,34 @@ #include "spine/spine-cocos2dx.h" -#include "Components/CCComAttribute.h" -#include "Components/CCComAudio.h" -#include "Components/CCComController.h" +#include "CocoStudio/Armature/CCArmature.h" +#include "CocoStudio/Armature/CCBone.h" +#include "CocoStudio/Armature/animation/CCArmatureAnimation.h" +#include "CocoStudio/Armature/datas/CCDatas.h" +#include "CocoStudio/Armature/display/CCBatchNode.h" +#include "CocoStudio/Armature/display/CCDecorativeDisplay.h" +#include "CocoStudio/Armature/display/CCDisplayManager.h" +#include "CocoStudio/Armature/display/CCSkin.h" +#include "CocoStudio/Armature/physics/CCColliderDetector.h" +#include "CocoStudio/Armature/physics/CCPhysicsWorld.h" +#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" +#include "CocoStudio/Armature/utils/CCConstValue.h" +#include "CocoStudio/Armature/utils/CCDataReaderHelper.h" +#include "CocoStudio/Armature/utils/CCTweenFunction.h" +#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" +#include "CocoStudio/Armature/external_tool/sigslot.h" + +#include "CocoStudio/Components/CCComAttribute.h" +#include "CocoStudio/Components/CCComAudio.h" +#include "CocoStudio/Components/CCComController.h" +#include "CocoStudio/Components/CCComRender.h" + +#include "CocoStudio/Json/CSContentJsonDictionary.h" +#include "CocoStudio/Json/DictionaryHelper.h" + +#include "CocoStudio/Reader/CCSSceneReader.h" + + #include "CCDeprecated-ext.h" diff --git a/extensions/proj.win32/libExtensions.vcxproj b/extensions/proj.win32/libExtensions.vcxproj index 03fa7848c0..964cc89d22 100644 --- a/extensions/proj.win32/libExtensions.vcxproj +++ b/extensions/proj.win32/libExtensions.vcxproj @@ -93,32 +93,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -143,10 +117,38 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -196,42 +198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -259,10 +225,48 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -318,9 +322,10 @@ - - - + + + + diff --git a/extensions/proj.win32/libExtensions.vcxproj.filters b/extensions/proj.win32/libExtensions.vcxproj.filters index 47fcc20bd4..9bcc34aceb 100644 --- a/extensions/proj.win32/libExtensions.vcxproj.filters +++ b/extensions/proj.win32/libExtensions.vcxproj.filters @@ -1,734 +1,761 @@ - - - - - {d37545ef-285b-4315-9fca-40da6fc2a6c9} - - - {202b519b-b5e0-499f-b3b8-ed5da144b248} - - - {c07abd14-e9dd-4e2d-85c4-a180070161b4} - - - {46797895-f71d-4ddb-b381-d0884e678d39} - - - {d5806151-7ae1-4fef-af5a-2fa1d1c7377b} - - - {4da8061d-80f3-45fd-aa7e-2c0a96701b79} - - - {5d186e3d-0aaf-4904-a5d8-e5cb0f35f4cc} - - - {49487dbe-5758-436a-b014-8e2edc6b33ae} - - - {ff4b5934-99d4-4ea7-9f50-a774192d9ca9} - - - {2a7741ff-87a5-41c8-8e51-d7a1cf0c8e4d} - - - {cf3469d5-421b-4990-a9be-4cd95129fb73} - - - {f48d1291-33fe-49a1-8f9f-4d203e782d4a} - - - {043f8489-822e-43c8-8d9d-5d171a701663} - - - {b8c65820-b5c9-4bd6-83c8-180fdc6100fb} - - - {fa9a165e-cc7c-45e9-ae4f-cae3c2f16e6a} - - - {5e5b3d7d-62a7-493e-a130-ed72ee7c65f2} - - - {5258a1e1-5d50-4fee-9216-da08d2ec19de} - - - {bd365bbb-6972-4073-b268-8360df428166} - - - - - GUI\CCScrollView - - - network - - - GUI\CCScrollView - - - GUI\CCScrollView - - - GUI\CCScrollView - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - physics_nodes - - - physics_nodes - - - LocalStorage - - - GUI\CCEditBox - - - GUI\CCEditBox - - - GUI\CCEditBox - - - AssetsManager - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - network - - - CCArmature - - - CCArmature - - - CCArmature\animation - - - CCArmature\animation - - - CCArmature\animation - - - CCArmature\datas - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\physics - - - CCArmature\physics - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - Components - - - Components - - - Components - - - Components - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - network - - - - - - GUI\CCScrollView - - - - - network - - - network - - - network - - - GUI\CCScrollView - - - GUI\CCScrollView - - - GUI\CCScrollView - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - CCBReader - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - GUI\CCControlExtension - - - physics_nodes - - - physics_nodes - - - LocalStorage - - - GUI\CCEditBox - - - GUI\CCEditBox - - - GUI\CCEditBox - - - GUI\CCEditBox - - - AssetsManager - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - spine - - - network - - - CCArmature - - - CCArmature - - - CCArmature\animation - - - CCArmature\animation - - - CCArmature\animation - - - CCArmature\datas - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\display - - - CCArmature\physics - - - CCArmature\physics - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - CCArmature\utils - - - Components - - - Components - - - Components - - - Components - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - - network - - - - - CCArmature\external_tool - - - CCArmature\external_tool - - - CCArmature\external_tool - - + + + + + {d37545ef-285b-4315-9fca-40da6fc2a6c9} + + + {202b519b-b5e0-499f-b3b8-ed5da144b248} + + + {c07abd14-e9dd-4e2d-85c4-a180070161b4} + + + {46797895-f71d-4ddb-b381-d0884e678d39} + + + {d5806151-7ae1-4fef-af5a-2fa1d1c7377b} + + + {4da8061d-80f3-45fd-aa7e-2c0a96701b79} + + + {5d186e3d-0aaf-4904-a5d8-e5cb0f35f4cc} + + + {49487dbe-5758-436a-b014-8e2edc6b33ae} + + + {ff4b5934-99d4-4ea7-9f50-a774192d9ca9} + + + {2a7741ff-87a5-41c8-8e51-d7a1cf0c8e4d} + + + {87250d95-2afd-45e7-bc9d-760478c4e709} + + + {5258a1e1-5d50-4fee-9216-da08d2ec19de} + + + {cf3469d5-421b-4990-a9be-4cd95129fb73} + + + {f48d1291-33fe-49a1-8f9f-4d203e782d4a} + + + {043f8489-822e-43c8-8d9d-5d171a701663} + + + {b8c65820-b5c9-4bd6-83c8-180fdc6100fb} + + + {fa9a165e-cc7c-45e9-ae4f-cae3c2f16e6a} + + + {5e5b3d7d-62a7-493e-a130-ed72ee7c65f2} + + + {bd365bbb-6972-4073-b268-8360df428166} + + + {d797adcd-2e59-4486-944e-b3e7f3a954b8} + + + {a824cea6-86d7-4230-8738-513a869a1882} + + + {d305abea-33cc-4ae8-b78d-b5fb59927e59} + + + + + GUI\CCScrollView + + + network + + + GUI\CCScrollView + + + GUI\CCScrollView + + + GUI\CCScrollView + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + physics_nodes + + + physics_nodes + + + LocalStorage + + + GUI\CCEditBox + + + GUI\CCEditBox + + + GUI\CCEditBox + + + AssetsManager + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + network + + + network + + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\datas + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\physics + + + CocoStudio\Armature\physics + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature + + + CocoStudio\Armature + + + CocoStudio\Json + + + CocoStudio\Json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Reader + + + CocoStudio\Components + + + CocoStudio\Armature\external_tool + + + + + GUI\CCScrollView + + + + + network + + + network + + + network + + + GUI\CCScrollView + + + GUI\CCScrollView + + + GUI\CCScrollView + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + CCBReader + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + GUI\CCControlExtension + + + physics_nodes + + + physics_nodes + + + LocalStorage + + + GUI\CCEditBox + + + GUI\CCEditBox + + + GUI\CCEditBox + + + GUI\CCEditBox + + + AssetsManager + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + spine + + + network + + + network + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Components + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\animation + + + CocoStudio\Armature\datas + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\display + + + CocoStudio\Armature\external_tool + + + CocoStudio\Armature\physics + + + CocoStudio\Armature\physics + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature\utils + + + CocoStudio\Armature + + + CocoStudio\Armature + + + CocoStudio\Json + + + CocoStudio\Json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Reader + + + CocoStudio\Components + + + CocoStudio\Armature\external_tool + + + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + + CocoStudio\Json\lib_json + + \ No newline at end of file