Hi!
My android (Samsung Nexus S) have pictures with sizes bigger than the texture supported, 2048. I have a image explorer on my application and i need load my android pictures, so i need resize these pictures for add on texture and create a sprite. How I set width and height on CCImage before add on texture?
This method return false because my CCImage is too bigger (2560x1920):
// implementation CCTexture2D (Image
bool CCTexture2D::initWithImage(CCImage *uiImage)
{
if (uiImage == NULL)
{
CCLOG("cocos2d: CCTexture2D. Can't create Texture. UIImage is nil");
return false;
}
unsigned int imageWidth = uiImage->getWidth();
unsigned int imageHeight = uiImage->getHeight();
CCConfiguration *conf = CCConfiguration::sharedConfiguration();
unsigned maxTextureSize = conf->getMaxTextureSize();
if (imageWidth > maxTextureSize || imageHeight > maxTextureSize)
{
CCLOG("cocos2d: WARNING: Image (%u x %u) is bigger than the supported %u x %u", imageWidth, imageHeight, maxTextureSize, maxTextureSize);
return false;
}
// always load premultiplied images
return initPremultipliedATextureWithImage(uiImage, imageWidth, imageHeight);
}
Thanks very much!
MG