mirror of https://github.com/axmolengine/axmol.git
fixed #1649: Reverted some invokings of function that returns const reference.
This commit is contained in:
parent
22ebf3a5e5
commit
6733f786a5
|
@ -117,7 +117,7 @@ bool CCAtlasNode::initWithTileFile(const char *tile, unsigned int tileWidth, uns
|
|||
|
||||
void CCAtlasNode::calculateMaxItems()
|
||||
{
|
||||
CCSize s = m_pTextureAtlas->getTexture()->getContentSize();
|
||||
const CCSize& s = m_pTextureAtlas->getTexture()->getContentSize();
|
||||
m_uItemsPerColumn = (int)(s.height / m_uItemHeight);
|
||||
m_uItemsPerRow = (int)(s.width / m_uItemWidth);
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ void CCLabelAtlas::draw()
|
|||
{
|
||||
CCAtlasNode::draw();
|
||||
|
||||
CCSize s = this->getContentSize();
|
||||
const CCSize& s = this->getContentSize();
|
||||
CCPoint vertices[4]={
|
||||
ccp(0,0),ccp(s.width,0),
|
||||
ccp(s.width,s.height),ccp(0,s.height),
|
||||
|
|
|
@ -1448,7 +1448,7 @@ const char* CCLabelBMFont::getFntFile()
|
|||
void CCLabelBMFont::draw()
|
||||
{
|
||||
CCSpriteBatchNode::draw();
|
||||
CCSize s = this->getContentSize();
|
||||
const CCSize& s = this->getContentSize();
|
||||
CCPoint vertices[4]={
|
||||
ccp(0,0),ccp(s.width,0),
|
||||
ccp(s.width,s.height),ccp(0,s.height),
|
||||
|
|
|
@ -206,7 +206,7 @@ void CCParticleSystemQuad::setTextureWithRect(CCTexture2D *texture, const CCRect
|
|||
}
|
||||
void CCParticleSystemQuad::setTexture(CCTexture2D* texture)
|
||||
{
|
||||
CCSize s = texture->getContentSize();
|
||||
const CCSize& s = texture->getContentSize();
|
||||
this->setTextureWithRect(texture, CCRectMake(0, 0, s.width, s.height));
|
||||
}
|
||||
void CCParticleSystemQuad::setDisplayFrame(CCSpriteFrame *spriteFrame)
|
||||
|
|
|
@ -281,7 +281,7 @@ CCSprite* CCSprite::initWithCGImage(CGImageRef pImage, const char *pszKey)
|
|||
// XXX: possible bug. See issue #349. New API should be added
|
||||
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);
|
||||
|
||||
return initWithTexture(texture, rect);
|
||||
|
|
|
@ -218,7 +218,7 @@ void CCTMXTiledMap::buildWithMapInfo(CCTMXMapInfo* mapInfo)
|
|||
addChild((CCNode*)child, idx, idx);
|
||||
|
||||
// update content size with the max size
|
||||
CCSize childSize = child->getContentSize();
|
||||
const CCSize& childSize = child->getContentSize();
|
||||
CCSize currentSize = this->getContentSize();
|
||||
currentSize.width = MAX( currentSize.width, childSize.width );
|
||||
currentSize.height = MAX( currentSize.height, childSize.height );
|
||||
|
|
|
@ -177,7 +177,7 @@ const char* CCBAnimationManager::getRunningSequenceName()
|
|||
return mRunningSequence->getName();
|
||||
}
|
||||
|
||||
CCSize CCBAnimationManager::getContainerSize(CCNode *pNode)
|
||||
const CCSize& CCBAnimationManager::getContainerSize(CCNode *pNode)
|
||||
{
|
||||
if (pNode)
|
||||
{
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
|
||||
const char* getRunningSequenceName();
|
||||
|
||||
CCSize getContainerSize(CCNode* pNode);
|
||||
const CCSize& getContainerSize(CCNode* pNode);
|
||||
|
||||
void addNode(CCNode *pNode, CCDictionary *pSeq);
|
||||
void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName);
|
||||
|
|
|
@ -21,7 +21,7 @@ ccColor3BWapper* ccColor3BWapper::create(const ccColor3B& color)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ccColor3B ccColor3BWapper::getColor()
|
||||
const ccColor3B& ccColor3BWapper::getColor() const
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ private:
|
|||
public:
|
||||
static ccColor3BWapper* create(const ccColor3B& color);
|
||||
|
||||
ccColor3B getColor();
|
||||
const ccColor3B& getColor() const;
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -68,7 +68,7 @@ protected:
|
|||
CC_SYNTHESIZE_READONLY(CCString*, m_currentTitle, CurrentTitle);
|
||||
|
||||
/** 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
|
||||
background will use the prefered size of the background image. */
|
||||
|
|
Loading…
Reference in New Issue