*** empty log message ***
This commit is contained in:
72
src/bmp.h
72
src/bmp.h
@@ -1,82 +1,12 @@
|
|||||||
#ifndef __bmp_h__
|
#ifndef __bmp_h__
|
||||||
#define __bmp_h__
|
#define __bmp_h__
|
||||||
|
|
||||||
#include "Image.h"
|
|
||||||
#include "mygl.h"
|
#include "mygl.h"
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
namespace OpenArena{
|
namespace OpenArena{
|
||||||
|
TextureImage* LoadBMP(const char* Filename);
|
||||||
/*!
|
|
||||||
* \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
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace OpenArena
|
|||||||
// Rotates the camera by angle degrees about the axis specified by the given components.
|
// Rotates the camera by angle degrees about the axis specified by the given components.
|
||||||
// Works the same as glRotatef(angle, X, Y, Z).
|
// Works the same as glRotatef(angle, X, Y, Z).
|
||||||
|
|
||||||
void SetViewByMouse(const Window* window);
|
void SetViewByMouse(Window window);
|
||||||
//Purpose:
|
//Purpose:
|
||||||
// Updates the view Vector based on the change in mouse position since the last time it was called.
|
// 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 "tga.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#ifdef WIN32
|
#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
|
#endif
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
@@ -104,8 +104,8 @@ namespace OpenArena
|
|||||||
uint32 numTriangles;
|
uint32 numTriangles;
|
||||||
list<Player> players;
|
list<Player> players;
|
||||||
list<ENTITY> ents;
|
list<ENTITY> ents;
|
||||||
list<Texture> textures;
|
//list<GL_MY_TEXTURE> textures;
|
||||||
//Texture* textures;
|
Texture* textures;
|
||||||
Texture menuTextures[NUM_MENU_TEXTURES];
|
Texture menuTextures[NUM_MENU_TEXTURES];
|
||||||
Window* _window;
|
Window* _window;
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ using namespace std;
|
|||||||
//These this is windows specific
|
//These this is windows specific
|
||||||
static HINSTANCE hInstance; // Application instance
|
static HINSTANCE hInstance; // Application instance
|
||||||
#endif
|
#endif
|
||||||
extern OpenArena::Window* g_Screen;
|
extern OpenArena::Window g_Screen;
|
||||||
//This doesn't need to be here I think
|
//This doesn't need to be here I think
|
||||||
//int InitGL(GLvoid);
|
//int InitGL(GLvoid);
|
||||||
namespace OpenArena
|
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);
|
void FreeGLTexture(GLuint);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace OpenArena
|
|||||||
short screenWidth;
|
short screenWidth;
|
||||||
short screenHeight;
|
short screenHeight;
|
||||||
unsigned int base;
|
unsigned int base;
|
||||||
unsigned int texture;
|
GLuint texture;
|
||||||
bool status;
|
bool status;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "../include/oa_audio.h"
|
#include "oa_audio.h"
|
||||||
|
|
||||||
namespace OpenArena
|
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
|
namespace OpenArena
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "../include/oa_game.h"
|
#include "oa_game.h"
|
||||||
|
|
||||||
namespace OpenArena
|
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
|
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
|
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
|
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:
|
public:
|
||||||
Screen();
|
Screen();
|
||||||
int GetWidth() const;
|
int GetWidth();
|
||||||
int GetHeight() const;
|
int GetHeight();
|
||||||
int GetColorDepth() const;
|
int GetColorDepth();
|
||||||
bool GetFullscreen() const;
|
bool GetFullscreen();
|
||||||
const char* GetName() const;
|
const char* GetName();
|
||||||
void SetWidth(int);
|
void SetWidth(int);
|
||||||
void SetHeight(int);
|
void SetHeight(int);
|
||||||
void Resize(int, int);
|
void Resize(int, int);
|
||||||
|
|||||||
56
src/tga.h
56
src/tga.h
@@ -15,51 +15,29 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
#include "Image.h"
|
|
||||||
|
|
||||||
namespace OpenArena{
|
namespace OpenArena{
|
||||||
class TargaImage: public Image{
|
struct TGAHeader
|
||||||
private:
|
{
|
||||||
TargaImage();
|
GLubyte Header[12]; // File Header To Determine File Type
|
||||||
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 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 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
|
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
|
#endif
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#ifndef __WorldDefs_h__
|
#ifndef __WorldDefs_h__
|
||||||
#define __WorldDefs_h__
|
#define __WorldDefs_h__
|
||||||
#include "PluginManager.h"
|
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
|
|
||||||
static OpenArena::Level level;
|
static OpenArena::Level level;
|
||||||
static OpenArena::PluginManager g_PluginManager;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user