diff --git a/include/tga.h b/include/tga.h index cc57a0f..8fa0805 100644 --- a/include/tga.h +++ b/include/tga.h @@ -10,27 +10,28 @@ #include #include "texture.h" -struct TGAHeader -{ - GLubyte Header[12]; // File Header To Determine File Type +namespace OpenArena{ + struct TGAHeader + { + GLubyte Header[12]; // File Header To Determine File Type + }; + + struct TGA + { + GLubyte header[6]; // Holds The First 6 Useful Bytes Of The File + GLuint bytesPerPixel; // Number Of BYTES Per Pixel (3 Or 4) + GLuint imageSize; // Amount Of Memory Needed To Hold The Image + GLuint type; // The Type Of Image, GL_RGB Or GL_RGBA + GLuint Height; // Height Of Image + GLuint Width; // Width Of Image + GLuint Bpp; // Number Of BITS Per Pixel (24 Or 32) + }; + + TextureImage* LoadTGA(const char *filename); + + const GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0}; // Uncompressed TGA Header + const GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; // Compressed TGA Header + TextureImage* LoadUncompressedTGA(FILE *); // Load an Uncompressed file + TextureImage* LoadCompressedTGA(FILE *); // Load a Compressed file }; - -struct TGA -{ - GLubyte header[6]; // Holds The First 6 Useful Bytes Of The File - GLuint bytesPerPixel; // Number Of BYTES Per Pixel (3 Or 4) - GLuint imageSize; // Amount Of Memory Needed To Hold The Image - GLuint type; // The Type Of Image, GL_RGB Or GL_RGBA - GLuint Height; // Height Of Image - GLuint Width; // Width Of Image - GLuint Bpp; // Number Of BITS Per Pixel (24 Or 32) -}; - -TextureImage* LoadTGA(const char *filename); - -const GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0}; // Uncompressed TGA Header -const GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; // Compressed TGA Header -TextureImage* LoadUncompressedTGA(FILE *); // Load an Uncompressed file -TextureImage* LoadCompressedTGA(FILE *); // Load a Compressed file - #endif diff --git a/src/tga.cpp b/src/tga.cpp index f69cb82..48e2d48 100644 --- a/src/tga.cpp +++ b/src/tga.cpp @@ -1,6 +1,10 @@ #include "../include/tga.h" +#ifdef WIN32 +#pragma warning(disable:4996) +#endif +namespace OpenArena{ TextureImage* LoadTGA(const char * filename) { TGAHeader tgaheader; @@ -662,3 +666,4 @@ TextureImage* LoadCompressedTGA(FILE * fTGA) return image; } */ +}; \ No newline at end of file