// xxx.pvr RGB565:wxh (x,y,0xRRGGBBAA) int main(int argc, char *argv[]) { EGGImage image = EGG_INVALID_HANDLE; int i; if (argc < 2) goto fail; image = loadPVR(argv[1]); if (image == EGG_INVALID_HANDLE) goto fail; if (argc > 2 && !verifyImage(image, argv[2])) goto fail; for (i = 3; i < argc; i++) { if (!verifyColor(image, argv[i])) goto fail; } eggDestroyImage(image); return EXIT_SUCCESS; fail: eggDestroyImage(image); return EXIT_FAILURE; }
void Texture::load(DataBuffer *dataBuffer) { char ext[ MAX_CHAR ] = {""}; Utils::getFileName(dataBuffer->getFilename(), this->name); Utils::getFileExtension(dataBuffer->getFilename(), ext, 1); if(!strcmp(ext, "PNG")) loadPNG(dataBuffer); else if(!strcmp(ext, "PVR")) loadPVR(dataBuffer); }