From 6f20da4444aab1634b2cdca1fa756ac4379ee0b6 Mon Sep 17 00:00:00 2001 From: pipu Date: Mon, 30 Mar 2015 16:46:33 +0800 Subject: [PATCH 1/5] Add destroyCocosStudio() --- .../cocostudio/ActionTimeline/CSLoader.cpp | 30 +++++++++++++++++++ .../cocostudio/ActionTimeline/CSLoader.h | 2 ++ .../cocostudio/FlatBuffersSerialize.cpp | 4 +-- .../cocostudio/FlatBuffersSerialize.h | 2 +- .../ArmatureNodeReader/ArmatureNodeReader.cpp | 5 ++++ .../ArmatureNodeReader/ArmatureNodeReader.h | 2 +- .../ButtonReader/ButtonReader.cpp | 2 +- .../WidgetReader/ButtonReader/ButtonReader.h | 2 +- .../CheckBoxReader/CheckBoxReader.cpp | 5 ++++ .../CheckBoxReader/CheckBoxReader.h | 2 +- .../ComAudioReader/ComAudioReader.cpp | 2 +- .../ComAudioReader/ComAudioReader.h | 2 +- .../ImageViewReader/ImageViewReader.cpp | 5 ++++ .../ImageViewReader/ImageViewReader.h | 2 +- .../LayoutReader/LayoutReader.cpp | 5 ++++ .../WidgetReader/LayoutReader/LayoutReader.h | 2 +- .../ListViewReader/ListViewReader.cpp | 5 ++++ .../ListViewReader/ListViewReader.h | 2 +- .../LoadingBarReader/LoadingBarReader.cpp | 5 ++++ .../LoadingBarReader/LoadingBarReader.h | 2 +- .../Node3DReader/Node3DReader.cpp | 2 +- .../WidgetReader/Node3DReader/Node3DReader.h | 2 +- .../WidgetReader/NodeReader/NodeReader.cpp | 2 +- .../WidgetReader/NodeReader/NodeReader.h | 2 +- .../PageViewReader/PageViewReader.cpp | 5 ++++ .../PageViewReader/PageViewReader.h | 2 +- .../Particle3DReader/Particle3DReader.cpp | 2 +- .../Particle3DReader/Particle3DReader.h | 2 +- .../ParticleReader/ParticleReader.cpp | 2 +- .../ParticleReader/ParticleReader.h | 2 +- .../ProjectNodeReader/ProjectNodeReader.cpp | 2 +- .../ProjectNodeReader/ProjectNodeReader.h | 2 +- .../ScrollViewReader/ScrollViewReader.cpp | 5 ++++ .../ScrollViewReader/ScrollViewReader.h | 2 +- .../SingleNodeReader/SingleNodeReader.cpp | 2 +- .../SingleNodeReader/SingleNodeReader.h | 2 +- .../SliderReader/SliderReader.cpp | 5 ++++ .../WidgetReader/SliderReader/SliderReader.h | 2 +- .../Sprite3DReader/Sprite3DReader.cpp | 2 +- .../Sprite3DReader/Sprite3DReader.h | 2 +- .../SpriteReader/SpriteReader.cpp | 2 +- .../WidgetReader/SpriteReader/SpriteReader.h | 2 +- .../TextAtlasReader/TextAtlasReader.cpp | 5 ++++ .../TextAtlasReader/TextAtlasReader.h | 1 + .../TextBMFontReader/TextBMFontReader.cpp | 5 ++++ .../TextBMFontReader/TextBMFontReader.h | 2 +- .../TextFieldReader/TextFieldReader.cpp | 5 ++++ .../TextFieldReader/TextFieldReader.h | 2 +- .../WidgetReader/TextReader/TextReader.cpp | 5 ++++ .../WidgetReader/TextReader/TextReader.h | 2 +- .../UserCameraReader/UserCameraReader.cpp | 2 +- .../UserCameraReader/UserCameraReader.h | 2 +- .../cocostudio/WidgetReader/WidgetReader.cpp | 2 +- .../cocostudio/WidgetReader/WidgetReader.h | 2 +- 54 files changed, 137 insertions(+), 39 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index bee63a0aea..463b571154 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -218,6 +218,36 @@ void CSLoader::purge() { } +void CSLoader::destroyCocosStudio() +{ + NodeReader::destroyInstance(); + SingleNodeReader::destroyInstance(); + SpriteReader::destroyInstance(); + ParticleReader::destroyInstance(); + + ButtonReader::destroyInstance(); + CheckBoxReader::destroyInstance(); + ImageViewReader::destroyInstance(); + TextBMFontReader::destroyInstance(); + TextReader::destroyInstance(); + TextFieldReader::destroyInstance(); + TextAtlasReader::destroyInstance(); + LoadingBarReader::destroyInstance(); + SliderReader::destroyInstance(); + LayoutReader::destroyInstance(); + ScrollViewReader::destroyInstance(); + PageViewReader::destroyInstance(); + ListViewReader::destroyInstance(); + + ArmatureNodeReader::destroyInstance(); + Node3DReader::destroyInstance(); + Sprite3DReader::destroyInstance(); + UserCameraReader::destroyInstance(); + Particle3DReader::destroyInstance(); + + destroyInstance(); +} + void CSLoader::init() { using namespace std::placeholders; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h index ef36a8b4a9..a0284db744 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h @@ -74,6 +74,8 @@ public: CSLoader(); void purge(); + static void destroyCocosStudio(); + void init(); static cocos2d::Node* createNode(const std::string& filename); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index 7604658117..bf257c2625 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -111,7 +111,7 @@ FlatBuffersSerialize::FlatBuffersSerialize() FlatBuffersSerialize::~FlatBuffersSerialize() { - purge(); + } FlatBuffersSerialize* FlatBuffersSerialize::getInstance() @@ -124,7 +124,7 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() return _instanceFlatBuffersSerialize; } -void FlatBuffersSerialize::purge() +void FlatBuffersSerialize::destroyInstance() { CC_SAFE_DELETE(_instanceFlatBuffersSerialize); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h index 9cd0d804f2..d0f0bcfb2e 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h @@ -91,7 +91,7 @@ class CC_STUDIO_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); - static void purge(); + static void destroyInstance(); FlatBuffersSerialize(); ~FlatBuffersSerialize(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 6d7189c225..957293280a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -34,6 +34,11 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance() return _instanceArmatureNodeReader; } +void ArmatureNodeReader::destroyInstance() +{ + CC_SAFE_DELETE(_instanceArmatureNodeReader); +} + Offset ArmatureNodeReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData, flatbuffers::FlatBufferBuilder *builder) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index a3930d8ed2..5416d4779c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -50,7 +50,7 @@ public: ~ArmatureNodeReader(); static ArmatureNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder) override; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 6025bea066..cdb34861fc 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -59,7 +59,7 @@ namespace cocostudio return instanceButtonReader; } - void ButtonReader::purge() + void ButtonReader::destroyInstance() { CC_SAFE_DELETE(instanceButtonReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index 2c1c969337..cd6a1aeaa8 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ButtonReader(); static ButtonReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index ae95206b78..09148b143d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -45,6 +45,11 @@ namespace cocostudio return instanceCheckBoxReader; } + void CheckBoxReader::destroyInstance() + { + CC_SAFE_DELETE(instanceCheckBoxReader); + } + void CheckBoxReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index df1b1857cb..76289b54ac 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~CheckBoxReader(); static CheckBoxReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index 2017f245ee..e194187adf 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -58,7 +58,7 @@ namespace cocostudio return _instanceComAudioReader; } - void ComAudioReader::purge() + void ComAudioReader::destroyInstance() { CC_SAFE_DELETE(_instanceComAudioReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index 5994b2f659..bb82865622 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -40,7 +40,7 @@ namespace cocostudio ~ComAudioReader(); static ComAudioReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index e08bc0c63a..f72f9802ec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -49,6 +49,11 @@ namespace cocostudio return instanceImageViewReader; } + void ImageViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceImageViewReader); + } + void ImageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 113276ec64..8c26b047da 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -41,7 +41,7 @@ namespace cocostudio virtual ~ImageViewReader(); static ImageViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index bb796b83de..25b1708182 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -64,6 +64,11 @@ namespace cocostudio return instanceLayoutReader; } + void LayoutReader::destroyInstance() + { + CC_SAFE_DELETE(instanceLayoutReader); + } + void LayoutReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 4cd08e224c..1f4e23da81 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -40,7 +40,7 @@ namespace cocostudio virtual ~LayoutReader(); static LayoutReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index 80245ed1a2..6856a4432d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -42,6 +42,11 @@ namespace cocostudio return instanceListViewReader; } + void ListViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceListViewReader); + } + void ListViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { ScrollViewReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index 4f260f4468..295caf46c2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ListViewReader(); static ListViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index 3fe61ee47a..accff552ec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -48,6 +48,11 @@ namespace cocostudio return instanceLoadingBar; } + void LoadingBarReader::destroyInstance() + { + CC_SAFE_DELETE(instanceLoadingBar); + } + void LoadingBarReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 955eb009f4..8e5634aefd 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~LoadingBarReader(); static LoadingBarReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 640e59cb62..9819416732 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceNode3DReader; } - void Node3DReader::purge() + void Node3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceNode3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index cf12772e5e..6d6747527c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~Node3DReader(); static Node3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp index a0ad52d60d..060c9c9ceb 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp @@ -79,7 +79,7 @@ namespace cocostudio return _instanceNodeReader; } - void NodeReader::purge() + void NodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h index 84049e6d73..0def64fa63 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -41,7 +41,7 @@ namespace cocostudio ~NodeReader(); static NodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 2a02d99004..0fde47f3be 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -40,6 +40,11 @@ namespace cocostudio return instancePageViewReader; } + void PageViewReader::destroyInstance() + { + CC_SAFE_DELETE(instancePageViewReader); + } + void PageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { LayoutReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index d2f90d9d38..4968d89dec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~PageViewReader(); static PageViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index f3a457f53c..f0a3479940 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -63,7 +63,7 @@ namespace cocostudio return _instanceParticle3DReader; } - void Particle3DReader::purge() + void Particle3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticle3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index a3a5dfaa28..a57e810fff 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,7 +41,7 @@ namespace cocostudio ~Particle3DReader(); static Particle3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index ffc2190e74..c72f06a863 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -59,7 +59,7 @@ namespace cocostudio return _instanceParticleReader; } - void ParticleReader::purge() + void ParticleReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticleReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 80841256fb..60ef3021d1 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~ParticleReader(); static ParticleReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index 6b0c73a53c..d9848a05a9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -57,7 +57,7 @@ namespace cocostudio return _instanceProjectNodeReader; } - void ProjectNodeReader::purge() + void ProjectNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceProjectNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 48b2fccd43..9e5c4973fe 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -40,7 +40,7 @@ namespace cocostudio ~ProjectNodeReader(); static ProjectNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index eb6020f638..12e8a839f3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -44,6 +44,11 @@ namespace cocostudio return instanceScrollViewReader; } + void ScrollViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceScrollViewReader); + } + void ScrollViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { //TODO: need to refactor... diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index de6f0e1f8f..4a69005329 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ScrollViewReader(); static ScrollViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 9c26174ae4..2fccc1479c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceSingleNodeReader; } - void SingleNodeReader::purge() + void SingleNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceSingleNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 0a3f0b8c35..9d8c1c111d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~SingleNodeReader(); static SingleNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index 639d626ad6..1a40f4825b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -48,6 +48,11 @@ namespace cocostudio return instanceSliderReader; } + void SliderReader::destroyInstance() + { + CC_SAFE_DELETE(instanceSliderReader); + } + void SliderReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h index b24aaa984c..6d01695b53 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~SliderReader(); static SliderReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp index aa141240d9..d901785ae7 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceSprite3DReader; } - void Sprite3DReader::purge() + void Sprite3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceSprite3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h index 083310eb4d..5b2e2988ef 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~Sprite3DReader(); static Sprite3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index c03cf73324..cb46fe0971 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -60,7 +60,7 @@ namespace cocostudio return _instanceSpriteReader; } - void SpriteReader::purge() + void SpriteReader::destroyInstance() { CC_SAFE_DELETE(_instanceSpriteReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 8dcc575339..37776a66ea 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~SpriteReader(); static SpriteReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index 09da4b64f9..6180d8fdda 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -45,6 +45,11 @@ namespace cocostudio return instanceTextAtalsReader; } + void TextAtlasReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextAtalsReader); + } + void TextAtlasReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 98a3421c08..07c5675264 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -39,6 +39,7 @@ namespace cocostudio virtual ~TextAtlasReader(); static TextAtlasReader* getInstance(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index c3cc6d2665..8ab76248ab 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -42,6 +42,11 @@ namespace cocostudio return instanceTextBMFontReader; } + void TextBMFontReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextBMFontReader); + } + void TextBMFontReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index c489a272a7..823ed71be3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextBMFontReader(); static TextBMFontReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index 6de6920888..6b808ebf82 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -49,6 +49,11 @@ namespace cocostudio return instanceTextFieldReader; } + void TextFieldReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextFieldReader); + } + void TextFieldReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index a51ceb7d3c..4b80a840b9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextFieldReader(); static TextFieldReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index c7c6f908cc..a49119f261 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -47,6 +47,11 @@ namespace cocostudio return instanceTextReader; } + void TextReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextReader); + } + void TextReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h index 70b32551af..67820e376d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextReader(); static TextReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 32e662d4bc..80b479f648 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -61,7 +61,7 @@ namespace cocostudio return _instanceUserCameraReader; } - void UserCameraReader::purge() + void UserCameraReader::destroyInstance() { CC_SAFE_DELETE(_instanceUserCameraReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 0028547c93..9dfc0f95d5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~UserCameraReader(); static UserCameraReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 88ddec98c2..3fe4b7ed45 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -134,7 +134,7 @@ namespace cocostudio return instanceWidgetReader; } - void WidgetReader::purge() + void WidgetReader::destroyInstance() { CC_SAFE_DELETE(instanceWidgetReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index 6e0a456753..e2fdaa5512 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -46,7 +46,7 @@ namespace cocostudio virtual ~WidgetReader(); static WidgetReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); From a0a461f319e628e66170486eff913dcc72454bad Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 31 Mar 2015 11:22:34 +0800 Subject: [PATCH 2/5] Supplement some Reader. --- .../editor-support/cocostudio/ActionTimeline/CSLoader.cpp | 4 ++++ .../WidgetReader/GameMapReader/GameMapReader.cpp | 2 +- .../cocostudio/WidgetReader/GameMapReader/GameMapReader.h | 2 +- .../Classes/CocosStudio3DTest/CocosStudio3DTest.cpp | 7 +++++++ .../Classes/CocosStudio3DTest/CocosStudio3DTest.h | 1 + .../ActionTimelineTestScene.cpp | 5 ++--- .../CocoStudioArmatureTest/ArmatureScene.cpp | 2 ++ .../CustomWidgetCallbackBindTest.cpp | 7 +++++++ .../CustomWidgetCallbackBindTest.h | 1 + .../Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp | 7 +++++++ .../Classes/UITest/CocoStudioGUITest/UIScene_Editor.h | 2 ++ 11 files changed, 35 insertions(+), 5 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 463b571154..2345e4cf58 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -224,7 +224,11 @@ void CSLoader::destroyCocosStudio() SingleNodeReader::destroyInstance(); SpriteReader::destroyInstance(); ParticleReader::destroyInstance(); + GameMapReader::destroyInstance(); + ProjectNodeReader::destroyInstance(); + ComAudioReader::destroyInstance(); + WidgetReader::destroyInstance(); ButtonReader::destroyInstance(); CheckBoxReader::destroyInstance(); ImageViewReader::destroyInstance(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp index 35bede0e21..10d7e0d938 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.cpp @@ -61,7 +61,7 @@ namespace cocostudio return _instanceTMXTiledMapReader; } - void GameMapReader::purge() + void GameMapReader::destroyInstance() { CC_SAFE_DELETE(_instanceTMXTiledMapReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index 24dfafc367..3246147185 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~GameMapReader(); static GameMapReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp index fa07c703a5..9772957916 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp @@ -102,6 +102,13 @@ void CocosStudio3DTestDemo::onEnter() BaseTest::onEnter(); } +void CocosStudio3DTestDemo::onExit() +{ + CSLoader::destroyCocosStudio(); + + BaseTest::onExit(); +} + void CocosStudio3DTestDemo::restartCallback(Ref* sender) { auto s = new (std::nothrow) CS3DTestScene(); diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h index 9f25baf360..0a4597ed38 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h @@ -47,6 +47,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; + virtual void onExit() override; }; class CSNode3DTest : public CocosStudio3DTestDemo diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp index 74249dd5cf..986ad51c86 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp @@ -164,9 +164,8 @@ void ActionTimelineTestLayer::onExit() removeAllChildren(); backItem = restartItem = nextItem = nullptr; - - ActionTimelineCache::getInstance()->purge(); - CSLoader::getInstance()->purge(); + + CSLoader::destroyCocosStudio(); Layer::onExit(); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 012e4500c4..25d2cdf2cd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -199,6 +199,8 @@ void ArmatureTestLayer::onExit() removeAllChildren(); backItem = restartItem = nextItem = nullptr; + + CSLoader::destroyCocosStudio(); Layer::onExit(); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp index 7159c5fe27..cdd01e9ad5 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp @@ -31,6 +31,13 @@ void CustomWidgetCallbackBindScene::onEnter() addChild(pMenu, 1); } +void CustomWidgetCallbackBindScene::onExit() +{ + CSLoader::destroyCocosStudio(); + + Scene::onExit(); +} + void CustomWidgetCallbackBindScene::runThisTest() { CSLoader* instance = CSLoader::getInstance(); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.h index a7c54b0729..74f551e1ab 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.h @@ -10,6 +10,7 @@ class CustomWidgetCallbackBindScene : public TestScene { public: virtual void onEnter() override; + virtual void onExit() override; virtual void runThisTest(); void BackCallback(cocos2d::Ref* pSender); }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp index 3167007133..1e8c2e8e33 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp @@ -19,6 +19,13 @@ UIScene_Editor::~UIScene_Editor() } +void UIScene_Editor::onExit() +{ + CSLoader::destroyCocosStudio(); + + Layer::onExit(); +} + bool UIScene_Editor::init() { if (CCLayer::init()) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h index 15f80cfd2f..a650d5f1e7 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h @@ -59,6 +59,8 @@ public: UIScene_Editor(); ~UIScene_Editor(); + virtual void onExit() override; + bool init(); virtual void previousCallback(Ref* sender, Widget::TouchEventType event); virtual void nextCallback(Ref* sender, Widget::TouchEventType event); From 91acd6aea911c677ff8a718e18065ae0fd081283 Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 31 Mar 2015 14:21:10 +0800 Subject: [PATCH 3/5] Set macro CC_DEPRECATED_ATTRIBUTE for method purge() for all Reader. --- cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp | 4 ---- cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h | 3 ++- cocos/editor-support/cocostudio/FlatBuffersSerialize.h | 2 ++ .../WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h | 2 ++ .../cocostudio/WidgetReader/ButtonReader/ButtonReader.h | 2 ++ .../cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h | 2 ++ .../cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h | 2 ++ .../cocostudio/WidgetReader/GameMapReader/GameMapReader.h | 2 ++ .../cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h | 2 ++ .../cocostudio/WidgetReader/LayoutReader/LayoutReader.h | 2 ++ .../cocostudio/WidgetReader/ListViewReader/ListViewReader.h | 2 ++ .../WidgetReader/LoadingBarReader/LoadingBarReader.h | 2 ++ .../cocostudio/WidgetReader/Node3DReader/Node3DReader.h | 2 ++ .../cocostudio/WidgetReader/NodeReader/NodeReader.h | 2 ++ .../cocostudio/WidgetReader/PageViewReader/PageViewReader.h | 2 ++ .../WidgetReader/Particle3DReader/Particle3DReader.h | 2 ++ .../cocostudio/WidgetReader/ParticleReader/ParticleReader.h | 2 ++ .../WidgetReader/ProjectNodeReader/ProjectNodeReader.h | 2 ++ .../WidgetReader/ScrollViewReader/ScrollViewReader.h | 2 ++ .../WidgetReader/SingleNodeReader/SingleNodeReader.h | 2 ++ .../cocostudio/WidgetReader/SliderReader/SliderReader.h | 2 ++ .../cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h | 2 ++ .../cocostudio/WidgetReader/SpriteReader/SpriteReader.h | 2 ++ .../cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h | 2 ++ .../WidgetReader/TextBMFontReader/TextBMFontReader.h | 2 ++ .../cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h | 2 ++ .../cocostudio/WidgetReader/TextReader/TextReader.h | 2 ++ .../WidgetReader/UserCameraReader/UserCameraReader.h | 2 ++ cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h | 2 ++ 29 files changed, 56 insertions(+), 5 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 2345e4cf58..125ecf32db 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -214,10 +214,6 @@ CSLoader::CSLoader() CREATE_CLASS_NODE_READER_INFO(Particle3DReader); } -void CSLoader::purge() -{ -} - void CSLoader::destroyCocosStudio() { NodeReader::destroyInstance(); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h index a0284db744..c85af163e0 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h @@ -72,7 +72,8 @@ public: static void destroyInstance(); CSLoader(); - void purge(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE void purge(); static void destroyCocosStudio(); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h index d0f0bcfb2e..f05c059c58 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h @@ -91,6 +91,8 @@ class CC_STUDIO_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index 5416d4779c..92f5ef7571 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -50,6 +50,8 @@ public: ~ArmatureNodeReader(); static ArmatureNodeReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index cd6a1aeaa8..6025e7e741 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~ButtonReader(); static ButtonReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index 76289b54ac..c6e9db2e8f 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~CheckBoxReader(); static CheckBoxReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index bb82865622..3296f90ca9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -40,6 +40,8 @@ namespace cocostudio ~ComAudioReader(); static ComAudioReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index 3246147185..c17227d446 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -42,6 +42,8 @@ namespace cocostudio ~GameMapReader(); static GameMapReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 8c26b047da..2539e57e5b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -41,6 +41,8 @@ namespace cocostudio virtual ~ImageViewReader(); static ImageViewReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 1f4e23da81..ba94695d8e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -40,6 +40,8 @@ namespace cocostudio virtual ~LayoutReader(); static LayoutReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index 295caf46c2..a36e4ef1f4 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~ListViewReader(); static ListViewReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 8e5634aefd..f51256b082 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~LoadingBarReader(); static LoadingBarReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 6d6747527c..6a83b038cd 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -46,6 +46,8 @@ namespace cocostudio ~Node3DReader(); static Node3DReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h index 0def64fa63..a25df215cb 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -41,6 +41,8 @@ namespace cocostudio ~NodeReader(); static NodeReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index 4968d89dec..4801e11b03 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~PageViewReader(); static PageViewReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index a57e810fff..6be1e73589 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,6 +41,8 @@ namespace cocostudio ~Particle3DReader(); static Particle3DReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 60ef3021d1..435ca11877 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -42,6 +42,8 @@ namespace cocostudio ~ParticleReader(); static ParticleReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 9e5c4973fe..73a3a50ca6 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -40,6 +40,8 @@ namespace cocostudio ~ProjectNodeReader(); static ProjectNodeReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index 4a69005329..fd91e23ea0 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~ScrollViewReader(); static ScrollViewReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 9d8c1c111d..b8cf0dabdd 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -42,6 +42,8 @@ namespace cocostudio ~SingleNodeReader(); static SingleNodeReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h index 6d01695b53..042eac3480 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~SliderReader(); static SliderReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h index 5b2e2988ef..1fc66e2116 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h @@ -46,6 +46,8 @@ namespace cocostudio ~Sprite3DReader(); static Sprite3DReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 37776a66ea..2882eb1d29 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -42,6 +42,8 @@ namespace cocostudio ~SpriteReader(); static SpriteReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 07c5675264..03d416fdc2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~TextAtlasReader(); static TextAtlasReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index 823ed71be3..34a770b76a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~TextBMFontReader(); static TextBMFontReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index 4b80a840b9..4d003e203b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~TextFieldReader(); static TextFieldReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h index 67820e376d..de6e2da763 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h @@ -39,6 +39,8 @@ namespace cocostudio virtual ~TextReader(); static TextReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 9dfc0f95d5..f1069bb5de 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -46,6 +46,8 @@ namespace cocostudio ~UserCameraReader(); static UserCameraReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index e2fdaa5512..b25d10566d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -46,6 +46,8 @@ namespace cocostudio virtual ~WidgetReader(); static WidgetReader* getInstance(); + /** @deprecated Use method destroyInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, From bb110449be7847a8d60a0088868e9fb27b0fc916 Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 31 Mar 2015 14:56:24 +0800 Subject: [PATCH 4/5] Reset method purge() definition for some Reader. --- cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp | 4 ++++ cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp | 6 ++++++ .../cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp | 5 +++++ .../WidgetReader/ComAudioReader/ComAudioReader.cpp | 5 +++++ .../cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp | 5 +++++ .../WidgetReader/Particle3DReader/Particle3DReader.cpp | 5 +++++ .../WidgetReader/ParticleReader/ParticleReader.cpp | 5 +++++ .../WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp | 5 +++++ .../WidgetReader/SingleNodeReader/SingleNodeReader.cpp | 5 +++++ .../WidgetReader/Sprite3DReader/Sprite3DReader.cpp | 5 +++++ .../cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp | 5 +++++ .../WidgetReader/UserCameraReader/UserCameraReader.cpp | 5 +++++ .../editor-support/cocostudio/WidgetReader/WidgetReader.cpp | 5 +++++ 13 files changed, 65 insertions(+) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 125ecf32db..2345e4cf58 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -214,6 +214,10 @@ CSLoader::CSLoader() CREATE_CLASS_NODE_READER_INFO(Particle3DReader); } +void CSLoader::purge() +{ +} + void CSLoader::destroyCocosStudio() { NodeReader::destroyInstance(); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index bf257c2625..3e38985e0a 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -123,6 +123,12 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() return _instanceFlatBuffersSerialize; } + +void FlatBuffersSerialize::purge() +{ + CC_SAFE_DELETE(_instanceFlatBuffersSerialize); + +} void FlatBuffersSerialize::destroyInstance() { diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index cdb34861fc..fae7bf852b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -59,6 +59,11 @@ namespace cocostudio return instanceButtonReader; } + void ButtonReader::purge() + { + CC_SAFE_DELETE(instanceButtonReader); + } + void ButtonReader::destroyInstance() { CC_SAFE_DELETE(instanceButtonReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index e194187adf..8142cf3120 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -58,6 +58,11 @@ namespace cocostudio return _instanceComAudioReader; } + void ComAudioReader::purge() + { + CC_SAFE_DELETE(_instanceComAudioReader); + } + void ComAudioReader::destroyInstance() { CC_SAFE_DELETE(_instanceComAudioReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 9819416732..ae39d9f497 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -62,6 +62,11 @@ namespace cocostudio return _instanceNode3DReader; } + void Node3DReader::purge() + { + CC_SAFE_DELETE(_instanceNode3DReader); + } + void Node3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceNode3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index f0a3479940..0332bf8e2e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -63,6 +63,11 @@ namespace cocostudio return _instanceParticle3DReader; } + void Particle3DReader::purge() + { + CC_SAFE_DELETE(_instanceParticle3DReader); + } + void Particle3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticle3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index c72f06a863..63d3e9ec51 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -59,6 +59,11 @@ namespace cocostudio return _instanceParticleReader; } + void ParticleReader::purge() + { + CC_SAFE_DELETE(_instanceParticleReader); + } + void ParticleReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticleReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index d9848a05a9..fe9d9cfdfb 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -57,6 +57,11 @@ namespace cocostudio return _instanceProjectNodeReader; } + void ProjectNodeReader::purge() + { + CC_SAFE_DELETE(_instanceProjectNodeReader); + } + void ProjectNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceProjectNodeReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 2fccc1479c..b041da0164 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -62,6 +62,11 @@ namespace cocostudio return _instanceSingleNodeReader; } + void SingleNodeReader::purge() + { + CC_SAFE_DELETE(_instanceSingleNodeReader); + } + void SingleNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceSingleNodeReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp index d901785ae7..28959fcc77 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp @@ -62,6 +62,11 @@ namespace cocostudio return _instanceSprite3DReader; } + void Sprite3DReader::purge() + { + CC_SAFE_DELETE(_instanceSprite3DReader); + } + void Sprite3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceSprite3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index cb46fe0971..56eb65df47 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -60,6 +60,11 @@ namespace cocostudio return _instanceSpriteReader; } + void SpriteReader::purge() + { + CC_SAFE_DELETE(_instanceSpriteReader); + } + void SpriteReader::destroyInstance() { CC_SAFE_DELETE(_instanceSpriteReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 80b479f648..5e5e253259 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -61,6 +61,11 @@ namespace cocostudio return _instanceUserCameraReader; } + void UserCameraReader::purge() + { + CC_SAFE_DELETE(_instanceUserCameraReader); + } + void UserCameraReader::destroyInstance() { CC_SAFE_DELETE(_instanceUserCameraReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 3fe4b7ed45..6b868635f7 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -134,6 +134,11 @@ namespace cocostudio return instanceWidgetReader; } + void WidgetReader::purge() + { + CC_SAFE_DELETE(instanceWidgetReader); + } + void WidgetReader::destroyInstance() { CC_SAFE_DELETE(instanceWidgetReader); From bc7d8f0a09499d2c8d6752a58cbaf6681f7503ff Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 31 Mar 2015 19:55:56 +0800 Subject: [PATCH 5/5] Add method destroyCocosStudio() for CocoStudio --- build/cocos2d_libs.xcodeproj/project.pbxproj | 6 ++ cocos/2d/libcocos2d.vcxproj | 1 + cocos/2d/libcocos2d.vcxproj.filters | 3 + .../libcocos2d_8_1.Shared.vcxitems | 1 + .../libcocos2d_8_1.Shared.vcxitems.filters | 5 +- cocos/2d/libcocos2d_wp8.vcxproj | 2 + cocos/2d/libcocos2d_wp8.vcxproj.filters | 6 ++ .../cocostudio/ActionTimeline/CSLoader.cpp | 34 ---------- .../cocostudio/ActionTimeline/CSLoader.h | 4 +- cocos/editor-support/cocostudio/Android.mk | 3 +- .../editor-support/cocostudio/CMakeLists.txt | 1 + .../editor-support/cocostudio/CocoStudio.cpp | 67 +++++++++++++++++++ cocos/editor-support/cocostudio/CocoStudio.h | 7 ++ .../ArmatureNodeReader/ArmatureNodeReader.h | 1 - .../CocosStudio3DTest/CocosStudio3DTest.cpp | 2 +- .../ActionTimelineTestScene.cpp | 2 +- .../CocoStudioArmatureTest/ArmatureScene.cpp | 2 +- .../CustomWidgetCallbackBindTest.cpp | 3 +- .../CocoStudioGUITest/UIScene_Editor.cpp | 2 +- 19 files changed, 107 insertions(+), 45 deletions(-) create mode 100644 cocos/editor-support/cocostudio/CocoStudio.cpp diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 3faf7dc529..dcad20b455 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1282,6 +1282,8 @@ 38B8E2E219E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */; }; 38B8E2E319E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; }; 38B8E2E419E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; }; + 38D9629D1ACA9721007C6FAF /* CocoStudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */; }; + 38D9629E1ACA9721007C6FAF /* CocoStudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */; }; 38F5263E1A48363B000DB7F7 /* ArmatureNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */; }; 38F5263F1A48363B000DB7F7 /* ArmatureNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */; }; 38F526401A48363B000DB7F7 /* ArmatureNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F5263C1A48363B000DB7F7 /* ArmatureNodeReader.h */; }; @@ -3109,6 +3111,7 @@ 38B8E2D419E66581002D7CE7 /* CSLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSLoader.h; sourceTree = ""; }; 38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutComponent.cpp; sourceTree = ""; }; 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutComponent.h; sourceTree = ""; }; + 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocoStudio.cpp; sourceTree = ""; }; 38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArmatureNodeReader.cpp; sourceTree = ""; }; 38F5263C1A48363B000DB7F7 /* ArmatureNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArmatureNodeReader.h; sourceTree = ""; }; 38F5263D1A48363B000DB7F7 /* CSArmatureNode_generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSArmatureNode_generated.h; sourceTree = ""; }; @@ -4868,6 +4871,7 @@ 1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */, 1A8C5985180E930E00EF57C3 /* CCUtilMath.h */, 1A8C5986180E930E00EF57C3 /* CocoStudio.h */, + 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */, 1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */, 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */, ); @@ -8602,6 +8606,7 @@ B665E2561AA80A6500DDB1C5 /* CCPUDoAffectorEventHandlerTranslator.cpp in Sources */, 15AE18A419AAD33D00C27E9E /* CCScale9SpriteLoader.cpp in Sources */, 182C5CD61A98F30500C30D34 /* Sprite3DReader.cpp in Sources */, + 38D9629D1ACA9721007C6FAF /* CocoStudio.cpp in Sources */, B665E3D61AA80A6600DDB1C5 /* CCPUScriptParser.cpp in Sources */, 15AE1B5719AADA9900C27E9E /* UISlider.cpp in Sources */, B665E2F61AA80A6500DDB1C5 /* CCPUListener.cpp in Sources */, @@ -9044,6 +9049,7 @@ B665E3AF1AA80A6500DDB1C5 /* CCPURender.cpp in Sources */, 382383FB1A258FA7002C4610 /* idl_gen_go.cpp in Sources */, B665E2EF1AA80A6500DDB1C5 /* CCPULineEmitter.cpp in Sources */, + 38D9629E1ACA9721007C6FAF /* CocoStudio.cpp in Sources */, 50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, 1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, B665E40B1AA80A6600DDB1C5 /* CCPUSphereSurfaceEmitterTranslator.cpp in Sources */, diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 96f5083022..dfbb65c4ee 100755 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -514,6 +514,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.* + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index 8cc70f8955..4f4420da8b 100755 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -1795,6 +1795,9 @@ cocostudio\json + + cocostudio\json + diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems index 339ff0ab88..7491ad18a6 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems @@ -947,6 +947,7 @@ + diff --git a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters index be937fc075..74bf7317b9 100644 --- a/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters +++ b/cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Shared/libcocos2d_8_1.Shared.vcxitems.filters @@ -1,4 +1,4 @@ - + @@ -3312,6 +3312,9 @@ 3d + + cocostudio\json + diff --git a/cocos/2d/libcocos2d_wp8.vcxproj b/cocos/2d/libcocos2d_wp8.vcxproj index 6b862f370e..7162254a64 100644 --- a/cocos/2d/libcocos2d_wp8.vcxproj +++ b/cocos/2d/libcocos2d_wp8.vcxproj @@ -538,6 +538,7 @@ + @@ -1179,6 +1180,7 @@ + diff --git a/cocos/2d/libcocos2d_wp8.vcxproj.filters b/cocos/2d/libcocos2d_wp8.vcxproj.filters index 9e6d9e7b74..5c26fcabad 100644 --- a/cocos/2d/libcocos2d_wp8.vcxproj.filters +++ b/cocos/2d/libcocos2d_wp8.vcxproj.filters @@ -1815,6 +1815,9 @@ 3d + + cocostudio\json + @@ -3528,6 +3531,9 @@ 3d + + cocostudio\json + diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 2345e4cf58..bee63a0aea 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -218,40 +218,6 @@ void CSLoader::purge() { } -void CSLoader::destroyCocosStudio() -{ - NodeReader::destroyInstance(); - SingleNodeReader::destroyInstance(); - SpriteReader::destroyInstance(); - ParticleReader::destroyInstance(); - GameMapReader::destroyInstance(); - ProjectNodeReader::destroyInstance(); - ComAudioReader::destroyInstance(); - - WidgetReader::destroyInstance(); - ButtonReader::destroyInstance(); - CheckBoxReader::destroyInstance(); - ImageViewReader::destroyInstance(); - TextBMFontReader::destroyInstance(); - TextReader::destroyInstance(); - TextFieldReader::destroyInstance(); - TextAtlasReader::destroyInstance(); - LoadingBarReader::destroyInstance(); - SliderReader::destroyInstance(); - LayoutReader::destroyInstance(); - ScrollViewReader::destroyInstance(); - PageViewReader::destroyInstance(); - ListViewReader::destroyInstance(); - - ArmatureNodeReader::destroyInstance(); - Node3DReader::destroyInstance(); - Sprite3DReader::destroyInstance(); - UserCameraReader::destroyInstance(); - Particle3DReader::destroyInstance(); - - destroyInstance(); -} - void CSLoader::init() { using namespace std::placeholders; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h index c85af163e0..2169762fff 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h @@ -73,9 +73,7 @@ public: CSLoader(); /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE void purge(); - - static void destroyCocosStudio(); + CC_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index 9f07ff1af8..6914cfa01c 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -75,7 +75,8 @@ ActionTimeline/CSLoader.cpp \ FlatBuffersSerialize.cpp \ WidgetCallBackHandlerProtocol.cpp \ WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp \ -CCObjectExtensionData.cpp +CCObjectExtensionData.cpp \ +CocoStudio.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. diff --git a/cocos/editor-support/cocostudio/CMakeLists.txt b/cocos/editor-support/cocostudio/CMakeLists.txt index 888b4f8146..25f8b80133 100644 --- a/cocos/editor-support/cocostudio/CMakeLists.txt +++ b/cocos/editor-support/cocostudio/CMakeLists.txt @@ -44,6 +44,7 @@ set(COCOS_CS_SRC editor-support/cocostudio/TriggerObj.cpp editor-support/cocostudio/FlatBuffersSerialize.cpp editor-support/cocostudio/CCObjectExtensionData.cpp + editor-support/cocostudio/CocoStudio.cpp editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp diff --git a/cocos/editor-support/cocostudio/CocoStudio.cpp b/cocos/editor-support/cocostudio/CocoStudio.cpp new file mode 100644 index 0000000000..894ecc94a4 --- /dev/null +++ b/cocos/editor-support/cocostudio/CocoStudio.cpp @@ -0,0 +1,67 @@ + +#include "CocoStudio.h" + +#include "cocostudio/WidgetReader/NodeReader/NodeReader.h" +#include "cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h" +#include "cocostudio/WidgetReader/SpriteReader/SpriteReader.h" +#include "cocostudio/WidgetReader/ParticleReader/ParticleReader.h" +#include "cocostudio/WidgetReader/GameMapReader/GameMapReader.h" +#include "cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h" +#include "cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h" + +#include "cocostudio/WidgetReader/ButtonReader/ButtonReader.h" +#include "cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h" +#include "cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h" +#include "cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h" +#include "cocostudio/WidgetReader/TextReader/TextReader.h" +#include "cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h" +#include "cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h" +#include "cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h" +#include "cocostudio/WidgetReader/SliderReader/SliderReader.h" +#include "cocostudio/WidgetReader/LayoutReader/LayoutReader.h" +#include "cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h" +#include "cocostudio/WidgetReader/PageViewReader/PageViewReader.h" +#include "cocostudio/WidgetReader/ListViewReader/ListViewReader.h" +#include "cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h" +#include "cocostudio/WidgetReader/Node3DReader/Node3DReader.h" +#include "cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h" +#include "cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h" +#include "cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h" + + +namespace cocostudio +{ + void destroyCocosStudio() + { + NodeReader::destroyInstance(); + SingleNodeReader::destroyInstance(); + SpriteReader::destroyInstance(); + ParticleReader::destroyInstance(); + GameMapReader::destroyInstance(); + ProjectNodeReader::destroyInstance(); + ComAudioReader::destroyInstance(); + + WidgetReader::destroyInstance(); + ButtonReader::destroyInstance(); + CheckBoxReader::destroyInstance(); + ImageViewReader::destroyInstance(); + TextBMFontReader::destroyInstance(); + TextReader::destroyInstance(); + TextFieldReader::destroyInstance(); + TextAtlasReader::destroyInstance(); + LoadingBarReader::destroyInstance(); + SliderReader::destroyInstance(); + LayoutReader::destroyInstance(); + ScrollViewReader::destroyInstance(); + PageViewReader::destroyInstance(); + ListViewReader::destroyInstance(); + + ArmatureNodeReader::destroyInstance(); + Node3DReader::destroyInstance(); + Sprite3DReader::destroyInstance(); + UserCameraReader::destroyInstance(); + Particle3DReader::destroyInstance(); + + cocos2d::CSLoader::destroyInstance(); + } +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index 76df122596..f82c3eb09a 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -65,4 +65,11 @@ THE SOFTWARE. #include "cocostudio/CocosStudioExport.h" #include "cocostudio/ActionTimeline/CSLoader.h" +#include "cocostudio/CocosStudioExport.h" + +namespace cocostudio +{ + void CC_STUDIO_DLL destroyCocosStudio(); +} + #endif diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index 92f5ef7571..1c0061505d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -26,7 +26,6 @@ THE SOFTWARE. #define __ARMATURENODEREADER_H_ #include "cocos2d.h" -#include "cocostudio/FlatBuffersSerialize.h" #include "cocostudio/WidgetReader/NodeReaderProtocol.h" #include "cocostudio/WidgetReader/NodeReaderDefine.h" diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp index 9772957916..a0da56794f 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp @@ -104,7 +104,7 @@ void CocosStudio3DTestDemo::onEnter() void CocosStudio3DTestDemo::onExit() { - CSLoader::destroyCocosStudio(); + cocostudio::destroyCocosStudio(); BaseTest::onExit(); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp index 986ad51c86..83289698df 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioActionTimelineTest/ActionTimelineTestScene.cpp @@ -165,7 +165,7 @@ void ActionTimelineTestLayer::onExit() backItem = restartItem = nextItem = nullptr; - CSLoader::destroyCocosStudio(); + cocostudio::destroyCocosStudio(); Layer::onExit(); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 25d2cdf2cd..4ff27404f6 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -200,7 +200,7 @@ void ArmatureTestLayer::onExit() backItem = restartItem = nextItem = nullptr; - CSLoader::destroyCocosStudio(); + cocostudio::destroyCocosStudio(); Layer::onExit(); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp index cdd01e9ad5..7e963fc9c8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomWidgetCallbackBindTest/CustomWidgetCallbackBindTest.cpp @@ -4,6 +4,7 @@ #include "../../CustomGUIScene.h" #include "cocostudio/ActionTimeline/CSLoader.h" +#include "cocostudio/CocoStudio.h" #include "base/ObjectFactory.h" @@ -33,7 +34,7 @@ void CustomWidgetCallbackBindScene::onEnter() void CustomWidgetCallbackBindScene::onExit() { - CSLoader::destroyCocosStudio(); + cocostudio::destroyCocosStudio(); Scene::onExit(); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp index 1e8c2e8e33..8f0dcb94e6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp @@ -21,7 +21,7 @@ UIScene_Editor::~UIScene_Editor() void UIScene_Editor::onExit() { - CSLoader::destroyCocosStudio(); + cocostudio::destroyCocosStudio(); Layer::onExit(); }