Is it possible to load a PVR file from a zip file? I need good quality PVR for my 2D game (PNG often crashed the game due to huge memory size) so I tried RGBA4444 and it looks great with no crash (BPP4 is not suitable for my game graphic) but each of the PVR file is around 2MB.
I somehow found out that if I zip the PVR file it became only 150kb which is very good but I don’t know how to convert the file data I obtained from the zip file into a valid CCTexture2D format. Any tips on that?
I previously tried
CCTexture2D* tex_idle0 = new CCTexture2D();
tex_idle0->initWithData((const char**), “character_idle0.pvr”)), kCCTexture2DPixelFormat_RGBA4444, 1024, 1024, CCSize);
and openZip looks like this
unsigned char** openZip(const char* zip, const char* file)
unsigned long fileSize = 0;
unsigned char* result = cocos2d::CCFileUtils::getFileDataFromZip(zip, file, &fileSize);
if (fileSize > 0)
std::cout << “Oh no~~” << std::endl;
return (unsigned char*)“”;
but my sprite seems to look very lossy and slightly offset to the side (looks ok if I just directly load the PVR file from directory and not zip). any other solution for this?
Sorry for my english.