mirror of https://github.com/axmolengine/axmol.git
Removes Hungarian notation
Removes Hungarian notation from the code.
This commit is contained in:
parent
d683e10808
commit
058935aa8d
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<std::string, std::string>::iterator cacheIter = _fullPathCache.find(pszFileName);
|
||||
std::map<std::string, std::string>::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<std::string, std::string>(pszFileName, fullpath));
|
||||
_fullPathCache.insert(std::pair<std::string, std::string>(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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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".
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -77,7 +77,7 @@ bool HelloWorld::init()
|
|||
}
|
||||
|
||||
|
||||
void HelloWorld::menuCloseCallback(Object* pSender)
|
||||
void HelloWorld::menuCloseCallback(Object* sender)
|
||||
{
|
||||
Director::getInstance()->end();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<Touch*>( touches->anyObject() );
|
||||
Point location = touch->getLocation();
|
||||
|
||||
log("++++++++after x:%f, y:%f", location.x, location.y);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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!");
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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<Touch*>(*it);
|
||||
|
||||
if(!touch)
|
||||
break;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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<Touch*>( 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<Touch*>( 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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<Touch*>( touches->anyObject() );
|
||||
|
||||
Point location = touch->getLocation();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Touch*>(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<Touch*>(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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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--;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
|
@ -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<Touch*>( touches->anyObject() );
|
||||
Point location = touch->getLocation();
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<Touch*>(pTouches->anyObject());
|
||||
Touch* touch = static_cast<Touch*>(touches->anyObject());
|
||||
|
||||
_beginPos = touch->getLocation();
|
||||
}
|
||||
|
||||
void ExtensionsMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent)
|
||||
void ExtensionsMainLayer::ccTouchesMoved(Set *touches, Event *event)
|
||||
{
|
||||
Touch* touch = static_cast<Touch*>(pTouches->anyObject());
|
||||
Touch* touch = static_cast<Touch*>(touches->anyObject());
|
||||
|
||||
Point touchLocation = touch->getLocation();
|
||||
float nMoveY = touchLocation.y - _beginPos.y;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Touch*>(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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<LayerMultiplex*>(_parent)->switchTo(2);
|
||||
}
|
||||
|
||||
void MenuLayerMainMenu::menuCallbackPriorityTest(Object* pSender)
|
||||
void MenuLayerMainMenu::menuCallbackPriorityTest(Object* sender)
|
||||
{
|
||||
static_cast<LayerMultiplex*>(_parent)->switchTo(4);
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ MenuLayerPriorityTest::~MenuLayerPriorityTest()
|
|||
|
||||
}
|
||||
|
||||
void MenuLayerPriorityTest::menuCallback(Object* pSender)
|
||||
void MenuLayerPriorityTest::menuCallback(Object* sender)
|
||||
{
|
||||
static_cast<LayerMultiplex*>(_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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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<Touch*>(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<Touch*>(item);
|
||||
TouchPoint* pTP = static_cast<TouchPoint*>(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<Touch*>(item);
|
||||
TouchPoint* pTP = static_cast<TouchPoint*>(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()
|
||||
|
|
|
@ -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)
|
||||
};
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Touch*>(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() );
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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<Touch*>(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() );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<Node*>(sender)->getTag();
|
||||
|
||||
ParticleMenuLayer* menu = (ParticleMenuLayer*)getChildByTag(kTagMenuLayer);
|
||||
menu->restartCallback(pSender);
|
||||
auto menu = static_cast<ParticleMenuLayer*>( getChildByTag(kTagMenuLayer) );
|
||||
menu->restartCallback(sender);
|
||||
}
|
||||
|
||||
void ParticleMainScene::updateQuantityLabel()
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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<MenuItemFont*>(sender)->getTag();
|
||||
auto menu = static_cast<SpriteMenuLayer*>( 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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
} ;
|
||||
|
||||
|
|
|
@ -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<ControlSlider*>(pSender);
|
||||
ControlSlider* pSliderCtl = static_cast<ControlSlider*>(sender);
|
||||
float scale;
|
||||
scale = pSliderCtl->getValue();
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue