diff --git a/cocos2dx/CCamera.cpp b/cocos2dx/CCamera.cpp index 9a2284f9f9..18606c13b2 100644 --- a/cocos2dx/CCamera.cpp +++ b/cocos2dx/CCamera.cpp @@ -41,12 +41,10 @@ CCCamera::~CCCamera(void) { } -string CCCamera::description(void) +char * CCCamera::description(void) { - char des[100]; - sprintf_s(des, 100, "", m_fCenterX, m_fCenterY, m_fCenterZ); - string ret(des); - + char *ret = new char[100]; + sprintf_s(ret, 100, "", m_fCenterX, m_fCenterY, m_fCenterZ); return ret; } diff --git a/cocos2dx/actions/CCAction.cpp b/cocos2dx/actions/CCAction.cpp index 67a17996b1..f53ebff7be 100644 --- a/cocos2dx/actions/CCAction.cpp +++ b/cocos2dx/actions/CCAction.cpp @@ -52,12 +52,10 @@ CCAction * CCAction::action() return pRet; } -std::string CCAction::description() +char * CCAction::description() { - char des[100] ; - sprintf_s(des, 100, "", m_nTag); - std::string ret(des); - + char *ret = new char[100] ; + sprintf_s(ret, 100, "", m_nTag); return ret; } NSObject* CCAction::copyWithZone(NSZone *pZone) diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 8929ddae59..6794cd0085 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -405,12 +405,10 @@ void CCNode::cleanup() } -std::string CCNode::description() +char * CCNode::description() { - char des[100] ; - sprintf_s(des, 100, "", m_nTag); - std::string ret(des); - + char *ret = new char[100] ; + sprintf_s(ret, 100, "", m_nTag); return ret; } diff --git a/cocos2dx/include/CCAction.h b/cocos2dx/include/CCAction.h index f96b4b00ef..d6ada83da5 100644 --- a/cocos2dx/include/CCAction.h +++ b/cocos2dx/include/CCAction.h @@ -43,7 +43,7 @@ public: CCAction(void); virtual ~CCAction(void); - std::string description(); + char * description(); virtual NSObject* copyWithZone(NSZone *pZone); @@ -125,7 +125,7 @@ class CCX_DLL CCRepeatForever : public CCAction { public: CCRepeatForever(){} - ~CCRepeatForever(); + virtual ~CCRepeatForever(); CCRepeatForever* initWithAction(CCIntervalAction *pAction); virtual NSObject* copyWithZone(NSZone *pZone); diff --git a/cocos2dx/include/CCAtlasNode.h b/cocos2dx/include/CCAtlasNode.h index 80f5d861df..97c415f327 100644 --- a/cocos2dx/include/CCAtlasNode.h +++ b/cocos2dx/include/CCAtlasNode.h @@ -72,7 +72,7 @@ protected: public: CCAtlasNode(); - ~CCAtlasNode(); + virtual ~CCAtlasNode(); /** creates a CCAtlasNode with an Atlas file the width and height of each item and the quantity of items to render*/ static CCAtlasNode * atlasWithTileFile(const char* tile,int tileWidth, int tileHeight, int itemsToRender); diff --git a/cocos2dx/include/CCCamera.h b/cocos2dx/include/CCCamera.h index 2b38de91d2..5e439eb10a 100644 --- a/cocos2dx/include/CCCamera.h +++ b/cocos2dx/include/CCCamera.h @@ -50,7 +50,7 @@ public: CCCamera(void); ~CCCamera(void); - std::string description(void); + char * description(void); // sets the dirty value void setDirty(bool bValue); diff --git a/cocos2dx/include/CCNode.h b/cocos2dx/include/CCNode.h index b671b25c03..5404ea1f0a 100644 --- a/cocos2dx/include/CCNode.h +++ b/cocos2dx/include/CCNode.h @@ -225,7 +225,7 @@ public: virtual ~CCNode(); - std::string description(void); + char * description(void); /** allocates and initializes a node. The node will be created as "autorelease". diff --git a/cocos2dx/include/CCPVRTexture.h b/cocos2dx/include/CCPVRTexture.h index ef5836e5c6..801128b465 100644 --- a/cocos2dx/include/CCPVRTexture.h +++ b/cocos2dx/include/CCPVRTexture.h @@ -46,7 +46,7 @@ protected: public: CCPVRTexture(); - ~CCPVRTexture(); + virtual ~CCPVRTexture(); CCPVRTexture * initWithContentsOfFile(const char* path); /// @todo CCPVRTexture * initWithContentsOfURL(NSURL *url); diff --git a/cocos2dx/include/CCTexture2D.h b/cocos2dx/include/CCTexture2D.h index c78bc43bd1..de3a6454eb 100644 --- a/cocos2dx/include/CCTexture2D.h +++ b/cocos2dx/include/CCTexture2D.h @@ -108,9 +108,9 @@ class CCX_DLL CCTexture2D : public NSObject public: CCTexture2D(); - ~CCTexture2D(); + virtual ~CCTexture2D(); - std::string description(void); + char * description(void); /** Intializes with a texture2d with data */ CCTexture2D * initWithData(const void* data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, CGSize contentSize); diff --git a/cocos2dx/include/CCTextureAtlas.h b/cocos2dx/include/CCTextureAtlas.h index 45b48a1353..fdc64672a8 100644 --- a/cocos2dx/include/CCTextureAtlas.h +++ b/cocos2dx/include/CCTextureAtlas.h @@ -65,9 +65,9 @@ protected: public: CCTextureAtlas(); - ~CCTextureAtlas(); + virtual ~CCTextureAtlas(); - std::string description(); + char * description(); /** creates a TextureAtlas with an filename and with an initial capacity for Quads. * The TextureAtlas capacity can be increased in runtime. diff --git a/cocos2dx/include/CCTextureCache.h b/cocos2dx/include/CCTextureCache.h index 7df07c7ba3..8a7016485e 100644 --- a/cocos2dx/include/CCTextureCache.h +++ b/cocos2dx/include/CCTextureCache.h @@ -55,9 +55,9 @@ private: public: CCTextureCache(); - ~CCTextureCache(); + virtual ~CCTextureCache(); - std::string description(void); + char * description(void); /** Retruns ths shared instance of the cache */ static CCTextureCache * sharedTextureCache(); diff --git a/cocos2dx/include/CCTransition.h b/cocos2dx/include/CCTransition.h index 943c8493d7..ec69a369c0 100644 --- a/cocos2dx/include/CCTransition.h +++ b/cocos2dx/include/CCTransition.h @@ -105,7 +105,7 @@ protected: public: CCOrientedTransitionScene(); - ~CCOrientedTransitionScene(); + virtual ~CCOrientedTransitionScene(); /** creates a base transition with duration and incoming scene */ static CCOrientedTransitionScene * transitionWithDuration(ccTime t,CCScene* scene, tOrientation orientation); diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 3d51d06403..d0a9faabd0 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -172,12 +172,10 @@ CCTexture2D * CCTexture2D::initWithData(const void *data, CCTexture2DPixelFormat } -std::string CCTexture2D::description(void) +char * CCTexture2D::description(void) { - char des[100]; - sprintf_s(des, 100, "", m_uName, m_uPixelsWide, m_uPixelsHigh, m_fMaxS, m_fMaxT); - std::string ret(des); - + char *ret = new char[100]; + sprintf_s(ret, 100, "", m_uName, m_uPixelsWide, m_uPixelsHigh, m_fMaxS, m_fMaxT); return ret; } diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index b57885dea4..bcccdce0a1 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -143,12 +143,10 @@ CCTextureAtlas * CCTextureAtlas::initWithTexture(CCTexture2D *texture, unsigned return this; } -std::string CCTextureAtlas::description() +char * CCTextureAtlas::description() { - char des[100]; - sprintf_s(des, 100, "", m_uTotalQuads); - std::string ret(des); - + char *ret = new char[100]; + sprintf_s(ret, 100, "", m_uTotalQuads); return ret; } diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index 28ba635bac..8e89607119 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -92,12 +92,10 @@ void CCTextureCache::purgeSharedTextureCache() } -std::string CCTextureCache::description() +char * CCTextureCache::description() { - char des[100]; - sprintf_s(des, 100, "", m_pTextures->count()); - std::string ret(des); - + char *ret = new char[100]; + sprintf_s(ret, 100, "", m_pTextures->count()); return ret; }