fixed #1649: Reverted some invokings of function that returns const reference.

This commit is contained in:
James Chen 2013-01-14 16:06:18 +08:00
parent 22ebf3a5e5
commit 6733f786a5
11 changed files with 11 additions and 11 deletions

View File

@ -117,7 +117,7 @@ bool CCAtlasNode::initWithTileFile(const char *tile, unsigned int tileWidth, uns
void CCAtlasNode::calculateMaxItems() void CCAtlasNode::calculateMaxItems()
{ {
CCSize s = m_pTextureAtlas->getTexture()->getContentSize(); const CCSize& s = m_pTextureAtlas->getTexture()->getContentSize();
m_uItemsPerColumn = (int)(s.height / m_uItemHeight); m_uItemsPerColumn = (int)(s.height / m_uItemHeight);
m_uItemsPerRow = (int)(s.width / m_uItemWidth); m_uItemsPerRow = (int)(s.width / m_uItemWidth);
} }

View File

@ -198,7 +198,7 @@ void CCLabelAtlas::draw()
{ {
CCAtlasNode::draw(); CCAtlasNode::draw();
CCSize s = this->getContentSize(); const CCSize& s = this->getContentSize();
CCPoint vertices[4]={ CCPoint vertices[4]={
ccp(0,0),ccp(s.width,0), ccp(0,0),ccp(s.width,0),
ccp(s.width,s.height),ccp(0,s.height), ccp(s.width,s.height),ccp(0,s.height),

View File

@ -1448,7 +1448,7 @@ const char* CCLabelBMFont::getFntFile()
void CCLabelBMFont::draw() void CCLabelBMFont::draw()
{ {
CCSpriteBatchNode::draw(); CCSpriteBatchNode::draw();
CCSize s = this->getContentSize(); const CCSize& s = this->getContentSize();
CCPoint vertices[4]={ CCPoint vertices[4]={
ccp(0,0),ccp(s.width,0), ccp(0,0),ccp(s.width,0),
ccp(s.width,s.height),ccp(0,s.height), ccp(s.width,s.height),ccp(0,s.height),

View File

@ -206,7 +206,7 @@ void CCParticleSystemQuad::setTextureWithRect(CCTexture2D *texture, const CCRect
} }
void CCParticleSystemQuad::setTexture(CCTexture2D* texture) void CCParticleSystemQuad::setTexture(CCTexture2D* texture)
{ {
CCSize s = texture->getContentSize(); const CCSize& s = texture->getContentSize();
this->setTextureWithRect(texture, CCRectMake(0, 0, s.width, s.height)); this->setTextureWithRect(texture, CCRectMake(0, 0, s.width, s.height));
} }
void CCParticleSystemQuad::setDisplayFrame(CCSpriteFrame *spriteFrame) void CCParticleSystemQuad::setDisplayFrame(CCSpriteFrame *spriteFrame)

View File

@ -281,7 +281,7 @@ CCSprite* CCSprite::initWithCGImage(CGImageRef pImage, const char *pszKey)
// XXX: possible bug. See issue #349. New API should be added // XXX: possible bug. See issue #349. New API should be added
CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addCGImage(pImage, pszKey); CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addCGImage(pImage, pszKey);
CCSize size = pTexture->getContentSize(); const CCSize& size = pTexture->getContentSize();
CCRect rect = CCRectMake(0 ,0, size.width, size.height); CCRect rect = CCRectMake(0 ,0, size.width, size.height);
return initWithTexture(texture, rect); return initWithTexture(texture, rect);

View File

@ -218,7 +218,7 @@ void CCTMXTiledMap::buildWithMapInfo(CCTMXMapInfo* mapInfo)
addChild((CCNode*)child, idx, idx); addChild((CCNode*)child, idx, idx);
// update content size with the max size // update content size with the max size
CCSize childSize = child->getContentSize(); const CCSize& childSize = child->getContentSize();
CCSize currentSize = this->getContentSize(); CCSize currentSize = this->getContentSize();
currentSize.width = MAX( currentSize.width, childSize.width ); currentSize.width = MAX( currentSize.width, childSize.width );
currentSize.height = MAX( currentSize.height, childSize.height ); currentSize.height = MAX( currentSize.height, childSize.height );

View File

@ -177,7 +177,7 @@ const char* CCBAnimationManager::getRunningSequenceName()
return mRunningSequence->getName(); return mRunningSequence->getName();
} }
CCSize CCBAnimationManager::getContainerSize(CCNode *pNode) const CCSize& CCBAnimationManager::getContainerSize(CCNode *pNode)
{ {
if (pNode) if (pNode)
{ {

View File

@ -80,7 +80,7 @@ public:
const char* getRunningSequenceName(); const char* getRunningSequenceName();
CCSize getContainerSize(CCNode* pNode); const CCSize& getContainerSize(CCNode* pNode);
void addNode(CCNode *pNode, CCDictionary *pSeq); void addNode(CCNode *pNode, CCDictionary *pSeq);
void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName); void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName);

View File

@ -21,7 +21,7 @@ ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color)
return ret; return ret;
} }
ccColor3B ccColor3BWapper::getColor() const ccColor3B& ccColor3BWapper::getColor() const
{ {
return color; return color;
} }

View File

@ -18,7 +18,7 @@ private:
public: public:
static ccColor3BWapper* create(const ccColor3B& color); static ccColor3BWapper* create(const ccColor3B& color);
ccColor3B getColor(); const ccColor3B& getColor() const;
}; };
enum enum

View File

@ -68,7 +68,7 @@ protected:
CC_SYNTHESIZE_READONLY(CCString*, m_currentTitle, CurrentTitle); CC_SYNTHESIZE_READONLY(CCString*, m_currentTitle, CurrentTitle);
/** The current color used to display the title. */ /** The current color used to display the title. */
CC_SYNTHESIZE_READONLY(ccColor3B, m_currentTitleColor, CurrentTitleColor); CC_SYNTHESIZE_READONLY_PASS_BY_REF(ccColor3B, m_currentTitleColor, CurrentTitleColor);
/** Adjust the background image. YES by default. If the property is set to NO, the /** Adjust the background image. YES by default. If the property is set to NO, the
background will use the prefered size of the background image. */ background will use the prefered size of the background image. */