*** empty log message ***
This commit is contained in:
72
src/bmp.h
72
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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<Player> players;
|
||||
list<ENTITY> ents;
|
||||
list<Texture> textures;
|
||||
//Texture* textures;
|
||||
//list<GL_MY_TEXTURE> textures;
|
||||
Texture* textures;
|
||||
Texture menuTextures[NUM_MENU_TEXTURES];
|
||||
Window* _window;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace OpenArena
|
||||
short screenWidth;
|
||||
short screenHeight;
|
||||
unsigned int base;
|
||||
unsigned int texture;
|
||||
GLuint texture;
|
||||
bool status;
|
||||
|
||||
public:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_audio.h"
|
||||
#include "oa_audio.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_audio.h"
|
||||
#include "oa_audio.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_game.h"
|
||||
#include "oa_game.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_input.h"
|
||||
#include "oa_input.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_net.h"
|
||||
#include "oa_net.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
18
src/oa_net.h
18
src/oa_net.h
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../include/oa_video.h"
|
||||
#include "oa_video.h"
|
||||
|
||||
namespace OpenArena
|
||||
{
|
||||
|
||||
@@ -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
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef __opengl_h__
|
||||
#define __opengl_h__
|
||||
|
||||
#include<windows.h>
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
#include <gl/glaux.h>
|
||||
|
||||
#endif
|
||||
10
src/screen.h
10
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);
|
||||
|
||||
28
src/tga.h
28
src/tga.h
@@ -15,21 +15,8 @@
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#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
|
||||
@@ -46,20 +33,11 @@ namespace OpenArena{
|
||||
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);
|
||||
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user