コード例 #1
0
ファイル: CCTextureAtlas.cpp プロジェクト: issamux/WebGame
CCTextureAtlas * CCTextureAtlas::textureAtlasWithFile(const char* file, unsigned int capacity)
{
	CCTextureAtlas * pTextureAtlas = new CCTextureAtlas();
	if(pTextureAtlas && pTextureAtlas->initWithFile(file, capacity))
	{
		pTextureAtlas->autorelease();
		return pTextureAtlas;
	}
	CC_SAFE_DELETE(pTextureAtlas);
	return NULL;
}
コード例 #2
0
ファイル: CCTextureAtlas.cpp プロジェクト: issamux/WebGame
CCTextureAtlas * CCTextureAtlas::textureAtlasWithTexture(CCTexture2D *texture, unsigned int capacity)
{
	CCTextureAtlas * pTextureAtlas = new CCTextureAtlas();
	if (pTextureAtlas && pTextureAtlas->initWithTexture(texture, capacity))
	{
		pTextureAtlas->autorelease();
		return pTextureAtlas;
	}
	CC_SAFE_DELETE(pTextureAtlas);
	return NULL;
}
コード例 #3
0
CCTextureAtlas* CCTextureAtlas::createWithTexture ( CCTexture2D* pTexture, KDuint uCapacity )
{
	CCTextureAtlas*  pRet = new CCTextureAtlas ( );

	if ( pRet && pRet->initWithTexture ( pTexture, uCapacity ) )
	{
		pRet->autorelease ( );
	}
	else
	{
		CC_SAFE_DELETE ( pRet );
	}

	return pRet;
}
コード例 #4
0
CCTextureAtlas* CCTextureAtlas::create ( const KDchar* szFilePath, KDuint uCapacity )
{
	CCTextureAtlas*  pRet = new CCTextureAtlas ( );

	if ( pRet && pRet->initWithFile ( szFilePath, uCapacity ) )
	{
		pRet->autorelease ( );
	}
	else
	{
		CC_SAFE_DELETE ( pRet );
	}

	return pRet;
}