diff --git a/src/bmp.h b/src/bmp.h index 01fef4e..a2885fc 100644 --- a/src/bmp.h +++ b/src/bmp.h @@ -1,82 +1,12 @@ #ifndef __bmp_h__ #define __bmp_h__ -#include "Image.h" #include "mygl.h" #include "datatypes.h" #include "texture.h" namespace OpenArena{ - - /*! - * \brief - * BitmapImage implements the Image interface and is used to load *.bmp files. - * - * BitmapImage implements the Image interface which replaces the soon-to-be-removed TextureImage class. When complete the texture class will accept an Image as the image to generate the texture from. - * - * \remarks - * I would like to make GetImageData return a const uint8 * but I'm not yet sure this will be possible. To create an editable image use the BufferedImage class which as yet hasn't been implemented. A created BitmapImage is expected to not change once it's created. Doing so may break functionality or cause a crash. - * - * \see - * Image - */ - class BitmapImage: public Image - { - public: - virtual ~BitmapImage(); - virtual uint8 * GetImageData() const; - virtual uint32 GetBitsPerPixel() const; - virtual uint32 GetBytesPerPixel() const; - virtual uint32 GetWidth() const; - virtual uint32 GetHeight() const; - virtual Image::Type GetType() const; - static BitmapImage* CreateFromFile(const char* filename); - static TextureImage* LoadBMP(const char* Filename); - private: - BitmapImage(); - BitmapImage(uint32 width, uint32 height, uint32 = 24, Image::Type = Image::Type_RGB); - uint8* _data; - uint32 _width; - uint32 _height; - uint32 _bpp; - Image::Type _type; - public: -#pragma pack(push,1) - struct BITMAP_HEADER - { - uint16 type; - uint32 size; - uint16 reserved1; - uint16 reserved2; - uint32 offset; - }; - - struct BITMAP_INFO - { - uint32 size; - uint32 width; - uint32 height; - uint16 planes; - uint16 bitCount; - uint32 compression; - uint32 sizeImage; - uint32 xPelsPerMeter; - uint32 yPelsPerMeter; - uint32 clrUsed; - uint32 clrImportant; - }; - - struct BITMAP_QUAD - { - uint8 blue; - uint8 green; - uint8 red; - uint8 reserved; - }; -#pragma pack(pop) - -#define BITMAP_MAGIC 19778 - }; + TextureImage* LoadBMP(const char* Filename); }; #endif diff --git a/src/camera.h b/src/camera.h index 169e7d2..73202a4 100644 --- a/src/camera.h +++ b/src/camera.h @@ -64,7 +64,7 @@ namespace OpenArena // Rotates the camera by angle degrees about the axis specified by the given components. // Works the same as glRotatef(angle, X, Y, Z). - void SetViewByMouse(const Window* window); + void SetViewByMouse(Window window); //Purpose: // Updates the view Vector based on the change in mouse position since the last time it was called. diff --git a/src/ctrls.h b/src/ctrls.h index 10451c1..fa89e40 100644 --- a/src/ctrls.h +++ b/src/ctrls.h @@ -39,4 +39,4 @@ namespace OpenArena{ list rollLeft; list rollRight; }; -}; \ No newline at end of file +}; diff --git a/src/entity.h b/src/entity.h index 931a7a4..afb2b7f 100644 --- a/src/entity.h +++ b/src/entity.h @@ -28,4 +28,4 @@ public: uint16 health; }; -#endif \ No newline at end of file +#endif diff --git a/src/level.h b/src/level.h index 172ed28..8a9d10d 100644 --- a/src/level.h +++ b/src/level.h @@ -25,7 +25,7 @@ #include "tga.h" #include "list.h" #ifdef WIN32 -#include "../lib/bass.h" //for audio in windows only this should be replaced by oa_audio +#include "bass.h" //for audio in windows only this should be replaced by oa_audio #endif #include "vector.h" #include "camera.h" @@ -104,8 +104,8 @@ namespace OpenArena uint32 numTriangles; list players; list ents; - list textures; - //Texture* textures; + //list textures; + Texture* textures; Texture menuTextures[NUM_MENU_TEXTURES]; Window* _window; diff --git a/src/mygl.h b/src/mygl.h index f905d0a..4b8cac7 100644 --- a/src/mygl.h +++ b/src/mygl.h @@ -29,12 +29,12 @@ using namespace std; //These this is windows specific static HINSTANCE hInstance; // Application instance #endif -extern OpenArena::Window* g_Screen; +extern OpenArena::Window g_Screen; //This doesn't need to be here I think //int InitGL(GLvoid); namespace OpenArena { - bool LoadGLTexture(string , GLuint&, GLuint = GL_LINEAR, GLuint = GL_LINEAR); + bool LoadGLTexture(string , GLuint, GLuint = GL_LINEAR, GLuint = GL_LINEAR); void FreeGLTexture(GLuint); }; #endif diff --git a/src/myglFont.h b/src/myglFont.h index eaee119..c19cec2 100644 --- a/src/myglFont.h +++ b/src/myglFont.h @@ -11,7 +11,7 @@ namespace OpenArena short screenWidth; short screenHeight; unsigned int base; - unsigned int texture; + GLuint texture; bool status; public: diff --git a/src/oa_audio.cpp b/src/oa_audio.cpp index 4eba92c..7d6ed40 100644 --- a/src/oa_audio.cpp +++ b/src/oa_audio.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_audio.h" +#include "oa_audio.h" namespace OpenArena { diff --git a/src/oa_audio.h b/src/oa_audio.h deleted file mode 100644 index 1f0ebbf..0000000 --- a/src/oa_audio.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __oa_audio_h__ -#define __oa_audio_h__ - -#include "vector.h" - -//NO REAL work is done by _init or _fini they should just call -// Init and DeInit instead. -void _init(); -void _fini(); -void Init(); -void DeInit(); - -namespace OpenArena -{ - namespace Audio - { - class Stream - { - Stream(); - Stream(const char* filename); - bool Load(const char* filename); - void UnLoad(); - bool Play(); - bool Play3D(); - SetPosition(Vec3d position); - Vec3d GetPosition(); - }; - }; -}; - -#endif diff --git a/src/oa_audio_alsa.cpp b/src/oa_audio_alsa.cpp index 4eba92c..7d6ed40 100644 --- a/src/oa_audio_alsa.cpp +++ b/src/oa_audio_alsa.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_audio.h" +#include "oa_audio.h" namespace OpenArena { diff --git a/src/oa_game.cpp b/src/oa_game.cpp index c973bbf..76291cd 100644 --- a/src/oa_game.cpp +++ b/src/oa_game.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_game.h" +#include "oa_game.h" namespace OpenArena { diff --git a/src/oa_game.h b/src/oa_game.h deleted file mode 100644 index 3ca2473..0000000 --- a/src/oa_game.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __oa_game_h__ -#define __oa_game_h__ - -//NO REAL work is done by _init or _fini they should just call -// Init and DeInit instead. -void _init(); -void _fini(); -void Init(); -void DeInit(); - -namespace OpenArena -{ - namespace Game - { - }; -}; - -#endif diff --git a/src/oa_input.cpp b/src/oa_input.cpp index 1ea7988..5e06d26 100644 --- a/src/oa_input.cpp +++ b/src/oa_input.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_input.h" +#include "oa_input.h" namespace OpenArena { diff --git a/src/oa_input.h b/src/oa_input.h deleted file mode 100644 index 0ea772c..0000000 --- a/src/oa_input.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __oa_input_h__ -#define __oa_input_h__ - -//NO REAL work is done by _init or _fini they should just call -// Init and DeInit instead. -void _init(); -void _fini(); -void Init(); -void DeInit(); - -namespace OpenArena -{ - namespace Input - { - }; -}; - -#endif diff --git a/src/oa_net.cpp b/src/oa_net.cpp index 7ff5f15..ed5089b 100644 --- a/src/oa_net.cpp +++ b/src/oa_net.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_net.h" +#include "oa_net.h" namespace OpenArena { diff --git a/src/oa_net.h b/src/oa_net.h deleted file mode 100644 index b1df5e3..0000000 --- a/src/oa_net.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __oa_net_h__ -#define __oa_net_h__ - -//NO REAL work is done by _init or _fini they should just call -// Init and DeInit instead. -void _init(); -void _fini(); -void Init(); -void DeInit(); - -namespace OpenArena -{ - namespace Net - { - }; -}; - -#endif diff --git a/src/oa_video.cpp b/src/oa_video.cpp index 92f8ef3..9b2bd38 100644 --- a/src/oa_video.cpp +++ b/src/oa_video.cpp @@ -12,7 +12,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "../include/oa_video.h" +#include "oa_video.h" namespace OpenArena { diff --git a/src/oa_video.h b/src/oa_video.h deleted file mode 100644 index cd560fd..0000000 --- a/src/oa_video.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __oa_video_h__ -#define __oa_video_h__ - -//NO REAL work is done by _init or _fini they should just call -// Init and DeInit instead. -void _init(); -void _fini(); -void Init(); -void DeInit(); - -namespace OpenArena -{ - namespace Video - { - }; -}; - -#endif diff --git a/src/opengl.h b/src/opengl.h deleted file mode 100644 index 1dbb83e..0000000 --- a/src/opengl.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __opengl_h__ -#define __opengl_h__ - -#include -#include -#include -#include - -#endif \ No newline at end of file diff --git a/src/screen.h b/src/screen.h index 7fed272..cf84c53 100644 --- a/src/screen.h +++ b/src/screen.h @@ -9,11 +9,11 @@ namespace OpenArena { public: Screen(); - int GetWidth() const; - int GetHeight() const; - int GetColorDepth() const; - bool GetFullscreen() const; - const char* GetName() const; + int GetWidth(); + int GetHeight(); + int GetColorDepth(); + bool GetFullscreen(); + const char* GetName(); void SetWidth(int); void SetHeight(int); void Resize(int, int); diff --git a/src/tga.h b/src/tga.h index 821fbe1..083bb1e 100644 --- a/src/tga.h +++ b/src/tga.h @@ -15,51 +15,29 @@ #include #include #include "texture.h" -#include "Image.h" namespace OpenArena{ - class TargaImage: public Image{ - private: - TargaImage(); - TargaImage(uint32 width, uint32 height, uint32 bpp = 24, Image::Type type = Image::Type_RGB); - static TextureImage* LoadUncompressedTGA(FILE *); // Load an Uncompressed file - static TextureImage* LoadCompressedTGA(FILE *); // Load a Compressed file - uint32 _width; - uint32 _height; - uint32 _bpp; - Image::Type _type; - uint8 * _data; - public: - 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) - }; - - virtual uint8 * GetImageData() const; - virtual uint32 GetBitsPerPixel() const; - virtual uint32 GetBytesPerPixel() const; - virtual uint32 GetWidth() const; - virtual uint32 GetHeight() const; - virtual Image::Type GetType() const; - virtual ~TargaImage(void); - static TargaImage* CreateFromFile(const char* filename); - static TextureImage* LoadTGA(const char *filename); - + 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 }; #endif diff --git a/src/worlddefs.h b/src/worlddefs.h index d791b66..add134a 100644 --- a/src/worlddefs.h +++ b/src/worlddefs.h @@ -1,9 +1,8 @@ #ifndef __WorldDefs_h__ #define __WorldDefs_h__ -#include "PluginManager.h" + #include "level.h" static OpenArena::Level level; -static OpenArena::PluginManager g_PluginManager; #endif