Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into di2905

This commit is contained in:
Dhilan007 2013-10-16 11:00:22 +08:00
commit 5116e91c4b
376 changed files with 2570 additions and 3846 deletions

View File

@ -1 +1 @@
9e303a34aef39593ada75e90ae8d0829f0096abe
fe809a5d9a1b0e24462a215517e08f6e525cd6b7

View File

@ -0,0 +1 @@
71d9dbdbc4e4e33dbb8fb7ad109611f197a0cec7

View File

@ -1 +0,0 @@
aa360e1cdcaf0d2ca399aebe9b7c8786e80abde8

View File

@ -122,6 +122,10 @@ THE SOFTWARE.
#include "CCPhysicsJoint.h"
#include "CCPhysicsWorld.h"
// kazmath
#include "kazmath/kazmath.h"
#include "kazmath/GL/matrix.h"
// platform
#include "platform/CCDevice.h"
#include "platform/CCCommon.h"

View File

@ -0,0 +1,48 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocosbuilder_static
LOCAL_MODULE_FILENAME := libcocosbuilder
LOCAL_SRC_FILES := CCBAnimationManager.cpp \
CCBFileLoader.cpp \
CCBKeyframe.cpp \
CCBReader.cpp \
CCBSequence.cpp \
CCBSequenceProperty.cpp \
CCBValue.cpp \
CCControlButtonLoader.cpp \
CCControlLoader.cpp \
CCLabelBMFontLoader.cpp \
CCLabelTTFLoader.cpp \
CCLayerColorLoader.cpp \
CCLayerGradientLoader.cpp \
CCLayerLoader.cpp \
CCMenuItemImageLoader.cpp \
CCMenuItemLoader.cpp \
CCNode+CCBRelativePositioning.cpp \
CCNodeLoader.cpp \
CCNodeLoaderLibrary.cpp \
CCParticleSystemQuadLoader.cpp \
CCScale9SpriteLoader.cpp \
CCScrollViewLoader.cpp \
CCSpriteLoader.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ \
$(LOCAL_PATH)/../../..
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../../..
LOCAL_CFLAGS += -Wno-psabi
LOCAL_EXPORT_CFLAGS += -Wno-psabi
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_STATIC_LIBRARY)
$(call import-module,2d)
$(call import-module,extensions)

View File

@ -11,8 +11,9 @@
using namespace cocos2d;
using namespace std;
using namespace cocos2d::extension;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
// Implementation of CCBAinmationManager
@ -1292,4 +1293,4 @@ void CCBEaseInstant::update(float dt)
}
NS_CC_EXT_END
}

View File

@ -6,9 +6,9 @@
#include "CCBSequence.h"
#include "CCBValue.h"
#include "CCBSequenceProperty.h"
#include "GUI/CCControlExtension/CCControl.h"
#include "extensions/GUI/CCControlExtension/CCControl.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class CCBAnimationManagerDelegate
{
@ -16,7 +16,7 @@ public:
virtual void completedAnimationSequenceNamed(const char *name) = 0;
};
class CCBAnimationManager : public Object
class CCBAnimationManager : public cocos2d::Object
{
public:
bool _jsControlled;
@ -31,54 +31,54 @@ public:
~CCBAnimationManager();
Object *_owner;
cocos2d::Object *_owner;
virtual bool init();
Array* getSequences();
void setSequences(Array* seq);
cocos2d::Array* getSequences();
void setSequences(cocos2d::Array* seq);
int getAutoPlaySequenceId();
void setAutoPlaySequenceId(int autoPlaySequenceId);
Node* getRootNode();
void setRootNode(Node* pRootNode); // weak reference
cocos2d::Node* getRootNode();
void setRootNode(cocos2d::Node* pRootNode); // weak reference
void addDocumentCallbackNode(Node *node);
void addDocumentCallbackNode(cocos2d::Node *node);
void addDocumentCallbackName(std::string name);
void addDocumentCallbackControlEvents(Control::EventType eventType);
void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType);
void addDocumentOutletNode(Node *node);
void addDocumentOutletNode(cocos2d::Node *node);
void addDocumentOutletName(std::string name);
void setDocumentControllerName(const std::string &name);
std::string getDocumentControllerName();
Array* getDocumentCallbackNames();
Array* getDocumentCallbackNodes();
Array* getDocumentCallbackControlEvents();
cocos2d::Array* getDocumentCallbackNames();
cocos2d::Array* getDocumentCallbackNodes();
cocos2d::Array* getDocumentCallbackControlEvents();
Array* getDocumentOutletNames();
Array* getDocumentOutletNodes();
cocos2d::Array* getDocumentOutletNames();
cocos2d::Array* getDocumentOutletNodes();
std::string getLastCompletedSequenceName();
Array* getKeyframeCallbacks();
cocos2d::Array* getKeyframeCallbacks();
const Size& getRootContainerSize();
void setRootContainerSize(const Size &rootContainerSize);
const cocos2d::Size& getRootContainerSize();
void setRootContainerSize(const cocos2d::Size &rootContainerSize);
CCBAnimationManagerDelegate* getDelegate();
void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain
const char* getRunningSequenceName();
const Size& getContainerSize(Node* pNode);
const cocos2d::Size& getContainerSize(cocos2d::Node* pNode);
void addNode(Node *pNode, Dictionary *pSeq);
void setBaseValue(Object *pValue, Node *pNode, const char *propName);
void moveAnimationsFromNode(Node* fromNode, Node* toNode);
void addNode(cocos2d::Node *pNode, cocos2d::Dictionary *pSeq);
void setBaseValue(cocos2d::Object *pValue, cocos2d::Node *pNode, const char *propName);
void moveAnimationsFromNode(cocos2d::Node* fromNode, cocos2d::Node* toNode);
/** @deprecated This interface will be deprecated sooner or later.*/
CC_DEPRECATED_ATTRIBUTE void runAnimations(const char *pName, float fTweenDuration);
@ -94,16 +94,16 @@ public:
* when this function bound to js ,the second param are callfunc_selector
* @lua NA
*/
void setAnimationCompletedCallback(Object *target, SEL_CallFunc callbackFunc);
void setAnimationCompletedCallback(cocos2d::Object *target, cocos2d::SEL_CallFunc callbackFunc);
void debug();
/**
* @js setCallFuncForJSCallbackNamed
*/
void setCallFunc(CallFunc *callFunc, const std::string &callbackNamed);
void setCallFunc(cocos2d::CallFunc *callFunc, const std::string &callbackNamed);
Object* actionForCallbackChannel(CCBSequenceProperty* channel);
Object* actionForSoundChannel(CCBSequenceProperty* channel);
cocos2d::Object* actionForCallbackChannel(CCBSequenceProperty* channel);
cocos2d::Object* actionForSoundChannel(CCBSequenceProperty* channel);
// return -1 if timeline not exsit
int getSequenceId(const char* pSequenceName);
@ -112,55 +112,55 @@ public:
float getSequenceDuration(const char* pSequenceName);
private:
Object* getBaseValue(Node *pNode, const char* propName);
cocos2d::Object* getBaseValue(cocos2d::Node *pNode, const char* propName);
CCBSequence* getSequence(int nSequenceId);
ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, Node *pNode);
void setAnimatedProperty(const char *propName, Node *pNode, Object *pValue, float fTweenDuraion);
void setFirstFrame(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
ActionInterval* getEaseAction(ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt);
void runAction(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
cocos2d::ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, cocos2d::Node *pNode);
void setAnimatedProperty(const char *propName,cocos2d::Node *pNode, Object *pValue, float fTweenDuraion);
void setFirstFrame(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
cocos2d::ActionInterval* getEaseAction(cocos2d::ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt);
void runAction(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);
void sequenceCompleted();
private:
Array *_sequences;
Dictionary *_nodeSequences;
Dictionary *_baseValues;
cocos2d::Array *_sequences;
cocos2d::Dictionary *_nodeSequences;
cocos2d::Dictionary *_baseValues;
int _autoPlaySequenceId;
Node *_rootNode;
cocos2d::Node *_rootNode;
Size _rootContainerSize;
cocos2d::Size _rootContainerSize;
CCBAnimationManagerDelegate *_delegate;
CCBSequence *_runningSequence;
Array *_documentOutletNames;
Array *_documentOutletNodes;
Array *_documentCallbackNames;
Array *_documentCallbackNodes;
Array *_documentCallbackControlEvents;
Array *_keyframeCallbacks;
Dictionary *_keyframeCallFuncs;
cocos2d::Array *_documentOutletNames;
cocos2d::Array *_documentOutletNodes;
cocos2d::Array *_documentCallbackNames;
cocos2d::Array *_documentCallbackNodes;
cocos2d::Array *_documentCallbackControlEvents;
cocos2d::Array *_keyframeCallbacks;
cocos2d::Dictionary *_keyframeCallFuncs;
std::string _documentControllerName;
std::string _lastCompletedSequenceName;
SEL_CallFunc _animationCompleteCallbackFunc;
Object *_target;
cocos2d::SEL_CallFunc _animationCompleteCallbackFunc;
cocos2d::Object *_target;
};
class CCBSetSpriteFrame : public ActionInstant
class CCBSetSpriteFrame : public cocos2d::ActionInstant
{
public:
/** creates a Place action with a position */
static CCBSetSpriteFrame* create(SpriteFrame *pSpriteFrame);
static CCBSetSpriteFrame* create(cocos2d::SpriteFrame *pSpriteFrame);
/**
* @js NA
* @lua NA
*/
~CCBSetSpriteFrame();
bool initWithSpriteFrame(SpriteFrame *pSpriteFrame);
bool initWithSpriteFrame(cocos2d::SpriteFrame *pSpriteFrame);
// Overrides
virtual void update(float time) override;
@ -168,11 +168,11 @@ public:
virtual CCBSetSpriteFrame* reverse() const override;
private:
SpriteFrame *_spriteFrame;
cocos2d::SpriteFrame *_spriteFrame;
};
class CCBSoundEffect : public ActionInstant
class CCBSoundEffect : public cocos2d::ActionInstant
{
public:
static CCBSoundEffect* actionWithSoundFile(const std::string &file, float pitch, float pan, float gain);
@ -194,7 +194,7 @@ private:
};
class CCBRotateTo : public ActionInterval
class CCBRotateTo : public cocos2d::ActionInterval
{
public:
static CCBRotateTo* create(float fDuration, float fAngle);
@ -204,7 +204,7 @@ public:
virtual void update(float time) override;
virtual CCBRotateTo* clone() const override;
virtual CCBRotateTo* reverse() const override;
virtual void startWithTarget(Node *pNode) override;
virtual void startWithTarget(cocos2d::Node *pNode) override;
private:
float _startAngle;
@ -213,14 +213,14 @@ private:
};
class CCBRotateXTo: public ActionInterval
class CCBRotateXTo: public cocos2d::ActionInterval
{
public:
static CCBRotateXTo* create(float fDuration, float fAngle);
bool initWithDuration(float fDuration, float fAngle);
// Overrides
virtual void startWithTarget(Node *pNode) override;
virtual void startWithTarget(cocos2d::Node *pNode) override;
virtual CCBRotateXTo* clone() const override;
virtual CCBRotateXTo* reverse() const override;
virtual void update(float time) override;
@ -232,14 +232,14 @@ private:
};
class CCBRotateYTo: public ActionInterval
class CCBRotateYTo: public cocos2d::ActionInterval
{
public:
static CCBRotateYTo* create(float fDuration, float fAngle);
bool initWithDuration(float fDuration, float fAngle);
// Override
virtual void startWithTarget(Node *pNode) override;
virtual void startWithTarget(cocos2d::Node *pNode) override;
virtual CCBRotateYTo* clone() const override;
virtual CCBRotateYTo* reverse() const override;
virtual void update(float time) override;
@ -251,10 +251,10 @@ private:
};
class CCBEaseInstant : public ActionEase
class CCBEaseInstant : public cocos2d::ActionEase
{
public:
static CCBEaseInstant* create(ActionInterval *pAction);
static CCBEaseInstant* create(cocos2d::ActionInterval *pAction);
virtual CCBEaseInstant* clone() const override;
virtual CCBEaseInstant* reverse() const override;
@ -262,6 +262,6 @@ public:
};
NS_CC_EXT_END
}
#endif // __CCB_CCBANIMATION_MANAGER_H__

View File

@ -1,8 +1,9 @@
#include "CCBFileLoader.h"
using namespace cocos2d;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define PROPERTY_CCBFILE "ccbFile"
@ -14,4 +15,4 @@ void CCBFileLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const
}
}
NS_CC_EXT_END
}

View File

@ -4,7 +4,7 @@
#include "CCNodeLoader.h"
#include "CCBReader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -25,9 +25,9 @@ class CCBFileLoader : public NodeLoader {
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile);
virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader);
virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -2,7 +2,7 @@
using namespace cocos2d;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
CCBKeyframe::CCBKeyframe()
: _value(NULL)
@ -58,4 +58,4 @@ void CCBKeyframe::setEasingOpt(float fEasingOpt)
_easingOpt = fEasingOpt;
}
NS_CC_EXT_END
}

View File

@ -2,11 +2,10 @@
#define __CCB_KEYFRAME_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class CCBKeyframe : public Object
class CCBKeyframe : public cocos2d::Object
{
public:
enum class EasingType
@ -41,8 +40,8 @@ public:
*/
~CCBKeyframe();
Object* getValue();
void setValue(Object *pValue); // retain
cocos2d::Object* getValue();
void setValue(cocos2d::Object *pValue); // retain
float getTime();
void setTime(float fTime);
@ -54,12 +53,12 @@ public:
void setEasingOpt(float fEasingOpt);
private:
Object *_value;
cocos2d::Object *_value;
float _time;
EasingType _easingType;
float _easingOpt;
};
NS_CC_EXT_END
}
#endif // __CCB_KEYFRAME_H__

View File

@ -4,7 +4,7 @@
#include "cocos2d.h"
#include "CCBValue.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \
if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, (MEMBERVARIABLENAME))) { \
@ -41,7 +41,7 @@ class CCBMemberVariableAssigner {
* @param node The member variable.
* @return Whether the assignment was successful.
*/
virtual bool onAssignCCBMemberVariable(Object* target, const char* memberVariableName, Node* node) = 0;
virtual bool onAssignCCBMemberVariable(cocos2d::Object* target, const char* memberVariableName, cocos2d::Node* node) = 0;
/**
* The callback function of assigning custom properties.
@ -51,9 +51,9 @@ class CCBMemberVariableAssigner {
* @param value The value of the property.
* @return Whether the assignment was successful.
*/
virtual bool onAssignCCBCustomProperty(Object* target, const char* memberVariableName, CCBValue* value) { return false; };
virtual bool onAssignCCBCustomProperty(cocos2d::Object* target, const char* memberVariableName, CCBValue* value) { return false; };
};
NS_CC_EXT_END
}
#endif

View File

@ -15,8 +15,10 @@
#include <ctype.h>
using namespace std;
using namespace cocos2d;
using namespace cocos2d::extension;
NS_CC_EXT_BEGIN;
namespace cocosbuilder {;
/*************************************************************************
Implementation of CCBFile
@ -1108,4 +1110,4 @@ void CCBReader::setResolutionScale(float scale)
__ccbResolutionScale = scale;
}
NS_CC_EXT_END;
};

View File

@ -2,11 +2,10 @@
#define _CCB_CCBREADER_H_
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include <string>
#include <vector>
#include "CCBSequence.h"
#include "GUI/CCControlExtension/CCControl.h"
#include "extensions/GUI/CCControlExtension/CCControl.h"
#define CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(T, METHOD) static T * METHOD() { \
T * ptr = new T(); \
@ -30,24 +29,24 @@
#define CCB_VERSION 5
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/**
* @addtogroup cocosbuilder
* @{
*/
class CCBFile : public Node
class CCBFile : public cocos2d::Node
{
private:
Node *_CCBFileNode;
cocos2d::Node *_CCBFileNode;
public:
CCBFile();
static CCBFile* create();
Node* getCCBFileNode();
cocos2d::Node* getCCBFileNode();
void setCCBFileNode(Node *pNode); // retain
};
@ -63,7 +62,7 @@ class CCBKeyframe;
/**
* @brief Parse CCBI file which is generated by CocosBuilder
*/
class CCBReader : public Object
class CCBReader : public cocos2d::Object
{
public:
enum class PropertyType {
@ -167,27 +166,27 @@ public:
void setCCBRootPath(const char* ccbRootPath);
const std::string& getCCBRootPath() const;
Node* readNodeGraphFromFile(const char *pCCBFileName);
Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner);
Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize);
cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName);
cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner);
cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);
/**
* @js NA
* @lua NA
*/
Node* readNodeGraphFromData(Data *pData, Object *pOwner, const Size &parentSize);
cocos2d::Node* readNodeGraphFromData(cocos2d::Data *pData, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);
/**
@lua NA
*/
Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName);
cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName);
/**
@lua NA
*/
Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner);
cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner);
/**
@lua NA
*/
Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize);
cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);
/**
* @js NA
@ -225,7 +224,7 @@ public:
* @js NA
* @lua NA
*/
Object* getOwner();
cocos2d::Object* getOwner();
/* Utility methods.
* @js NA
@ -283,24 +282,24 @@ public:
bool readCallbackKeyframesForSeq(CCBSequence* seq);
bool readSoundKeyframesForSeq(CCBSequence* seq);
Array* getOwnerCallbackNames();
Array* getOwnerCallbackNodes();
Array* getOwnerCallbackControlEvents();
cocos2d::Array* getOwnerCallbackNames();
cocos2d::Array* getOwnerCallbackNodes();
cocos2d::Array* getOwnerCallbackControlEvents();
Array* getOwnerOutletNames();
Array* getOwnerOutletNodes();
Array* getNodesWithAnimationManagers();
Array* getAnimationManagersForNodes();
cocos2d::Array* getOwnerOutletNames();
cocos2d::Array* getOwnerOutletNodes();
cocos2d::Array* getNodesWithAnimationManagers();
cocos2d::Array* getAnimationManagersForNodes();
/**
* @js NA
* @lua NA
*/
Dictionary* getAnimationManagers();
cocos2d::Dictionary* getAnimationManagers();
/**
* @js NA
* @lua NA
*/
void setAnimationManagers(Dictionary* x); // weak reference
void setAnimationManagers(cocos2d::Dictionary* x); // weak reference
/**
* @js NA
* @lua NA
@ -310,8 +309,8 @@ public:
* @js NA
* @lua NA
*/
void addOwnerCallbackNode(Node *node);
void addOwnerCallbackControlEvents(Control::EventType type);
void addOwnerCallbackNode(cocos2d::Node *node);
void addOwnerCallbackControlEvents(cocos2d::extension::Control::EventType type);
/**
* @js NA
* @lua NA
@ -321,8 +320,8 @@ public:
* @js NA
* @lua NA
*/
void addDocumentCallbackNode(Node *node);
void addDocumentCallbackControlEvents(Control::EventType eventType);
void addDocumentCallbackNode(cocos2d::Node *node);
void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType);
/**
* @js NA
* @lua NA
@ -333,21 +332,21 @@ public:
* @js NA
* @lua NA
*/
Node* readFileWithCleanUp(bool bCleanUp, Dictionary* am);
cocos2d::Node* readFileWithCleanUp(bool bCleanUp, cocos2d::Dictionary* am);
void addOwnerOutletName(std::string name);
void addOwnerOutletNode(Node *node);
void addOwnerOutletNode(cocos2d::Node *node);
private:
void cleanUpNodeGraph(Node *pNode);
void cleanUpNodeGraph(cocos2d::Node *pNode);
bool readSequences();
CCBKeyframe* readKeyframe(PropertyType type);
bool readHeader();
bool readStringCache();
//void readStringCacheEntry();
Node* readNodeGraph();
Node* readNodeGraph(Node * pParent);
cocos2d::Node* readNodeGraph();
cocos2d::Node* readNodeGraph(cocos2d::Node * pParent);
bool getBit();
void alignBits();
@ -357,7 +356,7 @@ private:
friend class NodeLoader;
private:
Data *_data;
cocos2d::Data *_data;
unsigned char *_bytes;
int _currentByte;
int _currentBit;
@ -365,10 +364,10 @@ private:
std::vector<std::string> _stringCache;
std::set<std::string> _loadedSpriteSheets;
Object *_owner;
cocos2d::Object *_owner;
CCBAnimationManager *_actionManager; //retain
Dictionary* _actionManagers;
cocos2d::Dictionary* _actionManagers;
std::set<std::string> *_animatedProps;
@ -378,13 +377,13 @@ private:
CCBSelectorResolver *_CCBSelectorResolver;
std::vector<std::string> _ownerOutletNames;
Array* _ownerOutletNodes;
Array* _nodesWithAnimationManagers;
Array* _animationManagersForNodes;
cocos2d::Array* _ownerOutletNodes;
cocos2d::Array* _nodesWithAnimationManagers;
cocos2d::Array* _animationManagersForNodes;
std::vector<std::string> _ownerCallbackNames;
Array* _ownerCallbackNodes;
Array* _ownerOwnerCallbackControlEvents;
cocos2d::Array* _ownerCallbackNodes;
cocos2d::Array* _ownerOwnerCallbackControlEvents;
std::string _CCBRootPath;
bool _jsControlled;
@ -393,6 +392,6 @@ private:
// end of effects group
/// @}
NS_CC_EXT_END
}
#endif

View File

@ -2,11 +2,10 @@
#define _CCB_CCBSELECTORRESOLVER_H_
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "../GUI/CCControlExtension/CCInvocation.h"
#include "extensions//GUI/CCControlExtension/CCInvocation.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
return menu_selector(METHOD); \
@ -27,9 +26,9 @@ class CCBSelectorResolver {
* @lua NA
*/
virtual ~CCBSelectorResolver() {};
virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0;
virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; };
virtual Control::Handler onResolveCCBCCControlSelector(Object * pTarget, const char* pSelectorName) = 0;
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;
virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Object * pTarget, const char* pSelectorName) { return NULL; };
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;
};
@ -43,6 +42,6 @@ public:
virtual CCBSelectorResolver * createNew() = 0;
};
NS_CC_EXT_END
}
#endif

View File

@ -4,7 +4,7 @@ using namespace cocos2d;
using namespace std;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
CCBSequence::CCBSequence()
: _duration(0.0f)
@ -86,4 +86,4 @@ void CCBSequence::setChainedSequenceId(int nChainedSequenceId)
mChainedSequenceId = nChainedSequenceId;
}
NS_CC_EXT_END
}

View File

@ -3,12 +3,11 @@
#include <string>
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCBSequenceProperty.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class CCBSequence : public Object
class CCBSequence : public cocos2d::Object
{
public:
CCBSequence();
@ -45,7 +44,7 @@ private:
};
NS_CC_EXT_END
}
#endif // __CCB_CCSEQUENCE_H__

View File

@ -3,7 +3,7 @@
using namespace cocos2d;
using namespace std;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
CCBSequenceProperty::CCBSequenceProperty()
: _name("")
@ -50,4 +50,4 @@ Array* CCBSequenceProperty::getKeyframes()
return _keyframes;
}
NS_CC_EXT_END
}

View File

@ -2,12 +2,11 @@
#define __CCB_SEQUENCE_PROPERTY_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCBKeyframe.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class CCBSequenceProperty : public Object
class CCBSequenceProperty : public cocos2d::Object
{
public:
/**
@ -28,14 +27,14 @@ public:
int getType();
void setType(int type);
Array* getKeyframes();
cocos2d::Array* getKeyframes();
private:
std::string _name;
int _type;
Array *_keyframes;
cocos2d::Array *_keyframes;
};
NS_CC_EXT_END
}
#endif // __CCB_SEQUENCE_PROPERTY_H__

View File

@ -1,6 +1,8 @@
#include "CCBValue.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocosbuilder {
// Implementation of Color3BWapper
@ -154,4 +156,4 @@ CCBValue::Type CCBValue::getType()
return _type;
}
NS_CC_EXT_END
}

View File

@ -2,28 +2,27 @@
#define __CCB_VALUE_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
/*
These classes are wrapper of basic types, such as Color3B
*/
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class Color3BWapper : public Object
class Color3BWapper : public cocos2d::Object
{
public:
static Color3BWapper* create(const Color3B& color);
static Color3BWapper* create(const cocos2d::Color3B& color);
const Color3B& getColor() const;
const cocos2d::Color3B& getColor() const;
private:
Color3B color;
cocos2d::Color3B color;
};
class CCBValue : public Object
class CCBValue : public cocos2d::Object
{
public:
@ -42,7 +41,7 @@ public:
static CCBValue* create(float fValue);
static CCBValue* create(unsigned char byte);
static CCBValue* create(const char* pStr);
static CCBValue* create(Array* pArr);
static CCBValue* create(cocos2d::Array* pArr);
int getIntValue();
@ -50,7 +49,7 @@ public:
bool getBoolValue();
unsigned char getByteValue();
const char* getStringValue();
Array *getArrayValue();
cocos2d::Array *getArrayValue();
Type getType();
@ -62,10 +61,10 @@ private:
} _value;
std::string _strValue;
Array* _arrValue;
cocos2d::Array* _arrValue;
Type _type;
};
NS_CC_EXT_END
}
#endif // __CCB_VALUE_H__

View File

@ -1,7 +1,9 @@
#include "CCControlButtonLoader.h"
using namespace cocos2d;
using namespace cocos2d::extension;
NS_CC_EXT_BEGIN;
namespace cocosbuilder {;
#define PROPERTY_ZOOMONTOUCHDOWN "zoomOnTouchDown"
#define PROPERTY_TITLE_NORMAL "title|1"
@ -112,4 +114,4 @@ void ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, c
}
}
NS_CC_EXT_END;
};

View File

@ -2,9 +2,9 @@
#define _CCB_CCCONTROLBUTTONLOADER_H_
#include "CCControlLoader.h"
#include "../GUI/CCControlExtension/CCControlButton.h"
#include "extensions//GUI/CCControlExtension/CCControlButton.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -23,18 +23,18 @@ class ControlButtonLoader : public ControlLoader {
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ControlButtonLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ControlButton);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ControlButton);
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,7 +1,9 @@
#include "CCControlLoader.h"
using namespace cocos2d;
using namespace cocos2d::extension;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define PROPERTY_ENABLED "enabled"
#define PROPERTY_SELECTED "selected"
@ -25,4 +27,4 @@ void ControlLoader::onHandlePropTypeBlockControl(Node * pNode, Node * pParent, c
}
}
NS_CC_EXT_END
}

View File

@ -2,9 +2,9 @@
#define _CCB_CCCONTROLLOADER_H_
#include "CCNodeLoader.h"
#include "../GUI/CCControlExtension/CCControl.h"
#include "extensions/GUI/CCControlExtension/CCControl.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,12 +18,12 @@ public:
virtual ~ControlLoader() {};
protected:
CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Control);
CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Control);
virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,8 +1,8 @@
#include "CCLabelBMFontLoader.h"
using namespace cocos2d;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define PROPERTY_COLOR "color"
#define PROPERTY_OPACITY "opacity"
@ -50,4 +50,4 @@ void LabelBMFontLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCNodeLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,15 +18,15 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelBMFontLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelBMFont);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelBMFont);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader);
virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader);
virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,6 +1,6 @@
#include "CCLabelTTFLoader.h"
using namespace cocos2d;
#define PROPERTY_COLOR "color"
#define PROPERTY_OPACITY "opacity"
@ -12,7 +12,7 @@
#define PROPERTY_STRING "string"
#define PROPERTY_DIMENSIONS "dimensions"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {
@ -80,4 +80,4 @@ void LabelTTFLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const ch
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCNodeLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,18 +18,18 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTTFLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelTTF);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelTTF);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,8 +1,8 @@
#include "CCLayerColorLoader.h"
using namespace cocos2d;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define PROPERTY_COLOR "color"
#define PROPERTY_OPACITY "opacity"
@ -32,4 +32,4 @@ void LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, c
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCLayerLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,13 +18,13 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerColorLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerColor);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerColor);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,6 +1,6 @@
#include "CCLayerGradientLoader.h"
using namespace cocos2d;
#define PROPERTY_STARTCOLOR "startColor"
#define PROPERTY_ENDCOLOR "endColor"
@ -9,7 +9,7 @@
#define PROPERTY_VECTOR "vector"
#define PROPERTY_BLENDFUNC "blendFunc"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) {
@ -51,4 +51,4 @@ void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, co
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCLayerLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,14 +18,14 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerGradientLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerGradient);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerGradient);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,14 +1,16 @@
#include "CCLayerLoader.h"
using namespace cocos2d;
#define PROPERTY_TOUCH_ENABLED "isTouchEnabled"
#define PROPERTY_ACCELEROMETER_ENABLED "isAccelerometerEnabled"
#define PROPERTY_MOUSE_ENABLED "isMouseEnabled"
#define PROPERTY_KEYBOARD_ENABLED "isKeyboardEnabled"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocosbuilder {
void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_TOUCH_ENABLED) == 0) {
@ -27,4 +29,4 @@ void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCNodeLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -18,11 +18,11 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Layer);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Layer);
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,12 +1,12 @@
#include "CCMenuItemImageLoader.h"
using namespace cocos2d;
#define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame"
#define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame"
#define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) {
@ -26,4 +26,4 @@ void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pPare
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCMenuItemLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -26,14 +26,14 @@ protected:
* @js NA
* @lua NA
*/
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItemImage);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItemImage);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,11 +1,11 @@
#include "CCMenuItemLoader.h"
using namespace cocos2d;
#define PROPERTY_BLOCK "block"
#define PROPERTY_ISENABLED "isEnabled"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) {
@ -27,4 +27,4 @@ void MenuItemLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const c
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCLayerLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -21,19 +21,19 @@ protected:
* @js NA
* @lua NA
*/
CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItem);
CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItem);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);
virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -3,7 +3,7 @@
#include "CCLayerLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -22,9 +22,9 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Menu);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Menu);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,7 +1,9 @@
#include "CCNode+CCBRelativePositioning.h"
#include "CCBReader.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocosbuilder {
Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName)
{
@ -57,4 +59,4 @@ void setRelativeScale(Node *pNode, float scaleX, float scaleY, CCBReader::ScaleT
pNode->setScaleY(scaleY);
}
NS_CC_EXT_END
}

View File

@ -2,15 +2,14 @@
#define __CCB_CCNODE_RELATIVEPOSITIONING_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCBReader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
extern Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName);
extern cocos2d::Point getAbsolutePosition(const cocos2d::Point &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const char *propName);
extern void setRelativeScale(Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName);
extern void setRelativeScale(cocos2d::Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName);
NS_CC_EXT_END
}
#endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__

View File

@ -5,8 +5,10 @@
#include "CCNode+CCBRelativePositioning.h"
using namespace std;
using namespace cocos2d;
using namespace cocos2d::extension;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
NodeLoader::NodeLoader()
{
@ -1156,4 +1158,4 @@ void NodeLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const cha
ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);
}
NS_CC_EXT_END
}

View File

@ -1,13 +1,13 @@
#ifndef _CCB_CCNODELOADER_H_
#define _CCB_CCNODELOADER_H_
#include "../GUI/CCControlExtension/CCInvocation.h"
#include "extensions/GUI/CCControlExtension/CCInvocation.h"
#include "cocos2d.h"
#include "CCBReader.h"
#include "CCBValue.h"
#include "../GUI/CCControlExtension/CCControl.h"
#include "extensions/GUI/CCControlExtension/CCControl.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
#define PROPERTY_POSITION "position"
#define PROPERTY_CONTENTSIZE "contentSize"
@ -24,27 +24,27 @@ NS_CC_EXT_BEGIN
#define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) cocos2d::log("Unexpected property: '%s'!\n", PROPERTY); assert(false)
#define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) cocos2d::log("Unexpected property type: '%d'!\n", PROPERTYTYPE); assert(false)
#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) { \
#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { \
return T::create(); \
}
#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) = 0
#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) = 0
struct BlockData {
SEL_MenuHandler mSELMenuHandler;
Object * _target;
cocos2d::SEL_MenuHandler mSELMenuHandler;
cocos2d::Object * _target;
};
struct BlockControlData {
Control::Handler mSELControlHandler;
Object * _target;
Control::EventType mControlEvents;
cocos2d::extension::Control::Handler mSELControlHandler;
cocos2d::Object * _target;
cocos2d::extension::Control::EventType mControlEvents;
};
/* Forward declaration. */
class CCBReader;
class NodeLoader : public Object {
class NodeLoader : public cocos2d::Object {
public:
/**
* @js NA
@ -65,85 +65,85 @@ class NodeLoader : public Object {
* @js NA
* @lua NA
*/
virtual Node * loadNode(Node *, CCBReader * ccbReader);
virtual cocos2d::Node * loadNode(cocos2d::Node *, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void parseProperties(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual void parseProperties(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual Dictionary* getCustomProperties();
virtual cocos2d::Dictionary* getCustomProperties();
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Node);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Node);
virtual Point parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual Point parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual Point parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual Size parsePropTypeSize(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeScaleLock(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual float parsePropTypeFloat(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual float parsePropTypeDegrees(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual float parsePropTypeFloatScale(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual int parsePropTypeInteger(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual int parsePropTypeIntegerLabeled(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeFloatVar(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual bool parsePropTypeCheck(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual SpriteFrame * parsePropTypeSpriteFrame(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual Animation * parsePropTypeAnimation(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual Texture2D * parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual unsigned char parsePropTypeByte(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual Color3B parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual Color4F * parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual bool * parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual BlendFunc parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeFntFile(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeString(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeText(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeFontTTF(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual BlockData * parsePropTypeBlock(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual BlockControlData * parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual Node * parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeFloatXY(Node * pNode, Node * pParent, CCBReader * ccbReader);
virtual cocos2d::Point parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual cocos2d::Point parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual cocos2d::Point parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader);
virtual cocos2d::Size parsePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual float parsePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual float parsePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual float parsePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual int parsePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual int parsePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeFloatVar(cocos2d::Node * pNode,cocos2d::Node * pParent, CCBReader * ccbReader);
virtual bool parsePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual cocos2d::SpriteFrame * parsePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual cocos2d::Animation * parsePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual cocos2d::Texture2D * parsePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual unsigned char parsePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual cocos2d::Color3B parsePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);
virtual cocos2d::Color4F * parsePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual bool * parsePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual cocos2d::BlendFunc parsePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual std::string parsePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual BlockData * parsePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual BlockControlData * parsePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual cocos2d::Node * parsePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual float * parsePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);
virtual void onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Point pPosition, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Point pPointLock, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char* pPropertyName, Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeScaleLock(Node * pNode, Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeDegrees(Node * pNode, Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatXY(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);
virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Point pPosition, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPointLock, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader);
virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char* pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeAnimation(Node * pNode, Node * pParent, const char* pPropertyName, Animation * pAnimation, CCBReader * ccbReader);
virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char* pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader);
virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader);
virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader);
virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);
virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);
virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char* pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Animation * pAnimation, CCBReader * ccbReader);
virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader);
virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader);
virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader);
virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader);
virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader);
virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);
virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);
virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);
protected:
Dictionary* _customProperties;
cocos2d::Dictionary* _customProperties;
};
NS_CC_EXT_END
}
#endif

View File

@ -15,9 +15,9 @@
#include "CCParticleSystemQuadLoader.h"
#include "CCScrollViewLoader.h"
using namespace cocos2d;
NS_CC_EXT_BEGIN
namespace cocosbuilder {
NodeLoaderLibrary::NodeLoaderLibrary() {
@ -102,4 +102,4 @@ NodeLoaderLibrary * NodeLoaderLibrary::newDefaultNodeLoaderLibrary() {
return ccNodeLoaderLibrary;
}
NS_CC_EXT_END
}

View File

@ -4,14 +4,14 @@
#include "cocos2d.h"
#include "CCBReader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class NodeLoader;
typedef std::map<std::string, NodeLoader *> NodeLoaderMap;
typedef std::pair<std::string, NodeLoader *> NodeLoaderMapEntry;
class NodeLoaderLibrary : public Object
class NodeLoaderLibrary : public cocos2d::Object
{
public:
/**
@ -114,6 +114,6 @@ private:
NodeLoaderMap _nodeLoaders;
};
NS_CC_EXT_END
}
#endif

View File

@ -3,7 +3,7 @@
#include "cocos2d.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
class NodeLoaderListener {
public:
@ -16,9 +16,9 @@ class NodeLoaderListener {
* @js NA
* @lua NA
*/
virtual void onNodeLoaded(Node * pNode, NodeLoader * pNodeLoader) = 0;
virtual void onNodeLoaded(cocos2d::Node * pNode, NodeLoader * pNodeLoader) = 0;
};
NS_CC_EXT_END
}
#endif

View File

@ -1,6 +1,6 @@
#include "CCParticleSystemQuadLoader.h"
using namespace cocos2d;
#define PROPERTY_EMITERMODE "emitterMode"
#define PROPERTY_POSVAR "posVar"
@ -25,7 +25,7 @@
#define PROPERTY_ENDRADIUS "endRadius"
#define PROPERTY_ROTATEPERSECOND "rotatePerSecond"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void ParticleSystemQuadLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_EMITERMODE) == 0) {
@ -133,4 +133,4 @@ void ParticleSystemQuadLoader::onHandlePropTypeTexture(Node * pNode, Node * pPar
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCNodeLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -19,56 +19,56 @@ public:
* @js NA
* @lua NA
*/
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ParticleSystemQuadLoader, loader);
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(cocosbuilder::ParticleSystemQuadLoader, loader);
protected:
/**
* @js NA
* @lua NA
*/
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ParticleSystemQuad);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::ParticleSystemQuad);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader);
virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader);
virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader);
virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader);
virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader);
virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,6 +1,7 @@
#include "CCScale9SpriteLoader.h"
using namespace cocos2d;
using namespace cocos2d::extension;
#define PROPERTY_CONTENTSIZE "contentSize"
#define PROPERTY_SPRITEFRAME "spriteFrame"
@ -13,7 +14,7 @@
#define PROPERTY_INSETRIGHT "insetRight"
#define PROPERTY_INSETBOTTOM "insetBottom"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) {
@ -72,4 +73,4 @@ void Scale9SpriteLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, con
}
}
NS_CC_EXT_END
}

View File

@ -3,9 +3,9 @@
#include "CCNodeLoader.h"
#include "CCScale9SpriteLoader.h"
#include "../GUI/CCControlExtension/CCScale9Sprite.h"
#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -28,39 +28,39 @@ protected:
* @js NA
* @lua NA
*/
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Scale9Sprite);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Scale9Sprite);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
/**
* @js NA
* @lua NA
*/
virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,6 +1,7 @@
#include "CCScrollViewLoader.h"
using namespace cocos2d;
using namespace cocos2d::extension;
#define PROPERTY_CONTAINER "container"
#define PROPERTY_DIRECTION "direction"
@ -8,7 +9,7 @@
#define PROPERTY_BOUNCES "bounces"
#define PROPERTY_SCALE "scale"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void ScrollViewLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) {
@ -53,4 +54,4 @@ void ScrollViewLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pPare
}
}
NS_CC_EXT_END
}

View File

@ -2,9 +2,9 @@
#define _CCB_CCSCROLLVIEWLOADER_H_
#include "CCNodeLoader.h"
#include "../GUI/CCScrollView/CCScrollView.h"
#include "extensions/GUI/CCScrollView/CCScrollView.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -23,14 +23,14 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ScrollView);
virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ScrollView);
virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);
virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);
virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);
virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);
virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -1,12 +1,14 @@
#include "CCSpriteLoader.h"
using namespace cocos2d;
#define PROPERTY_FLIP "flip"
#define PROPERTY_DISPLAYFRAME "displayFrame"
#define PROPERTY_COLOR "color"
#define PROPERTY_OPACITY "opacity"
#define PROPERTY_BLENDFUNC "blendFunc"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {
if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {
@ -53,4 +55,4 @@ void SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const
}
}
NS_CC_EXT_END
}

View File

@ -3,7 +3,7 @@
#include "CCNodeLoader.h"
NS_CC_EXT_BEGIN
namespace cocosbuilder {
/* Forward declaration. */
class CCBReader;
@ -22,15 +22,15 @@ public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteLoader, loader);
protected:
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Sprite);
CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Sprite);
virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pCCBBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader);
virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);
virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);
virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pCCBBlendFunc, CCBReader * ccbReader);
virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);
virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader);
};
NS_CC_EXT_END
}
#endif

View File

@ -0,0 +1,32 @@
#ifndef __EDITOR_SUPPORT_COCOSBUILDER_H__
#define __EDITOR_SUPPORT_COCOSBUILDER_H__
#include "cocosbuilder/CCBAnimationManager.h"
#include "cocosbuilder/CCBFileLoader.h"
#include "cocosbuilder/CCBKeyframe.h"
#include "cocosbuilder/CCBMemberVariableAssigner.h"
#include "cocosbuilder/CCBReader.h"
#include "cocosbuilder/CCBSelectorResolver.h"
#include "cocosbuilder/CCBSequence.h"
#include "cocosbuilder/CCBSequenceProperty.h"
#include "cocosbuilder/CCBValue.h"
#include "cocosbuilder/CCControlButtonLoader.h"
#include "cocosbuilder/CCControlLoader.h"
#include "cocosbuilder/CCLabelBMFontLoader.h"
#include "cocosbuilder/CCLabelTTFLoader.h"
#include "cocosbuilder/CCLayerColorLoader.h"
#include "cocosbuilder/CCLayerGradientLoader.h"
#include "cocosbuilder/CCLayerLoader.h"
#include "cocosbuilder/CCMenuItemImageLoader.h"
#include "cocosbuilder/CCMenuItemLoader.h"
#include "cocosbuilder/CCMenuLoader.h"
#include "cocosbuilder/CCNode+CCBRelativePositioning.h"
#include "cocosbuilder/CCNodeLoader.h"
#include "cocosbuilder/CCNodeLoaderLibrary.h"
#include "cocosbuilder/CCNodeLoaderListener.h"
#include "cocosbuilder/CCParticleSystemQuadLoader.h"
#include "cocosbuilder/CCScale9SpriteLoader.h"
#include "cocosbuilder/CCScrollViewLoader.h"
#include "cocosbuilder/CCSpriteLoader.h"
#endif // __EDITOR_SUPPORT_COCOSBUILDER_H__

View File

@ -0,0 +1,64 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocostudio_static
LOCAL_MODULE_FILENAME := libcocostudio
LOCAL_SRC_FILES := action/CCActionFrame.cpp \
action/CCActionFrameEasing.cpp \
action/CCActionManagerEx.cpp \
action/CCActionNode.cpp \
action/CCActionObject.cpp \
armature/CCArmature.cpp \
armature/CCBone.cpp \
armature/animation/CCArmatureAnimation.cpp \
armature/animation/CCProcessBase.cpp \
armature/animation/CCTween.cpp \
armature/datas/CCDatas.cpp \
armature/display/CCBatchNode.cpp \
armature/display/CCDecorativeDisplay.cpp \
armature/display/CCDisplayFactory.cpp \
armature/display/CCDisplayManager.cpp \
armature/display/CCSkin.cpp \
armature/physics/CCColliderDetector.cpp \
armature/utils/CCArmatureDataManager.cpp \
armature/utils/CCArmatureDefine.cpp \
armature/utils/CCDataReaderHelper.cpp \
armature/utils/CCSpriteFrameCacheHelper.cpp \
armature/utils/CCTransformHelp.cpp \
armature/utils/CCTweenFunction.cpp \
armature/utils/CCUtilMath.cpp \
components/CCComAttribute.cpp \
components/CCComAudio.cpp \
components/CCComController.cpp \
components/CCComRender.cpp \
components/CCInputDelegate.cpp \
json/CSContentJsonDictionary.cpp \
json/DictionaryHelper.cpp \
reader/CCSGUIReader.cpp \
reader/CCSSceneReader.cpp \
../../../external/json/json_reader.cpp \
../../../external/json/json_value.cpp \
../../../external/json/json_writer.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../../../external/json
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \
$(LOCAL_PATH)/../../../external/json \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../../gui \
$(LOCAL_PATH)/../../../external
LOCAL_CFLAGS += -Wno-psabi -fexceptions
LOCAL_EXPORT_CFLAGS += -Wno-psabi
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
include $(BUILD_STATIC_LIBRARY)
$(call import-module,2d)
$(call import-module,audio/android)

View File

@ -0,0 +1,62 @@
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __EDITOR_SUPPORT_COCOSTUDIO_H__
#define __EDITOR_SUPPORT_COCOSTUDIO_H__
#include "action/CCActionFrame.h"
#include "action/CCActionFrameEasing.h"
#include "action/CCActionManagerEx.h"
#include "action/CCActionNode.h"
#include "action/CCActionObject.h"
#include "armature/CCArmature.h"
#include "armature/CCBone.h"
#include "armature/animation/CCArmatureAnimation.h"
#include "armature/animation/CCProcessBase.h"
#include "armature/animation/CCTween.h"
#include "armature/datas/CCDatas.h"
#include "armature/display/CCBatchNode.h"
#include "armature/display/CCDecorativeDisplay.h"
#include "armature/display/CCDisplayFactory.h"
#include "armature/display/CCDisplayManager.h"
#include "armature/display/CCSkin.h"
#include "armature/physics/CCColliderDetector.h"
#include "armature/utils/CCArmatureDataManager.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/utils/CCDataReaderHelper.h"
#include "armature/utils/CCSpriteFrameCacheHelper.h"
#include "armature/utils/CCTransformHelp.h"
#include "armature/utils/CCTweenFunction.h"
#include "armature/utils/CCUtilMath.h"
#include "components/CCComAttribute.h"
#include "components/CCComAudio.h"
#include "components/CCComController.h"
#include "components/CCComRender.h"
#include "components/CCInputDelegate.h"
#include "json/CSContentJsonDictionary.h"
#include "json/DictionaryHelper.h"
#include "reader/CCSGUIReader.h"
#include "reader/CCSSceneReader.h"
#endif

View File

@ -24,7 +24,9 @@
#include "CCActionFrame.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocostudio {
ActionFrame::ActionFrame()
: _frameType(0)
@ -222,4 +224,4 @@ Action* ActionTintFrame::getAction(float fDuration)
}
NS_CC_EXT_END
}

View File

@ -26,9 +26,8 @@
#define __ActionFRAME_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
NS_CC_EXT_BEGIN
namespace cocostudio {
enum FrameType
{
@ -40,7 +39,7 @@ enum FrameType
kKeyframeMax
};
class ActionFrame:public Object
class ActionFrame:public cocos2d::Object
{
public:
@ -118,7 +117,7 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
int _frameType;
int _easingType;
@ -145,14 +144,14 @@ public:
*
* @param the move action position.
*/
void setPosition(Point pos);
void setPosition(cocos2d::Point pos);
/**
* Gets the move action position.
*
* @return the move action position.
*/
Point getPosition();
cocos2d::Point getPosition();
/**
* Gets the CCAction of ActionFrame.
@ -161,9 +160,9 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
Point _position;
cocos2d::Point _position;
};
class ActionScaleFrame:public ActionFrame
@ -215,7 +214,7 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
float _scaleX;
float _scaleY;
@ -256,7 +255,7 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
float _rotation;
};
@ -296,7 +295,7 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
float _opacity;
};
@ -321,14 +320,14 @@ public:
*
* @param ccolor the tint action color
*/
void setColor(Color3B ccolor);
void setColor(cocos2d::Color3B ccolor);
/**
* Gets the tint action color.
*
* @return the tint action color.
*/
Color3B getColor();
cocos2d::Color3B getColor();
/**
* Gets the CCAction of ActionFrame.
@ -337,11 +336,11 @@ public:
*
* @return CCAction
*/
virtual Action* getAction(float fDuration);
virtual cocos2d::Action* getAction(float fDuration);
protected:
Color3B _color;
cocos2d::Color3B _color;
};
NS_CC_EXT_END
}
#endif

View File

@ -24,8 +24,8 @@
#include <math.h>
#include "CCActionFrameEasing.h"
#include "../Json/DictionaryHelper.h"
NS_CC_EXT_BEGIN
#include "json/DictionaryHelper.h"
namespace cocostudio {
#ifndef M_PI_X_2
#define M_PI_X_2 (float)M_PI * 2.0f
@ -186,4 +186,4 @@ float ActionFrameEasing::easeValue(float t)
return 0;
}
NS_CC_EXT_END
}

View File

@ -26,10 +26,9 @@
#define __ActionFrameEasing_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "../Json/CSContentJsonDictionary.h"
#include "json/CSContentJsonDictionary.h"
NS_CC_EXT_BEGIN
namespace cocostudio {
enum FrameEasingType
{
@ -68,6 +67,6 @@ public:
float easeValue(float t);
};
NS_CC_EXT_END
}
#endif

View File

@ -23,9 +23,11 @@
****************************************************************************/
#include "CCActionManagerEx.h"
#include "../Json/DictionaryHelper.h"
#include "json/DictionaryHelper.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocostudio {
static ActionManagerEx* sharedActionManager = NULL;
@ -55,7 +57,7 @@ ActionManagerEx::~ActionManagerEx()
_pActionDic->release();
}
void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary *dic,Object* root)
void ActionManagerEx::initWithDictionary(const char* jsonName,JsonDictionary *dic,Object* root)
{
std::string path = jsonName;
int pos = path.find_last_of("/");
@ -66,7 +68,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary
for (int i=0; i<actionCount; i++) {
ActionObject* action = new ActionObject();
action->autorelease();
cs::JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i);
JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i);
action->initWithDictionary(actionDic,root);
actionList->addObject(action);
CC_SAFE_DELETE(actionDic);
@ -108,4 +110,4 @@ void ActionManagerEx::releaseActions()
}
NS_CC_EXT_END
}

View File

@ -26,13 +26,12 @@
#define __ActionMANAGER_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCActionObject.h"
#include "../Json/CSContentJsonDictionary.h"
#include "json/CSContentJsonDictionary.h"
NS_CC_EXT_BEGIN
namespace cocostudio {
class ActionManagerEx:public Object
class ActionManagerEx:public cocos2d::Object
{
public:
@ -77,7 +76,7 @@ public:
void playActionByName(const char* jsonName,const char* actionName);
/*init properties with json dictionay*/
void initWithDictionary(const char* jsonName,cs::JsonDictionary* dic,Object* root);
void initWithDictionary(const char* jsonName,JsonDictionary* dic,cocos2d::Object* root);
/**
* Release all actions.
@ -86,9 +85,9 @@ public:
void releaseActions();
protected:
Dictionary* _pActionDic;
cocos2d::Dictionary* _pActionDic;
};
NS_CC_EXT_END
}
#endif

View File

@ -24,11 +24,14 @@ THE SOFTWARE.
#include "CCActionNode.h"
#include "CCActionFrameEasing.h"
#include "../GUI/BaseClasses/UIWidget.h"
#include "../GUI/System/UIHelper.h"
#include "../Json/DictionaryHelper.h"
#include "base-classes/UIWidget.h"
#include "system/UIHelper.h"
#include "json/DictionaryHelper.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
using namespace gui;
namespace cocostudio {
ActionNode::ActionNode()
: _currentFrameIndex(0)
@ -70,13 +73,13 @@ ActionNode::~ActionNode()
}
}
void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
void ActionNode::initWithDictionary(JsonDictionary *dic,Object* root)
{
setActionTag(DICTOOL->getIntValue_json(dic, "ActionTag"));
int actionFrameCount = DICTOOL->getArrayCount_json(dic, "actionframelist");
for (int i=0; i<actionFrameCount; i++) {
cs::JsonDictionary* actionFrameDic = DICTOOL->getDictionaryFromArray_json(dic, "actionframelist", i);
JsonDictionary* actionFrameDic = DICTOOL->getDictionaryFromArray_json(dic, "actionframelist", i);
int frameInex = DICTOOL->getIntValue_json(actionFrameDic,"frameid");
bool existPosition = DICTOOL->checkObjectExist_json(actionFrameDic,"positionx");
@ -477,4 +480,4 @@ void ActionNode::easingToFrame(float duration,float delayTime,ActionFrame* destF
cAction->update(delayTime);
}
NS_CC_EXT_END
}

View File

@ -26,13 +26,12 @@
#define __ActionNODE_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCActionFrame.h"
#include "../Json/CSContentJsonDictionary.h"
#include "json/CSContentJsonDictionary.h"
NS_CC_EXT_BEGIN
namespace cocostudio {
class ActionNode:public Object
class ActionNode:public cocos2d::Object
{
public:
@ -77,14 +76,14 @@ public:
*
* @param node which will run a action
*/
void setObject(Object* node);
void setObject(cocos2d::Object* node);
/**
* Gets node which will run a action.
*
* @return node which will run a action
*/
Object* getObject();
cocos2d::Object* getObject();
/**
* Insets a ActionFrame to ActionNode.
@ -148,7 +147,7 @@ public:
virtual void stopAction();
/*init properties with a json dictionary*/
virtual void initWithDictionary(cs::JsonDictionary* dic,Object* root);
virtual void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root);
protected:
int _currentFrameIndex;
int _destFrameIndex;
@ -156,21 +155,21 @@ protected:
float _fUnitTime;
int _actionTag;
Spawn * _actionSpawn;
Action* _action;
Object* _object;
cocos2d::Spawn * _actionSpawn;
cocos2d::Action* _action;
cocos2d::Object* _object;
Array* _frameArray;
cocos2d::Array* _frameArray;
int _frameArrayNum;
protected:
virtual Node* getActionNode();
virtual Spawn * refreshActionProperty();
virtual cocos2d::Node* getActionNode();
virtual cocos2d::Spawn * refreshActionProperty();
virtual void runAction();
virtual void initActionNodeFromRoot(Object* root);
virtual void initActionNodeFromRoot(cocos2d::Object* root);
virtual void easingToFrame(float duration,float delayTime,ActionFrame* destFrame);
};
NS_CC_EXT_END
}
#endif

View File

@ -23,9 +23,11 @@
****************************************************************************/
#include "CCActionObject.h"
#include "../Json/DictionaryHelper.h"
#include "json/DictionaryHelper.h"
NS_CC_EXT_BEGIN
using namespace cocos2d;
namespace cocostudio {
ActionObject::ActionObject()
: _actionNodeList(NULL)
@ -94,7 +96,7 @@ bool ActionObject::isPlaying()
return _bPlaying;
}
void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root)
void ActionObject::initWithDictionary(JsonDictionary *dic,Object* root)
{
setName(DICTOOL->getStringValue_json(dic, "name"));
setLoop(DICTOOL->getBooleanValue_json(dic, "loop"));
@ -103,7 +105,7 @@ void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root)
for (int i=0; i<actionNodeCount; i++) {
ActionNode* actionNode = new ActionNode();
actionNode->autorelease();
cs::JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i);
JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i);
actionNode->initWithDictionary(actionNodeDic,root);
actionNode->setUnitTime(getUnitTime());
_actionNodeList->addObject(actionNode);
@ -172,4 +174,4 @@ void ActionObject::updateToFrameByTime(float fTime)
}
}
NS_CC_EXT_END
}

View File

@ -26,13 +26,12 @@
#define __ActionObject_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCActionNode.h"
#include "../Json/CSContentJsonDictionary.h"
#include "json/CSContentJsonDictionary.h"
NS_CC_EXT_BEGIN
namespace cocostudio {
class ActionObject:public Object
class ActionObject:public cocos2d::Object
{
public:
@ -142,10 +141,10 @@ public:
void updateToFrameByTime(float fTime);
/*init properties with a json dictionary*/
void initWithDictionary(cs::JsonDictionary* dic,Object* root);
void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root);
protected:
Array* _actionNodeList;/*actionnode*/
cocos2d::Array* _actionNodeList;/*actionnode*/
std::string _name;
bool _loop;
bool _bPause;
@ -154,6 +153,6 @@ protected:
float _currentTime;
};
NS_CC_EXT_END
}
#endif

View File

@ -35,8 +35,10 @@ THE SOFTWARE.
#include "chipmunk.h"
#endif
using namespace cocos2d;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
Armature *Armature::create()
{
@ -788,4 +790,4 @@ cpShape *Armature::getShapeList()
#endif
NS_CC_EXT_ARMATURE_END
}

View File

@ -35,7 +35,7 @@ THE SOFTWARE.
class b2Body;
struct cpBody;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase;
CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData;
@ -66,7 +66,7 @@ CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation;
CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature;
CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager;
class Armature : public NodeRGBA, public BlendProtocol
class Armature : public cocos2d::NodeRGBA, public cocos2d::BlendProtocol
{
public:
@ -139,12 +139,12 @@ public:
* Get Armature's bone dictionary
* @return Armature's bone dictionary
*/
Dictionary *getBoneDic();
cocos2d::Dictionary *getBoneDic();
/**
* This boundingBox will calculate all bones' boundingBox every time
*/
virtual Rect getBoundingBox() const;
virtual cocos2d::Rect getBoundingBox() const;
Bone *getBoneAtPoint(float x, float y);
@ -157,10 +157,10 @@ public:
virtual void update(float dt) override;
virtual void draw() override;
virtual const AffineTransform& getNodeToParentTransform() const override;
virtual const cocos2d::AffineTransform& getNodeToParentTransform() const override;
inline void setBlendFunc(const BlendFunc &blendFunc) override { _blendFunc = blendFunc; }
inline const BlendFunc &getBlendFunc(void) const override{ return _blendFunc; }
inline void setBlendFunc(const cocos2d::BlendFunc &blendFunc) override { _blendFunc = blendFunc; }
inline const cocos2d::BlendFunc &getBlendFunc(void) const override{ return _blendFunc; }
/**
@ -195,7 +195,7 @@ protected:
CC_SYNTHESIZE(std::string, _name, Name);
CC_SYNTHESIZE(TextureAtlas *, _atlas, TextureAtlas);
CC_SYNTHESIZE(cocos2d::TextureAtlas *, _atlas, TextureAtlas);
CC_SYNTHESIZE(Bone *, _parentBone, ParentBone);
@ -204,13 +204,13 @@ protected:
protected:
mutable bool _armatureTransformDirty;
Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren.
cocos2d::Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren.
Array *_topBoneList;
cocos2d::Array *_topBoneList;
BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance
cocos2d::BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance
Point _offsetPoint;
cocos2d::Point _offsetPoint;
ArmatureAnimation *_animation;
@ -221,6 +221,6 @@ protected:
#endif
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCARMATURE_H__*/

View File

@ -29,7 +29,9 @@ THE SOFTWARE.
#include "utils/CCTransformHelp.h"
#include "display/CCDisplayManager.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
Bone *Bone::create()
{
@ -373,4 +375,4 @@ Array *Bone::getColliderBodyList()
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -31,12 +31,12 @@ THE SOFTWARE.
#include "display/CCDecorativeDisplay.h"
#include "display/CCDisplayManager.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Armature;
class Bone : public NodeRGBA
class Bone : public cocos2d::NodeRGBA
{
public:
/**
@ -84,7 +84,7 @@ public:
*/
void addDisplay(DisplayData *displayData, int index);
void addDisplay(Node *display, int index);
void addDisplay(cocos2d::Node *display, int index);
void changeDisplayByIndex(int index, bool force);
@ -124,7 +124,7 @@ public:
void update(float delta);
void updateDisplayedColor(const Color3B &parentColor);
void updateDisplayedColor(const cocos2d::Color3B &parentColor);
void updateDisplayedOpacity(GLubyte parentOpacity);
//! Update color to render display
@ -144,15 +144,15 @@ public:
virtual bool isTransformDirty();
virtual AffineTransform getNodeToArmatureTransform() const;
virtual AffineTransform getNodeToWorldTransform() const override;
virtual cocos2d::AffineTransform getNodeToArmatureTransform() const;
virtual cocos2d::AffineTransform getNodeToWorldTransform() const override;
Node *getDisplayRenderNode();
/*
* Get the ColliderBody list in this bone. The object in the Array is ColliderBody.
*/
virtual Array *getColliderBodyList();
virtual cocos2d::Array *getColliderBodyList();
public:
/*
@ -188,9 +188,9 @@ protected:
bool _boneTransformDirty; //! Whether or not transform dirty
//! self Transform, use this to change display's state
AffineTransform _worldTransform;
cocos2d::AffineTransform _worldTransform;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCBONE_H__*/

View File

@ -23,14 +23,16 @@ THE SOFTWARE.
****************************************************************************/
#include "CCArmatureAnimation.h"
#include "../CCArmature.h"
#include "../CCBone.h"
#include "../utils/CCArmatureDefine.h"
#include "../utils/CCUtilMath.h"
#include "../datas/CCDatas.h"
#include "armature/CCArmature.h"
#include "armature/CCBone.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/utils/CCUtilMath.h"
#include "armature/datas/CCDatas.h"
using namespace cocos2d;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
ArmatureAnimation *ArmatureAnimation::create(Armature *armature)
{
@ -403,4 +405,4 @@ void ArmatureAnimation::frameEvent(Bone *bone, const char *frameEventName, int o
(_frameEventTarget->*_frameEventCallFunc)(bone, frameEventName, originFrameIndex, currentFrameIndex);
}
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#include "CCProcessBase.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
enum MovementEventType
@ -42,8 +42,8 @@ enum MovementEventType
class Armature;
class Bone;
typedef void (Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *);
typedef void (Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int);
typedef void (cocos2d::Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *);
typedef void (cocos2d::Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int);
#define movementEvent_selector(_SELECTOR) (SEL_MovementEventCallFunc)(&_SELECTOR)
#define frameEvent_selector(_SELECTOR) (SEL_FrameEventCallFunc)(&_SELECTOR)
@ -158,13 +158,13 @@ public:
* Set armature's movement event callback function
* To disconnect this event, just setMovementEventCallFunc(NULL, NULL);
*/
void setMovementEventCallFunc(Object *target, SEL_MovementEventCallFunc callFunc);
void setMovementEventCallFunc(cocos2d::Object *target, SEL_MovementEventCallFunc callFunc);
/**
* Set armature's frame event callback function
* To disconnect this event, just setFrameEventCallFunc(NULL, NULL);
*/
void setFrameEventCallFunc(Object *target, SEL_FrameEventCallFunc callFunc);
void setFrameEventCallFunc(cocos2d::Object *target, SEL_FrameEventCallFunc callFunc);
protected:
@ -199,7 +199,7 @@ protected:
int _toIndex; //! The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.
Array *_tweenList;
cocos2d::Array *_tweenList;
protected:
/**
@ -220,10 +220,10 @@ protected:
SEL_FrameEventCallFunc _frameEventCallFunc;
Object *_movementEventTarget;
Object *_frameEventTarget;
cocos2d::Object *_movementEventTarget;
cocos2d::Object *_frameEventTarget;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCANIMATION_H__*/

View File

@ -23,9 +23,11 @@ THE SOFTWARE.
****************************************************************************/
#include "CCProcessBase.h"
#include "../utils/CCUtilMath.h"
#include "armature/utils/CCUtilMath.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
ProcessBase::ProcessBase(void)
: _processScale(1)
@ -149,4 +151,4 @@ int ProcessBase::getCurrentFrameIndex()
return _curFrameIndex;
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -26,10 +26,10 @@ THE SOFTWARE.
#ifndef __CCPROCESSBASE_H__
#define __CCPROCESSBASE_H__
#include "../utils/CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/datas/CCDatas.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
enum AnimationType
{
@ -47,7 +47,7 @@ enum AnimationType
};
class ProcessBase : public Object
class ProcessBase : public cocos2d::Object
{
public:
/**
@ -169,6 +169,6 @@ protected:
bool _isLoopBack;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCPROCESSBASE_H__*/

View File

@ -25,14 +25,14 @@ THE SOFTWARE.
#include "CCTween.h"
#include "CCArmatureAnimation.h"
#include "../CCBone.h"
#include "../CCArmature.h"
#include "../utils/CCUtilMath.h"
#include "../utils/CCTweenFunction.h"
#include "../utils/CCTransformHelp.h"
#include "armature/CCBone.h"
#include "armature/CCArmature.h"
#include "armature/utils/CCUtilMath.h"
#include "armature/utils/CCTweenFunction.h"
#include "armature/utils/CCTransformHelp.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
Tween *Tween::create(Bone *bone)
{
@ -462,4 +462,4 @@ float Tween::updateFrameData(float currentPercent)
return currentPercent;
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -27,9 +27,9 @@ THE SOFTWARE.
#define __CCTWEEN_H__
#include "CCProcessBase.h"
#include "../utils/CCTweenFunction.h"
#include "armature/utils/CCTweenFunction.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Bone;
class ArmatureAnimation;
@ -147,6 +147,6 @@ protected:
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCTWEEN_H__*/

View File

@ -23,10 +23,12 @@ THE SOFTWARE.
****************************************************************************/
#include "CCDatas.h"
#include "../utils/CCUtilMath.h"
#include "../utils/CCTransformHelp.h"
#include "armature/utils/CCUtilMath.h"
#include "armature/utils/CCTransformHelp.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
BaseData::BaseData()
@ -425,4 +427,4 @@ ContourData *TextureData::getContourData(int index)
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,8 +25,8 @@ THE SOFTWARE.
#ifndef __CCARMATURE_DATAS_H__
#define __CCARMATURE_DATAS_H__
#include "../utils/CCArmatureDefine.h"
#include "../utils/CCTweenFunction.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/utils/CCTweenFunction.h"
#define CC_CREATE_NO_PARAM_NO_INIT(varType)\
@ -55,12 +55,12 @@ public: \
return NULL;\
}
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
/**
* The base node include a lot of attributes.
*/
class BaseData : public Object
class BaseData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM_NO_INIT(BaseData)
@ -89,8 +89,8 @@ public:
*/
virtual void subtract(BaseData *from, BaseData *to, bool limit);
virtual void setColor(const Color4B &color);
virtual Color4B getColor();
virtual void setColor(const cocos2d::Color4B &color);
virtual cocos2d::Color4B getColor();
public:
float x; //! position x attribute
float y; //! position y attribute
@ -126,7 +126,7 @@ enum DisplayType
CS_DISPLAY_MAX
};
class DisplayData : public Object
class DisplayData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM_NO_INIT(DisplayData)
@ -269,8 +269,8 @@ public:
public:
std::string name; //! the bone's name
std::string parentName; //! the bone parent's name
Array displayDataList; //! save DisplayData informations for the Bone
AffineTransform boneDataTransform;
cocos2d::Array displayDataList; //! save DisplayData informations for the Bone
cocos2d::AffineTransform boneDataTransform;
};
@ -279,7 +279,7 @@ public:
* When we create a Armature, we need to get each Bone's BoneData as it's init information.
* So we can get a BoneData from the Dictionary saved in the ArmatureData.
*/
class ArmatureData : public Object
class ArmatureData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM(ArmatureData)
@ -299,7 +299,7 @@ public:
BoneData *getBoneData(const char *boneName);
public:
std::string name;
Dictionary boneDataDic;
cocos2d::Dictionary boneDataDic;
float dataVersion;
};
@ -362,7 +362,7 @@ public:
};
class MovementBoneData : public Object
class MovementBoneData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM(MovementBoneData)
@ -387,11 +387,11 @@ public:
float duration; //! this Bone in this movement will last m_iDuration frames
std::string name; //! bone name
Array frameList;
cocos2d::Array frameList;
};
class MovementData : public Object
class MovementData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM_NO_INIT(MovementData)
@ -442,7 +442,7 @@ public:
* @key const char *
* @value MovementBoneData *
*/
Dictionary movBoneDataDic;
cocos2d::Dictionary movBoneDataDic;
};
@ -451,7 +451,7 @@ public:
* The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData
* -> MovementFrameData
*/
class AnimationData : public Object
class AnimationData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM_NO_INIT(AnimationData)
@ -471,12 +471,12 @@ public:
int getMovementCount();
public:
std::string name;
Dictionary movementDataDic;
cocos2d::Dictionary movementDataDic;
std::vector<std::string> movementNames;
};
struct ContourVertex2 : public Object
struct ContourVertex2 : public cocos2d::Object
{
ContourVertex2(float x, float y)
{
@ -491,7 +491,7 @@ struct ContourVertex2 : public Object
/*
* ContourData include a contour vertex information
*/
class ContourData : public Object
class ContourData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM(ContourData)
@ -507,9 +507,9 @@ public:
~ContourData(void);
virtual bool init();
virtual void addVertex(Point *vertex);
virtual void addVertex(cocos2d::Point *vertex);
public:
Array vertexList; //! Save contour vertex info, vertex saved in a Point
cocos2d::Array vertexList; //! Save contour vertex info, vertex saved in a Point
};
@ -518,7 +518,7 @@ public:
/*
* TextureData include a texture's information
*/
class TextureData : public Object
class TextureData : public cocos2d::Object
{
public:
CC_CREATE_NO_PARAM(TextureData)
@ -547,10 +547,10 @@ public:
std::string name; //! The texture's name
Array contourDataList;
cocos2d::Array contourDataList;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCARMATURE_DATAS_H__*/

View File

@ -23,10 +23,12 @@ THE SOFTWARE.
****************************************************************************/
#include "CCBatchNode.h"
#include "../utils/CCArmatureDefine.h"
#include "../CCArmature.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/CCArmature.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
BatchNode *BatchNode::create()
{
@ -117,4 +119,4 @@ void BatchNode::draw()
}
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,11 +25,11 @@ THE SOFTWARE.
#ifndef __CCBATCHNODE_H__
#define __CCBATCHNODE_H__
#include "../utils/CCArmatureDefine.h"
#include "armature/utils/CCArmatureDefine.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class BatchNode : public Node
class BatchNode : public cocos2d::Node
{
public:
static BatchNode *create();
@ -40,14 +40,14 @@ public:
BatchNode();
virtual bool init();
virtual void addChild(Node *child, int zOrder, int tag);
virtual void addChild(cocos2d::Node *child, int zOrder, int tag);
virtual void visit();
void draw();
protected:
TextureAtlas *_atlas;
cocos2d::TextureAtlas *_atlas;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCBATCHNODE_H__*/

View File

@ -24,7 +24,9 @@ THE SOFTWARE.
#include "CCDecorativeDisplay.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
DecorativeDisplay *DecorativeDisplay::create()
{
@ -64,4 +66,4 @@ bool DecorativeDisplay::init()
return true;
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,18 +25,18 @@ THE SOFTWARE.
#ifndef __CCDECORATIVEDISPLAY_H__
#define __CCDECORATIVEDISPLAY_H__
#include "../utils/CCArmatureDefine.h"
#include "armature/utils/CCArmatureDefine.h"
#include "CCDisplayFactory.h"
#include "../datas/CCDatas.h"
#include "armature/datas/CCDatas.h"
#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT
#include "../physics/CCColliderDetector.h"
#endif
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class DecorativeDisplay: public Object
class DecorativeDisplay: public cocos2d::Object
{
public:
static DecorativeDisplay *create();
@ -55,7 +55,7 @@ public:
protected:
CC_SYNTHESIZE_RETAIN(Node *, _display, Display);
CC_SYNTHESIZE_RETAIN(cocos2d::Node *, _display, Display);
CC_SYNTHESIZE_RETAIN(DisplayData *, _displayData, DisplayData);
#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT
@ -63,6 +63,6 @@ protected:
#endif
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCDECORATIVEDISPLAY_H__*/

View File

@ -23,14 +23,16 @@ THE SOFTWARE.
****************************************************************************/
#include "CCDisplayFactory.h"
#include "../CCBone.h"
#include "../CCArmature.h"
#include "../display/CCSkin.h"
#include "../utils/CCSpriteFrameCacheHelper.h"
#include "../utils/CCArmatureDataManager.h"
#include "../utils/CCTransformHelp.h"
#include "armature/CCBone.h"
#include "armature/CCArmature.h"
#include "armature/display/CCSkin.h"
#include "armature/utils/CCSpriteFrameCacheHelper.h"
#include "armature/utils/CCArmatureDataManager.h"
#include "armature/utils/CCTransformHelp.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
void DisplayFactory::addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData)
{
@ -272,4 +274,4 @@ void DisplayFactory::updateParticleDisplay(Bone *bone, Node *display, float dt,
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,10 +25,10 @@ THE SOFTWARE.
#ifndef __CCDISPLAYFACTORY_H__
#define __CCDISPLAYFACTORY_H__
#include "../utils/CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/datas/CCDatas.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Skin;
class Bone;
@ -45,19 +45,19 @@ public:
static void addSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);
static void createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay);
static void initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, const char *displayName, Skin *skin);
static void updateSpriteDisplay(Bone *bone, Node *display, float dt, bool dirty);
static void updateSpriteDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty);
static void addArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);
static void createArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay);
static void updateArmatureDisplay(Bone *bone, Node *display, float dt, bool dirty);
static void updateArmatureDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty);
static void addParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);
static void createParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay);
static void updateParticleDisplay(Bone *bone, Node *display, float dt, bool dirty);
static void updateParticleDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty);
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCDISPLAYFACTORY_H__*/

View File

@ -23,12 +23,14 @@ THE SOFTWARE.
****************************************************************************/
#include "CCDisplayManager.h"
#include "../CCBone.h"
#include "../CCArmature.h"
#include "../utils/CCUtilMath.h"
#include "../display/CCSkin.h"
#include "armature/CCBone.h"
#include "armature/CCArmature.h"
#include "armature/utils/CCUtilMath.h"
#include "armature/display/CCSkin.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
DisplayManager *DisplayManager::create(Bone *bone)
{
@ -392,4 +394,4 @@ Point DisplayManager::getAnchorPointInPoints()
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,16 +25,16 @@ THE SOFTWARE.
#ifndef __CCDISPLAYMANAGER_H__
#define __CCDISPLAYMANAGER_H__
#include "../utils/CCArmatureDefine.h"
#include "../display/CCDecorativeDisplay.h"
#include "../datas/CCDatas.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/display/CCDecorativeDisplay.h"
#include "armature/datas/CCDatas.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Bone;
//! DisplayManager manages Bone's display
class DisplayManager : public Object
class DisplayManager : public cocos2d::Object
{
public:
static DisplayManager *create(Bone *bone);
@ -72,11 +72,11 @@ public:
*/
void addDisplay(DisplayData *displayData, int index);
void addDisplay(Node *display, int index);
void addDisplay(cocos2d::Node *display, int index);
void removeDisplay(int index);
Array *getDecorativeDisplayList();
cocos2d::Array *getDecorativeDisplayList();
/**
* Change display by index. You can just use this method to change display in the display list.
@ -90,7 +90,7 @@ public:
void changeDisplayByIndex(int index, bool force);
Node *getDisplayRenderNode();
cocos2d::Node *getDisplayRenderNode();
int getCurrentDisplayIndex();
@ -113,16 +113,16 @@ public:
*/
virtual bool isVisible();
Size getContentSize();
Rect getBoundingBox();
cocos2d::Size getContentSize();
cocos2d::Rect getBoundingBox();
Point getAnchorPoint();
Point getAnchorPointInPoints();
cocos2d::Point getAnchorPoint();
cocos2d::Point getAnchorPointInPoints();
/**
* Check if the position is inside the bone.
*/
virtual bool containPoint(Point &_point);
virtual bool containPoint(cocos2d::Point &_point);
/**
* Check if the position is inside the bone.
@ -130,9 +130,9 @@ public:
virtual bool containPoint(float x, float y);
protected:
Array *_decoDisplayList;
cocos2d::Array *_decoDisplayList;
//! Display render node.
Node *_displayRenderNode;
cocos2d::Node *_displayRenderNode;
//! Include current display information, like contour sprite, etc.
DecorativeDisplay *_currentDecoDisplay;
//! Current display index
@ -146,6 +146,6 @@ protected:
Bone *_bone;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCDISPLAYMANAGER_H__*/

View File

@ -23,11 +23,13 @@ THE SOFTWARE.
****************************************************************************/
#include "CCSkin.h"
#include "../utils/CCTransformHelp.h"
#include "../utils/CCSpriteFrameCacheHelper.h"
#include "../CCArmature.h"
#include "armature/utils/CCTransformHelp.h"
#include "armature/utils/CCSpriteFrameCacheHelper.h"
#include "armature/CCArmature.h"
NS_CC_EXT_ARMATURE_BEGIN
using namespace cocos2d;
namespace cocostudio {
#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
#define RENDER_IN_SUBPIXEL
@ -201,4 +203,4 @@ AffineTransform Skin::getNodeToWorldTransformAR() const
return AffineTransformConcat(displayTransform, _bone->getArmature()->getNodeToWorldTransform());
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,12 +25,12 @@ THE SOFTWARE.
#ifndef __CCSKIN_H__
#define __CCSKIN_H__
#include "../utils/CCArmatureDefine.h"
#include "../CCBone.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/CCBone.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Skin : public Sprite
class Skin : public cocos2d::Sprite
{
public:
static Skin *create();
@ -45,17 +45,17 @@ public:
void updateArmatureTransform();
void updateTransform();
AffineTransform getNodeToWorldTransform() const;
AffineTransform getNodeToWorldTransformAR() const;
cocos2d::AffineTransform getNodeToWorldTransform() const;
cocos2d::AffineTransform getNodeToWorldTransformAR() const;
CC_PROPERTY_PASS_BY_REF(BaseData, _skinData, SkinData);
CC_SYNTHESIZE(Bone *, _bone, Bone);
protected:
AffineTransform _skinTransform;
cocos2d::AffineTransform _skinTransform;
CC_SYNTHESIZE_READONLY(std::string, _displayName, DisplayName)
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCSKIN_H__*/

View File

@ -23,8 +23,8 @@ THE SOFTWARE.
****************************************************************************/
#include "CCColliderDetector.h"
#include "../CCBone.h"
#include "../utils/CCTransformHelp.h"
#include "armature/CCBone.h"
#include "armature/utils/CCTransformHelp.h"
#if ENABLE_PHYSICS_BOX2D_DETECT
#include "Box2D/Box2D.h"
@ -32,8 +32,9 @@ THE SOFTWARE.
#include "chipmunk.h"
#endif
using namespace cocos2d;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
#if ENABLE_PHYSICS_BOX2D_DETECT
@ -393,4 +394,4 @@ cpBody *ColliderDetector::getBody()
#endif
NS_CC_EXT_ARMATURE_END
}

View File

@ -25,8 +25,8 @@ THE SOFTWARE.
#ifndef __CCCOLLIDERDETECTOR_H__
#define __CCCOLLIDERDETECTOR_H__
#include "../utils/CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "armature/utils/CCArmatureDefine.h"
#include "armature/datas/CCDatas.h"
#ifndef PT_RATIO
#define PT_RATIO 32
@ -40,11 +40,11 @@ struct b2Filter;
struct cpBody;
struct cpShape;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class Bone;
class ColliderBody : public Object
class ColliderBody : public cocos2d::Object
{
public:
#if ENABLE_PHYSICS_BOX2D_DETECT
@ -70,7 +70,7 @@ private:
/*
* @brief ContourSprite used to draw the contour of the display
*/
class ColliderDetector : public Object
class ColliderDetector : public cocos2d::Object
{
public:
static ColliderDetector *create();
@ -90,20 +90,20 @@ public:
virtual bool init(Bone *bone);
void addContourData(ContourData *contourData);
void addContourDataList(Array *contourDataList);
void addContourDataList(cocos2d::Array *contourDataList);
void removeContourData(ContourData *contourData);
void removeAll();
void updateTransform(AffineTransform &t);
void updateTransform(cocos2d::AffineTransform &t);
void setActive(bool active);
bool getActive();
Array *getColliderBodyList();
cocos2d::Array *getColliderBodyList();
protected:
Array *_colliderBodyList;
cocos2d::Array *_colliderBodyList;
CC_SYNTHESIZE(Bone *, _bone, Bone);
#if ENABLE_PHYSICS_BOX2D_DETECT
@ -116,6 +116,6 @@ protected:
bool _active;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCCOLLIDERDETECTOR_H__*/

View File

@ -28,8 +28,9 @@ THE SOFTWARE.
#include "CCDataReaderHelper.h"
#include "CCSpriteFrameCacheHelper.h"
using namespace cocos2d;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
static ArmatureDataManager *s_sharedArmatureDataManager = NULL;
@ -245,4 +246,4 @@ Dictionary *ArmatureDataManager::getTextureDatas() const
return _textureDatas;
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -26,15 +26,15 @@ THE SOFTWARE.
#define __CCARMATUREDATAMANAGER_H__
#include "CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "armature/datas/CCDatas.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
/**
* @brief format and manage armature configuration and armature animation
*/
class ArmatureDataManager : public Object
class ArmatureDataManager : public cocos2d::Object
{
public:
/** @deprecated Use getInstance() instead */
@ -133,7 +133,7 @@ public:
* @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager.
* It will load data in a new thread
*/
void addArmatureFileInfoAsync(const char *configFilePath, Object *target, SEL_SCHEDULE selector);
void addArmatureFileInfoAsync(const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);
/**
* @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager.
@ -144,7 +144,7 @@ public:
* @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager.
* It will load data in a new thread
*/
void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, Object *target, SEL_SCHEDULE selector);
void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);
/**
* @brief Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name
@ -163,35 +163,35 @@ public:
bool isAutoLoadSpriteFile();
Dictionary *getArmatureDatas() const;
Dictionary *getAnimationDatas() const;
Dictionary *getTextureDatas() const;
cocos2d::Dictionary *getArmatureDatas() const;
cocos2d::Dictionary *getAnimationDatas() const;
cocos2d::Dictionary *getTextureDatas() const;
private:
/**
* @brief save amature datas
* @key std::string
* @value ArmatureData *
*/
Dictionary *_armarureDatas;
cocos2d::Dictionary *_armarureDatas;
/**
* @brief save animation datas
* @key std::string
* @value AnimationData *
*/
Dictionary *_animationDatas;
cocos2d::Dictionary *_animationDatas;
/**
* @brief save texture datas
* @key std::string
* @value TextureData *
*/
Dictionary *_textureDatas;
cocos2d::Dictionary *_textureDatas;
bool _autoLoadSpriteFile;
};
NS_CC_EXT_ARMATURE_END
}
#endif/*__CCARMATUREDATAMANAGER_H__*/

View File

@ -24,11 +24,11 @@ THE SOFTWARE.
#include "CCArmatureDefine.h"
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
const char *armatureVersion()
{
return "0.4.0.0";
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -27,7 +27,6 @@ THE SOFTWARE.
#include "cocos2d.h"
#include "ExtensionMacros.h"
#define VERSION_COMBINED 0.30f
#define VERSION_CHANGE_ROTATION_RANGE 1.0f
@ -48,14 +47,10 @@ THE SOFTWARE.
#define CS_RETURN_IF(cond) if (cond) return
#define CS_RETURN_NULL_IF(cond) if (cond) return NULL;
#define NS_CC_EXT_ARMATURE_BEGIN namespace cocos2d { namespace extension { namespace armature {
#define NS_CC_EXT_ARMATURE_END }}}
#define USING_NS_CC_EXT_ARMATURE using namespace cocos2d::extension::armature
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
const char *armatureVersion();
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCARMATUREDEFINE_H__*/

View File

@ -22,13 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "support/tinyxml2/tinyxml2.h"
#include "tinyxml2.h"
#include "CCDataReaderHelper.h"
#include "CCArmatureDataManager.h"
#include "CCTransformHelp.h"
#include "CCUtilMath.h"
#include "CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "armature/datas/CCDatas.h"
using namespace cocos2d;
static const char *VERSION = "version";
@ -133,7 +135,7 @@ static const char *COLOR_INFO = "color";
static const char *CONFIG_FILE_PATH = "config_file_path";
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
std::vector<std::string> s_arrConfigFileList;
@ -1118,14 +1120,14 @@ ContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML)
void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo)
{
cs::JsonDictionary json;
JsonDictionary json;
json.initWithDescription(fileContent);
// Decode armatures
int length = json.getArrayItemCount(ARMATURE_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i);
JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i);
ArmatureData *armatureData = decodeArmature(*armatureDic);
if (dataInfo)
@ -1145,7 +1147,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d
length = json.getArrayItemCount(ANIMATION_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i);
JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i);
AnimationData *animationData = decodeAnimation(*animationDic);
if (dataInfo)
@ -1165,7 +1167,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d
length = json.getArrayItemCount(TEXTURE_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i);
JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i);
TextureData *textureData = decodeTexture(*textureDic);
if (dataInfo)
@ -1213,7 +1215,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d
}
}
ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json)
ArmatureData *DataReaderHelper::decodeArmature(JsonDictionary &json)
{
ArmatureData *armatureData = new ArmatureData();
armatureData->init();
@ -1229,7 +1231,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json)
int length = json.getArrayItemCount(BONE_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i);
BoneData *boneData = decodeBone(*dic);
armatureData->addBoneData(boneData);
boneData->release();
@ -1240,7 +1242,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json)
return armatureData;
}
BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json)
BoneData *DataReaderHelper::decodeBone(JsonDictionary &json)
{
BoneData *boneData = new BoneData();
boneData->init();
@ -1263,7 +1265,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json)
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i);
DisplayData *displayData = decodeBoneDisplay(*dic);
boneData->addDisplayData(displayData);
displayData->release();
@ -1274,7 +1276,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json)
return boneData;
}
DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json)
DisplayData *DataReaderHelper::decodeBoneDisplay(JsonDictionary &json)
{
DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE);
@ -1292,7 +1294,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json)
((SpriteDisplayData *)displayData)->displayName = name;
}
cs::JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0);
JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0);
if (dic != NULL)
{
SpriteDisplayData *sdd = (SpriteDisplayData *)displayData;
@ -1341,7 +1343,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json)
return displayData;
}
AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json)
AnimationData *DataReaderHelper::decodeAnimation(JsonDictionary &json)
{
AnimationData *aniData = new AnimationData();
@ -1355,7 +1357,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json)
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i);
MovementData *movementData = decodeMovement(*dic);
aniData->addMovement(movementData);
movementData->release();
@ -1366,7 +1368,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json)
return aniData;
}
MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json)
MovementData *DataReaderHelper::decodeMovement(JsonDictionary &json)
{
MovementData *movementData = new MovementData();
@ -1386,7 +1388,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json)
int length = json.getArrayItemCount(MOVEMENT_BONE_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i);
MovementBoneData *movementBoneData = decodeMovementBone(*dic);
movementData->addMovementBoneData(movementBoneData);
movementBoneData->release();
@ -1397,7 +1399,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json)
return movementData;
}
MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json)
MovementBoneData *DataReaderHelper::decodeMovementBone(JsonDictionary &json)
{
MovementBoneData *movementBoneData = new MovementBoneData();
movementBoneData->init();
@ -1413,7 +1415,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json)
int length = json.getArrayItemCount(FRAME_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i);
FrameData *frameData = decodeFrame(*dic);
movementBoneData->addFrameData(frameData);
@ -1469,7 +1471,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json)
return movementBoneData;
}
FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json)
FrameData *DataReaderHelper::decodeFrame(JsonDictionary &json)
{
FrameData *frameData = new FrameData();
@ -1498,7 +1500,7 @@ FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json)
return frameData;
}
TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json)
TextureData *DataReaderHelper::decodeTexture(JsonDictionary &json)
{
TextureData *textureData = new TextureData();
textureData->init();
@ -1517,7 +1519,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json)
int length = json.getArrayItemCount(CONTOUR_DATA);
for (int i = 0; i < length; i++)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i);
JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i);
ContourData *contourData = decodeContour(*dic);
textureData->contourDataList.addObject(contourData);
contourData->release();
@ -1528,7 +1530,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json)
return textureData;
}
ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json)
ContourData *DataReaderHelper::decodeContour(JsonDictionary &json)
{
ContourData *contourData = new ContourData();
contourData->init();
@ -1536,7 +1538,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json)
int length = json.getArrayItemCount(VERTEX_POINT);
for (int i = length - 1; i >= 0; i--)
{
cs::JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i);
JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i);
ContourVertex2 *vertex = new ContourVertex2(0, 0);
@ -1552,7 +1554,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json)
return contourData;
}
void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json)
void DataReaderHelper::decodeNode(BaseData *node, JsonDictionary &json)
{
node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale;
node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale;
@ -1563,7 +1565,7 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json)
node->scaleX = json.getItemFloatValue(A_SCALE_X, 1);
node->scaleY = json.getItemFloatValue(A_SCALE_Y, 1);
cs::JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0);
JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0);
if (colorDic)
{
@ -1579,4 +1581,4 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json)
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -26,9 +26,9 @@ THE SOFTWARE.
#define __CCDATAREADERHELPER_H__
#include "CCArmatureDefine.h"
#include "../datas/CCDatas.h"
#include "../CCArmature.h"
#include "../../Json/CSContentJsonDictionary.h"
#include "armature/datas/CCDatas.h"
#include "armature/CCArmature.h"
#include "json/CSContentJsonDictionary.h"
#include <string>
#include <queue>
@ -41,10 +41,10 @@ namespace tinyxml2
class XMLElement;
}
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class DataReaderHelper : Object
class DataReaderHelper : cocos2d::Object
{
protected:
@ -60,8 +60,8 @@ protected:
std::string fileContent;
ConfigType configType;
std::string baseFilePath;
Object *target;
SEL_SCHEDULE selector;
cocos2d::Object *target;
cocos2d::SEL_SCHEDULE selector;
bool autoLoadSpriteFile;
} AsyncStruct;
@ -99,7 +99,7 @@ public:
~DataReaderHelper();
void addDataFromFile(const char *filePath);
void addDataFromFileAsync(const char *filePath, Object *target, SEL_SCHEDULE selector);
void addDataFromFileAsync(const char *filePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);
void addDataAsyncCallBack(float dt);
@ -145,20 +145,20 @@ public:
public:
static void addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo = NULL);
static ArmatureData *decodeArmature(cs::JsonDictionary &json);
static BoneData *decodeBone(cs::JsonDictionary &json);
static DisplayData *decodeBoneDisplay(cs::JsonDictionary &json);
static ArmatureData *decodeArmature(JsonDictionary &json);
static BoneData *decodeBone(JsonDictionary &json);
static DisplayData *decodeBoneDisplay(JsonDictionary &json);
static AnimationData *decodeAnimation(cs::JsonDictionary &json);
static MovementData *decodeMovement(cs::JsonDictionary &json);
static MovementBoneData *decodeMovementBone(cs::JsonDictionary &json);
static FrameData *decodeFrame(cs::JsonDictionary &json);
static AnimationData *decodeAnimation(JsonDictionary &json);
static MovementData *decodeMovement(JsonDictionary &json);
static MovementBoneData *decodeMovementBone(JsonDictionary &json);
static FrameData *decodeFrame(JsonDictionary &json);
static TextureData *decodeTexture(cs::JsonDictionary &json);
static TextureData *decodeTexture(JsonDictionary &json);
static ContourData *decodeContour(cs::JsonDictionary &json);
static ContourData *decodeContour(JsonDictionary &json);
static void decodeNode(BaseData *node, cs::JsonDictionary &json);
static void decodeNode(BaseData *node, JsonDictionary &json);
protected:
void loadData();
@ -190,6 +190,6 @@ protected:
static DataReaderHelper *_dataReaderHelper;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCDATAREADERHELPER_H__*/

View File

@ -24,8 +24,10 @@ THE SOFTWARE.
#include "CCSpriteFrameCacheHelper.h"
using namespace cocos2d;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
SpriteFrameCacheHelper *SpriteFrameCacheHelper::_spriteFrameCacheHelper = NULL;
@ -72,4 +74,4 @@ SpriteFrameCacheHelper::~SpriteFrameCacheHelper()
CC_SAFE_RELEASE_NULL(_textureAtlasDic);
}
NS_CC_EXT_ARMATURE_END
}

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
using namespace std;
NS_CC_EXT_ARMATURE_BEGIN
namespace cocostudio {
class SpriteFrameCacheHelper
{
@ -47,7 +47,7 @@ public:
*/
void addSpriteFrameFromFile(const char *plistPath, const char *imagePath);
TextureAtlas *getTexureAtlasWithTexture(Texture2D *texture);
cocos2d::TextureAtlas *getTexureAtlasWithTexture(cocos2d::Texture2D *texture);
private:
/**
@ -60,11 +60,11 @@ private:
*/
~SpriteFrameCacheHelper();
Dictionary *_textureAtlasDic;
cocos2d::Dictionary *_textureAtlasDic;
static SpriteFrameCacheHelper *_spriteFrameCacheHelper;
};
NS_CC_EXT_ARMATURE_END
}
#endif /*__CCSPRITEFRAMECACHEHELPER_H__*/

Some files were not shown because too many files have changed in this diff Show More