mirror of https://github.com/axmolengine/axmol.git
Fix all compiler warnings produced by gcc.
This allows the linux and NaCl builds (and perhaps others) to be compiles with -Wall and -Werror, and it makes the build output much less noisy.
This commit is contained in:
parent
da0aadefe4
commit
38878b084b
|
@ -45,7 +45,6 @@ void FmodAudioPlayer::init() {
|
|||
FMOD_RESULT result;
|
||||
FMOD::ChannelGroup *masterChannelGroup;
|
||||
|
||||
unsigned int version;
|
||||
/*
|
||||
Create a System object and initialize.
|
||||
*/
|
||||
|
|
|
@ -37,13 +37,13 @@ CCConfiguration* CCConfiguration::s_gSharedConfiguration = NULL;
|
|||
CCConfiguration::CCConfiguration(void)
|
||||
: m_nMaxTextureSize(0)
|
||||
, m_nMaxModelviewStackDepth(0)
|
||||
, m_nMaxTextureUnits(0)
|
||||
, m_bSupportsPVRTC(false)
|
||||
, m_bSupportsNPOT(false)
|
||||
, m_bSupportsBGRA8888(false)
|
||||
, m_bSupportsShareableVAO(false)
|
||||
, m_bSupportsDiscardFramebuffer(false)
|
||||
, m_bSupportsShareableVAO(false)
|
||||
, m_nMaxSamplesAllowed(0)
|
||||
, m_nMaxTextureUnits(0)
|
||||
, m_pGlExtensions(NULL)
|
||||
{
|
||||
}
|
||||
|
@ -77,14 +77,13 @@ bool CCConfiguration::init(void)
|
|||
CCLOG("cocos2d: GL supports discard_framebuffer: %s", (m_bSupportsDiscardFramebuffer ? "YES" : "NO"));
|
||||
CCLOG("cocos2d: GL supports shareable VAO: %s", (m_bSupportsShareableVAO ? "YES" : "NO") );
|
||||
|
||||
bool bEnableProfilers = false;
|
||||
bool CC_UNUSED bEnableProfilers = false;
|
||||
|
||||
#if CC_ENABLE_PROFILERS
|
||||
bEnableProfilers = true;
|
||||
#else
|
||||
bEnableProfilers = false;
|
||||
bEnableProfilers = false;
|
||||
#endif
|
||||
|
||||
CCLOG("cocos2d: compiled with Profiling Support: %s",
|
||||
bEnableProfilers ? "YES - *** Disable it when you finish profiling ***" : "NO");
|
||||
|
||||
|
|
|
@ -71,15 +71,15 @@ typedef struct _hashSelectorEntry
|
|||
// implementation CCTimer
|
||||
|
||||
CCTimer::CCTimer()
|
||||
: m_pfnSelector(NULL)
|
||||
, m_fInterval(0.0f)
|
||||
, m_pTarget(NULL)
|
||||
: m_pTarget(NULL)
|
||||
, m_fElapsed(-1)
|
||||
, m_bRunForever(false)
|
||||
, m_bUseDelay(false)
|
||||
, m_uTimesExecuted(0)
|
||||
, m_uRepeat(0)
|
||||
, m_fDelay(0.0f)
|
||||
, m_fInterval(0.0f)
|
||||
, m_pfnSelector(NULL)
|
||||
, m_nScriptHandler(0)
|
||||
{
|
||||
}
|
||||
|
@ -243,8 +243,8 @@ CCScheduler::CCScheduler(void)
|
|||
, m_pHashForTimers(NULL)
|
||||
, m_pCurrentTarget(NULL)
|
||||
, m_bCurrentTargetSalvaged(false)
|
||||
, m_pScriptHandlerEntries(NULL)
|
||||
, m_bUpdateHashLocked(false)
|
||||
, m_pScriptHandlerEntries(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ void CCScheduler::unscheduleScriptEntry(unsigned int uScheduleScriptEntryID)
|
|||
for (int i = m_pScriptHandlerEntries->count() - 1; i >= 0; i--)
|
||||
{
|
||||
CCSchedulerScriptHandlerEntry* pEntry = static_cast<CCSchedulerScriptHandlerEntry*>(m_pScriptHandlerEntries->objectAtIndex(i));
|
||||
if (pEntry->getEntryId() == uScheduleScriptEntryID)
|
||||
if (pEntry->getEntryId() == (int)uScheduleScriptEntryID)
|
||||
{
|
||||
pEntry->markedForDeletion();
|
||||
break;
|
||||
|
|
|
@ -261,8 +261,8 @@ CCCardinalSplineTo::~CCCardinalSplineTo()
|
|||
|
||||
CCCardinalSplineTo::CCCardinalSplineTo()
|
||||
: m_pPoints(NULL)
|
||||
, m_fTension(0.f)
|
||||
, m_fDeltaT(0.f)
|
||||
, m_fTension(0.f)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ void CCShuffleTiles::startWithTarget(CCNode *pTarget)
|
|||
{
|
||||
CCTiledGrid3DAction::startWithTarget(pTarget);
|
||||
|
||||
if (m_nSeed != -1)
|
||||
if (m_nSeed != (unsigned int)-1)
|
||||
{
|
||||
srand(m_nSeed);
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ void CCTurnOffTiles::startWithTarget(CCNode *pTarget)
|
|||
|
||||
CCTiledGrid3DAction::startWithTarget(pTarget);
|
||||
|
||||
if (m_nSeed != -1)
|
||||
if (m_nSeed != (unsigned int)-1)
|
||||
{
|
||||
srand(m_nSeed);
|
||||
}
|
||||
|
@ -1060,4 +1060,4 @@ void CCSplitCols::update(float time)
|
|||
}
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
NS_CC_END
|
||||
|
|
|
@ -52,42 +52,42 @@ NS_CC_BEGIN
|
|||
static int s_globalOrderOfArrival = 1;
|
||||
|
||||
CCNode::CCNode(void)
|
||||
: m_nZOrder(0)
|
||||
, m_fVertexZ(0.0f)
|
||||
, m_fRotationX(0.0f)
|
||||
: m_fRotationX(0.0f)
|
||||
, m_fRotationY(0.0f)
|
||||
, m_fScaleX(1.0f)
|
||||
, m_fScaleY(1.0f)
|
||||
, m_fVertexZ(0.0f)
|
||||
, m_obPosition(CCPointZero)
|
||||
, m_fSkewX(0.0f)
|
||||
, m_fSkewY(0.0f)
|
||||
// children (lazy allocs)
|
||||
, m_pChildren(NULL)
|
||||
// lazy alloc
|
||||
, m_pCamera(NULL)
|
||||
, m_pGrid(NULL)
|
||||
, m_bVisible(true)
|
||||
, m_obAnchorPoint(CCPointZero)
|
||||
, m_obAnchorPointInPoints(CCPointZero)
|
||||
, m_obAnchorPoint(CCPointZero)
|
||||
, m_obContentSize(CCSizeZero)
|
||||
, m_bRunning(false)
|
||||
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
|
||||
, m_pCamera(NULL)
|
||||
// children (lazy allocs)
|
||||
// lazy alloc
|
||||
, m_pGrid(NULL)
|
||||
, m_nZOrder(0)
|
||||
, m_pChildren(NULL)
|
||||
, m_pParent(NULL)
|
||||
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to false
|
||||
, m_bIgnoreAnchorPointForPosition(false)
|
||||
, m_nTag(kCCNodeTagInvalid)
|
||||
// userData is always inited as nil
|
||||
, m_pUserData(NULL)
|
||||
, m_pUserObject(NULL)
|
||||
, m_pShaderProgram(NULL)
|
||||
, m_eGLServerState(ccGLServerState(0))
|
||||
, m_uOrderOfArrival(0)
|
||||
, m_bRunning(false)
|
||||
, m_bTransformDirty(true)
|
||||
, m_bInverseDirty(true)
|
||||
, m_bAdditionalTransformDirty(false)
|
||||
, m_bVisible(true)
|
||||
, m_bIgnoreAnchorPointForPosition(false)
|
||||
, m_bReorderChildDirty(false)
|
||||
, m_nScriptHandler(0)
|
||||
, m_nUpdateScriptHandler(0)
|
||||
, m_pShaderProgram(NULL)
|
||||
, m_uOrderOfArrival(0)
|
||||
, m_eGLServerState(ccGLServerState(0))
|
||||
, m_bReorderChildDirty(false)
|
||||
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
|
||||
, m_bAdditionalTransformDirty(false)
|
||||
{
|
||||
// set default scheduler and actionManager
|
||||
CCDirector *director = CCDirector::sharedDirector();
|
||||
|
|
|
@ -38,9 +38,9 @@ CCObject* CCCopying::copyWithZone(CCZone *pZone)
|
|||
}
|
||||
|
||||
CCObject::CCObject(void)
|
||||
:m_uAutoReleaseCount(0)
|
||||
,m_uReference(1) // when the object is created, the reference count of it is 1
|
||||
,m_nLuaID(0)
|
||||
: m_nLuaID(0)
|
||||
, m_uReference(1) // when the object is created, the reference count of it is 1
|
||||
, m_uAutoReleaseCount(0)
|
||||
{
|
||||
static unsigned int uObjectCount = 0;
|
||||
|
||||
|
|
|
@ -518,17 +518,17 @@ bool CCLabelBMFont::initWithString(const char *theString, const char *fntFile, f
|
|||
}
|
||||
|
||||
CCLabelBMFont::CCLabelBMFont()
|
||||
: m_cDisplayedOpacity(255)
|
||||
: m_sString(NULL)
|
||||
, m_pConfiguration(NULL)
|
||||
, m_bLineBreakWithoutSpaces(false)
|
||||
, m_tImageOffset(CCPointZero)
|
||||
, m_cDisplayedOpacity(255)
|
||||
, m_cRealOpacity(255)
|
||||
, m_tDisplayedColor(ccWHITE)
|
||||
, m_tRealColor(ccWHITE)
|
||||
, m_bCascadeOpacityEnabled(true)
|
||||
, m_bCascadeColorEnabled(true)
|
||||
, m_bCascadeOpacityEnabled(true)
|
||||
, m_bIsOpacityModifyRGB(false)
|
||||
, m_pConfiguration(NULL)
|
||||
, m_sString(NULL)
|
||||
, m_bLineBreakWithoutSpaces(false)
|
||||
, m_tImageOffset(CCPointZero)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -275,9 +275,12 @@ protected:
|
|||
CCSprite *m_pReusedChar;
|
||||
|
||||
// texture RGBA
|
||||
GLubyte m_cDisplayedOpacity, m_cRealOpacity;
|
||||
ccColor3B m_tDisplayedColor, m_tRealColor;
|
||||
bool m_bCascadeColorEnabled, m_bCascadeOpacityEnabled;
|
||||
GLubyte m_cDisplayedOpacity;
|
||||
GLubyte m_cRealOpacity;
|
||||
ccColor3B m_tDisplayedColor;
|
||||
ccColor3B m_tRealColor;
|
||||
bool m_bCascadeColorEnabled;
|
||||
bool m_bCascadeOpacityEnabled;
|
||||
/** conforms to CCRGBAProtocol protocol */
|
||||
bool m_bIsOpacityModifyRGB;
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ CCLayer::CCLayer()
|
|||
: m_bTouchEnabled(false)
|
||||
, m_bAccelerometerEnabled(false)
|
||||
, m_bKeypadEnabled(false)
|
||||
,m_pScriptTouchHandlerEntry(NULL)
|
||||
,m_pScriptKeypadHandlerEntry(NULL)
|
||||
,m_pScriptAccelerateHandlerEntry(NULL)
|
||||
, m_eTouchMode(kCCTouchesAllAtOnce)
|
||||
, m_pScriptTouchHandlerEntry(NULL)
|
||||
, m_pScriptKeypadHandlerEntry(NULL)
|
||||
, m_pScriptAccelerateHandlerEntry(NULL)
|
||||
, m_nTouchPriority(0)
|
||||
, m_eTouchMode(kCCTouchesAllAtOnce)
|
||||
{
|
||||
m_bIgnoreAnchorPointForPosition = true;
|
||||
setAnchorPoint(ccp(0.5f, 0.5f));
|
||||
|
@ -494,8 +494,8 @@ CCLayerRGBA::CCLayerRGBA()
|
|||
, _realOpacity (255)
|
||||
, _displayedColor(ccWHITE)
|
||||
, _realColor(ccWHITE)
|
||||
, _cascadeColorEnabled(false)
|
||||
, _cascadeOpacityEnabled(false)
|
||||
, _cascadeColorEnabled(false)
|
||||
{}
|
||||
|
||||
CCLayerRGBA::~CCLayerRGBA() {}
|
||||
|
@ -711,7 +711,7 @@ bool CCLayerColor::initWithColor(const ccColor4B& color, GLfloat w, GLfloat h)
|
|||
_displayedColor.b = _realColor.b = color.b;
|
||||
_displayedOpacity = color.a;
|
||||
|
||||
for (int i = 0; i<sizeof(m_pSquareVertices) / sizeof( m_pSquareVertices[0]); i++ )
|
||||
for (size_t i = 0; i<sizeof(m_pSquareVertices) / sizeof( m_pSquareVertices[0]); i++ )
|
||||
{
|
||||
m_pSquareVertices[i].x = 0.0f;
|
||||
m_pSquareVertices[i].y = 0.0f;
|
||||
|
|
|
@ -163,8 +163,10 @@ private:
|
|||
int excuteScriptTouchHandler(int nEventType, CCSet *pTouches);
|
||||
};
|
||||
|
||||
#ifdef __apple__
|
||||
#pragma mark -
|
||||
#pragma mark CCLayerRGBA
|
||||
#endif
|
||||
|
||||
/** CCLayerRGBA is a subclass of CCLayer that implements the CCRGBAProtocol protocol using a solid color as the background.
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ static void setProgram(CCNode *n, CCGLProgram *p)
|
|||
|
||||
CCClippingNode::CCClippingNode()
|
||||
: m_pStencil(NULL)
|
||||
, m_bInverted(false)
|
||||
, m_fAlphaThreshold(0.0f)
|
||||
, m_bInverted(false)
|
||||
{}
|
||||
|
||||
CCClippingNode::~CCClippingNode()
|
||||
|
|
|
@ -36,6 +36,7 @@ NS_CC_BEGIN
|
|||
|
||||
CCMotionStreak::CCMotionStreak()
|
||||
: m_bFastMode(false)
|
||||
, m_bStartingPositionInitialized(false)
|
||||
, m_pTexture(NULL)
|
||||
, m_tPositionR(CCPointZero)
|
||||
, m_fStroke(0.0f)
|
||||
|
@ -49,7 +50,6 @@ CCMotionStreak::CCMotionStreak()
|
|||
, m_pVertices(NULL)
|
||||
, m_pColorPointer(NULL)
|
||||
, m_pTexCoords(NULL)
|
||||
, m_bStartingPositionInitialized(false)
|
||||
{
|
||||
m_tBlendFunc.src = GL_SRC_ALPHA;
|
||||
m_tBlendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;
|
||||
|
|
|
@ -82,40 +82,40 @@ NS_CC_BEGIN
|
|||
//
|
||||
|
||||
CCParticleSystem::CCParticleSystem()
|
||||
:m_sPlistFile("")
|
||||
,m_fElapsed(0)
|
||||
,m_pParticles(NULL)
|
||||
,m_fEmitCounter(0)
|
||||
,m_uParticleIdx(0)
|
||||
,m_bIsActive(true)
|
||||
,m_uParticleCount(0)
|
||||
,m_fDuration(0)
|
||||
,m_tSourcePosition(CCPointZero)
|
||||
,m_tPosVar(CCPointZero)
|
||||
,m_fLife(0)
|
||||
,m_fLifeVar(0)
|
||||
,m_fAngle(0)
|
||||
,m_fAngleVar(0)
|
||||
,m_fStartSize(0)
|
||||
,m_fStartSizeVar(0)
|
||||
,m_fEndSize(0)
|
||||
,m_fEndSizeVar(0)
|
||||
,m_fStartSpin(0)
|
||||
,m_fStartSpinVar(0)
|
||||
,m_fEndSpin(0)
|
||||
,m_fEndSpinVar(0)
|
||||
,m_fEmissionRate(0)
|
||||
,m_uTotalParticles(0)
|
||||
,m_pTexture(NULL)
|
||||
,m_bOpacityModifyRGB(false)
|
||||
,m_bIsBlendAdditive(false)
|
||||
,m_ePositionType(kCCPositionTypeFree)
|
||||
,m_bIsAutoRemoveOnFinish(false)
|
||||
,m_nEmitterMode(kCCParticleModeGravity)
|
||||
,m_pBatchNode(NULL)
|
||||
,m_uAtlasIndex(0)
|
||||
,m_bTransformSystemDirty(false)
|
||||
,m_uAllocatedParticles(0)
|
||||
: m_sPlistFile("")
|
||||
, m_fElapsed(0)
|
||||
, m_pParticles(NULL)
|
||||
, m_fEmitCounter(0)
|
||||
, m_uParticleIdx(0)
|
||||
, m_pBatchNode(NULL)
|
||||
, m_uAtlasIndex(0)
|
||||
, m_bTransformSystemDirty(false)
|
||||
, m_uAllocatedParticles(0)
|
||||
, m_bIsActive(true)
|
||||
, m_uParticleCount(0)
|
||||
, m_fDuration(0)
|
||||
, m_tSourcePosition(CCPointZero)
|
||||
, m_tPosVar(CCPointZero)
|
||||
, m_fLife(0)
|
||||
, m_fLifeVar(0)
|
||||
, m_fAngle(0)
|
||||
, m_fAngleVar(0)
|
||||
, m_fStartSize(0)
|
||||
, m_fStartSizeVar(0)
|
||||
, m_fEndSize(0)
|
||||
, m_fEndSizeVar(0)
|
||||
, m_fStartSpin(0)
|
||||
, m_fStartSpinVar(0)
|
||||
, m_fEndSpin(0)
|
||||
, m_fEndSpinVar(0)
|
||||
, m_fEmissionRate(0)
|
||||
, m_uTotalParticles(0)
|
||||
, m_pTexture(NULL)
|
||||
, m_bOpacityModifyRGB(false)
|
||||
, m_bIsBlendAdditive(false)
|
||||
, m_ePositionType(kCCPositionTypeFree)
|
||||
, m_bIsAutoRemoveOnFinish(false)
|
||||
, m_nEmitterMode(kCCParticleModeGravity)
|
||||
{
|
||||
modeA.gravity = CCPointZero;
|
||||
modeA.speed = 0;
|
||||
|
|
|
@ -44,8 +44,8 @@ static void removeUsedIndexBit(int index)
|
|||
|
||||
CCEGLViewProtocol::CCEGLViewProtocol()
|
||||
: m_pDelegate(NULL)
|
||||
, m_fScaleY(1.0f)
|
||||
, m_fScaleX(1.0f)
|
||||
, m_fScaleY(1.0f)
|
||||
, m_eResolutionPolicy(kResolutionUnKnown)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -419,8 +419,7 @@ unsigned char* CCFileUtils::getFileDataFromZip(const char* pszZipFilePath, const
|
|||
CC_BREAK_IF(UNZ_OK != nRet);
|
||||
|
||||
pBuffer = new unsigned char[FileInfo.uncompressed_size];
|
||||
int nSize = 0;
|
||||
nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size);
|
||||
int CC_UNUSED nSize = unzReadCurrentFile(pFile, pBuffer, FileInfo.uncompressed_size);
|
||||
CCAssert(nSize == 0 || nSize == (int)FileInfo.uncompressed_size, "the file size is wrong");
|
||||
|
||||
*pSize = FileInfo.uncompressed_size;
|
||||
|
|
|
@ -527,22 +527,22 @@ static uint64 _tiffSeekProc(thandle_t fd, uint64 off, int whence)
|
|||
{
|
||||
if (whence == SEEK_SET)
|
||||
{
|
||||
CC_BREAK_IF(off > isource->size-1);
|
||||
CC_BREAK_IF(off >= (uint64)isource->size);
|
||||
ret = isource->offset = (uint32)off;
|
||||
}
|
||||
else if (whence == SEEK_CUR)
|
||||
{
|
||||
CC_BREAK_IF(isource->offset + off > isource->size-1);
|
||||
CC_BREAK_IF(isource->offset + off >= (uint64)isource->size);
|
||||
ret = isource->offset += (uint32)off;
|
||||
}
|
||||
else if (whence == SEEK_END)
|
||||
{
|
||||
CC_BREAK_IF(off > isource->size-1);
|
||||
CC_BREAK_IF(off >= (uint64)isource->size);
|
||||
ret = isource->offset = (uint32)(isource->size-1 - off);
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_BREAK_IF(off > isource->size-1);
|
||||
CC_BREAK_IF(off >= (uint64)isource->size);
|
||||
ret = isource->offset = (uint32)off;
|
||||
}
|
||||
} while (0);
|
||||
|
@ -620,11 +620,11 @@ bool CCImage::_initWithTiffData(void* pData, int nDataLen)
|
|||
{
|
||||
if (TIFFReadRGBAImageOriented(tif, w, h, raster, ORIENTATION_TOPLEFT, 0))
|
||||
{
|
||||
/* the raster data is pre-multiplied by the alpha component
|
||||
after invoking TIFFReadRGBAImageOriented
|
||||
unsigned char* src = (unsigned char*)raster;
|
||||
unsigned int* tmp = (unsigned int*)m_pData;
|
||||
|
||||
/* the raster data is pre-multiplied by the alpha component
|
||||
after invoking TIFFReadRGBAImageOriented
|
||||
for(int j = 0; j < m_nWidth * m_nHeight * 4; j += 4)
|
||||
{
|
||||
*tmp++ = CC_RGB_PREMULTIPLY_ALPHA( src[j], src[j + 1],
|
||||
|
|
|
@ -244,4 +244,10 @@ public: virtual void set##funName(varType var) \
|
|||
#define CC_DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define CC_UNUSED __attribute__ ((unused))
|
||||
#else
|
||||
#define CC_UNUSED
|
||||
#endif
|
||||
|
||||
#endif // __CC_PLATFORM_MACROS_H__
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
iMaxLineHeight = 0;
|
||||
//Free all text lines
|
||||
size_t size = vLines.size();
|
||||
for (int i=0; i<size; ++i) {
|
||||
for (size_t i=0; i<size; ++i) {
|
||||
TextLine line = vLines[i];
|
||||
free(line.text);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
oTempLine.text = text;
|
||||
|
||||
//get last glyph
|
||||
int iError = FT_Load_Char(face, cLastChar, FT_LOAD_DEFAULT);
|
||||
FT_Load_Char(face, cLastChar, FT_LOAD_DEFAULT);
|
||||
|
||||
oTempLine.iLineWidth = iCurXCursor;// - SHIFT6((face->glyph->metrics.horiAdvance + face->glyph->metrics.horiBearingX - face->glyph->metrics.width))/*-iInterval*/;//TODO interval
|
||||
iMaxLineWidth = MAX(iMaxLineWidth, oTempLine.iLineWidth);
|
||||
|
@ -116,7 +116,7 @@ public:
|
|||
|
||||
bool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) {
|
||||
int iError = 0;
|
||||
int iCurXCursor, iCurYCursor;
|
||||
int iCurXCursor;
|
||||
const char* pText = sText;
|
||||
|
||||
FT_UInt unicode = utf8((char**)&pText);
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
pText = sText;
|
||||
size_t text_len = 0;
|
||||
wchar_t* text_buf = (wchar_t*) malloc(sizeof(wchar_t) * strlen(sText));
|
||||
while (unicode=utf8((char**)&pText)) {
|
||||
while ((unicode=utf8((char**)&pText))) {
|
||||
if (unicode == '\n') {
|
||||
buildLine(text_buf, text_len, face, iCurXCursor, cLastCh);
|
||||
text_len = 0;
|
||||
|
|
|
@ -50,7 +50,9 @@ static GLuint s_uCurrentBoundTexture[kCCMaxActiveTexture] = {(GLuint)-1,(GLu
|
|||
static GLenum s_eBlendingSource = -1;
|
||||
static GLenum s_eBlendingDest = -1;
|
||||
static int s_eGLServerState = 0;
|
||||
#if CC_TEXTURE_ATLAS_USE_VAO
|
||||
static GLuint s_uVAO = 0;
|
||||
#endif
|
||||
#endif // CC_ENABLE_GL_STATE_CACHE
|
||||
|
||||
// GL State Cache functions
|
||||
|
|
|
@ -294,8 +294,8 @@ CCSprite* CCSprite::initWithCGImage(CGImageRef pImage, const char *pszKey)
|
|||
*/
|
||||
|
||||
CCSprite::CCSprite(void)
|
||||
: m_pobTexture(NULL)
|
||||
, m_bShouldBeHidden(false)
|
||||
: m_bShouldBeHidden(false),
|
||||
m_pobTexture(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -121,24 +121,6 @@ static const char *const g_utf8_skip = utf8_skip_data;
|
|||
|
||||
#define cc_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(unsigned char *)(p)])
|
||||
|
||||
/*
|
||||
* @str: the string to search through.
|
||||
* @c: the character to find.
|
||||
*
|
||||
* Returns the index of the first occurrence of the character, if found. Otherwise -1 is returned.
|
||||
*
|
||||
* Return value: the index of the first occurrence of the character if found or -1 otherwise.
|
||||
* */
|
||||
static unsigned int cc_utf8_find_char(std::vector<unsigned short> str, unsigned short c)
|
||||
{
|
||||
unsigned int len = str.size();
|
||||
|
||||
for (unsigned int i = 0; i < len; ++i)
|
||||
if (str[i] == c) return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* @str: the string to search through.
|
||||
* @c: the character to not look for.
|
||||
|
|
|
@ -407,8 +407,7 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *
|
|||
CC_BREAK_IF(UNZ_OK != nRet);
|
||||
|
||||
pBuffer = new unsigned char[fileInfo.uncompressed_size];
|
||||
int nSize = 0;
|
||||
nSize = unzReadCurrentFile(m_data->zipFile, pBuffer, fileInfo.uncompressed_size);
|
||||
int CC_UNUSED nSize = unzReadCurrentFile(m_data->zipFile, pBuffer, fileInfo.uncompressed_size);
|
||||
CCAssert(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong");
|
||||
|
||||
if (pSize)
|
||||
|
|
|
@ -61,14 +61,14 @@ static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelForma
|
|||
static bool PVRHaveAlphaPremultiplied_ = false;
|
||||
|
||||
CCTexture2D::CCTexture2D()
|
||||
: m_uPixelsWide(0)
|
||||
: m_bPVRHaveAlphaPremultiplied(true)
|
||||
, m_uPixelsWide(0)
|
||||
, m_uPixelsHigh(0)
|
||||
, m_uName(0)
|
||||
, m_fMaxS(0.0)
|
||||
, m_fMaxT(0.0)
|
||||
, m_bHasPremultipliedAlpha(false)
|
||||
, m_bHasMipmaps(false)
|
||||
, m_bPVRHaveAlphaPremultiplied(true)
|
||||
, m_pShaderProgram(NULL)
|
||||
{
|
||||
}
|
||||
|
@ -445,6 +445,7 @@ bool CCTexture2D::initWithString(const char *text, const char *fontName, float f
|
|||
else
|
||||
{
|
||||
CCAssert(false, "Not supported alignment format!");
|
||||
return false;
|
||||
}
|
||||
|
||||
do
|
||||
|
|
|
@ -225,16 +225,16 @@ typedef struct {
|
|||
|
||||
|
||||
CCTexturePVR::CCTexturePVR()
|
||||
: m_pPixelFormatInfo(NULL)
|
||||
, m_uNumberOfMipmaps(0)
|
||||
: m_uNumberOfMipmaps(0)
|
||||
, m_uWidth(0)
|
||||
, m_uHeight(0)
|
||||
, m_bRetainName(false)
|
||||
, m_bHasAlpha(false)
|
||||
, m_uName(0)
|
||||
, m_eFormat(kCCTexture2DPixelFormat_Default)
|
||||
, m_bHasAlpha(false)
|
||||
, m_bHasPremultipliedAlpha(false)
|
||||
, m_bForcePremultipliedAlpha(false)
|
||||
, m_bRetainName(false)
|
||||
, m_eFormat(kCCTexture2DPixelFormat_Default)
|
||||
, m_pPixelFormatInfo(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ bool CCTexturePVR::unpackPVRv3Data(unsigned char* dataPointer, unsigned int data
|
|||
|
||||
bool infoValid = false;
|
||||
|
||||
for(int i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++)
|
||||
for(unsigned int i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++)
|
||||
{
|
||||
if( v3_pixel_formathash[i].pixelFormat == pixelFormat )
|
||||
{
|
||||
|
|
|
@ -517,7 +517,7 @@ void CCTMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
// Parse everything automatically
|
||||
const char* pArray[] = {"name", "type", "width", "height", "gid"};
|
||||
|
||||
for( int i = 0; i < sizeof(pArray)/sizeof(pArray[0]); ++i )
|
||||
for(size_t i = 0; i < sizeof(pArray)/sizeof(pArray[0]); ++i )
|
||||
{
|
||||
const char* key = pArray[i];
|
||||
CCString* obj = new CCString(valueForKey(key, attributeDict));
|
||||
|
|
|
@ -64,13 +64,13 @@ CCBReader::CCBReader(CCNodeLoaderLibrary * pCCNodeLoaderLibrary, CCBMemberVariab
|
|||
, mCurrentBit(-1)
|
||||
, mOwner(NULL)
|
||||
, mActionManager(NULL)
|
||||
, mAnimatedProps(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
, mActionManagers(NULL)
|
||||
, mAnimatedProps(NULL)
|
||||
, mOwnerOutletNodes(NULL)
|
||||
, mNodesWithAnimationManagers(NULL)
|
||||
, mAnimationManagersForNodes(NULL)
|
||||
, mOwnerOutletNodes(NULL)
|
||||
, mOwnerCallbackNodes(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
{
|
||||
this->mCCNodeLoaderLibrary = pCCNodeLoaderLibrary;
|
||||
this->mCCNodeLoaderLibrary->retain();
|
||||
|
@ -87,13 +87,13 @@ CCBReader::CCBReader(CCBReader * pCCBReader)
|
|||
, mCurrentBit(-1)
|
||||
, mOwner(NULL)
|
||||
, mActionManager(NULL)
|
||||
, mAnimatedProps(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
, mActionManagers(NULL)
|
||||
, mAnimatedProps(NULL)
|
||||
, mOwnerOutletNodes(NULL)
|
||||
, mNodesWithAnimationManagers(NULL)
|
||||
, mAnimationManagersForNodes(NULL)
|
||||
, mOwnerOutletNodes(NULL)
|
||||
, mOwnerCallbackNodes(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
{
|
||||
this->mLoadedSpriteSheets = pCCBReader->mLoadedSpriteSheets;
|
||||
this->mCCNodeLoaderLibrary = pCCBReader->mCCNodeLoaderLibrary;
|
||||
|
@ -119,15 +119,14 @@ CCBReader::CCBReader()
|
|||
, mCurrentBit(-1)
|
||||
, mOwner(NULL)
|
||||
, mActionManager(NULL)
|
||||
, mActionManagers(NULL)
|
||||
, mCCNodeLoaderLibrary(NULL)
|
||||
, mCCNodeLoaderListener(NULL)
|
||||
, mCCBMemberVariableAssigner(NULL)
|
||||
, mCCBSelectorResolver(NULL)
|
||||
, mAnimatedProps(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
, mActionManagers(NULL)
|
||||
, mNodesWithAnimationManagers(NULL)
|
||||
, mAnimationManagersForNodes(NULL)
|
||||
, hasScriptingOwner(false)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
@ -862,7 +861,7 @@ bool CCBReader::readSequences()
|
|||
|
||||
std::string CCBReader::lastPathComponent(const char* pPath) {
|
||||
std::string path(pPath);
|
||||
int slashPos = path.find_last_of("/");
|
||||
size_t slashPos = path.find_last_of("/");
|
||||
if(slashPos != std::string::npos) {
|
||||
return path.substr(slashPos + 1, path.length() - slashPos);
|
||||
}
|
||||
|
@ -871,7 +870,7 @@ std::string CCBReader::lastPathComponent(const char* pPath) {
|
|||
|
||||
std::string CCBReader::deletePathExtension(const char* pPath) {
|
||||
std::string path(pPath);
|
||||
int dotPos = path.find_last_of(".");
|
||||
size_t dotPos = path.find_last_of(".");
|
||||
if(dotPos != std::string::npos) {
|
||||
return path.substr(0, dotPos);
|
||||
}
|
||||
|
|
|
@ -196,6 +196,7 @@ private:
|
|||
std::vector<std::string> mOwnerCallbackNames;
|
||||
CCArray* mOwnerCallbackNodes;
|
||||
std::string mCCBRootPath;
|
||||
bool hasScriptingOwner;
|
||||
bool init();
|
||||
public:
|
||||
CCBReader(CCNodeLoaderLibrary *pCCNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, CCNodeLoaderListener *pCCNodeLoaderListener = NULL);
|
||||
|
@ -262,7 +263,6 @@ public:
|
|||
static float getResolutionScale();
|
||||
|
||||
CCNode* readFileWithCleanUp(bool bCleanUp, CCDictionary* am);
|
||||
bool hasScriptingOwner;
|
||||
|
||||
private:
|
||||
void cleanUpNodeGraph(CCNode *pNode);
|
||||
|
|
|
@ -55,8 +55,8 @@ CCControlButton::CCControlButton()
|
|||
, m_titleColorDispatchTable(NULL)
|
||||
, m_titleLabelDispatchTable(NULL)
|
||||
, m_backgroundSpriteDispatchTable(NULL)
|
||||
, m_marginH(CCControlButtonMarginLR)
|
||||
, m_marginV(CCControlButtonMarginTB)
|
||||
, m_marginH(CCControlButtonMarginLR)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
NS_CC_EXT_BEGIN
|
||||
|
||||
CCControlPotentiometer::CCControlPotentiometer()
|
||||
: m_fValue(0.0f)
|
||||
: m_pThumbSprite(NULL)
|
||||
, m_pProgressTimer(NULL)
|
||||
, m_fValue(0.0f)
|
||||
, m_fMinimumValue(0.0f)
|
||||
, m_fMaximumValue(0.0f)
|
||||
, m_pThumbSprite(NULL)
|
||||
, m_pProgressTimer(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -39,17 +39,17 @@ NS_CC_EXT_BEGIN
|
|||
#define kAutorepeatIncreaseTimeIncrement 12
|
||||
|
||||
CCControlStepper::CCControlStepper()
|
||||
: m_dValue(0.0)
|
||||
: m_pMinusSprite(NULL)
|
||||
, m_pPlusSprite(NULL)
|
||||
, m_pMinusLabel(NULL)
|
||||
, m_pPlusLabel(NULL)
|
||||
, m_dValue(0.0)
|
||||
, m_bContinuous(false)
|
||||
, m_bAutorepeat(false)
|
||||
, m_bWraps(false)
|
||||
, m_dMinimumValue(0.0)
|
||||
, m_dMaximumValue(0.0)
|
||||
, m_dStepValue(0.0)
|
||||
, m_pMinusSprite(NULL)
|
||||
, m_pPlusSprite(NULL)
|
||||
, m_pMinusLabel(NULL)
|
||||
, m_pPlusLabel(NULL)
|
||||
, m_bTouchInsideFlag(false)
|
||||
, m_eTouchedPart(kCCControlStepperPartNone)
|
||||
, m_nAutorepeatCount(0)
|
||||
|
|
|
@ -45,12 +45,12 @@ CCScrollView::CCScrollView()
|
|||
, m_fMinZoomScale(0.0f)
|
||||
, m_fMaxZoomScale(0.0f)
|
||||
, m_pDelegate(NULL)
|
||||
, m_bDragging(false)
|
||||
, m_bBounceable(false)
|
||||
, m_eDirection(kCCScrollViewDirectionBoth)
|
||||
, m_bClippingToBounds(false)
|
||||
, m_bDragging(false)
|
||||
, m_pContainer(NULL)
|
||||
, m_bTouchMoved(false)
|
||||
, m_bBounceable(false)
|
||||
, m_bClippingToBounds(false)
|
||||
, m_fTouchLength(0.0f)
|
||||
, m_pTouches(NULL)
|
||||
, m_fMinScale(0.0f)
|
||||
|
|
|
@ -37,6 +37,7 @@ private:
|
|||
unsigned int objectID;
|
||||
};
|
||||
|
||||
#if 0
|
||||
static int _compareObject(const void * val1, const void * val2)
|
||||
{
|
||||
CCSortableObject* operand1;
|
||||
|
@ -54,6 +55,7 @@ static int _compareObject(const void * val1, const void * val2)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void CCArrayForObjectSorting::insertSortedObject(CCSortableObject* object)
|
||||
|
|
|
@ -66,12 +66,12 @@ bool CCTableView::initWithViewSize(CCSize size, CCNode* container/* = NULL*/)
|
|||
}
|
||||
|
||||
CCTableView::CCTableView()
|
||||
: m_pIndices(NULL)
|
||||
: m_pTouchedCell(NULL)
|
||||
, m_pIndices(NULL)
|
||||
, m_pCellsUsed(NULL)
|
||||
, m_pCellsFreed(NULL)
|
||||
, m_pDataSource(NULL)
|
||||
, m_pTableViewDelegate(NULL)
|
||||
, m_pTouchedCell(NULL)
|
||||
, m_eOldDirection(kCCScrollViewDirectionNone)
|
||||
{
|
||||
|
||||
|
|
|
@ -404,8 +404,8 @@ void CCHttpClient::destroyInstance()
|
|||
}
|
||||
|
||||
CCHttpClient::CCHttpClient()
|
||||
:_timeoutForRead(60)
|
||||
,_timeoutForConnect(30)
|
||||
: _timeoutForConnect(30)
|
||||
, _timeoutForRead(60)
|
||||
{
|
||||
CCDirector::sharedDirector()->getScheduler()->scheduleSelector(
|
||||
schedule_selector(CCHttpClient::dispatchResponseCallbacks), this, 0, false);
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
|
||||
void Step(Settings* settings)
|
||||
{
|
||||
bool sleeping = true;
|
||||
//bool sleeping = true;
|
||||
for (b2Body* b = m_world->GetBodyList(); b; b = b->GetNext())
|
||||
{
|
||||
if (b->GetType() != b2_dynamicBody)
|
||||
|
@ -122,10 +122,10 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
if (b->IsAwake())
|
||||
{
|
||||
sleeping = false;
|
||||
}
|
||||
//if (b->IsAwake())
|
||||
//{
|
||||
// sleeping = false;
|
||||
//}
|
||||
}
|
||||
|
||||
if (m_stepCount == 180)
|
||||
|
|
|
@ -86,10 +86,6 @@ public:
|
|||
sweepB.GetTransform(&transformB, 0.0f);
|
||||
|
||||
b2Vec2 localPoint(2.0f, -0.1f);
|
||||
b2Vec2 rB = b2Mul(transformB, localPoint) - sweepB.c0;
|
||||
float32 wB = sweepB.a - sweepB.a0;
|
||||
b2Vec2 vB = sweepB.c - sweepB.c0;
|
||||
b2Vec2 v = vB + b2Cross(wB, rB);
|
||||
|
||||
for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i)
|
||||
{
|
||||
|
|
|
@ -16,10 +16,6 @@ enum {
|
|||
};
|
||||
|
||||
// callback to remove Shapes from the Space
|
||||
static void removeShape( cpBody *body, cpShape *shape, void *data )
|
||||
{
|
||||
cpShapeFree( shape );
|
||||
}
|
||||
|
||||
ChipmunkTestLayer::ChipmunkTestLayer()
|
||||
{
|
||||
|
|
|
@ -39,9 +39,15 @@ CurrentLanguageTest::CurrentLanguageTest()
|
|||
case kLanguageJapanese:
|
||||
labelLanguage->setString("current language is Japanese");
|
||||
break;
|
||||
case kLanguageHungarian:
|
||||
case kLanguageHungarian:
|
||||
labelLanguage->setString("current language is Hungarian");
|
||||
break;
|
||||
case kLanguagePortuguese:
|
||||
labelLanguage->setString("current language is Portuguese");
|
||||
break;
|
||||
case kLanguageArabic:
|
||||
labelLanguage->setString("current language is Arabic");
|
||||
break;
|
||||
}
|
||||
|
||||
addChild(labelLanguage);
|
||||
|
|
|
@ -127,7 +127,7 @@ NotificationCenterTest::NotificationCenterTest()
|
|||
light->setIsConnectToSwitch(bConnected);
|
||||
}
|
||||
|
||||
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)item->getSelectedIndex());
|
||||
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)(intptr_t)item->getSelectedIndex());
|
||||
}
|
||||
|
||||
void NotificationCenterTest::toExtensionsMainLayer(cocos2d::CCObject* sender)
|
||||
|
@ -141,7 +141,7 @@ void NotificationCenterTest::toggleSwitch(CCObject *sender)
|
|||
{
|
||||
CCMenuItemToggle* item = (CCMenuItemToggle*)sender;
|
||||
int index = item->getSelectedIndex();
|
||||
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)index);
|
||||
CCNotificationCenter::sharedNotificationCenter()->postNotification(MSG_SWITCH_STATE, (CCObject*)(intptr_t)index);
|
||||
}
|
||||
|
||||
void NotificationCenterTest::connectToSwitch(CCObject *sender)
|
||||
|
|
|
@ -227,13 +227,15 @@ void TestSearchPath::onEnter()
|
|||
// Gets external.txt from writable path
|
||||
string fullPath = sharedFileUtils->fullPathForFilename("external.txt");
|
||||
CCLog("\nexternal file path = %s\n", fullPath.c_str());
|
||||
if (fullPath.length() > 0) {
|
||||
if (fullPath.length() > 0)
|
||||
{
|
||||
fp = fopen(fullPath.c_str(), "rb");
|
||||
if (fp)
|
||||
{
|
||||
char szReadBuf[100] = {0};
|
||||
fread(szReadBuf, 1, strlen(szBuf), fp);
|
||||
CCLog("The content of file from writable path: %s", szReadBuf);
|
||||
int read = fread(szReadBuf, 1, strlen(szBuf), fp);
|
||||
if (read > 0)
|
||||
CCLog("The content of file from writable path: %s", szReadBuf);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
@ -345,4 +347,4 @@ string TestIsFileExist::title()
|
|||
string TestIsFileExist::subtitle()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -362,14 +362,14 @@ void MenuLayer3::menuCallback(CCObject* sender)
|
|||
|
||||
void MenuLayer3::menuCallback2(CCObject* sender)
|
||||
{
|
||||
//UXLOG("Label clicked. Toogling AtlasSprite");
|
||||
//CCLOG("Label clicked. Toogling AtlasSprite");
|
||||
m_disabledItem->setEnabled( ! m_disabledItem->isEnabled() );
|
||||
m_disabledItem->stopAllActions();
|
||||
}
|
||||
|
||||
void MenuLayer3::menuCallback3(CCObject* sender)
|
||||
{
|
||||
//UXLOG("MenuItemSprite clicked");
|
||||
//CCLOG("MenuItemSprite clicked");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
@ -466,7 +466,7 @@ MenuLayer4::~MenuLayer4()
|
|||
|
||||
void MenuLayer4::menuCallback(CCObject* sender)
|
||||
{
|
||||
//UXLOG("selected item: %x index:%d", dynamic_cast<CCMenuItemToggle*>(sender)->selectedItem(), dynamic_cast<CCMenuItemToggle*>(sender)->selectedIndex() );
|
||||
//CCLOG("selected item: %x index:%d", dynamic_cast<CCMenuItemToggle*>(sender)->selectedItem(), dynamic_cast<CCMenuItemToggle*>(sender)->selectedIndex() );
|
||||
}
|
||||
|
||||
void MenuLayer4::backCallback(CCObject* sender)
|
||||
|
|
|
@ -471,16 +471,16 @@ std::string StressTest2::title()
|
|||
SchedulerTest1::SchedulerTest1()
|
||||
{
|
||||
CCLayer*layer = CCLayer::create();
|
||||
//UXLOG("retain count after init is %d", layer->retainCount()); // 1
|
||||
//CCLOG("retain count after init is %d", layer->retainCount()); // 1
|
||||
|
||||
addChild(layer, 0);
|
||||
//UXLOG("retain count after addChild is %d", layer->retainCount()); // 2
|
||||
//CCLOG("retain count after addChild is %d", layer->retainCount()); // 2
|
||||
|
||||
layer->schedule( schedule_selector(SchedulerTest1::doSomething) );
|
||||
//UXLOG("retain count after schedule is %d", layer->retainCount()); // 3 : (object-c viersion), but win32 version is still 2, because CCTimer class don't save target.
|
||||
//CCLOG("retain count after schedule is %d", layer->retainCount()); // 3 : (object-c viersion), but win32 version is still 2, because CCTimer class don't save target.
|
||||
|
||||
layer->unschedule(schedule_selector(SchedulerTest1::doSomething));
|
||||
//UXLOG("retain count after unschedule is %d", layer->retainCount()); // STILL 3! (win32 is '2')
|
||||
//CCLOG("retain count after unschedule is %d", layer->retainCount()); // STILL 3! (win32 is '2')
|
||||
}
|
||||
|
||||
void SchedulerTest1::doSomething(float dt)
|
||||
|
@ -560,7 +560,6 @@ CameraOrbitTest::CameraOrbitTest()
|
|||
|
||||
CCSprite* sprite;
|
||||
CCOrbitCamera* orbit;
|
||||
CCCamera* cam;
|
||||
CCSize ss;
|
||||
|
||||
// LEFT
|
||||
|
@ -569,7 +568,6 @@ CameraOrbitTest::CameraOrbitTest()
|
|||
sprite->setScale(0.5f);
|
||||
p->addChild(sprite, 0);
|
||||
sprite->setPosition( ccp(s.width/4*1, s.height/2) );
|
||||
cam = sprite->getCamera();
|
||||
orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 0, 0);
|
||||
sprite->runAction( CCRepeatForever::create( orbit ) );
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ SceneTestLayer1::SceneTestLayer1()
|
|||
|
||||
void SceneTestLayer1::testDealloc(float dt)
|
||||
{
|
||||
//UXLOG("SceneTestLayer1:testDealloc");
|
||||
//CCLOG("SceneTestLayer1:testDealloc");
|
||||
}
|
||||
|
||||
void SceneTestLayer1::onEnter()
|
||||
|
|
|
@ -1 +1 @@
|
|||
51f42cf74fedd14098cdf7ea89e53cdc81c6ee80
|
||||
eff4f2aa0226630c0b7749f48604f100212b964e
|
|
@ -21,7 +21,7 @@ TileMapTest::TileMapTest()
|
|||
// Convert it to "alias" (GL_LINEAR filtering)
|
||||
map->getTexture()->setAntiAliasTexParameters();
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
// If you are not going to use the Map, you can free it now
|
||||
|
@ -56,7 +56,7 @@ TileMapEditTest::TileMapEditTest()
|
|||
// Create an Aliased Atlas
|
||||
map->getTexture()->setAliasTexParameters();
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
// If you are not going to use the Map, you can free it now
|
||||
|
@ -86,7 +86,7 @@ void TileMapEditTest::updateMap(float dt)
|
|||
// for(int y=0; y < tilemap.tgaInfo->height; y++) {
|
||||
// ccColor3B c =[tilemap tileAt:CCSizeMake(x,y));
|
||||
// if( c.r != 0 ) {
|
||||
// ////----UXLOG("%d,%d = %d", x,y,c.r);
|
||||
// ////----CCLOG("%d,%d = %d", x,y,c.r);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@ -125,7 +125,7 @@ TMXOrthoTest::TMXOrthoTest()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCArray * pChildrenArray = map->getChildren();
|
||||
|
@ -174,8 +174,8 @@ TMXOrthoTest2::TMXOrthoTest2()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test1.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCArray* pChildrenArray = map->getChildren();
|
||||
CCSpriteBatchNode* child = NULL;
|
||||
|
@ -208,8 +208,8 @@ TMXOrthoTest3::TMXOrthoTest3()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test3.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCArray* pChildrenArray = map->getChildren();
|
||||
CCSpriteBatchNode* child = NULL;
|
||||
|
@ -243,8 +243,8 @@ TMXOrthoTest4::TMXOrthoTest4()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test4.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s1 = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s1.width,s1.height);
|
||||
CCSize CC_UNUSED s1 = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s1.width,s1.height);
|
||||
|
||||
CCArray* pChildrenArray = map->getChildren();
|
||||
CCSpriteBatchNode* child = NULL;
|
||||
|
@ -314,8 +314,8 @@ TMXReadWriteTest::TMXReadWriteTest()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
|
||||
CCTMXLayer* layer = map->layerNamed("Layer 0");
|
||||
|
@ -351,21 +351,21 @@ TMXReadWriteTest::TMXReadWriteTest()
|
|||
|
||||
|
||||
m_gid = layer->tileGIDAt(ccp(0,63));
|
||||
////----UXLOG("Tile GID at:(0,63) is: %d", m_gid);
|
||||
////----CCLOG("Tile GID at:(0,63) is: %d", m_gid);
|
||||
|
||||
schedule(schedule_selector(TMXReadWriteTest::updateCol), 2.0f);
|
||||
schedule(schedule_selector(TMXReadWriteTest::repaintWithGID), 2.05f);
|
||||
schedule(schedule_selector(TMXReadWriteTest::removeTiles), 1.0f);
|
||||
|
||||
////----UXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
|
||||
////----UXLOG("++++children: %d", layer->getChildren()->count() );
|
||||
////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
|
||||
////----CCLOG("++++children: %d", layer->getChildren()->count() );
|
||||
|
||||
m_gid2 = 0;
|
||||
}
|
||||
|
||||
void TMXReadWriteTest::removeSprite(CCNode* sender)
|
||||
{
|
||||
////----UXLOG("removing tile: %x", sender);
|
||||
////----CCLOG("removing tile: %x", sender);
|
||||
CCNode* p = ((CCNode*)sender)->getParent();
|
||||
|
||||
if (p)
|
||||
|
@ -373,7 +373,7 @@ void TMXReadWriteTest::removeSprite(CCNode* sender)
|
|||
p->removeChild((CCNode*)sender, true);
|
||||
}
|
||||
|
||||
//////----UXLOG("atlas quantity: %d", p->textureAtlas()->totalQuads());
|
||||
//////----CCLOG("atlas quantity: %d", p->textureAtlas()->totalQuads());
|
||||
}
|
||||
|
||||
void TMXReadWriteTest::updateCol(float dt)
|
||||
|
@ -381,8 +381,8 @@ void TMXReadWriteTest::updateCol(float dt)
|
|||
CCTMXTiledMap* map = (CCTMXTiledMap*)getChildByTag(kTagTileMap);
|
||||
CCTMXLayer *layer = (CCTMXLayer*)map->getChildByTag(0);
|
||||
|
||||
////----UXLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
|
||||
////----UXLOG("++++children: %d", layer->getChildren()->count() );
|
||||
////----CCLOG("++++atlas quantity: %d", layer->textureAtlas()->getTotalQuads());
|
||||
////----CCLOG("++++children: %d", layer->getChildren()->count() );
|
||||
|
||||
|
||||
CCSize s = layer->getLayerSize();
|
||||
|
@ -445,8 +445,8 @@ TMXHexTest::TMXHexTest()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/hexa-test.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
}
|
||||
|
||||
std::string TMXHexTest::title()
|
||||
|
@ -491,8 +491,8 @@ TMXIsoTest1::TMXIsoTest1()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test1.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
map->setAnchorPoint(ccp(0.5f, 0.5f));
|
||||
}
|
||||
|
@ -515,8 +515,8 @@ TMXIsoTest2::TMXIsoTest2()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
// move map to the center of the screen
|
||||
CCSize ms = map->getMapSize();
|
||||
|
@ -542,8 +542,8 @@ TMXUncompressedTest::TMXUncompressedTest()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/iso-test2-uncompressed.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
// move map to the center of the screen
|
||||
CCSize ms = map->getMapSize();
|
||||
|
@ -581,8 +581,8 @@ TMXTilesetTest::TMXTilesetTest()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCTMXLayer* layer;
|
||||
layer = map->layerNamed("Layer 0");
|
||||
|
@ -610,10 +610,10 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-objects.tmx");
|
||||
addChild(map, -1, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
////----UXLOG("----> Iterating over all the group objets");
|
||||
////----CCLOG("----> Iterating over all the group objets");
|
||||
CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1");
|
||||
CCArray* objects = group->getObjects();
|
||||
|
||||
|
@ -626,12 +626,12 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest()
|
|||
if(!dict)
|
||||
break;
|
||||
|
||||
////----UXLOG("object: %x", dict);
|
||||
////----CCLOG("object: %x", dict);
|
||||
}
|
||||
|
||||
////----UXLOG("----> Fetching 1 object by name");
|
||||
////----CCLOG("----> Fetching 1 object by name");
|
||||
// CCStringToStringDictionary* platform = group->objectNamed("platform");
|
||||
////----UXLOG("platform: %x", platform);
|
||||
////----CCLOG("platform: %x", platform);
|
||||
}
|
||||
|
||||
void TMXOrthoObjectsTest::draw()
|
||||
|
@ -690,8 +690,8 @@ TMXIsoObjectsTest::TMXIsoObjectsTest()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/iso-test-objectgroup.tmx");
|
||||
addChild(map, -1, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCTMXObjectGroup* group = map->objectGroupNamed("Object Group 1");
|
||||
|
||||
|
@ -707,7 +707,7 @@ TMXIsoObjectsTest::TMXIsoObjectsTest()
|
|||
if(!dict)
|
||||
break;
|
||||
|
||||
////----UXLOG("object: %x", dict);
|
||||
////----CCLOG("object: %x", dict);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -767,8 +767,8 @@ TMXResizeTest::TMXResizeTest()
|
|||
CCTMXTiledMap* map = CCTMXTiledMap::create("TileMaps/orthogonal-test5.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCTMXLayer* layer;
|
||||
layer = map->layerNamed("Layer 0");
|
||||
|
@ -873,8 +873,8 @@ TMXOrthoZorder::TMXOrthoZorder()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-zorder.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
m_tamara = CCSprite::create(s_pPathSister1);
|
||||
map->addChild(m_tamara, map->getChildren()->count());
|
||||
|
@ -1004,8 +1004,8 @@ TMXOrthoVertexZ::TMXOrthoVertexZ()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
// because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you
|
||||
// can use any CCSprite and it will work OK.
|
||||
|
@ -1075,8 +1075,8 @@ TMXIsoMoveLayer::TMXIsoMoveLayer()
|
|||
|
||||
map->setPosition(ccp(-700,-50));
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
}
|
||||
|
||||
std::string TMXIsoMoveLayer::title()
|
||||
|
@ -1100,8 +1100,8 @@ TMXOrthoMoveLayer::TMXOrthoMoveLayer()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test-movelayer.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
////----UXLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s.width,s.height);
|
||||
}
|
||||
|
||||
std::string TMXOrthoMoveLayer::title()
|
||||
|
@ -1151,7 +1151,7 @@ TMXOrthoFlipTest::TMXOrthoFlipTest()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/ortho-rotation-test.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLog("ContentSize: %f, %f", s.width,s.height);
|
||||
|
||||
CCObject* pObj = NULL;
|
||||
|
@ -1289,7 +1289,7 @@ TMXBug987::TMXBug987()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/orthogonal-test6.tmx");
|
||||
addChild(map, 0, kTagTileMap);
|
||||
|
||||
CCSize s1 = map->getContentSize();
|
||||
CCSize CC_UNUSED s1 = map->getContentSize();
|
||||
CCLOG("ContentSize: %f, %f", s1.width,s1.height);
|
||||
|
||||
CCArray* childs = map->getChildren();
|
||||
|
@ -1540,7 +1540,7 @@ TMXGIDObjectsTest::TMXGIDObjectsTest()
|
|||
CCTMXTiledMap *map = CCTMXTiledMap::create("TileMaps/test-object-layer.tmx");
|
||||
addChild(map, -1, kTagTileMap);
|
||||
|
||||
CCSize s = map->getContentSize();
|
||||
CCSize CC_UNUSED s = map->getContentSize();
|
||||
CCLOG("Contentsize: %f, %f", s.width, s.height);
|
||||
|
||||
CCLOG("----> Iterating over all the group objets");
|
||||
|
|
|
@ -94,7 +94,7 @@ TOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)
|
|||
if (lua_isnil(L, -1))
|
||||
{
|
||||
lua_pop(L, 2);
|
||||
printf("[LUA ERROR] remove CCObject with NULL type, refid: %d, ptr: %x\n", refid, (int)ptr);
|
||||
printf("[LUA ERROR] remove CCObject with NULL type, refid: %d, ptr: %p\n", refid, ptr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ TOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)
|
|||
lua_pop(L, 1); /* stack: mt ubox */
|
||||
if (ud == NULL)
|
||||
{
|
||||
printf("[LUA ERROR] remove CCObject with NULL userdata, refid: %d, ptr: %x, type: %s\n", refid, (int)ptr, type);
|
||||
printf("[LUA ERROR] remove CCObject with NULL userdata, refid: %d, ptr: %p, type: %s\n", refid, ptr, type);
|
||||
lua_pop(L, 2);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -729,7 +729,7 @@ TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, l
|
|||
TOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name) {
|
||||
|
||||
#ifdef LUA_VERSION_NUM /* lua 5.1 */
|
||||
luaL_loadbuffer(L, B, size, name) || lua_pcall(L, 0, 0, 0);
|
||||
if (!luaL_loadbuffer(L, B, size, name)) lua_pcall(L, 0, 0, 0);
|
||||
#else
|
||||
lua_dobuffer(L, B, size, name);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue