Move file format to a separate header in order to better obfuscate the image loaders within the io library.

This commit is contained in:
Pavel Krajcevski 2012-08-27 22:47:20 -04:00
parent db6e76f1b3
commit f2c2f7c9af
4 changed files with 16 additions and 6 deletions

View File

@ -1,11 +1,7 @@
#ifndef _IMAGE_LOADER_H_
#define _IMAGE_LOADER_H_
enum EImageFileFormat {
eFileFormat_PNG,
kNumImageFileFormats
};
#include "ImageFileFormat.h"
class ImageLoader {

View File

@ -1,7 +1,7 @@
#ifndef _IMAGE_FILE_H_
#define _IMAGE_FILE_H_
#include "ImageLoader.h"
#include "ImageFileFormat.h"
class ImageFile {

View File

@ -0,0 +1,10 @@
#ifndef _IMAGE_FILE_FORMAT_H_
#define _IMAGE_FILE_FORMAT_H_
enum EImageFileFormat {
eFileFormat_PNG,
kNumImageFileFormats
};
#endif // _IMAGE_FILE_FORMAT_H_

View File

@ -5,6 +5,7 @@
#include <assert.h>
#include "ImageFile.h"
#include "ImageLoader.h"
#ifdef PNG_FOUND
# include "ImageLoaderPNG.h"
@ -149,6 +150,9 @@ EImageFileFormat ImageFile::DetectFileFormat(const char *filename) {
// !FIXME! Report Error.....
return kNumImageFileFormats;
}
// consume the last character...
dotPos++;
const char *ext = &filename[dotPos];