From 058935aa8d19cb0dcbf5c9c5c5e72b503e995265 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 25 Jul 2013 15:53:24 -0700 Subject: [PATCH] Removes Hungarian notation Removes Hungarian notation from the code. --- cocos2dx/cocoa/CCString.cpp | 4 +- cocos2dx/cocoa/CCString.h | 2 +- cocos2dx/effects/CCGrabber.cpp | 12 +- cocos2dx/effects/CCGrabber.h | 6 +- cocos2dx/effects/CCGrid.cpp | 22 +-- cocos2dx/effects/CCGrid.h | 6 +- .../particle_nodes/CCParticleExamples.cpp | 76 +++++------ cocos2dx/platform/CCFileUtils.cpp | 46 +++---- cocos2dx/platform/CCFileUtils.h | 22 +-- .../platform/android/CCFileUtilsAndroid.cpp | 22 +-- .../platform/android/CCFileUtilsAndroid.h | 6 +- cocos2dx/sprite_nodes/CCAnimation.cpp | 8 +- cocos2dx/sprite_nodes/CCAnimation.h | 2 +- cocos2dx/sprite_nodes/CCSprite.cpp | 128 +++++++++--------- cocos2dx/sprite_nodes/CCSprite.h | 54 ++++---- cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 26 ++-- cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp | 6 +- cocos2dx/support/image_support/TGAlib.cpp | 4 +- cocos2dx/support/image_support/TGAlib.h | 2 +- cocos2dx/textures/CCTextureAtlas.cpp | 10 +- cocos2dx/textures/CCTexturePVR.cpp | 14 +- .../Cpp/HelloCpp/Classes/HelloWorldScene.cpp | 2 +- .../Cpp/HelloCpp/Classes/HelloWorldScene.h | 2 +- .../SimpleGame/Classes/HelloWorldScene.cpp | 4 +- .../Cpp/SimpleGame/Classes/HelloWorldScene.h | 2 +- .../ActionManagerTest/ActionManagerTest.cpp | 6 +- .../ActionManagerTest/ActionManagerTest.h | 6 +- .../ActionsEaseTest/ActionsEaseTest.cpp | 6 +- .../Classes/ActionsEaseTest/ActionsEaseTest.h | 6 +- .../ActionsProgressTest.cpp | 6 +- .../ActionsProgressTest/ActionsProgressTest.h | 6 +- .../Classes/ActionsTest/ActionsTest.cpp | 18 +-- .../TestCpp/Classes/ActionsTest/ActionsTest.h | 14 +- samples/Cpp/TestCpp/Classes/BaseTest.cpp | 6 +- samples/Cpp/TestCpp/Classes/BaseTest.h | 6 +- .../TestCpp/Classes/Box2DTest/Box2dTest.cpp | 2 +- .../Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp | 2 +- .../Cpp/TestCpp/Classes/BugsTest/Bug-1159.h | 2 +- .../Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp | 10 +- .../Cpp/TestCpp/Classes/BugsTest/BugsTest.h | 6 +- .../Classes/ChipmunkTest/ChipmunkTest.cpp | 2 +- .../Classes/ChipmunkTest/ChipmunkTest.h | 2 +- .../ClickAndMoveTest/ClickAndMoveTest.cpp | 4 +- .../ClickAndMoveTest/ClickAndMoveTest.h | 2 +- .../ClippingNodeTest/ClippingNodeTest.cpp | 10 +- .../ClippingNodeTest/ClippingNodeTest.h | 8 +- .../CocosDenshionTest/CocosDenshionTest.cpp | 20 +-- .../ConfigurationTest/ConfigurationTest.cpp | 6 +- .../ConfigurationTest/ConfigurationTest.h | 6 +- .../Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp | 2 +- .../Cpp/TestCpp/Classes/CurlTest/CurlTest.h | 2 +- .../DrawPrimitivesTest/DrawPrimitivesTest.h | 6 +- .../EffectsAdvancedTest.cpp | 6 +- .../EffectsAdvancedTest/EffectsAdvancedTest.h | 6 +- .../Classes/EffectsTest/EffectsTest.cpp | 6 +- .../TestCpp/Classes/EffectsTest/EffectsTest.h | 6 +- .../ArmatureTest/ArmatureScene.cpp | 14 +- .../ArmatureTest/ArmatureScene.h | 14 +- .../AnimationsTest/AnimationsTestLayer.h | 8 +- .../ButtonTest/ButtonTestLayer.h | 2 +- .../HelloCocosBuilderLayer.cpp | 14 +- .../HelloCocosBuilderLayer.h | 14 +- .../CocosBuilderTest/MenuTest/MenuTestLayer.h | 6 +- .../TestHeader/TestHeaderLayer.h | 2 +- .../ComponentsTest/PlayerController.cpp | 4 +- .../ComponentsTest/PlayerController.h | 2 +- .../Classes/ExtensionsTest/ExtensionsTest.cpp | 8 +- .../Classes/ExtensionsTest/ExtensionsTest.h | 4 +- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 6 +- .../Classes/FileUtilsTest/FileUtilsTest.h | 6 +- .../Cpp/TestCpp/Classes/FontTest/FontTest.cpp | 6 +- .../Cpp/TestCpp/Classes/FontTest/FontTest.h | 6 +- .../TestCpp/Classes/LabelTest/LabelTest.cpp | 28 ++-- .../Cpp/TestCpp/Classes/LabelTest/LabelTest.h | 24 ++-- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 18 +-- .../Cpp/TestCpp/Classes/LayerTest/LayerTest.h | 12 +- .../Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp | 16 +-- .../Cpp/TestCpp/Classes/MenuTest/MenuTest.h | 36 ++--- .../MotionStreakTest/MotionStreakTest.cpp | 6 +- .../MotionStreakTest/MotionStreakTest.h | 8 +- .../Classes/MutiTouchTest/MutiTouchTest.cpp | 36 ++--- .../Classes/MutiTouchTest/MutiTouchTest.h | 8 +- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp | 6 +- .../Cpp/TestCpp/Classes/NodeTest/NodeTest.h | 6 +- .../Classes/ParallaxTest/ParallaxTest.cpp | 10 +- .../Classes/ParallaxTest/ParallaxTest.h | 8 +- .../Classes/ParticleTest/ParticleTest.cpp | 20 +-- .../Classes/ParticleTest/ParticleTest.h | 14 +- .../PerformanceParticleTest.cpp | 8 +- .../PerformanceTest/PerformanceParticleTest.h | 2 +- .../PerformanceTest/PerformanceSpriteTest.cpp | 12 +- .../PerformanceTest/PerformanceSpriteTest.h | 6 +- .../PerformanceTest/PerformanceTest.cpp | 8 +- .../Classes/PerformanceTest/PerformanceTest.h | 8 +- .../RenderTextureTest/RenderTextureTest.cpp | 6 +- .../RenderTextureTest/RenderTextureTest.h | 6 +- .../TestCpp/Classes/SceneTest/SceneTest.cpp | 20 +-- .../Cpp/TestCpp/Classes/SceneTest/SceneTest.h | 20 +-- .../Classes/SchedulerTest/SchedulerTest.cpp | 10 +- .../Classes/SchedulerTest/SchedulerTest.h | 8 +- .../TestCpp/Classes/ShaderTest/ShaderTest.cpp | 6 +- .../TestCpp/Classes/ShaderTest/ShaderTest.h | 6 +- .../SpriteTest/SpriteTest.cpp.REMOVED.git-id | 2 +- .../TestCpp/Classes/SpriteTest/SpriteTest.h | 6 +- .../Classes/TextInputTest/TextInputTest.cpp | 38 +++--- .../Classes/TextInputTest/TextInputTest.h | 20 +-- .../Classes/Texture2dTest/Texture2dTest.cpp | 6 +- .../Classes/Texture2dTest/Texture2dTest.h | 6 +- .../Classes/TileMapTest/TileMapTest.cpp | 10 +- .../TestCpp/Classes/TileMapTest/TileMapTest.h | 8 +- .../TransitionsTest/TransitionsTest.cpp | 12 +- .../Classes/TransitionsTest/TransitionsTest.h | 12 +- .../Classes/ZwoptexTest/ZwoptexTest.cpp | 6 +- .../TestCpp/Classes/ZwoptexTest/ZwoptexTest.h | 6 +- samples/Cpp/TestCpp/Classes/controller.cpp | 14 +- samples/Cpp/TestCpp/Classes/controller.h | 8 +- 116 files changed, 668 insertions(+), 668 deletions(-) diff --git a/cocos2dx/cocoa/CCString.cpp b/cocos2dx/cocoa/CCString.cpp index f1ecce7120..cbbb86678e 100644 --- a/cocos2dx/cocoa/CCString.cpp +++ b/cocos2dx/cocoa/CCString.cpp @@ -227,12 +227,12 @@ String* String::createWithFormat(const char* format, ...) return pRet; } -String* String::createWithContentsOfFile(const char* pszFileName) +String* String::createWithContentsOfFile(const char* filename) { unsigned long size = 0; unsigned char* pData = 0; String* pRet = NULL; - pData = FileUtils::getInstance()->getFileData(pszFileName, "rb", &size); + pData = FileUtils::getInstance()->getFileData(filename, "rb", &size); pRet = String::createWithData(pData, size); CC_SAFE_DELETE_ARRAY(pData); return pRet; diff --git a/cocos2dx/cocoa/CCString.h b/cocos2dx/cocoa/CCString.h index 2840dd33bb..f8c085bd9d 100644 --- a/cocos2dx/cocoa/CCString.h +++ b/cocos2dx/cocoa/CCString.h @@ -115,7 +115,7 @@ public: * @return A String pointer which is an autorelease object pointer, * it means that you needn't do a release operation unless you retain it. */ - static String* createWithContentsOfFile(const char* pszFileName); + static String* createWithContentsOfFile(const char* filename); virtual void acceptVisitor(DataVisitor &visitor); virtual String* clone() const; diff --git a/cocos2dx/effects/CCGrabber.cpp b/cocos2dx/effects/CCGrabber.cpp index 0a58cdff44..656a4ea6f8 100644 --- a/cocos2dx/effects/CCGrabber.cpp +++ b/cocos2dx/effects/CCGrabber.cpp @@ -38,7 +38,7 @@ Grabber::Grabber(void) glGenFramebuffers(1, &_FBO); } -void Grabber::grab(Texture2D *pTexture) +void Grabber::grab(Texture2D *texture) { glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); @@ -46,7 +46,7 @@ void Grabber::grab(Texture2D *pTexture) glBindFramebuffer(GL_FRAMEBUFFER, _FBO); // associate texture with FBO - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pTexture->getName(), 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->getName(), 0); // check if it worked (probably worth doing :) ) GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -58,9 +58,9 @@ void Grabber::grab(Texture2D *pTexture) glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); } -void Grabber::beforeRender(Texture2D *pTexture) +void Grabber::beforeRender(Texture2D *texture) { - CC_UNUSED_PARAM(pTexture); + CC_UNUSED_PARAM(texture); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); glBindFramebuffer(GL_FRAMEBUFFER, _FBO); @@ -80,9 +80,9 @@ void Grabber::beforeRender(Texture2D *pTexture) // glColorMask(true, true, true, false); // #631 } -void Grabber::afterRender(cocos2d::Texture2D *pTexture) +void Grabber::afterRender(cocos2d::Texture2D *texture) { - CC_UNUSED_PARAM(pTexture); + CC_UNUSED_PARAM(texture); glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); // glColorMask(true, true, true, true); // #631 diff --git a/cocos2dx/effects/CCGrabber.h b/cocos2dx/effects/CCGrabber.h index 9f70b0725c..c75bb33ab3 100644 --- a/cocos2dx/effects/CCGrabber.h +++ b/cocos2dx/effects/CCGrabber.h @@ -45,9 +45,9 @@ public: Grabber(void); ~Grabber(void); - void grab(Texture2D *pTexture); - void beforeRender(Texture2D *pTexture); - void afterRender(Texture2D *pTexture); + void grab(Texture2D *texture); + void beforeRender(Texture2D *texture); + void afterRender(Texture2D *texture); protected: GLuint _FBO; diff --git a/cocos2dx/effects/CCGrid.cpp b/cocos2dx/effects/CCGrid.cpp index 8ac122afcc..69d6207fe3 100644 --- a/cocos2dx/effects/CCGrid.cpp +++ b/cocos2dx/effects/CCGrid.cpp @@ -76,7 +76,7 @@ GridBase* GridBase::create(const Size& gridSize, Texture2D *texture, bool flippe return pGridBase; } -bool GridBase::initWithSize(const Size& gridSize, Texture2D *pTexture, bool bFlipped) +bool GridBase::initWithSize(const Size& gridSize, Texture2D *texture, bool bFlipped) { bool bRet = true; @@ -84,7 +84,7 @@ bool GridBase::initWithSize(const Size& gridSize, Texture2D *pTexture, bool bFli _reuseGrid = 0; _gridSize = gridSize; - _texture = pTexture; + _texture = texture; CC_SAFE_RETAIN(_texture); _isTextureFlipped = bFlipped; @@ -127,20 +127,20 @@ bool GridBase::initWithSize(const Size& gridSize) return false; } - Texture2D *pTexture = new Texture2D(); - pTexture->initWithData(data, format, POTWide, POTHigh, s); + Texture2D *texture = new Texture2D(); + texture->initWithData(data, format, POTWide, POTHigh, s); free(data); - if (! pTexture) + if (! texture) { CCLOG("cocos2d: Grid: error creating texture"); return false; } - initWithSize(gridSize, pTexture, false); + initWithSize(gridSize, texture, false); - pTexture->release(); + texture->release(); return true; } @@ -253,13 +253,13 @@ void GridBase::calculateVertexPoints(void) // implementation of Grid3D -Grid3D* Grid3D::create(const Size& gridSize, Texture2D *pTexture, bool bFlipped) +Grid3D* Grid3D::create(const Size& gridSize, Texture2D *texture, bool bFlipped) { Grid3D *pRet= new Grid3D(); if (pRet) { - if (pRet->initWithSize(gridSize, pTexture, bFlipped)) + if (pRet->initWithSize(gridSize, texture, bFlipped)) { pRet->autorelease(); } @@ -486,13 +486,13 @@ TiledGrid3D::~TiledGrid3D(void) CC_SAFE_FREE(_indices); } -TiledGrid3D* TiledGrid3D::create(const Size& gridSize, Texture2D *pTexture, bool bFlipped) +TiledGrid3D* TiledGrid3D::create(const Size& gridSize, Texture2D *texture, bool bFlipped) { TiledGrid3D *pRet= new TiledGrid3D(); if (pRet) { - if (pRet->initWithSize(gridSize, pTexture, bFlipped)) + if (pRet->initWithSize(gridSize, texture, bFlipped)) { pRet->autorelease(); } diff --git a/cocos2dx/effects/CCGrid.h b/cocos2dx/effects/CCGrid.h index 323641ecc5..732c324daa 100644 --- a/cocos2dx/effects/CCGrid.h +++ b/cocos2dx/effects/CCGrid.h @@ -59,7 +59,7 @@ public: virtual ~GridBase(void); - bool initWithSize(const Size& gridSize, Texture2D *pTexture, bool bFlipped); + bool initWithSize(const Size& gridSize, Texture2D *texture, bool bFlipped); bool initWithSize(const Size& gridSize); /** whether or not the grid is active */ @@ -112,7 +112,7 @@ class CC_DLL Grid3D : public GridBase { public: /** create one Grid */ - static Grid3D* create(const Size& gridSize, Texture2D *pTexture, bool bFlipped); + static Grid3D* create(const Size& gridSize, Texture2D *texture, bool bFlipped); /** create one Grid */ static Grid3D* create(const Size& gridSize); @@ -154,7 +154,7 @@ class CC_DLL TiledGrid3D : public GridBase { public: /** create one Grid */ - static TiledGrid3D* create(const Size& gridSize, Texture2D *pTexture, bool bFlipped); + static TiledGrid3D* create(const Size& gridSize, Texture2D *texture, bool bFlipped); /** create one Grid */ static TiledGrid3D* create(const Size& gridSize); diff --git a/cocos2dx/particle_nodes/CCParticleExamples.cpp b/cocos2dx/particle_nodes/CCParticleExamples.cpp index dcbd3bf339..31edf19998 100644 --- a/cocos2dx/particle_nodes/CCParticleExamples.cpp +++ b/cocos2dx/particle_nodes/CCParticleExamples.cpp @@ -36,26 +36,26 @@ NS_CC_BEGIN static Texture2D* getDefaultTexture() { - Texture2D* pTexture = NULL; + Texture2D* texture = NULL; Image* pImage = NULL; do { bool bRet = false; const char* key = "__firePngData"; - pTexture = TextureCache::getInstance()->textureForKey(key); - CC_BREAK_IF(pTexture != NULL); + texture = TextureCache::getInstance()->textureForKey(key); + CC_BREAK_IF(texture != NULL); pImage = new Image(); CC_BREAK_IF(NULL == pImage); bRet = pImage->initWithImageData((void*)__firePngData, sizeof(__firePngData), Image::Format::PNG); CC_BREAK_IF(!bRet); - pTexture = TextureCache::getInstance()->addUIImage(pImage, key); + texture = TextureCache::getInstance()->addUIImage(pImage, key); } while (0); CC_SAFE_RELEASE(pImage); - return pTexture; + return texture; } ParticleFire* ParticleFire::create() @@ -147,10 +147,10 @@ bool ParticleFire::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -250,10 +250,10 @@ bool ParticleFireworks::initWithTotalParticles(unsigned int numberOfParticles) _startSizeVar = 2.0f; _endSize = START_SIZE_EQUAL_TO_END_SIZE; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive this->setBlendAdditive(false); @@ -356,10 +356,10 @@ bool ParticleSun::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } return true; @@ -463,10 +463,10 @@ bool ParticleGalaxy::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -572,10 +572,10 @@ bool ParticleFlower::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -680,10 +680,10 @@ bool ParticleMeteor::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -789,10 +789,10 @@ bool ParticleSpiral::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.5f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -897,10 +897,10 @@ bool ParticleExplosion::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.5f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -1002,10 +1002,10 @@ bool ParticleSmoke::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -1111,10 +1111,10 @@ bool ParticleSnow::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive @@ -1219,10 +1219,10 @@ bool ParticleRain::initWithTotalParticles(unsigned int numberOfParticles) _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; - Texture2D* pTexture = getDefaultTexture(); - if (pTexture != NULL) + Texture2D* texture = getDefaultTexture(); + if (texture != NULL) { - setTexture(pTexture); + setTexture(texture); } // additive diff --git a/cocos2dx/platform/CCFileUtils.cpp b/cocos2dx/platform/CCFileUtils.cpp index 5f0e25007d..7b14c6dafe 100644 --- a/cocos2dx/platform/CCFileUtils.cpp +++ b/cocos2dx/platform/CCFileUtils.cpp @@ -498,15 +498,15 @@ void FileUtils::purgeCachedEntries() _fullPathCache.clear(); } -unsigned char* FileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize) +unsigned char* FileUtils::getFileData(const char* filename, const char* pszMode, unsigned long * pSize) { unsigned char * pBuffer = NULL; - CCASSERT(pszFileName != NULL && pSize != NULL && pszMode != NULL, "Invalid parameters."); + CCASSERT(filename != NULL && pSize != NULL && pszMode != NULL, "Invalid parameters."); *pSize = 0; do { // read the file from hardware - std::string fullPath = fullPathForFilename(pszFileName); + std::string fullPath = fullPathForFilename(filename); FILE *fp = fopen(fullPath.c_str(), pszMode); CC_BREAK_IF(!fp); @@ -521,14 +521,14 @@ unsigned char* FileUtils::getFileData(const char* pszFileName, const char* pszMo if (! pBuffer) { std::string msg = "Get data from file("; - msg.append(pszFileName).append(") failed!"); + msg.append(filename).append(") failed!"); CCLOG("%s", msg.c_str()); } return pBuffer; } -unsigned char* FileUtils::getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize) +unsigned char* FileUtils::getFileDataFromZip(const char* pszZipFilePath, const char* filename, unsigned long * pSize) { unsigned char * pBuffer = NULL; unzFile pFile = NULL; @@ -536,13 +536,13 @@ unsigned char* FileUtils::getFileDataFromZip(const char* pszZipFilePath, const c do { - CC_BREAK_IF(!pszZipFilePath || !pszFileName); + CC_BREAK_IF(!pszZipFilePath || !filename); CC_BREAK_IF(strlen(pszZipFilePath) == 0); pFile = unzOpen(pszZipFilePath); CC_BREAK_IF(!pFile); - int nRet = unzLocateFile(pFile, pszFileName, 1); + int nRet = unzLocateFile(pFile, filename, 1); CC_BREAK_IF(UNZ_OK != nRet); char szFilePathA[260]; @@ -569,13 +569,13 @@ unsigned char* FileUtils::getFileDataFromZip(const char* pszZipFilePath, const c return pBuffer; } -std::string FileUtils::getNewFilename(const char* pszFileName) +std::string FileUtils::getNewFilename(const char* filename) { const char* pszNewFileName = NULL; // in Lookup Filename dictionary ? - String* fileNameFound = _filenameLookupDict ? (String*)_filenameLookupDict->objectForKey(pszFileName) : NULL; + String* fileNameFound = _filenameLookupDict ? (String*)_filenameLookupDict->objectForKey(filename) : NULL; if( NULL == fileNameFound || fileNameFound->length() == 0) { - pszNewFileName = pszFileName; + pszNewFileName = filename; } else { pszNewFileName = fileNameFound->getCString(); @@ -607,19 +607,19 @@ std::string FileUtils::getPathForFilename(const std::string& filename, const std } -std::string FileUtils::fullPathForFilename(const char* pszFileName) +std::string FileUtils::fullPathForFilename(const char* filename) { - CCASSERT(pszFileName != NULL, "CCFileUtils: Invalid path"); + CCASSERT(filename != NULL, "CCFileUtils: Invalid path"); - std::string strFileName = pszFileName; - if (isAbsolutePath(pszFileName)) + std::string strFileName = filename; + if (isAbsolutePath(filename)) { - //CCLOG("Return absolute path( %s ) directly.", pszFileName); - return pszFileName; + //CCLOG("Return absolute path( %s ) directly.", filename); + return filename; } // Already Cached ? - std::map::iterator cacheIter = _fullPathCache.find(pszFileName); + std::map::iterator cacheIter = _fullPathCache.find(filename); if (cacheIter != _fullPathCache.end()) { //CCLOG("Return full path from cache: %s", cacheIter->second.c_str()); @@ -627,7 +627,7 @@ std::string FileUtils::fullPathForFilename(const char* pszFileName) } // Get the new file name. - std::string newFilename = getNewFilename(pszFileName); + std::string newFilename = getNewFilename(filename); string fullpath = ""; @@ -643,25 +643,25 @@ std::string FileUtils::fullPathForFilename(const char* pszFileName) if (fullpath.length() > 0) { // Using the filename passed in as key. - _fullPathCache.insert(std::pair(pszFileName, fullpath)); + _fullPathCache.insert(std::pair(filename, fullpath)); // CCLOG("Returning path: %s", fullpath.c_str()); return fullpath; } } } -// CCLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", pszFileName); +// CCLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", filename); // The file wasn't found, return the file name passed in. - return pszFileName; + return filename; } -const char* FileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile) +const char* FileUtils::fullPathFromRelativeFile(const char *filename, const char *pszRelativeFile) { std::string relativeFile = pszRelativeFile; String *pRet = String::create(""); pRet->_string = relativeFile.substr(0, relativeFile.rfind('/')+1); - pRet->_string += getNewFilename(pszFilename); + pRet->_string += getNewFilename(filename); return pRet->getCString(); } diff --git a/cocos2dx/platform/CCFileUtils.h b/cocos2dx/platform/CCFileUtils.h index a5681b6902..ec01aba5ab 100644 --- a/cocos2dx/platform/CCFileUtils.h +++ b/cocos2dx/platform/CCFileUtils.h @@ -90,23 +90,23 @@ public: /** * Gets resource file data * - * @param[in] pszFileName The resource file name which contains the path. + * @param[in] filename The resource file name which contains the path. * @param[in] pszMode The read mode of the file. * @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0. * @return Upon success, a pointer to the data is returned, otherwise NULL. * @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned. */ - virtual unsigned char* getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize); + virtual unsigned char* getFileData(const char* filename, const char* pszMode, unsigned long * pSize); /** * Gets resource file data from a zip file. * - * @param[in] pszFileName The resource file name which contains the relative path of the zip file. + * @param[in] filename The resource file name which contains the relative path of the zip file. * @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0. * @return Upon success, a pointer to the data is returned, otherwise NULL. * @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned. */ - virtual unsigned char* getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize); + virtual unsigned char* getFileDataFromZip(const char* pszZipFilePath, const char* filename, unsigned long * pSize); /** Returns the fullpath for a given filename. @@ -147,14 +147,14 @@ public: internal_dir/gamescene/uilayer/resources-iphonehd/sprite.pvr.gz (if not found, search next) internal_dir/gamescene/uilayer/sprite.pvr.gz (if not found, return "gamescene/uilayer/sprite.png") - If the new file can't be found on the file system, it will return the parameter pszFileName directly. + If the new file can't be found on the file system, it will return the parameter filename directly. This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, you might need to load different resources for a given file in the different platforms. @since v2.1 */ - virtual std::string fullPathForFilename(const char* pszFileName); + virtual std::string fullPathForFilename(const char* filename); /** * Loads the filenameLookup dictionary from the contents of a filename. @@ -199,14 +199,14 @@ public: /** * Gets full path from a file name and the path of the reletive file. - * @param pszFilename The file name. + * @param filename The file name. * @param pszRelativeFile The path of the relative file. * @return The full path. - * e.g. pszFilename: hello.png, pszRelativeFile: /User/path1/path2/hello.plist + * e.g. filename: hello.png, pszRelativeFile: /User/path1/path2/hello.plist * Return: /User/path1/path2/hello.pvr (If there a a key(hello.png)-value(hello.pvr) in FilenameLookup dictionary. ) * */ - virtual const char* fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile); + virtual const char* fullPathFromRelativeFile(const char *filename, const char *pszRelativeFile); /** * Sets the array that contains the search order of the resources. @@ -318,11 +318,11 @@ protected: /** * Gets the new filename from the filename lookup dictionary. - * @param pszFileName The original filename. + * @param filename The original filename. * @return The new filename after searching in the filename lookup dictionary. * If the original filename wasn't in the dictionary, it will return the original filename. */ - virtual std::string getNewFilename(const char* pszFileName); + virtual std::string getNewFilename(const char* filename); /** * Gets full path for filename, resolution directory and search path. diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp index 6b0683bd6c..a31de560ff 100644 --- a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp @@ -132,35 +132,35 @@ bool FileUtilsAndroid::isAbsolutePath(const std::string& strPath) } -unsigned char* FileUtilsAndroid::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize) +unsigned char* FileUtilsAndroid::getFileData(const char* filename, const char* pszMode, unsigned long * pSize) { - return doGetFileData(pszFileName, pszMode, pSize, false); + return doGetFileData(filename, pszMode, pSize, false); } -unsigned char* FileUtilsAndroid::getFileDataForAsync(const char* pszFileName, const char* pszMode, unsigned long * pSize) +unsigned char* FileUtilsAndroid::getFileDataForAsync(const char* filename, const char* pszMode, unsigned long * pSize) { - return doGetFileData(pszFileName, pszMode, pSize, true); + return doGetFileData(filename, pszMode, pSize, true); } -unsigned char* FileUtilsAndroid::doGetFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize, bool forAsync) +unsigned char* FileUtilsAndroid::doGetFileData(const char* filename, const char* pszMode, unsigned long * pSize, bool forAsync) { unsigned char * pData = 0; - if ((! pszFileName) || (! pszMode) || 0 == strlen(pszFileName)) + if ((! filename) || (! pszMode) || 0 == strlen(filename)) { return 0; } - string fullPath = fullPathForFilename(pszFileName); + string fullPath = fullPathForFilename(filename); if (fullPath[0] != '/') { - string fullPath(pszFileName); + string fullPath(filename); // fullPathForFilename is not thread safe. if (! forAsync) { - fullPath = fullPathForFilename(pszFileName); + fullPath = fullPathForFilename(filename); } const char* relativepath = fullPath.c_str(); @@ -200,7 +200,7 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* pszFileName, const ch do { // read rrom other path than user set it - //CCLOG("GETTING FILE ABSOLUTE DATA: %s", pszFileName); + //CCLOG("GETTING FILE ABSOLUTE DATA: %s", filename); FILE *fp = fopen(fullPath.c_str(), pszMode); CC_BREAK_IF(!fp); @@ -222,7 +222,7 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* pszFileName, const ch if (! pData) { std::string msg = "Get data from file("; - msg.append(pszFileName).append(") failed!"); + msg.append(filename).append(") failed!"); CCLOG(msg.c_str()); } diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.h b/cocos2dx/platform/android/CCFileUtilsAndroid.h index 7c2ff207d3..e137ffe9ac 100644 --- a/cocos2dx/platform/android/CCFileUtilsAndroid.h +++ b/cocos2dx/platform/android/CCFileUtilsAndroid.h @@ -54,7 +54,7 @@ public: /* override funtions */ bool init(); - virtual unsigned char* getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize); + virtual unsigned char* getFileData(const char* filename, const char* pszMode, unsigned long * pSize); virtual std::string getWritablePath(); virtual bool isFileExist(const std::string& strFilePath); virtual bool isAbsolutePath(const std::string& strPath); @@ -62,10 +62,10 @@ public: /** This function is android specific. It is used for TextureCache::addImageAsync(). Don't use it in your codes. */ - unsigned char* getFileDataForAsync(const char* pszFileName, const char* pszMode, unsigned long * pSize); + unsigned char* getFileDataForAsync(const char* filename, const char* pszMode, unsigned long * pSize); private: - unsigned char* doGetFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize, bool forAsync); + unsigned char* doGetFileData(const char* filename, const char* pszMode, unsigned long * pSize, bool forAsync); }; // end of platform group diff --git a/cocos2dx/sprite_nodes/CCAnimation.cpp b/cocos2dx/sprite_nodes/CCAnimation.cpp index 89cbbe8671..50dda491af 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.cpp +++ b/cocos2dx/sprite_nodes/CCAnimation.cpp @@ -174,12 +174,12 @@ void Animation::addSpriteFrame(SpriteFrame *pFrame) _totalDelayUnits++; } -void Animation::addSpriteFrameWithFileName(const char *pszFileName) +void Animation::addSpriteFrameWithFileName(const char *filename) { - Texture2D *pTexture = TextureCache::getInstance()->addImage(pszFileName); + Texture2D *texture = TextureCache::getInstance()->addImage(filename); Rect rect = Rect::ZERO; - rect.size = pTexture->getContentSize(); - SpriteFrame *pFrame = SpriteFrame::createWithTexture(pTexture, rect); + rect.size = texture->getContentSize(); + SpriteFrame *pFrame = SpriteFrame::createWithTexture(texture, rect); addSpriteFrame(pFrame); } diff --git a/cocos2dx/sprite_nodes/CCAnimation.h b/cocos2dx/sprite_nodes/CCAnimation.h index c4840f8f06..054480734e 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.h +++ b/cocos2dx/sprite_nodes/CCAnimation.h @@ -157,7 +157,7 @@ public: The frame will be added with one "delay unit". Added to facilitate the migration from v0.8 to v0.9. */ - void addSpriteFrameWithFileName(const char *pszFileName); + void addSpriteFrameWithFileName(const char *filename); /** Adds a frame with a texture and a rect. Internally it will create a SpriteFrame and it will add it. The frame will be added with one "delay unit". diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 780c03447d..9764e3001d 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -56,73 +56,73 @@ NS_CC_BEGIN #define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) #endif -Sprite* Sprite::createWithTexture(Texture2D *pTexture) +Sprite* Sprite::createWithTexture(Texture2D *texture) { - Sprite *pobSprite = new Sprite(); - if (pobSprite && pobSprite->initWithTexture(pTexture)) + Sprite *sprite = new Sprite(); + if (sprite && sprite->initWithTexture(texture)) { - pobSprite->autorelease(); - return pobSprite; + sprite->autorelease(); + return sprite; } - CC_SAFE_DELETE(pobSprite); + CC_SAFE_DELETE(sprite); return NULL; } -Sprite* Sprite::createWithTexture(Texture2D *pTexture, const Rect& rect) +Sprite* Sprite::createWithTexture(Texture2D *texture, const Rect& rect) { - Sprite *pobSprite = new Sprite(); - if (pobSprite && pobSprite->initWithTexture(pTexture, rect)) + Sprite *sprite = new Sprite(); + if (sprite && sprite->initWithTexture(texture, rect)) { - pobSprite->autorelease(); - return pobSprite; + sprite->autorelease(); + return sprite; } - CC_SAFE_DELETE(pobSprite); + CC_SAFE_DELETE(sprite); return NULL; } -Sprite* Sprite::create(const char *pszFileName) +Sprite* Sprite::create(const char *filename) { - Sprite *pobSprite = new Sprite(); - if (pobSprite && pobSprite->initWithFile(pszFileName)) + Sprite *sprite = new Sprite(); + if (sprite && sprite->initWithFile(filename)) { - pobSprite->autorelease(); - return pobSprite; + sprite->autorelease(); + return sprite; } - CC_SAFE_DELETE(pobSprite); + CC_SAFE_DELETE(sprite); return NULL; } -Sprite* Sprite::create(const char *pszFileName, const Rect& rect) +Sprite* Sprite::create(const char *filename, const Rect& rect) { - Sprite *pobSprite = new Sprite(); - if (pobSprite && pobSprite->initWithFile(pszFileName, rect)) + Sprite *sprite = new Sprite(); + if (sprite && sprite->initWithFile(filename, rect)) { - pobSprite->autorelease(); - return pobSprite; + sprite->autorelease(); + return sprite; } - CC_SAFE_DELETE(pobSprite); + CC_SAFE_DELETE(sprite); return NULL; } Sprite* Sprite::createWithSpriteFrame(SpriteFrame *pSpriteFrame) { - Sprite *pobSprite = new Sprite(); - if (pSpriteFrame && pobSprite && pobSprite->initWithSpriteFrame(pSpriteFrame)) + Sprite *sprite = new Sprite(); + if (pSpriteFrame && sprite && sprite->initWithSpriteFrame(pSpriteFrame)) { - pobSprite->autorelease(); - return pobSprite; + sprite->autorelease(); + return sprite; } - CC_SAFE_DELETE(pobSprite); + CC_SAFE_DELETE(sprite); return NULL; } -Sprite* Sprite::createWithSpriteFrameName(const char *pszSpriteFrameName) +Sprite* Sprite::createWithSpriteFrameName(const char *spriteFrameName) { - SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pszSpriteFrameName); + SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); #if COCOS2D_DEBUG > 0 char msg[256] = {0}; - sprintf(msg, "Invalid spriteFrameName: %s", pszSpriteFrameName); + sprintf(msg, "Invalid spriteFrameName: %s", spriteFrameName); CCASSERT(pFrame != NULL, msg); #endif @@ -147,7 +147,7 @@ bool Sprite::init(void) } // designated initializer -bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated) +bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated) { if (NodeRGBA::init()) { @@ -185,7 +185,7 @@ bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated setShaderProgram(ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); // update texture (calls updateBlendFunc) - setTexture(pTexture); + setTexture(texture); setTextureRect(rect, rotated, rect.size); // by default use "Self Render". @@ -200,31 +200,31 @@ bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated } } -bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect) +bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect) { - return initWithTexture(pTexture, rect, false); + return initWithTexture(texture, rect, false); } -bool Sprite::initWithTexture(Texture2D *pTexture) +bool Sprite::initWithTexture(Texture2D *texture) { - CCASSERT(pTexture != NULL, "Invalid texture for sprite"); + CCASSERT(texture != NULL, "Invalid texture for sprite"); Rect rect = Rect::ZERO; - rect.size = pTexture->getContentSize(); + rect.size = texture->getContentSize(); - return initWithTexture(pTexture, rect); + return initWithTexture(texture, rect); } -bool Sprite::initWithFile(const char *pszFilename) +bool Sprite::initWithFile(const char *filename) { - CCASSERT(pszFilename != NULL, "Invalid filename for sprite"); + CCASSERT(filename != NULL, "Invalid filename for sprite"); - Texture2D *pTexture = TextureCache::getInstance()->addImage(pszFilename); - if (pTexture) + Texture2D *texture = TextureCache::getInstance()->addImage(filename); + if (texture) { Rect rect = Rect::ZERO; - rect.size = pTexture->getContentSize(); - return initWithTexture(pTexture, rect); + rect.size = texture->getContentSize(); + return initWithTexture(texture, rect); } // don't release here. @@ -233,14 +233,14 @@ bool Sprite::initWithFile(const char *pszFilename) return false; } -bool Sprite::initWithFile(const char *pszFilename, const Rect& rect) +bool Sprite::initWithFile(const char *filename, const Rect& rect) { - CCASSERT(pszFilename != NULL, ""); + CCASSERT(filename != NULL, ""); - Texture2D *pTexture = TextureCache::getInstance()->addImage(pszFilename); - if (pTexture) + Texture2D *texture = TextureCache::getInstance()->addImage(filename); + if (texture) { - return initWithTexture(pTexture, rect); + return initWithTexture(texture, rect); } // don't release here. @@ -259,11 +259,11 @@ bool Sprite::initWithSpriteFrame(SpriteFrame *pSpriteFrame) return bRet; } -bool Sprite::initWithSpriteFrameName(const char *pszSpriteFrameName) +bool Sprite::initWithSpriteFrameName(const char *spriteFrameName) { - CCASSERT(pszSpriteFrameName != NULL, ""); + CCASSERT(spriteFrameName != NULL, ""); - SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pszSpriteFrameName); + SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); return initWithSpriteFrame(pFrame); } @@ -284,9 +284,9 @@ Sprite* Sprite::initWithCGImage(CGImageRef pImage, const char *pszKey) CCASSERT(pImage != NULL); // XXX: possible bug. See issue #349. New API should be added - Texture2D *pTexture = TextureCache::getInstance()->addCGImage(pImage, pszKey); + Texture2D *texture = TextureCache::getInstance()->addCGImage(pImage, pszKey); - const Size& size = pTexture->getContentSize(); + const Size& size = texture->getContentSize(); Rect rect = Rect(0 ,0, size.width, size.height); return initWithTexture(texture, rect); @@ -382,14 +382,14 @@ void Sprite::setTextureCoords(Rect rect) { #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); - right = left+(rect.size.height*2-2)/(2*atlasWidth); - top = (2*rect.origin.y+1)/(2*atlasHeight); - bottom = top+(rect.size.width*2-2)/(2*atlasHeight); + right = left+(rect.size.height*2-2)/(2*atlasWidth); + top = (2*rect.origin.y+1)/(2*atlasHeight); + bottom = top+(rect.size.width*2-2)/(2*atlasHeight); #else left = rect.origin.x/atlasWidth; - right = (rect.origin.x+rect.size.height) / atlasWidth; - top = rect.origin.y/atlasHeight; - bottom = (rect.origin.y+rect.size.width) / atlasHeight; + right = (rect.origin.x+rect.size.height) / atlasWidth; + top = rect.origin.y/atlasHeight; + bottom = (rect.origin.y+rect.size.width) / atlasHeight; #endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL if (_flipX) @@ -1017,9 +1017,9 @@ SpriteBatchNode* Sprite::getBatchNode(void) return _batchNode; } -void Sprite::setBatchNode(SpriteBatchNode *pobSpriteBatchNode) +void Sprite::setBatchNode(SpriteBatchNode *spriteBatchNode) { - _batchNode = pobSpriteBatchNode; // weak reference + _batchNode = spriteBatchNode; // weak reference // self render if( ! _batchNode ) { diff --git a/cocos2dx/sprite_nodes/CCSprite.h b/cocos2dx/sprite_nodes/CCSprite.h index 313abd4b2e..ca2aaae47d 100644 --- a/cocos2dx/sprite_nodes/CCSprite.h +++ b/cocos2dx/sprite_nodes/CCSprite.h @@ -101,40 +101,40 @@ public: * After creation, the rect of sprite will be the size of the image, * and the offset will be (0,0). * - * @param pszFileName The string which indicates a path to image file, e.g., "scene1/monster.png". + * @param filename The string which indicates a path to image file, e.g., "scene1/monster.png". * @return A valid sprite object that is marked as autoreleased. */ - static Sprite* create(const char *pszFileName); + static Sprite* create(const char *filename); /** * Creates a sprite with an image filename and a rect. * - * @param pszFileName The string wich indicates a path to image file, e.g., "scene1/monster.png" - * @param rect Only the contents inside rect of pszFileName's texture will be applied for this sprite. + * @param filename The string wich indicates a path to image file, e.g., "scene1/monster.png" + * @param rect Only the contents inside rect of filename's texture will be applied for this sprite. * @return A valid sprite object that is marked as autoreleased. */ - static Sprite* create(const char *pszFileName, const Rect& rect); + static Sprite* create(const char *filename, const Rect& rect); /** * Creates a sprite with an exsiting texture contained in a Texture2D object * After creation, the rect will be the size of the texture, and the offset will be (0,0). * - * @param pTexture A pointer to a Texture2D object. + * @param texture A pointer to a Texture2D object. * @return A valid sprite object that is marked as autoreleased. */ - static Sprite* createWithTexture(Texture2D *pTexture); + static Sprite* createWithTexture(Texture2D *texture); /** * Creates a sprite with a texture and a rect. * * After creation, the offset will be (0,0). * - * @param pTexture A pointer to an existing Texture2D object. + * @param texture A pointer to an existing Texture2D object. * You can use a Texture2D object for many sprites. * @param rect Only the contents inside the rect of this texture will be applied for this sprite. * @return A valid sprite object that is marked as autoreleased. */ - static Sprite* createWithTexture(Texture2D *pTexture, const Rect& rect); + static Sprite* createWithTexture(Texture2D *texture, const Rect& rect); /** * Creates a sprite with an sprite frame. @@ -147,13 +147,13 @@ public: /** * Creates a sprite with an sprite frame name. * - * A SpriteFrame will be fetched from the SpriteFrameCache by pszSpriteFrameName param. + * A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param. * If the SpriteFrame doesn't exist it will raise an exception. * - * @param pszSpriteFrameName A null terminated string which indicates the sprite frame name. + * @param spriteFrameName A null terminated string which indicates the sprite frame name. * @return A valid sprite object that is marked as autoreleased. */ - static Sprite* createWithSpriteFrameName(const char *pszSpriteFrameName); + static Sprite* createWithSpriteFrameName(const char *spriteFrameName); /// @} end of creators group @@ -181,23 +181,23 @@ public: * * After initialization, the rect used will be the size of the texture, and the offset will be (0,0). * - * @param pTexture A pointer to an existing Texture2D object. + * @param texture A pointer to an existing Texture2D object. * You can use a Texture2D object for many sprites. * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithTexture(Texture2D *pTexture); + virtual bool initWithTexture(Texture2D *texture); /** * Initializes a sprite with a texture and a rect. * * After initialization, the offset will be (0,0). * - * @param pTexture A pointer to an exisiting Texture2D object. + * @param texture A pointer to an exisiting Texture2D object. * You can use a Texture2D object for many sprites. * @param rect Only the contents inside rect of this texture will be applied for this sprite. * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithTexture(Texture2D *pTexture, const Rect& rect); + virtual bool initWithTexture(Texture2D *texture, const Rect& rect); /** * Initializes a sprite with a texture and a rect in points, optionally rotated. @@ -205,12 +205,12 @@ public: * After initialization, the offset will be (0,0). * @note This is the designated initializer. * - * @param pTexture A Texture2D object whose texture will be applied to this sprite. + * @param texture A Texture2D object whose texture will be applied to this sprite. * @param rect A rectangle assigned the contents of texture. * @param rotated Whether or not the texture rectangle is rotated. * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated); + virtual bool initWithTexture(Texture2D *texture, const Rect& rect, bool rotated); /** * Initializes a sprite with an SpriteFrame. The texture and rect in SpriteFrame will be applied on this sprite @@ -226,35 +226,35 @@ public: * A SpriteFrame will be fetched from the SpriteFrameCache by name. * If the SpriteFrame doesn't exist it will raise an exception. * - * @param pszSpriteFrameName A key string that can fected a volid SpriteFrame from SpriteFrameCache + * @param spriteFrameName A key string that can fected a volid SpriteFrame from SpriteFrameCache * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithSpriteFrameName(const char *pszSpriteFrameName); + virtual bool initWithSpriteFrameName(const char *spriteFrameName); /** * Initializes a sprite with an image filename. * - * This method will find pszFilename from local file system, load its content to Texture2D, + * This method will find filename from local file system, load its content to Texture2D, * then use Texture2D to create a sprite. * After initialization, the rect used will be the size of the image. The offset will be (0,0). * - * @param pszFilename The path to an image file in local file system + * @param filename The path to an image file in local file system * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithFile(const char *pszFilename); + virtual bool initWithFile(const char *filename); /** * Initializes a sprite with an image filename, and a rect. * - * This method will find pszFilename from local file system, load its content to Texture2D, + * This method will find filename from local file system, load its content to Texture2D, * then use Texture2D to create a sprite. * After initialization, the offset will be (0,0). * - * @param pszFilename The path to an image file in local file system. + * @param filename The path to an image file in local file system. * @param rect The rectangle assigned the content area from texture. * @return true if the sprite is initialized properly, false otherwise. */ - virtual bool initWithFile(const char *pszFilename, const Rect& rect); + virtual bool initWithFile(const char *filename, const Rect& rect); /// @} end of initializers @@ -283,7 +283,7 @@ public: * layer->addChild(batch); * @endcode */ - virtual void setBatchNode(SpriteBatchNode *pobSpriteBatchNode); + virtual void setBatchNode(SpriteBatchNode *spriteBatchNode); /// @} end of BatchNode methods diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index 0addea2606..99eb30d204 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -110,8 +110,8 @@ bool SpriteBatchNode::init() */ bool SpriteBatchNode::initWithFile(const char* fileImage, int capacity) { - Texture2D *pTexture2D = TextureCache::getInstance()->addImage(fileImage); - return initWithTexture(pTexture2D, capacity); + Texture2D *texture2D = TextureCache::getInstance()->addImage(fileImage); + return initWithTexture(texture2D, capacity); } SpriteBatchNode::SpriteBatchNode() @@ -494,13 +494,13 @@ unsigned int SpriteBatchNode::lowestAtlasIndexInChild(Sprite *pSprite) } } -unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *pobSprite, int nZ) +unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *sprite, int nZ) { - Array *pBrothers = pobSprite->getParent()->getChildren(); - unsigned int uChildIndex = pBrothers->indexOfObject(pobSprite); + Array *pBrothers = sprite->getParent()->getChildren(); + unsigned int uChildIndex = pBrothers->indexOfObject(sprite); // ignore parent Z if parent is spriteSheet - bool bIgnoreParent = (SpriteBatchNode*)(pobSprite->getParent()) == this; + bool bIgnoreParent = (SpriteBatchNode*)(sprite->getParent()) == this; Sprite *pPrevious = NULL; if (uChildIndex > 0 && uChildIndex < UINT_MAX) @@ -524,7 +524,7 @@ unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *pobSprite, int nZ) // first child of an Sprite ? if (uChildIndex == 0) { - Sprite *p = (Sprite*)(pobSprite->getParent()); + Sprite *p = (Sprite*)(sprite->getParent()); // less than parent and brothers if (nZ < 0) @@ -545,7 +545,7 @@ unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *pobSprite, int nZ) } // else (previous < 0 and sprite >= 0 ) - Sprite *p = (Sprite*)(pobSprite->getParent()); + Sprite *p = (Sprite*)(sprite->getParent()); return p->getAtlasIndex() + 1; } @@ -625,15 +625,15 @@ void SpriteBatchNode::appendChild(Sprite* sprite) } } -void SpriteBatchNode::removeSpriteFromAtlas(Sprite *pobSprite) +void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite) { // remove from TextureAtlas - _textureAtlas->removeQuadAtIndex(pobSprite->getAtlasIndex()); + _textureAtlas->removeQuadAtIndex(sprite->getAtlasIndex()); // Cleanup sprite. It might be reused (issue #569) - pobSprite->setBatchNode(NULL); + sprite->setBatchNode(NULL); - unsigned int uIndex = _descendants->indexOfObject(pobSprite); + unsigned int uIndex = _descendants->indexOfObject(sprite); if (uIndex != UINT_MAX) { _descendants->removeObjectAtIndex(uIndex); @@ -649,7 +649,7 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *pobSprite) } // remove children recursively - Array *pChildren = pobSprite->getChildren(); + Array *pChildren = sprite->getChildren(); if (pChildren && pChildren->count() > 0) { Object* pObject = NULL; diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp index a3d4bf0236..202df05c70 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp @@ -264,11 +264,11 @@ void SpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist) CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str()); } - Texture2D *pTexture = TextureCache::getInstance()->addImage(texturePath.c_str()); + Texture2D *texture = TextureCache::getInstance()->addImage(texturePath.c_str()); - if (pTexture) + if (texture) { - addSpriteFramesWithDictionary(dict, pTexture); + addSpriteFramesWithDictionary(dict, texture); _loadedFileNames->insert(pszPlist); } else diff --git a/cocos2dx/support/image_support/TGAlib.cpp b/cocos2dx/support/image_support/TGAlib.cpp index db2a46296f..ba4ca83b01 100644 --- a/cocos2dx/support/image_support/TGAlib.cpp +++ b/cocos2dx/support/image_support/TGAlib.cpp @@ -193,13 +193,13 @@ void tgaFlipImage( tImageTGA *psInfo ) } // this is the function to call when we want to load an image -tImageTGA * tgaLoad(const char *pszFilename) +tImageTGA * tgaLoad(const char *filename) { int mode,total; tImageTGA *info = NULL; unsigned long nSize = 0; - unsigned char* pBuffer = FileUtils::getInstance()->getFileData(pszFilename, "rb", &nSize); + unsigned char* pBuffer = FileUtils::getInstance()->getFileData(filename, "rb", &nSize); do { diff --git a/cocos2dx/support/image_support/TGAlib.h b/cocos2dx/support/image_support/TGAlib.h index 141b6a2fff..28a19324b1 100644 --- a/cocos2dx/support/image_support/TGAlib.h +++ b/cocos2dx/support/image_support/TGAlib.h @@ -59,7 +59,7 @@ bool tgaLoadHeader(unsigned char *Buffer, unsigned long bufSize, tImageTGA *psIn bool tgaLoadImageData(unsigned char *Buffer, unsigned long bufSize, tImageTGA *psInfo); /// this is the function to call when we want to load an image -tImageTGA * tgaLoad(const char *pszFilename); +tImageTGA * tgaLoad(const char *filename); // /converts RGB to grayscale void tgaRGBtogreyscale(tImageTGA *psInfo); diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index af5ed14f8f..24926c2af0 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -121,13 +121,13 @@ TextureAtlas * TextureAtlas::create(const char* file, int capacity) TextureAtlas * TextureAtlas::createWithTexture(Texture2D *texture, int capacity) { - TextureAtlas * pTextureAtlas = new TextureAtlas(); - if (pTextureAtlas && pTextureAtlas->initWithTexture(texture, capacity)) + TextureAtlas * textureAtlas = new TextureAtlas(); + if (textureAtlas && textureAtlas->initWithTexture(texture, capacity)) { - pTextureAtlas->autorelease(); - return pTextureAtlas; + textureAtlas->autorelease(); + return textureAtlas; } - CC_SAFE_DELETE(pTextureAtlas); + CC_SAFE_DELETE(textureAtlas); return NULL; } diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 1c14e94805..08e6db429c 100644 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -667,21 +667,21 @@ bool TexturePVR::initWithContentsOfFile(const char* path) TexturePVR * TexturePVR::create(const char* path) { - TexturePVR * pTexture = new TexturePVR(); - if (pTexture) + TexturePVR * texture = new TexturePVR(); + if (texture) { - if (pTexture->initWithContentsOfFile(path)) + if (texture->initWithContentsOfFile(path)) { - pTexture->autorelease(); + texture->autorelease(); } else { - delete pTexture; - pTexture = NULL; + delete texture; + texture = NULL; } } - return pTexture; + return texture; } NS_CC_END diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp index b00c3184c1..e07234d078 100644 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp @@ -77,7 +77,7 @@ bool HelloWorld::init() } -void HelloWorld::menuCloseCallback(Object* pSender) +void HelloWorld::menuCloseCallback(Object* sender) { Director::getInstance()->end(); diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h index 45139f9d67..876073cdb5 100644 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h +++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h @@ -13,7 +13,7 @@ public: static cocos2d::Scene* scene(); // a selector callback - void menuCloseCallback(Object* pSender); + void menuCloseCallback(Object* sender); // implement the "static node()" method manually CREATE_FUNC(HelloWorld); diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp index 2f2ed57017..9b7cc00c3a 100644 --- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp +++ b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp @@ -117,7 +117,7 @@ bool HelloWorld::init() return bRet; } -void HelloWorld::menuCloseCallback(Object* pSender) +void HelloWorld::menuCloseCallback(Object* sender) { // "close" menu item clicked Director::getInstance()->end(); @@ -190,7 +190,7 @@ void HelloWorld::gameLogic(float dt) void HelloWorld::ccTouchesEnded(Set* touches, Event* event) { // Choose one of the touches to work with - Touch* touch = (Touch*)( touches->anyObject() ); + Touch* touch = static_cast( touches->anyObject() ); Point location = touch->getLocation(); log("++++++++after x:%f, y:%f", location.x, location.y); diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h index be943b4724..bb5ac961dc 100644 --- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h +++ b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h @@ -19,7 +19,7 @@ public: static cocos2d::Scene* scene(); // a selector callback - virtual void menuCloseCallback(cocos2d::Object* pSender); + virtual void menuCloseCallback(cocos2d::Object* sender); // implement the "static node()" method manually CREATE_FUNC(HelloWorld); diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp index 9260a12bb9..66cb282165 100644 --- a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -82,7 +82,7 @@ std::string ActionManagerTest::title() return "No title"; } -void ActionManagerTest::restartCallback(Object* pSender) +void ActionManagerTest::restartCallback(Object* sender) { Scene* s = new ActionManagerTestScene(); s->addChild(restartActionManagerAction()); @@ -91,7 +91,7 @@ void ActionManagerTest::restartCallback(Object* pSender) s->release(); } -void ActionManagerTest::nextCallback(Object* pSender) +void ActionManagerTest::nextCallback(Object* sender) { Scene* s = new ActionManagerTestScene(); s->addChild( nextActionManagerAction() ); @@ -99,7 +99,7 @@ void ActionManagerTest::nextCallback(Object* pSender) s->release(); } -void ActionManagerTest::backCallback(Object* pSender) +void ActionManagerTest::backCallback(Object* sender) { Scene* s = new ActionManagerTestScene(); s->addChild( backActionManagerAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h index 6e0a3c8522..946c2f4b38 100644 --- a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h @@ -17,9 +17,9 @@ public: virtual std::string title(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class CrashTest : public ActionManagerTest diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp index da9e8fa250..b9c6e14145 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -622,7 +622,7 @@ void EaseSpriteDemo::onEnter() _tamara->setPosition(Point(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*4/5)); } -void EaseSpriteDemo::restartCallback(Object* pSender) +void EaseSpriteDemo::restartCallback(Object* sender) { Scene* s = new ActionsEaseTestScene();//CCScene::create(); s->addChild(restartEaseAction()); @@ -631,7 +631,7 @@ void EaseSpriteDemo::restartCallback(Object* pSender) s->release(); } -void EaseSpriteDemo::nextCallback(Object* pSender) +void EaseSpriteDemo::nextCallback(Object* sender) { Scene* s = new ActionsEaseTestScene();//CCScene::create(); s->addChild( nextEaseAction() ); @@ -639,7 +639,7 @@ void EaseSpriteDemo::nextCallback(Object* pSender) s->release(); } -void EaseSpriteDemo::backCallback(Object* pSender) +void EaseSpriteDemo::backCallback(Object* sender) { Scene* s = new ActionsEaseTestScene();//CCScene::create(); s->addChild( backEaseAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h index 3ea8b23bec..e202402688 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h @@ -23,9 +23,9 @@ public: virtual std::string title(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); void positionForTwo(); }; diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp index e2f0b5b3a3..00fb18e3ed 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -96,7 +96,7 @@ void SpriteDemo::onEnter() addChild(background, -10); } -void SpriteDemo::restartCallback(Object* pSender) +void SpriteDemo::restartCallback(Object* sender) { Scene* s = new ProgressActionsTestScene(); s->addChild(restartAction()); @@ -105,7 +105,7 @@ void SpriteDemo::restartCallback(Object* pSender) s->release(); } -void SpriteDemo::nextCallback(Object* pSender) +void SpriteDemo::nextCallback(Object* sender) { Scene* s = new ProgressActionsTestScene(); s->addChild( nextAction() ); @@ -113,7 +113,7 @@ void SpriteDemo::nextCallback(Object* pSender) s->release(); } -void SpriteDemo::backCallback(Object* pSender) +void SpriteDemo::backCallback(Object* sender) { Scene* s = new ProgressActionsTestScene(); s->addChild( backAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h index 54e6183b27..37b780be51 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h @@ -14,9 +14,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class SpriteProgressToRadial : public SpriteDemo diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp index 40cbfb037f..2f1f0b3907 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp @@ -142,7 +142,7 @@ void ActionsDemo::onExit() BaseTest::onExit(); } -void ActionsDemo::restartCallback(Object* pSender) +void ActionsDemo::restartCallback(Object* sender) { Scene* s = new ActionsTestScene(); s->addChild( restartAction() ); @@ -150,7 +150,7 @@ void ActionsDemo::restartCallback(Object* pSender) s->release(); } -void ActionsDemo::nextCallback(Object* pSender) +void ActionsDemo::nextCallback(Object* sender) { Scene* s = new ActionsTestScene(); s->addChild( nextAction() ); @@ -158,7 +158,7 @@ void ActionsDemo::nextCallback(Object* pSender) s->release(); } -void ActionsDemo::backCallback(Object* pSender) +void ActionsDemo::backCallback(Object* sender) { Scene* s = new ActionsTestScene(); s->addChild( backAction() ); @@ -852,7 +852,7 @@ std::string ActionCallFuncND::subtitle() return "simulates CallFuncND with std::bind()"; } -void ActionCallFuncND::doRemoveFromParentAndCleanup(Node* pSender, bool cleanup) +void ActionCallFuncND::doRemoveFromParentAndCleanup(Node* sender, bool cleanup) { _grossini->removeFromParentAndCleanup(cleanup); } @@ -1013,11 +1013,11 @@ void ActionRepeatForever::onEnter() _grossini->runAction(action); } -void ActionRepeatForever::repeatForever(Node* pSender) +void ActionRepeatForever::repeatForever(Node* sender) { auto repeat = RepeatForever::create( RotateBy::create(1.0f, 360) ); - pSender->runAction(repeat); + sender->runAction(repeat); } std::string ActionRepeatForever::subtitle() @@ -1700,7 +1700,7 @@ void Issue1305::onEnter() scheduleOnce(schedule_selector(Issue1305::addSprite), 2); } -void Issue1305::log(Node* pSender) +void Issue1305::log(Node* sender) { cocos2d::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE"); } @@ -1885,9 +1885,9 @@ std::string Issue1327::subtitle() return "See console: You should see: 0, 45, 90, 135, 180"; } -void Issue1327::logSprRotation(Sprite* pSender) +void Issue1327::logSprRotation(Sprite* sender) { - log("%f", pSender->getRotation()); + log("%f", sender->getRotation()); } //Issue1398 diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h index 737e1f5502..facb2a01cc 100644 --- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h +++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h @@ -32,9 +32,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class ActionManual : public ActionsDemo @@ -240,7 +240,7 @@ public: virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - void callback(Node* pSender); + void callback(Node* sender); }; class ActionCallFuncND : public ActionsDemo @@ -249,7 +249,7 @@ public: virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - void doRemoveFromParentAndCleanup(Node* pSender, bool cleanup); + void doRemoveFromParentAndCleanup(Node* sender, bool cleanup); }; class ActionCallFuncO : public ActionsDemo @@ -351,7 +351,7 @@ class Issue1305 : public ActionsDemo public: virtual void onEnter(); virtual void onExit(); - void log(Node* pSender); + void log(Node* sender); void addSprite(float dt); virtual std::string title(); virtual std::string subtitle(); @@ -393,7 +393,7 @@ public: virtual void onEnter(); virtual std::string subtitle(); virtual std::string title(); - void logSprRotation(Sprite* pSender); + void logSprRotation(Sprite* sender); }; class Issue1398 : public ActionsDemo diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.cpp b/samples/Cpp/TestCpp/Classes/BaseTest.cpp index de2ef9a17e..5660d4baaa 100644 --- a/samples/Cpp/TestCpp/Classes/BaseTest.cpp +++ b/samples/Cpp/TestCpp/Classes/BaseTest.cpp @@ -64,17 +64,17 @@ std::string BaseTest::subtitle() return ""; } -void BaseTest::restartCallback(Object* pSender) +void BaseTest::restartCallback(Object* sender) { log("override restart!"); } -void BaseTest::nextCallback(Object* pSender) +void BaseTest::nextCallback(Object* sender) { log("override next!"); } -void BaseTest::backCallback(Object* pSender) +void BaseTest::backCallback(Object* sender) { log("override back!"); } diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.h b/samples/Cpp/TestCpp/Classes/BaseTest.h index cf9b5d06b5..d1e77c5a11 100644 --- a/samples/Cpp/TestCpp/Classes/BaseTest.h +++ b/samples/Cpp/TestCpp/Classes/BaseTest.h @@ -20,9 +20,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - virtual void restartCallback(Object* pSender); - virtual void nextCallback(Object* pSender); - virtual void backCallback(Object* pSender); + virtual void restartCallback(Object* sender); + virtual void nextCallback(Object* sender); + virtual void backCallback(Object* sender); }; diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp index 86d2598b33..aa75313475 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp @@ -213,7 +213,7 @@ void Box2DTestLayer::ccTouchesEnded(Set* touches, Event* event) for( it = touches->begin(); it != touches->end(); it++) { - touch = (Touch*)(*it); + touch = static_cast(*it); if(!touch) break; diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp index 2798076821..d14bb1ab45 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp @@ -56,7 +56,7 @@ bool Bug1159Layer::init() return false; } -void Bug1159Layer::callBack(Object* pSender) +void Bug1159Layer::callBack(Object* sender) { Director::getInstance()->replaceScene(TransitionPageTurn::create(1.0f, Bug1159Layer::scene(), false)); } diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h index f01a1885ce..1c7383a952 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h +++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h @@ -9,7 +9,7 @@ public: virtual bool init(); virtual void onExit(); static Scene* scene(); - void callBack(Object* pSender); + void callBack(Object* sender); CREATE_FUNC(Bug1159Layer); }; diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp index 392c8f8a74..4c1afe8585 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp @@ -70,16 +70,16 @@ void BugsTestMainLayer::onEnter() setTouchEnabled(true); } -void BugsTestMainLayer::ccTouchesBegan(Set *pTouches, Event *pEvent) +void BugsTestMainLayer::ccTouchesBegan(Set *touches, Event *event) { - Touch* touch = (Touch*) pTouches->anyObject(); + Touch* touch = static_cast( touches->anyObject() ); _beginPos = touch->getLocation(); } -void BugsTestMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent) +void BugsTestMainLayer::ccTouchesMoved(Set *touches, Event *event) { - Touch* touch = (Touch*) pTouches->anyObject(); + Touch* touch = static_cast( touches->anyObject() ); Point touchLocation = touch->getLocation(); float nMoveY = touchLocation.y - _beginPos.y; @@ -122,7 +122,7 @@ void BugsTestBaseLayer::onEnter() addChild(menu); } -void BugsTestBaseLayer::backCallback(Object* pSender) +void BugsTestBaseLayer::backCallback(Object* sender) { // Director::getInstance()->enableRetinaDisplay(false); BugsTestScene* scene = new BugsTestScene(); diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h index d212a44180..2ec930f3be 100644 --- a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h +++ b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h @@ -8,8 +8,8 @@ class BugsTestMainLayer : public Layer public: virtual void onEnter(); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); protected: Point _beginPos; @@ -20,7 +20,7 @@ class BugsTestBaseLayer : public Layer { public: virtual void onEnter(); - void backCallback(Object* pSender); + void backCallback(Object* sender); }; class BugsTestScene : public TestScene diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp index 7c17ad36b2..a7b450da09 100644 --- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -70,7 +70,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() } -void ChipmunkTestLayer::toggleDebugCallback(Object* pSender) +void ChipmunkTestLayer::toggleDebugCallback(Object* sender) { #if CC_ENABLE_CHIPMUNK_INTEGRATION _debugLayer->setVisible(! _debugLayer->isVisible()); diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h index cf64e0017d..7ff01e4daf 100644 --- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h +++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h @@ -23,7 +23,7 @@ public: void addNewSpriteAtPosition(Point p); void update(float dt); - void toggleDebugCallback(Object* pSender); + void toggleDebugCallback(Object* sender); virtual void ccTouchesEnded(Set* touches, Event* event); virtual void didAccelerate(Acceleration* pAccelerationValue); diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index c5121c670b..01cef08321 100644 --- a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -37,9 +37,9 @@ MainLayer::MainLayer() )); } -void MainLayer::ccTouchesEnded(Set *pTouches, Event *pEvent) +void MainLayer::ccTouchesEnded(Set *touches, Event *event) { - Touch* touch = (Touch*) pTouches->anyObject(); + Touch* touch = static_cast( touches->anyObject() ); Point location = touch->getLocation(); diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h index 17233755e9..8dae4f5990 100644 --- a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h +++ b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h @@ -13,7 +13,7 @@ class MainLayer : public Layer { public: MainLayer(); - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent); + virtual void ccTouchesEnded(Set *touches, Event *event); }; #endif diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 9f67b94444..9f9733ad6e 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -529,9 +529,9 @@ void ScrollViewDemo::setup() this->setTouchEnabled(true); } -void ScrollViewDemo::ccTouchesBegan(Set *pTouches, Event *pEvent) +void ScrollViewDemo::ccTouchesBegan(Set *touches, Event *event) { - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Node *clipper = this->getChildByTag(kTagClipperNode); Point point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); Rect rect = Rect(0, 0, clipper->getContentSize().width, clipper->getContentSize().height); @@ -539,10 +539,10 @@ void ScrollViewDemo::ccTouchesBegan(Set *pTouches, Event *pEvent) _lastPoint = point; } -void ScrollViewDemo::ccTouchesMoved(Set *pTouches, Event *pEvent) +void ScrollViewDemo::ccTouchesMoved(Set *touches, Event *event) { if (!_scrolling) return; - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Node *clipper = this->getChildByTag(kTagClipperNode); Point point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); Point diff = point - _lastPoint; @@ -551,7 +551,7 @@ void ScrollViewDemo::ccTouchesMoved(Set *pTouches, Event *pEvent) _lastPoint = point; } -void ScrollViewDemo::ccTouchesEnded(Set *pTouches, Event *pEvent) +void ScrollViewDemo::ccTouchesEnded(Set *touches, Event *event) { if (!_scrolling) return; _scrolling = false; diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h index fd149c09b7..ec85a98eba 100644 --- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h +++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h @@ -98,7 +98,7 @@ public: virtual std::string title(); virtual std::string subtitle(); void pokeHoleAtPoint(Point point); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); private: ClippingNode* _outerClipper; Node* _holes; @@ -111,9 +111,9 @@ public: virtual std::string title(); virtual std::string subtitle(); virtual void setup(); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); + virtual void ccTouchesEnded(Set *touches, Event *event); private: bool _scrolling; Point _lastPoint; diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 368560f9ab..3aae4594f7 100644 --- a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -79,33 +79,33 @@ private: return true; } - bool touchHits(Touch *pTouch) + bool touchHits(Touch *touch) { const Rect area(0, 0, _child->getContentSize().width, _child->getContentSize().height); - return area.containsPoint(_child->convertToNodeSpace(pTouch->getLocation())); + return area.containsPoint(_child->convertToNodeSpace(touch->getLocation())); } - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) + virtual bool ccTouchBegan(Touch *touch, Event *event) { - CC_UNUSED_PARAM(pEvent); - const bool hits = touchHits(pTouch); + CC_UNUSED_PARAM(event); + const bool hits = touchHits(touch); if (hits) scaleButtonTo(0.9f); return hits; } - virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) + virtual void ccTouchEnded(Touch *touch, Event *event) { - CC_UNUSED_PARAM(pEvent); - const bool hits = touchHits(pTouch); + CC_UNUSED_PARAM(event); + const bool hits = touchHits(touch); if (hits && _onTriggered) _onTriggered(); scaleButtonTo(1); } - virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) + virtual void ccTouchCancelled(Touch *touch, Event *event) { - CC_UNUSED_PARAM(pEvent); + CC_UNUSED_PARAM(event); scaleButtonTo(1); } diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp index 2767ee1539..064bfa29fb 100644 --- a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp @@ -84,7 +84,7 @@ void ConfigurationBase::onExit() BaseTest::onExit(); } -void ConfigurationBase::restartCallback(Object* pSender) +void ConfigurationBase::restartCallback(Object* sender) { Scene* s = new ConfigurationTestScene(); s->addChild( restartAction() ); @@ -92,7 +92,7 @@ void ConfigurationBase::restartCallback(Object* pSender) s->release(); } -void ConfigurationBase::nextCallback(Object* pSender) +void ConfigurationBase::nextCallback(Object* sender) { Scene* s = new ConfigurationTestScene(); s->addChild( nextAction() ); @@ -100,7 +100,7 @@ void ConfigurationBase::nextCallback(Object* pSender) s->release(); } -void ConfigurationBase::backCallback(Object* pSender) +void ConfigurationBase::backCallback(Object* sender) { Scene* s = new ConfigurationTestScene(); s->addChild( backAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h index 6e3f4feff5..807719cea0 100644 --- a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h +++ b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h @@ -27,9 +27,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class ConfigurationLoadConfig : public ConfigurationBase diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp index 985f5061f4..215d7f4e33 100644 --- a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp +++ b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp @@ -22,7 +22,7 @@ CurlTest::CurlTest() // the test code is // http://curl.haxx.se/mail/lib-2009-12/0071.html -void CurlTest::ccTouchesEnded(Set *pTouches, Event *pEvent) +void CurlTest::ccTouchesEnded(Set *touches, Event *event) { CURL *curl; CURLcode res; diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h index 511abb6526..dfa73adbe6 100644 --- a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h +++ b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h @@ -10,7 +10,7 @@ public: CurlTest(); ~CurlTest(); - virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent); + virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event); private: cocos2d::LabelTTF* _label; diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h index 9f7bbba77a..8b24b3c00a 100644 --- a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h +++ b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h @@ -12,9 +12,9 @@ class BaseLayer : public BaseTest public: BaseLayer(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); virtual std::string title(); virtual std::string subtitle(); virtual void onEnter(); diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp index 441787c4e9..910033e094 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp +++ b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp @@ -368,7 +368,7 @@ std::string EffectAdvanceTextLayer::subtitle() return ""; } -void EffectAdvanceTextLayer::restartCallback(Object* pSender) +void EffectAdvanceTextLayer::restartCallback(Object* sender) { Scene* s = new EffectAdvanceScene(); s->addChild(restartEffectAdvanceAction()); @@ -377,7 +377,7 @@ void EffectAdvanceTextLayer::restartCallback(Object* pSender) s->release(); } -void EffectAdvanceTextLayer::nextCallback(Object* pSender) +void EffectAdvanceTextLayer::nextCallback(Object* sender) { Scene* s = new EffectAdvanceScene(); s->addChild( nextEffectAdvanceAction() ); @@ -386,7 +386,7 @@ void EffectAdvanceTextLayer::nextCallback(Object* pSender) s->release(); } -void EffectAdvanceTextLayer::backCallback(Object* pSender) +void EffectAdvanceTextLayer::backCallback(Object* sender) { Scene* s = new EffectAdvanceScene(); s->addChild( backEffectAdvanceAction() ); diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h index c041520641..b64d48dc9e 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h +++ b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h @@ -19,9 +19,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class Effect1 : public EffectAdvanceTextLayer diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp index b26620e1a8..9603c0a0ae 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp @@ -408,12 +408,12 @@ void TextLayer::newScene() s->release(); } -void TextLayer::restartCallback(Object* pSender) +void TextLayer::restartCallback(Object* sender) { newScene(); } -void TextLayer::nextCallback(Object* pSender) +void TextLayer::nextCallback(Object* sender) { // update the action index actionIdx++; @@ -422,7 +422,7 @@ void TextLayer::nextCallback(Object* pSender) newScene(); } -void TextLayer::backCallback(Object* pSender) +void TextLayer::backCallback(Object* sender) { // update the action index actionIdx--; diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h index 068cfc8afe..2f65c73711 100644 --- a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h +++ b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h @@ -23,9 +23,9 @@ public: virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); void newScene(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp index 547028f1b2..c9b465f847 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp @@ -110,7 +110,7 @@ void ArmatureTestScene::runThisTest() Director::getInstance()->replaceScene(this); } -void ArmatureTestScene::MainMenuCallback(Object* pSender) +void ArmatureTestScene::MainMenuCallback(Object* sender) { removeAllChildren(); ArmatureDataManager::sharedArmatureDataManager()->purgeArmatureSystem(); @@ -170,21 +170,21 @@ std::string ArmatureTestLayer::subtitle() return ""; } -void ArmatureTestLayer::restartCallback(Object* pSender) +void ArmatureTestLayer::restartCallback(Object* sender) { Scene* s = new ArmatureTestScene(); s->addChild( RestartTest() ); Director::getInstance()->replaceScene(s); s->release(); } -void ArmatureTestLayer::nextCallback(Object* pSender) +void ArmatureTestLayer::nextCallback(Object* sender) { Scene* s = new ArmatureTestScene(); s->addChild( NextTest() ); Director::getInstance()->replaceScene(s); s->release(); } -void ArmatureTestLayer::backCallback(Object* pSender) +void ArmatureTestLayer::backCallback(Object* sender) { Scene* s = new ArmatureTestScene(); s->addChild( BackTest() ); @@ -450,7 +450,7 @@ std::string TestParticleDisplay::subtitle() { return "Touch to change animation"; } -bool TestParticleDisplay::ccTouchBegan(Touch *pTouch, Event *pEvent) +bool TestParticleDisplay::ccTouchBegan(Touch *touch, Event *event) { ++animationID; animationID = animationID % armature->getAnimation()->getMovementCount(); @@ -496,7 +496,7 @@ std::string TestUseMutiplePicture::subtitle() { return "weapon and armature are in different picture"; } -bool TestUseMutiplePicture::ccTouchBegan(Touch *pTouch, Event *pEvent) +bool TestUseMutiplePicture::ccTouchBegan(Touch *touch, Event *event) { ++displayIndex; displayIndex = (displayIndex) % 6; @@ -631,7 +631,7 @@ std::string TestArmatureNesting::title() { return "Test Armature Nesting"; } -bool TestArmatureNesting::ccTouchBegan(Touch *pTouch, Event *pEvent) +bool TestArmatureNesting::ccTouchBegan(Touch *touch, Event *event) { ++weaponIndex; weaponIndex = weaponIndex % 4; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h index 454f079ffd..8115958e0f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h @@ -31,7 +31,7 @@ public: virtual void runThisTest(); // The CallBack for back to the main menu scene - virtual void MainMenuCallback(Object* pSender); + virtual void MainMenuCallback(Object* sender); }; enum { @@ -60,9 +60,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); virtual void draw(); }; @@ -139,7 +139,7 @@ class TestUseMutiplePicture : public ArmatureTestLayer virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent); + virtual bool ccTouchBegan(Touch *touch, Event *event); virtual void registerWithTouchDispatcher(); int displayIndex; @@ -151,7 +151,7 @@ class TestParticleDisplay : public ArmatureTestLayer virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent); + virtual bool ccTouchBegan(Touch *touch, Event *event); virtual void registerWithTouchDispatcher(); int animationID; @@ -195,7 +195,7 @@ class TestArmatureNesting : public ArmatureTestLayer public: virtual void onEnter(); virtual std::string title(); - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent); + virtual bool ccTouchBegan(Touch *touch, Event *event); virtual void registerWithTouchDispatcher(); cocos2d::extension::armature::Armature *armature; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index 16dce83727..d72757d3ce 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -19,10 +19,10 @@ public: virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); - void onControlButtonIdleClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onControlButtonWaveClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onControlButtonJumpClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onControlButtonFunkyClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); + void onControlButtonIdleClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onControlButtonWaveClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onControlButtonJumpClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onControlButtonFunkyClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); void setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index 8f7a3f8a25..f79a54576b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -19,7 +19,7 @@ public: virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); - void onControlButtonClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); + void onControlButtonClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); private: cocos2d::LabelBMFont * mControlEventLabel; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 89c5603de0..8942ac199c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -126,19 +126,19 @@ bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const ch return bRet; } -void HelloCocosBuilderLayer::onMenuTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) { +void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", MenuTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onSpriteTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) { +void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", SpriteTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onButtonTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) { +void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", ButtonTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) { +void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { /* Create an autorelease NodeLoaderLibrary. */ NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); @@ -179,16 +179,16 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * pSender, cocos2d:: //this->openTest("TestAnimations.ccbi", "TestAnimationsLayer", AnimationsTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) { +void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", ParticleSystemTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) +void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", ScrollViewTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) +void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) { this->openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", TimelineCallbackTestLayerLoader::loader()); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index 55e4d44845..9a8cabf042 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -34,13 +34,13 @@ class HelloCocosBuilderLayer virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue); virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); - void onMenuTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onSpriteTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onButtonTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onAnimationsTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onParticleSystemTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onScrollViewTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); - void onTimelineCallbackSoundClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent); + void onMenuTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onSpriteTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onButtonTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onAnimationsTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onParticleSystemTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onScrollViewTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); + void onTimelineCallbackSoundClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent); private: cocos2d::Sprite * mBurstSprite; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index ba16fbd725..8533e38dda 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -19,9 +19,9 @@ class MenuTestLayer virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); - void onMenuItemAClicked(cocos2d::Object * pSender); - void onMenuItemBClicked(cocos2d::Object * pSender); - void onMenuItemCClicked(cocos2d::Object * pSender); + void onMenuItemAClicked(cocos2d::Object * sender); + void onMenuItemBClicked(cocos2d::Object * sender); + void onMenuItemCClicked(cocos2d::Object * sender); private: cocos2d::LabelBMFont * mMenuItemStatusLabelBMFont; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index ddefc46ed3..3a8f2dc84d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -16,7 +16,7 @@ class TestHeaderLayer virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); - void onBackClicked(cocos2d::Object * pSender); + void onBackClicked(cocos2d::Object * sender); }; #endif \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp index 01042b3d99..2b451647e7 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp @@ -35,10 +35,10 @@ void PlayerController::update(float delta) } -void PlayerController::ccTouchesEnded(Set *pTouches, Event *pEvent) +void PlayerController::ccTouchesEnded(Set *touches, Event *event) { // Choose one of the touches to work with - Touch* touch = (Touch*)( pTouches->anyObject() ); + Touch* touch = static_cast( touches->anyObject() ); Point location = touch->getLocation(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h index c23e8fa751..61ec49dc4e 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h @@ -12,7 +12,7 @@ protected: virtual ~PlayerController(void); public: - virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent); + virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event); public: virtual bool init(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp index ba96f3d391..514b672c27 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -111,16 +111,16 @@ void ExtensionsMainLayer::onEnter() addChild(_itemMenu); } -void ExtensionsMainLayer::ccTouchesBegan(Set *pTouches, Event *pEvent) +void ExtensionsMainLayer::ccTouchesBegan(Set *touches, Event *event) { - Touch* touch = static_cast(pTouches->anyObject()); + Touch* touch = static_cast(touches->anyObject()); _beginPos = touch->getLocation(); } -void ExtensionsMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent) +void ExtensionsMainLayer::ccTouchesMoved(Set *touches, Event *event) { - Touch* touch = static_cast(pTouches->anyObject()); + Touch* touch = static_cast(touches->anyObject()); Point touchLocation = touch->getLocation(); float nMoveY = touchLocation.y - _beginPos.y; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h index 3b1a77a13d..67b0fb374b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h @@ -8,8 +8,8 @@ class ExtensionsMainLayer : public Layer public: virtual void onEnter(); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); Point _beginPos; Menu* _itemMenu; diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp index f8dc9a46b9..f8444c4ae9 100644 --- a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -68,7 +68,7 @@ void FileUtilsDemo::onEnter() BaseTest::onEnter(); } -void FileUtilsDemo::backCallback(Object* pSender) +void FileUtilsDemo::backCallback(Object* sender) { Scene* scene = new FileUtilsTestScene(); Layer* layer = backAction(); @@ -78,7 +78,7 @@ void FileUtilsDemo::backCallback(Object* pSender) scene->release(); } -void FileUtilsDemo::nextCallback(Object* pSender) +void FileUtilsDemo::nextCallback(Object* sender) { Scene* scene = new FileUtilsTestScene(); Layer* layer = nextAction(); @@ -88,7 +88,7 @@ void FileUtilsDemo::nextCallback(Object* pSender) scene->release(); } -void FileUtilsDemo::restartCallback(Object* pSender) +void FileUtilsDemo::restartCallback(Object* sender) { Scene* scene = new FileUtilsTestScene(); Layer* layer = restartAction(); diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h index 79ecc65b57..d524d81a4b 100644 --- a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h +++ b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h @@ -19,9 +19,9 @@ public: virtual void onEnter(); virtual string title(); virtual string subtitle(); - void backCallback(Object* pSender); - void nextCallback(Object* pSender); - void restartCallback(Object* pSender); + void backCallback(Object* sender); + void nextCallback(Object* sender); + void restartCallback(Object* sender); }; class TestResolutionDirectories : public FileUtilsDemo diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp index 2a769bc98f..1a2eda4167 100644 --- a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp +++ b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp @@ -139,12 +139,12 @@ void FontTest::showFont(const char *pFont) this->addChild(top, 0, kTagLabel4); } -void FontTest::backCallback(Object* pSender) +void FontTest::backCallback(Object* sender) { showFont(backAction()); } -void FontTest::nextCallback(Object* pSender) +void FontTest::nextCallback(Object* sender) { showFont(nextAction()); } @@ -154,7 +154,7 @@ std::string FontTest::title() return "Font test"; } -void FontTest::restartCallback(Object* pSender) +void FontTest::restartCallback(Object* sender) { showFont(restartAction()); } diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h index e84098ef99..1cbf6190d8 100644 --- a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h +++ b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h @@ -17,9 +17,9 @@ public: FontTest(); void showFont(const char *pFont); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); virtual std::string title(); CREATE_FUNC(FontTest); diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp index 9368a8a497..7dd610a3a0 100644 --- a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp @@ -132,7 +132,7 @@ void AtlasDemo::onEnter() BaseTest::onEnter(); } -void AtlasDemo::restartCallback(Object* pSender) +void AtlasDemo::restartCallback(Object* sender) { Scene* s = new AtlasTestScene(); s->addChild(restartAtlasAction()); @@ -141,7 +141,7 @@ void AtlasDemo::restartCallback(Object* pSender) s->release(); } -void AtlasDemo::nextCallback(Object* pSender) +void AtlasDemo::nextCallback(Object* sender) { Scene* s = new AtlasTestScene(); s->addChild( nextAtlasAction() ); @@ -149,7 +149,7 @@ void AtlasDemo::nextCallback(Object* pSender) s->release(); } -void AtlasDemo::backCallback(Object* pSender) +void AtlasDemo::backCallback(Object* sender) { Scene* s = new AtlasTestScene(); s->addChild( backAtlasAction() ); @@ -986,37 +986,37 @@ void LabelTTFTest::updateAlignment() this->addChild(_plabel); } -void LabelTTFTest::setAlignmentLeft(Object* pSender) +void LabelTTFTest::setAlignmentLeft(Object* sender) { _horizAlign = Label::HAlignment::LEFT; this->updateAlignment(); } -void LabelTTFTest::setAlignmentCenter(Object* pSender) +void LabelTTFTest::setAlignmentCenter(Object* sender) { _horizAlign = Label::HAlignment::CENTER; this->updateAlignment(); } -void LabelTTFTest::setAlignmentRight(Object* pSender) +void LabelTTFTest::setAlignmentRight(Object* sender) { _horizAlign = Label::HAlignment::RIGHT; this->updateAlignment(); } -void LabelTTFTest::setAlignmentTop(Object* pSender) +void LabelTTFTest::setAlignmentTop(Object* sender) { _vertAlign = Label::VAlignment::TOP; this->updateAlignment(); } -void LabelTTFTest::setAlignmentMiddle(Object* pSender) +void LabelTTFTest::setAlignmentMiddle(Object* sender) { _vertAlign = Label::VAlignment::CENTER; this->updateAlignment(); } -void LabelTTFTest::setAlignmentBottom(Object* pSender) +void LabelTTFTest::setAlignmentBottom(Object* sender) { _vertAlign = Label::VAlignment::BOTTOM; this->updateAlignment(); @@ -1266,9 +1266,9 @@ void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::Object *sender) this->snapArrowsToEdge(); } -void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent) +void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *touches, cocos2d::Event *event) { - Touch *touch = (Touch *)pTouches->anyObject(); + Touch *touch = (Touch *)touches->anyObject(); Point location = touch->getLocationInView(); if (this->_arrowsShouldRetain->getBoundingBox().containsPoint(location)) @@ -1278,7 +1278,7 @@ void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *pTouches, cocos2 } } -void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent) +void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event) { _drag = false; this->snapArrowsToEdge(); @@ -1286,14 +1286,14 @@ void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *pTouches, cocos2 this->_arrowsBarShouldRetain->setVisible(false); } -void BitmapFontMultiLineAlignment::ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent) +void BitmapFontMultiLineAlignment::ccTouchesMoved(cocos2d::Set *touches, cocos2d::Event *event) { if (! _drag) { return; } - Touch *touch = (Touch *)pTouches->anyObject(); + Touch *touch = (Touch *)touches->anyObject(); Point location = touch->getLocationInView(); Size winSize = Director::getInstance()->getWinSize(); diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h index e57b0d0d51..dec68cacaf 100644 --- a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h +++ b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h @@ -16,9 +16,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; @@ -181,12 +181,12 @@ public: virtual std::string title(); virtual std::string subtitle(); private: - void setAlignmentLeft(Object* pSender); - void setAlignmentCenter(Object* pSender); - void setAlignmentRight(Object* pSender); - void setAlignmentTop(Object* pSender); - void setAlignmentMiddle(Object* pSender); - void setAlignmentBottom(Object* pSender); + void setAlignmentLeft(Object* sender); + void setAlignmentCenter(Object* sender); + void setAlignmentRight(Object* sender); + void setAlignmentTop(Object* sender); + void setAlignmentMiddle(Object* sender); + void setAlignmentBottom(Object* sender); void updateAlignment(); const char* getCurrentAlignment(); private: @@ -227,9 +227,9 @@ public: virtual std::string subtitle(); void stringChanged(Object *sender); void alignmentChanged(Object *sender); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesEnded(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); public: LabelBMFont *_labelShouldRetain; diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp index a9fd293f58..ea266cc6b7 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -89,7 +89,7 @@ void LayerTest::onEnter() BaseTest::onEnter(); } -void LayerTest::restartCallback(Object* pSender) +void LayerTest::restartCallback(Object* sender) { Scene* s = new LayerTestScene(); s->addChild(restartAction()); @@ -98,7 +98,7 @@ void LayerTest::restartCallback(Object* pSender) s->release(); } -void LayerTest::nextCallback(Object* pSender) +void LayerTest::nextCallback(Object* sender) { Scene* s = new LayerTestScene(); s->addChild( nextAction() ); @@ -106,7 +106,7 @@ void LayerTest::nextCallback(Object* pSender) s->release(); } -void LayerTest::backCallback(Object* pSender) +void LayerTest::backCallback(Object* sender) { Scene* s = new LayerTestScene(); s->addChild( backAction() ); @@ -470,22 +470,22 @@ void LayerTest1::updateSize(Point &touchLocation) l->setContentSize( newSize ); } -void LayerTest1::ccTouchesBegan(Set *pTouches, Event *pEvent) +void LayerTest1::ccTouchesBegan(Set *touches, Event *event) { - ccTouchesMoved(pTouches, pEvent); + ccTouchesMoved(touches, event); } -void LayerTest1::ccTouchesMoved(Set *pTouches, Event *pEvent) +void LayerTest1::ccTouchesMoved(Set *touches, Event *event) { - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Point touchLocation = touch->getLocation(); updateSize(touchLocation); } -void LayerTest1::ccTouchesEnded(Set *pTouches, Event *pEvent) +void LayerTest1::ccTouchesEnded(Set *touches, Event *event) { - ccTouchesMoved(pTouches, pEvent); + ccTouchesMoved(touches, event); } std::string LayerTest1::title() diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h index 7dd3186959..eba08c1dab 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h @@ -18,9 +18,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class LayerTestCascadingOpacityA : public LayerTest @@ -74,9 +74,9 @@ public: void updateSize(Point &touchLocation); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); + virtual void ccTouchesEnded(Set *touches, Event *event); }; class LayerTest2 : public LayerTest diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp index ab1aef0f34..4316e676ec 100644 --- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp @@ -114,20 +114,20 @@ MenuLayerMainMenu::MenuLayerMainMenu() menu->setPosition(Point(s.width/2, s.height/2)); } -bool MenuLayerMainMenu::ccTouchBegan(Touch *touch, Event * pEvent) +bool MenuLayerMainMenu::ccTouchBegan(Touch *touch, Event * event) { return true; } -void MenuLayerMainMenu::ccTouchEnded(Touch *touch, Event * pEvent) +void MenuLayerMainMenu::ccTouchEnded(Touch *touch, Event * event) { } -void MenuLayerMainMenu::ccTouchCancelled(Touch *touch, Event * pEvent) +void MenuLayerMainMenu::ccTouchCancelled(Touch *touch, Event * event) { } -void MenuLayerMainMenu::ccTouchMoved(Touch *touch, Event * pEvent) +void MenuLayerMainMenu::ccTouchMoved(Touch *touch, Event * event) { } @@ -168,7 +168,7 @@ void MenuLayerMainMenu::menuCallback2(Object* sender) static_cast(_parent)->switchTo(2); } -void MenuLayerMainMenu::menuCallbackPriorityTest(Object* pSender) +void MenuLayerMainMenu::menuCallbackPriorityTest(Object* sender) { static_cast(_parent)->switchTo(4); } @@ -509,7 +509,7 @@ MenuLayerPriorityTest::~MenuLayerPriorityTest() } -void MenuLayerPriorityTest::menuCallback(Object* pSender) +void MenuLayerPriorityTest::menuCallback(Object* sender) { static_cast(_parent)->switchTo(0); // [[Director sharedDirector] poscene]; @@ -590,12 +590,12 @@ void RemoveMenuItemWhenMove::registerWithTouchDispatcher(void) Director::getInstance()->getTouchDispatcher()->addTargetedDelegate(this, -129, false); } -bool RemoveMenuItemWhenMove::ccTouchBegan(Touch *pTouch, Event *pEvent) +bool RemoveMenuItemWhenMove::ccTouchBegan(Touch *touch, Event *event) { return true; } -void RemoveMenuItemWhenMove::ccTouchMoved(Touch *pTouch, Event *pEvent) +void RemoveMenuItemWhenMove::ccTouchMoved(Touch *touch, Event *event) { if (item) { diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h index 1a2600b0ff..1f227402f4 100644 --- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h +++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h @@ -14,19 +14,19 @@ public: ~MenuLayerMainMenu(); public: - virtual bool ccTouchBegan(Touch *touch, Event * pEvent); - virtual void ccTouchEnded(Touch *touch, Event * pEvent); - virtual void ccTouchCancelled(Touch *touch, Event * pEvent); - virtual void ccTouchMoved(Touch *touch, Event * pEvent); + virtual bool ccTouchBegan(Touch *touch, Event * event); + virtual void ccTouchEnded(Touch *touch, Event * event); + virtual void ccTouchCancelled(Touch *touch, Event * event); + virtual void ccTouchMoved(Touch *touch, Event * event); void allowTouches(float dt); - void menuCallback(Object* pSender); - void menuCallbackConfig(Object* pSender); - void menuCallbackDisabled(Object* pSender); - void menuCallback2(Object* pSender); - void menuCallbackPriorityTest(Object* pSender); + void menuCallback(Object* sender); + void menuCallbackConfig(Object* sender); + void menuCallbackDisabled(Object* sender); + void menuCallback2(Object* sender); + void menuCallbackPriorityTest(Object* sender); void menuCallbackBugsTest(Object *pSender); - void onQuit(Object* pSender); + void onQuit(Object* sender); void menuMovingCallback(Object *pSender); //CREATE_NODE(MenuLayer1); @@ -46,9 +46,9 @@ public: ~MenuLayer2(); public: - void menuCallback(Object* pSender); - void menuCallbackOpacity(Object* pSender); - void menuCallbackAlign(Object* pSender); + void menuCallback(Object* sender); + void menuCallbackOpacity(Object* sender); + void menuCallbackAlign(Object* sender); //CREATE_NODE(MenuLayer2); }; @@ -72,8 +72,8 @@ public: ~MenuLayer4(); public: - void menuCallback(Object* pSender); - void backCallback(Object* pSender); + void menuCallback(Object* sender); + void backCallback(Object* sender); //CREATE_NODE(MenuLayer4); }; @@ -84,7 +84,7 @@ public: MenuLayerPriorityTest(); ~MenuLayerPriorityTest(); - void menuCallback(Object* pSender); + void menuCallback(Object* sender); private: Menu* _menu1; Menu* _menu2; @@ -108,8 +108,8 @@ public: ~RemoveMenuItemWhenMove(); virtual void registerWithTouchDispatcher(void); - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent); - virtual void ccTouchMoved(Touch *pTouch, Event *pEvent); + virtual bool ccTouchBegan(Touch *touch, Event *event); + virtual void ccTouchMoved(Touch *touch, Event *event); void goBack(Object *pSender); diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp index b8a2019e55..54aaf4db86 100644 --- a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -234,7 +234,7 @@ void MotionStreakTest::modeCallback(Object *pSender) streak->setFastMode(! fastMode); } -void MotionStreakTest::restartCallback(Object* pSender) +void MotionStreakTest::restartCallback(Object* sender) { Scene* s = new MotionStreakTestScene();//CCScene::create(); s->addChild(restartMotionAction()); @@ -243,7 +243,7 @@ void MotionStreakTest::restartCallback(Object* pSender) s->release(); } -void MotionStreakTest::nextCallback(Object* pSender) +void MotionStreakTest::nextCallback(Object* sender) { Scene* s = new MotionStreakTestScene();//CCScene::create(); s->addChild( nextMotionAction() ); @@ -251,7 +251,7 @@ void MotionStreakTest::nextCallback(Object* pSender) s->release(); } -void MotionStreakTest::backCallback(Object* pSender) +void MotionStreakTest::backCallback(Object* sender) { Scene* s = new MotionStreakTestScene;//CCScene::create(); s->addChild( backMotionAction() ); diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h index eb4adfd0d5..84ee4437aa 100644 --- a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h +++ b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h @@ -17,10 +17,10 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); - void modeCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); + void modeCallback(Object* sender); protected: MotionStreak *streak; }; diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp index dea738d10e..0a2b9875cb 100644 --- a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp +++ b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp @@ -69,50 +69,50 @@ void MutiTouchTestLayer::registerWithTouchDispatcher(void) Director::getInstance()->getTouchDispatcher()->addStandardDelegate(this, 0); } -void MutiTouchTestLayer::ccTouchesBegan(Set *touches, Event *pEvent) +void MutiTouchTestLayer::ccTouchesBegan(Set *touches, Event *event) { for ( auto &item: *touches ) { - Touch* pTouch = (Touch*)item; - TouchPoint* pTouchPoint = TouchPoint::touchPointWithParent(this); - Point location = pTouch->getLocation(); + Touch* touch = static_cast(item); + TouchPoint* touchPoint = TouchPoint::touchPointWithParent(this); + Point location = touch->getLocation(); - pTouchPoint->setTouchPos(location); - pTouchPoint->setTouchColor(s_TouchColors[pTouch->getID()]); + touchPoint->setTouchPos(location); + touchPoint->setTouchColor(s_TouchColors[touch->getID()]); - addChild(pTouchPoint); - s_dic.setObject(pTouchPoint, pTouch->getID()); + addChild(touchPoint); + s_dic.setObject(touchPoint, touch->getID()); } } -void MutiTouchTestLayer::ccTouchesMoved(Set *touches, Event *pEvent) +void MutiTouchTestLayer::ccTouchesMoved(Set *touches, Event *event) { for( auto &item: *touches) { - Touch* pTouch = (Touch*)item; - TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID()); - Point location = pTouch->getLocation(); + Touch* touch = static_cast(item); + TouchPoint* pTP = static_cast(s_dic.objectForKey(touch->getID())); + Point location = touch->getLocation(); pTP->setTouchPos(location); } } -void MutiTouchTestLayer::ccTouchesEnded(Set *touches, Event *pEvent) +void MutiTouchTestLayer::ccTouchesEnded(Set *touches, Event *event) { for ( auto &item: *touches ) { - Touch* pTouch = (Touch*)item; - TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID()); + Touch* touch = static_cast(item); + TouchPoint* pTP = static_cast(s_dic.objectForKey(touch->getID())); removeChild(pTP, true); - s_dic.removeObjectForKey(pTouch->getID()); + s_dic.removeObjectForKey(touch->getID()); } } -void MutiTouchTestLayer::ccTouchesCancelled(Set *pTouches, Event *pEvent) +void MutiTouchTestLayer::ccTouchesCancelled(Set *touches, Event *event) { - ccTouchesEnded(pTouches, pEvent); + ccTouchesEnded(touches, event); } void MutiTouchTestScene::runThisTest() diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h index d6d8e263b1..0f3190c6ce 100644 --- a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h +++ b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h @@ -9,10 +9,10 @@ public: bool init(); virtual void registerWithTouchDispatcher(void); - virtual void ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent); - virtual void ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent); - virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent); - virtual void ccTouchesCancelled(cocos2d::Set *pTouches, cocos2d::Event *pEvent); + virtual void ccTouchesBegan(cocos2d::Set *touches, cocos2d::Event *event); + virtual void ccTouchesMoved(cocos2d::Set *touches, cocos2d::Event *event); + virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event); + virtual void ccTouchesCancelled(cocos2d::Set *touches, cocos2d::Event *event); CREATE_FUNC(MutiTouchTestLayer) }; diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp index 2623a4da00..d48313c472 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -103,7 +103,7 @@ void TestCocosNodeDemo::onEnter() BaseTest::onEnter(); } -void TestCocosNodeDemo::restartCallback(Object* pSender) +void TestCocosNodeDemo::restartCallback(Object* sender) { Scene* s = new CocosNodeTestScene();//CCScene::create(); s->addChild(restartCocosNodeAction()); @@ -112,7 +112,7 @@ void TestCocosNodeDemo::restartCallback(Object* pSender) s->release(); } -void TestCocosNodeDemo::nextCallback(Object* pSender) +void TestCocosNodeDemo::nextCallback(Object* sender) { Scene* s = new CocosNodeTestScene();//CCScene::create(); s->addChild( nextCocosNodeAction() ); @@ -120,7 +120,7 @@ void TestCocosNodeDemo::nextCallback(Object* pSender) s->release(); } -void TestCocosNodeDemo::backCallback(Object* pSender) +void TestCocosNodeDemo::backCallback(Object* sender) { Scene* s = new CocosNodeTestScene();//CCScene::create(); s->addChild( backCocosNodeAction() ); diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h index ff220a6bff..a507f60599 100644 --- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h +++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h @@ -15,9 +15,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class Test2 : public TestCocosNodeDemo diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp index 0ede68f9cf..31d9fca350 100644 --- a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp @@ -132,9 +132,9 @@ Parallax2::Parallax2() addChild(voidNode, 0, kTagNode); } -void Parallax2::ccTouchesMoved(Set *pTouches, Event *pEvent) +void Parallax2::ccTouchesMoved(Set *touches, Event *event) { - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Point diff = touch->getDelta(); Node* node = getChildByTag(kTagNode); @@ -219,7 +219,7 @@ void ParallaxDemo::onEnter() BaseTest::onEnter(); } -void ParallaxDemo::restartCallback(Object* pSender) +void ParallaxDemo::restartCallback(Object* sender) { Scene* s = new ParallaxTestScene(); s->addChild(restartParallaxAction()); @@ -228,7 +228,7 @@ void ParallaxDemo::restartCallback(Object* pSender) s->release(); } -void ParallaxDemo::nextCallback(Object* pSender) +void ParallaxDemo::nextCallback(Object* sender) { Scene* s = new ParallaxTestScene(); s->addChild( nextParallaxAction() ); @@ -236,7 +236,7 @@ void ParallaxDemo::nextCallback(Object* pSender) s->release(); } -void ParallaxDemo::backCallback(Object* pSender) +void ParallaxDemo::backCallback(Object* sender) { Scene* s = new ParallaxTestScene(); s->addChild( backParallaxAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h index 24cd640da0..1dded76eb7 100644 --- a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h +++ b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h @@ -16,9 +16,9 @@ public: virtual std::string title(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class Parallax1 : public ParallaxDemo @@ -43,7 +43,7 @@ protected: public: Parallax2(); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesMoved(Set *touches, Event *event); virtual std::string title(); }; diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp index 2de579ec5c..065fb71d16 100644 --- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -1114,19 +1114,19 @@ std::string ParticleDemo::subtitle() return "No titile"; } -void ParticleDemo::ccTouchesBegan(Set *pTouches, Event *pEvent) +void ParticleDemo::ccTouchesBegan(Set *touches, Event *event) { - ccTouchesEnded(pTouches, pEvent); + ccTouchesEnded(touches, event); } -void ParticleDemo::ccTouchesMoved(Set *pTouches, Event *pEvent) +void ParticleDemo::ccTouchesMoved(Set *touches, Event *event) { - return ccTouchesEnded(pTouches, pEvent); + return ccTouchesEnded(touches, event); } -void ParticleDemo::ccTouchesEnded(Set *pTouches, Event *pEvent) +void ParticleDemo::ccTouchesEnded(Set *touches, Event *event) { - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Point location = touch->getLocation(); @@ -1153,7 +1153,7 @@ void ParticleDemo::update(float dt) } } -void ParticleDemo::toggleCallback(Object* pSender) +void ParticleDemo::toggleCallback(Object* sender) { if (_emitter != NULL) { @@ -1166,7 +1166,7 @@ void ParticleDemo::toggleCallback(Object* pSender) } } -void ParticleDemo::restartCallback(Object* pSender) +void ParticleDemo::restartCallback(Object* sender) { if (_emitter != NULL) { @@ -1174,7 +1174,7 @@ void ParticleDemo::restartCallback(Object* pSender) } } -void ParticleDemo::nextCallback(Object* pSender) +void ParticleDemo::nextCallback(Object* sender) { Scene* s = new ParticleTestScene(); s->addChild( nextParticleAction() ); @@ -1182,7 +1182,7 @@ void ParticleDemo::nextCallback(Object* pSender) s->release(); } -void ParticleDemo::backCallback(Object* pSender) +void ParticleDemo::backCallback(Object* sender) { Scene* s = new ParticleTestScene(); s->addChild( backParticleAction() ); diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h index b95730891c..65e6478d5a 100644 --- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h +++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h @@ -28,14 +28,14 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); - void toggleCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); + void toggleCallback(Object* sender); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); + virtual void ccTouchesEnded(Set *touches, Event *event); virtual void update(float dt); void setEmitterPosition(); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp index ed241cb72f..d2670f69d6 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -255,12 +255,12 @@ void ParticleMainScene::createParticleSystem() Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888); } -void ParticleMainScene::testNCallback(Object* pSender) +void ParticleMainScene::testNCallback(Object* sender) { - subtestNumber = ((Node*)pSender)->getTag(); + subtestNumber = static_cast(sender)->getTag(); - ParticleMenuLayer* menu = (ParticleMenuLayer*)getChildByTag(kTagMenuLayer); - menu->restartCallback(pSender); + auto menu = static_cast( getChildByTag(kTagMenuLayer) ); + menu->restartCallback(sender); } void ParticleMainScene::updateQuantityLabel() diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h index 6dad0146f0..2412ba975f 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h @@ -18,7 +18,7 @@ public: void step(float dt); void createParticleSystem(); - void testNCallback(Object* pSender); + void testNCallback(Object* sender); void updateQuantityLabel(); int getSubTestNum() { return subtestNumber; } int getParticlesNum() { return quantityParticles; } diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 492e9a01e1..8fc2774af8 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -354,11 +354,11 @@ SpriteMainScene::~SpriteMainScene() } } -void SpriteMainScene::testNCallback(Object* pSender) +void SpriteMainScene::testNCallback(Object* sender) { - subtestNumber = ((MenuItemFont*) pSender)->getTag(); - SpriteMenuLayer* menu = (SpriteMenuLayer*)getChildByTag(kTagMenuLayer); - menu->restartCallback(pSender); + subtestNumber = static_cast(sender)->getTag(); + auto menu = static_cast( getChildByTag(kTagMenuLayer) ); + menu->restartCallback(sender); } void SpriteMainScene::updateNodes() @@ -374,7 +374,7 @@ void SpriteMainScene::updateNodes() } } -void SpriteMainScene::onIncrease(Object* pSender) +void SpriteMainScene::onIncrease(Object* sender) { if( quantityNodes >= kMaxNodes) return; @@ -389,7 +389,7 @@ void SpriteMainScene::onIncrease(Object* pSender) updateNodes(); } -void SpriteMainScene::onDecrease(Object* pSender) +void SpriteMainScene::onDecrease(Object* sender) { if( quantityNodes <= 0 ) return; diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h index 9fd16220dc..da7f009ec3 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h @@ -37,9 +37,9 @@ public: void initWithSubTest(int nSubTest, int nNodes); void updateNodes(); - void testNCallback(Object* pSender); - void onIncrease(Object* pSender); - void onDecrease(Object* pSender); + void testNCallback(Object* sender); + void onIncrease(Object* sender); + void onDecrease(Object* sender); virtual void doTest(Sprite* sprite) = 0; diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp index 4f852ad552..6321671805 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp @@ -91,7 +91,7 @@ void PerformBasicLayer::onEnter() addChild(menu); } -void PerformBasicLayer::toMainLayer(Object* pSender) +void PerformBasicLayer::toMainLayer(Object* sender) { PerformanceTestScene* scene = new PerformanceTestScene(); scene->runThisTest(); @@ -99,12 +99,12 @@ void PerformBasicLayer::toMainLayer(Object* pSender) scene->release(); } -void PerformBasicLayer::restartCallback(Object* pSender) +void PerformBasicLayer::restartCallback(Object* sender) { showCurrentTest(); } -void PerformBasicLayer::nextCallback(Object* pSender) +void PerformBasicLayer::nextCallback(Object* sender) { _curCase++; _curCase = _curCase % _maxCases; @@ -112,7 +112,7 @@ void PerformBasicLayer::nextCallback(Object* pSender) showCurrentTest(); } -void PerformBasicLayer::backCallback(Object* pSender) +void PerformBasicLayer::backCallback(Object* sender) { _curCase--; if( _curCase < 0 ) diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h index 844c148595..95f0d38464 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h @@ -16,12 +16,12 @@ public: virtual void onEnter(); - virtual void restartCallback(Object* pSender); - virtual void nextCallback(Object* pSender); - virtual void backCallback(Object* pSender); + virtual void restartCallback(Object* sender); + virtual void nextCallback(Object* sender); + virtual void backCallback(Object* sender); virtual void showCurrentTest() = 0; - virtual void toMainLayer(Object* pSender); + virtual void toMainLayer(Object* sender); protected: bool _controlMenuVisible; diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index 2ed5b4cdf2..c0b76d3b2c 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -55,7 +55,7 @@ void RenderTextureTest::onEnter() BaseTest::onEnter(); } -void RenderTextureTest::restartCallback(Object* pSender) +void RenderTextureTest::restartCallback(Object* sender) { Scene* s = new RenderTextureScene(); s->addChild(restartTestCase()); @@ -64,7 +64,7 @@ void RenderTextureTest::restartCallback(Object* pSender) s->release(); } -void RenderTextureTest::nextCallback(Object* pSender) +void RenderTextureTest::nextCallback(Object* sender) { Scene* s = new RenderTextureScene(); s->addChild( nextTestCase() ); @@ -72,7 +72,7 @@ void RenderTextureTest::nextCallback(Object* pSender) s->release(); } -void RenderTextureTest::backCallback(Object* pSender) +void RenderTextureTest::backCallback(Object* sender) { Scene* s = new RenderTextureScene(); s->addChild( backTestCase() ); diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h index e220be3289..e0a3b891dd 100644 --- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h +++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h @@ -12,9 +12,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class RenderTextureSave : public RenderTextureTest diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp index 018f9ec325..4c175f8ede 100644 --- a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp +++ b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp @@ -60,7 +60,7 @@ SceneTestLayer1::~SceneTestLayer1() //NSLog(@"SceneTestLayer1 - dealloc"); } -void SceneTestLayer1::onPushScene(Object* pSender) +void SceneTestLayer1::onPushScene(Object* sender) { Scene* scene = new SceneTestScene(); Layer* layer = new SceneTestLayer2(); @@ -70,7 +70,7 @@ void SceneTestLayer1::onPushScene(Object* pSender) layer->release(); } -void SceneTestLayer1::onPushSceneTran(Object* pSender) +void SceneTestLayer1::onPushSceneTran(Object* sender) { Scene* scene = new SceneTestScene(); Layer* layer = new SceneTestLayer2(); @@ -82,7 +82,7 @@ void SceneTestLayer1::onPushSceneTran(Object* pSender) } -void SceneTestLayer1::onQuit(Object* pSender) +void SceneTestLayer1::onQuit(Object* sender) { //getCocosApp()->exit(); //CCDirector::getInstance()->poscene(); @@ -130,12 +130,12 @@ void SceneTestLayer2::testDealloc(float dt) // onReplaceScene(this); } -void SceneTestLayer2::onGoBack(Object* pSender) +void SceneTestLayer2::onGoBack(Object* sender) { Director::getInstance()->popScene(); } -void SceneTestLayer2::onReplaceScene(Object* pSender) +void SceneTestLayer2::onReplaceScene(Object* sender) { Scene* scene = new SceneTestScene(); Layer* layer = SceneTestLayer3::create(); @@ -145,7 +145,7 @@ void SceneTestLayer2::onReplaceScene(Object* pSender) } -void SceneTestLayer2::onReplaceSceneTran(Object* pSender) +void SceneTestLayer2::onReplaceSceneTran(Object* sender) { Scene* scene = new SceneTestScene(); Layer* layer = SceneTestLayer3::create(); @@ -198,24 +198,24 @@ void SceneTestLayer3::testDealloc(float dt) log("Layer3:testDealloc"); } -void SceneTestLayer3::item0Clicked(Object* pSender) +void SceneTestLayer3::item0Clicked(Object* sender) { Scene *newScene = Scene::create(); newScene->addChild(SceneTestLayer3::create()); Director::getInstance()->pushScene(TransitionFade::create(0.5, newScene, Color3B(0,255,255))); } -void SceneTestLayer3::item1Clicked(Object* pSender) +void SceneTestLayer3::item1Clicked(Object* sender) { Director::getInstance()->popScene(); } -void SceneTestLayer3::item2Clicked(Object* pSender) +void SceneTestLayer3::item2Clicked(Object* sender) { Director::getInstance()->popToRootScene(); } -void SceneTestLayer3::item3Clicked(Object* pSender) +void SceneTestLayer3::item3Clicked(Object* sender) { Director::getInstance()->popToSceneStackLevel(2); } diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h index ba6302e8fc..b79ff0a656 100644 --- a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h +++ b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h @@ -14,9 +14,9 @@ public: virtual void onEnterTransitionDidFinish(); void testDealloc(float dt); - void onPushScene(Object* pSender); - void onPushSceneTran(Object* pSender); - void onQuit(Object* pSender); + void onPushScene(Object* sender); + void onPushSceneTran(Object* sender); + void onQuit(Object* sender); //CREATE_NODE(SceneTestLayer1); } ; @@ -28,9 +28,9 @@ public: SceneTestLayer2(); void testDealloc(float dt); - void onGoBack(Object* pSender); - void onReplaceScene(Object* pSender); - void onReplaceSceneTran(Object* pSender); + void onGoBack(Object* sender); + void onReplaceScene(Object* sender); + void onReplaceSceneTran(Object* sender); //CREATE_NODE(SceneTestLayer2); } ; @@ -41,10 +41,10 @@ public: SceneTestLayer3(); bool init(); virtual void testDealloc(float dt); - void item0Clicked(Object* pSender); - void item1Clicked(Object* pSender); - void item2Clicked(Object* pSender); - void item3Clicked(Object* pSender); + void item0Clicked(Object* sender); + void item1Clicked(Object* sender); + void item2Clicked(Object* sender); + void item3Clicked(Object* sender); CREATE_FUNC(SceneTestLayer3) } ; diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp index 94e094198a..6244072167 100644 --- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp @@ -94,7 +94,7 @@ void SchedulerTestLayer::onEnter() BaseTest::onEnter(); } -void SchedulerTestLayer::backCallback(Object* pSender) +void SchedulerTestLayer::backCallback(Object* sender) { Scene* scene = new SchedulerTestScene(); Layer* layer = backSchedulerTest(); @@ -104,7 +104,7 @@ void SchedulerTestLayer::backCallback(Object* pSender) scene->release(); } -void SchedulerTestLayer::nextCallback(Object* pSender) +void SchedulerTestLayer::nextCallback(Object* sender) { Scene* scene = new SchedulerTestScene(); Layer* layer = nextSchedulerTest(); @@ -114,7 +114,7 @@ void SchedulerTestLayer::nextCallback(Object* pSender) scene->release(); } -void SchedulerTestLayer::restartCallback(Object* pSender) +void SchedulerTestLayer::restartCallback(Object* sender) { Scene* scene = new SchedulerTestScene(); Layer* layer = restartSchedulerTest(); @@ -874,9 +874,9 @@ ControlSlider* SchedulerTimeScale::sliderCtl() return slider; } -void SchedulerTimeScale::sliderAction(Object* pSender, ControlEvent controlEvent) +void SchedulerTimeScale::sliderAction(Object* sender, ControlEvent controlEvent) { - ControlSlider* pSliderCtl = static_cast(pSender); + ControlSlider* pSliderCtl = static_cast(sender); float scale; scale = pSliderCtl->getValue(); diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h index 464ffff35a..34ea78d2bf 100644 --- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h +++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h @@ -16,9 +16,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void backCallback(Object* pSender); - void nextCallback(Object* pSender); - void restartCallback(Object* pSender); + void backCallback(Object* sender); + void nextCallback(Object* sender); + void restartCallback(Object* sender); }; // class SchedulerTestLayer : Layer @@ -228,7 +228,7 @@ public: virtual std::string title(); virtual std::string subtitle(); ControlSlider* sliderCtl(); - void sliderAction(Object* pSender, ControlEvent controlEvent); + void sliderAction(Object* sender, ControlEvent controlEvent); ControlSlider* _sliderCtl; }; diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp index 258070f96a..b801c1cf55 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp @@ -62,7 +62,7 @@ ShaderTestDemo::ShaderTestDemo() } -void ShaderTestDemo::backCallback(Object* pSender) +void ShaderTestDemo::backCallback(Object* sender) { Scene* s = new ShaderTestScene(); s->addChild( backAction() ); @@ -70,7 +70,7 @@ void ShaderTestDemo::backCallback(Object* pSender) s->release(); } -void ShaderTestDemo::nextCallback(Object* pSender) +void ShaderTestDemo::nextCallback(Object* sender) { Scene* s = new ShaderTestScene();//CCScene::create(); s->addChild( nextAction() ); @@ -88,7 +88,7 @@ std::string ShaderTestDemo::subtitle() return ""; } -void ShaderTestDemo::restartCallback(Object* pSender) +void ShaderTestDemo::restartCallback(Object* sender) { Scene* s = new ShaderTestScene(); s->addChild(restartAction()); diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h index 09f70b987c..6ab3ed7559 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h @@ -15,9 +15,9 @@ public: virtual std::string title(); virtual std::string subtitle(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); CREATE_FUNC(ShaderTestDemo); }; diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index c9040a298f..e04e178c10 100644 --- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -65aa6a64b1eca738a6ddf151ab860c76eb5dd107 \ No newline at end of file +8853550dc382b38c368250fb940660f35ee5ad4d \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h index ea4d175666..7cd867b38c 100644 --- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h +++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h @@ -19,9 +19,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class Sprite1 : public SpriteTestDemo diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp index cda39d5f81..55ccc82be6 100644 --- a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp @@ -78,7 +78,7 @@ TextInputTest::TextInputTest() } -void TextInputTest::restartCallback(Object* pSender) +void TextInputTest::restartCallback(Object* sender) { Scene* s = new TextInputTestScene(); s->addChild(restartTextInputTest()); @@ -87,7 +87,7 @@ void TextInputTest::restartCallback(Object* pSender) s->release(); } -void TextInputTest::nextCallback(Object* pSender) +void TextInputTest::nextCallback(Object* sender) { Scene* s = new TextInputTestScene(); s->addChild( nextTextInputTest() ); @@ -95,7 +95,7 @@ void TextInputTest::nextCallback(Object* pSender) s->release(); } -void TextInputTest::backCallback(Object* pSender) +void TextInputTest::backCallback(Object* sender) { Scene* s = new TextInputTestScene(); s->addChild( backTextInputTest() ); @@ -175,21 +175,21 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in // Layer function -bool KeyboardNotificationLayer::ccTouchBegan(Touch *pTouch, Event *pEvent) +bool KeyboardNotificationLayer::ccTouchBegan(Touch *touch, Event *event) { CCLOG("++++++++++++++++++++++++++++++++++++++++++++"); - _beginPos = pTouch->getLocation(); + _beginPos = touch->getLocation(); return true; } -void KeyboardNotificationLayer::ccTouchEnded(Touch *pTouch, Event *pEvent) +void KeyboardNotificationLayer::ccTouchEnded(Touch *touch, Event *event) { if (! _trackNode) { return; } - Point endPos = pTouch->getLocation(); + Point endPos = touch->getLocation(); float delta = 5.0f; if (::abs(endPos.x - _beginPos.x) > delta @@ -202,7 +202,7 @@ void KeyboardNotificationLayer::ccTouchEnded(Touch *pTouch, Event *pEvent) // decide the trackNode is clicked. Rect rect; - Point point = convertTouchToNodeSpaceAR(pTouch); + Point point = convertTouchToNodeSpaceAR(touch); CCLOG("KeyboardNotificationLayer:clickedAt(%f,%f)", point.x, point.y); rect = getRect(_trackNode); @@ -331,7 +331,7 @@ void TextFieldTTFActionTest::onExit() } // TextFieldDelegate protocol -bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * pSender) +bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * sender) { if (! _action) { @@ -341,7 +341,7 @@ bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * pSender) return false; } -bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * pSender) +bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * sender) { if (_action) { @@ -352,7 +352,7 @@ bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * pSender) return false; } -bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen) +bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const char * text, int nLen) { // if insert enter, treat as default to detach with ime if ('\n' == *text) @@ -361,7 +361,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const } // if the textfield's char count more than _charLimit, doesn't insert text anymore. - if (pSender->getCharCount() >= _charLimit) + if (sender->getCharCount() >= _charLimit) { return true; } @@ -373,10 +373,10 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const label->setColor(color); // move the sprite from top to position - Point endPos = pSender->getPosition(); - if (pSender->getCharCount()) + Point endPos = sender->getPosition(); + if (sender->getCharCount()) { - endPos.x += pSender->getContentSize().width / 2; + endPos.x += sender->getContentSize().width / 2; } Size inputTextSize = label->getContentSize(); Point beginPos(endPos.x, Director::getInstance()->getWinSize().height - inputTextSize.height * 2); @@ -397,15 +397,15 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const return false; } -bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen) +bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, int nLen) { // create a delete text sprite and do some action LabelTTF * label = LabelTTF::create(delText, FONT_NAME, FONT_SIZE); this->addChild(label); // move the sprite to fly out - Point beginPos = pSender->getPosition(); - Size textfieldSize = pSender->getContentSize(); + Point beginPos = sender->getPosition(); + Size textfieldSize = sender->getContentSize(); Size labelSize = label->getContentSize(); beginPos.x += (textfieldSize.width - labelSize.width) / 2.0f; @@ -431,7 +431,7 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * pSender, c return false; } -bool TextFieldTTFActionTest::onDraw(TextFieldTTF * pSender) +bool TextFieldTTFActionTest::onDraw(TextFieldTTF * sender) { return false; } diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h index ed4ed39a35..237a62c615 100644 --- a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h +++ b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h @@ -15,9 +15,9 @@ class TextInputTest : public BaseTest public: TextInputTest(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); std::string title(); void addKeyboardNotificationLayer(KeyboardNotificationLayer * layer); @@ -41,8 +41,8 @@ public: virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info); // Layer - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent); - virtual void ccTouchEnded(Touch *pTouch, Event *pEvent); + virtual bool ccTouchBegan(Touch *touch, Event *event); + virtual void ccTouchEnded(Touch *touch, Event *event); protected: Node * _trackNode; @@ -87,11 +87,11 @@ public: virtual void onExit(); // TextFieldDelegate - virtual bool onTextFieldAttachWithIME(TextFieldTTF * pSender); - virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender); - virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen); - virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen); - virtual bool onDraw(TextFieldTTF * pSender); + virtual bool onTextFieldAttachWithIME(TextFieldTTF * sender); + virtual bool onTextFieldDetachWithIME(TextFieldTTF * sender); + virtual bool onTextFieldInsertText(TextFieldTTF * sender, const char * text, int nLen); + virtual bool onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, int nLen); + virtual bool onDraw(TextFieldTTF * sender); }; class TextInputTestScene : public TestScene diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index 709825df7d..f3e7aa92a2 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -130,7 +130,7 @@ TextureDemo::~TextureDemo() TextureCache::getInstance()->dumpCachedTextureInfo(); } -void TextureDemo::restartCallback(Object* pSender) +void TextureDemo::restartCallback(Object* sender) { Scene *s = new TextureTestScene(); s->addChild(restartTextureTest()); @@ -138,7 +138,7 @@ void TextureDemo::restartCallback(Object* pSender) s->autorelease(); } -void TextureDemo::nextCallback(Object* pSender) +void TextureDemo::nextCallback(Object* sender) { Scene *s = new TextureTestScene(); s->addChild(nextTextureTest()); @@ -146,7 +146,7 @@ void TextureDemo::nextCallback(Object* pSender) s->autorelease(); } -void TextureDemo::backCallback(Object* pSender) +void TextureDemo::backCallback(Object* sender) { Scene *s = new TextureTestScene(); s->addChild(backTextureTest()); diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h index b557237c98..581c4b59bb 100644 --- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h +++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h @@ -13,9 +13,9 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); }; class TextureTIFF : public TextureDemo diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 729f28c3a7..943f9d6485 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1452,7 +1452,7 @@ void TileDemo::onEnter() BaseTest::onEnter(); } -void TileDemo::restartCallback(Object* pSender) +void TileDemo::restartCallback(Object* sender) { Scene* s = new TileMapTestScene(); s->addChild(restartTileMapAction()); @@ -1461,7 +1461,7 @@ void TileDemo::restartCallback(Object* pSender) s->release(); } -void TileDemo::nextCallback(Object* pSender) +void TileDemo::nextCallback(Object* sender) { Scene* s = new TileMapTestScene(); s->addChild( nextTileMapAction() ); @@ -1469,7 +1469,7 @@ void TileDemo::nextCallback(Object* pSender) s->release(); } -void TileDemo::backCallback(Object* pSender) +void TileDemo::backCallback(Object* sender) { Scene* s = new TileMapTestScene(); s->addChild( backTileMapAction() ); @@ -1477,9 +1477,9 @@ void TileDemo::backCallback(Object* pSender) s->release(); } -void TileDemo::ccTouchesMoved(Set *pTouches, Event *pEvent) +void TileDemo::ccTouchesMoved(Set *touches, Event *event) { - Touch *touch = (Touch*)pTouches->anyObject(); + Touch *touch = static_cast(touches->anyObject()); Point diff = touch->getDelta(); Node *node = getChildByTag(kTagTileMap); diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h index 0eb38c8196..a3aa9ae0e0 100644 --- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h +++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h @@ -14,11 +14,11 @@ public: virtual std::string subtitle(); virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesMoved(Set *touches, Event *event); }; class TileMapTest : public TileDemo diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index 76061e3c60..e79f1c58a6 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -318,7 +318,7 @@ TestLayer1::~TestLayer1(void) } -void TestLayer1::restartCallback(Object* pSender) +void TestLayer1::restartCallback(Object* sender) { Scene* s = new TransitionsTestScene(); @@ -334,7 +334,7 @@ void TestLayer1::restartCallback(Object* pSender) } } -void TestLayer1::nextCallback(Object* pSender) +void TestLayer1::nextCallback(Object* sender) { s_nSceneIdx++; s_nSceneIdx = s_nSceneIdx % MAX_LAYER; @@ -353,7 +353,7 @@ void TestLayer1::nextCallback(Object* pSender) } } -void TestLayer1::backCallback(Object* pSender) +void TestLayer1::backCallback(Object* sender) { s_nSceneIdx--; int total = MAX_LAYER; @@ -447,7 +447,7 @@ TestLayer2::~TestLayer2() } -void TestLayer2::restartCallback(Object* pSender) +void TestLayer2::restartCallback(Object* sender) { Scene* s = new TransitionsTestScene(); @@ -463,7 +463,7 @@ void TestLayer2::restartCallback(Object* pSender) } } -void TestLayer2::nextCallback(Object* pSender) +void TestLayer2::nextCallback(Object* sender) { s_nSceneIdx++; s_nSceneIdx = s_nSceneIdx % MAX_LAYER; @@ -482,7 +482,7 @@ void TestLayer2::nextCallback(Object* pSender) } } -void TestLayer2::backCallback(Object* pSender) +void TestLayer2::backCallback(Object* sender) { s_nSceneIdx--; int total = MAX_LAYER; diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h index c488a15361..ccf7ba3100 100644 --- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h +++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h @@ -17,9 +17,9 @@ public: TestLayer1(void); ~TestLayer1(void); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); void step(float dt); @@ -35,9 +35,9 @@ public: TestLayer2(void); ~TestLayer2(void); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); void step(float dt); diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp index ef3b133d5e..afb4388c5d 100644 --- a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -61,21 +61,21 @@ void ZwoptexTest::onEnter() BaseTest::onEnter(); } -void ZwoptexTest::restartCallback(Object* pSender) +void ZwoptexTest::restartCallback(Object* sender) { Scene *s = ZwoptexTestScene::create(); s->addChild(restartZwoptexTest()); Director::getInstance()->replaceScene(s); } -void ZwoptexTest::nextCallback(Object* pSender) +void ZwoptexTest::nextCallback(Object* sender) { Scene *s = ZwoptexTestScene::create(); s->addChild(nextZwoptexTest()); Director::getInstance()->replaceScene(s); } -void ZwoptexTest::backCallback(Object* pSender) +void ZwoptexTest::backCallback(Object* sender) { Scene *s = ZwoptexTestScene::create(); s->addChild(backZwoptexTest()); diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h index 6b3f25744b..76b8cc0ef4 100644 --- a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h +++ b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h @@ -9,9 +9,9 @@ class ZwoptexTest : public BaseTest public: virtual void onEnter(); - void restartCallback(Object* pSender); - void nextCallback(Object* pSender); - void backCallback(Object* pSender); + void restartCallback(Object* sender); + void nextCallback(Object* sender); + void backCallback(Object* sender); virtual std::string title(); virtual std::string subtitle(); diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/samples/Cpp/TestCpp/Classes/controller.cpp index 522bb1c052..7846a7332d 100644 --- a/samples/Cpp/TestCpp/Classes/controller.cpp +++ b/samples/Cpp/TestCpp/Classes/controller.cpp @@ -129,13 +129,13 @@ TestController::~TestController() { } -void TestController::menuCallback(Object * pSender) +void TestController::menuCallback(Object * sender) { Director::getInstance()->purgeCachedData(); // get the userdata, it's the index of the menu item clicked - MenuItem* menuItem = (MenuItem *)(pSender); + MenuItem* menuItem = static_cast(sender); int idx = menuItem->getZOrder() - 10000; // create the test scene and run it @@ -148,7 +148,7 @@ void TestController::menuCallback(Object * pSender) } } -void TestController::closeCallback(Object * pSender) +void TestController::closeCallback(Object * sender) { Director::getInstance()->end(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) @@ -156,16 +156,16 @@ void TestController::closeCallback(Object * pSender) #endif } -void TestController::ccTouchesBegan(Set *pTouches, Event *pEvent) +void TestController::ccTouchesBegan(Set *touches, Event *event) { - Touch* touch = (Touch*)pTouches->anyObject(); + Touch* touch = static_cast(touches->anyObject()); _beginPos = touch->getLocation(); } -void TestController::ccTouchesMoved(Set *pTouches, Event *pEvent) +void TestController::ccTouchesMoved(Set *touches, Event *event) { - Touch* touch = (Touch*)pTouches->anyObject(); + Touch* touch = static_cast(touches->anyObject()); Point touchLocation = touch->getLocation(); float nMoveY = touchLocation.y - _beginPos.y; diff --git a/samples/Cpp/TestCpp/Classes/controller.h b/samples/Cpp/TestCpp/Classes/controller.h index 52b1d52a37..0dd5998640 100644 --- a/samples/Cpp/TestCpp/Classes/controller.h +++ b/samples/Cpp/TestCpp/Classes/controller.h @@ -11,11 +11,11 @@ public: TestController(); ~TestController(); - void menuCallback(Object * pSender); - void closeCallback(Object * pSender); + void menuCallback(Object * sender); + void closeCallback(Object * sender); - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent); - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent); + virtual void ccTouchesBegan(Set *touches, Event *event); + virtual void ccTouchesMoved(Set *touches, Event *event); private: Point _beginPos;