From edf7a948c4186379427e033bc71d117505098faa Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 20 Aug 2013 15:28:02 -0400 Subject: [PATCH] Recognize pvr images when loading data. --- IO/include/ImageFileFormat.h | 1 + IO/src/ImageFile.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/IO/include/ImageFileFormat.h b/IO/include/ImageFileFormat.h index 330506d..48b262b 100644 --- a/IO/include/ImageFileFormat.h +++ b/IO/include/ImageFileFormat.h @@ -46,6 +46,7 @@ enum EImageFileFormat { eFileFormat_PNG, + eFileFormat_PVR, kNumImageFileFormats }; diff --git a/IO/src/ImageFile.cpp b/IO/src/ImageFile.cpp index 0af6696..e2363f7 100644 --- a/IO/src/ImageFile.cpp +++ b/IO/src/ImageFile.cpp @@ -61,6 +61,8 @@ # include "ImageWriterPNG.h" #endif +#include "ImageLoaderPVR.h" + ////////////////////////////////////////////////////////////////////////////////////////// // // Static helper functions @@ -172,6 +174,10 @@ Image *ImageFile::LoadImage(const unsigned char *rawImageData) const { break; #endif // PNG_FOUND + case eFileFormat_PVR: + loader = new ImageLoaderPVR(rawImageData); + break; + default: fprintf(stderr, "Unable to load image: unknown file format.\n"); return NULL; @@ -215,6 +221,10 @@ EImageFileFormat ImageFile::DetectFileFormat(const CHAR *filename) { if(strcmp(ext, ".png") == 0) { return eFileFormat_PNG; } + else if(strcmp(ext, ".pvr") == 0) { + return eFileFormat_PVR; + } + return kNumImageFileFormats; }