Changed: Updated to compile under linux
~g2k
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
#ifndef __bmp_h__
|
||||
#define __bmp_h__
|
||||
|
||||
#include <gl/glaux.h>
|
||||
#include <stdio.h>
|
||||
#include "mygl.h"
|
||||
#include "datatypes.h"
|
||||
#include "texture.h"
|
||||
|
||||
//AUX_RGBImageRec *LoadBMP(const char *Filename);
|
||||
TextureImage* LoadBMP(const char* Filename);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
#define __camera_h__
|
||||
|
||||
#include <cmath>
|
||||
#include <windows.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //Currently used for mouse stuff this should be replaced by oa_input
|
||||
#endif
|
||||
#include "vector.h"
|
||||
#include "myGl.h"
|
||||
#include "mygl.h"
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
@@ -85,4 +87,4 @@ private:
|
||||
Vec3f m_vStrafe;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "keys.h"
|
||||
#include "physics.h"
|
||||
#include "datatypes.h"
|
||||
#include "list.h"
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef WIN32
|
||||
//#include <windows.h> //used for VK_ keys and possibly something else. If this file wont compile try uncommenting this.
|
||||
#endif
|
||||
enum {CTRLS_FORWARD, CTRLS_BACKWARD, CTRLS_LOOKLEFT, CTRLS_LOOKRIGHT, CTRLS_LOOKUP,
|
||||
CTRLS_LOOKDOWN, CTRLS_MOVELEFT, CTRLS_MOVERIGHT, CTRLS_MOVEUP, CTRLS_MOVEDOWN,
|
||||
CTRLS_ROLLLEFT, CTRLS_ROLLRIGHT, CTRLS_FIREPRIMARY, CTRLS_FIRESECONDARY,
|
||||
@@ -38,4 +40,4 @@ public:
|
||||
list<uint8> quickMouseLook;
|
||||
list<uint8> rollLeft;
|
||||
list<uint8> rollRight;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef __datatypes_h__
|
||||
#define __datatypes_h__
|
||||
|
||||
#ifdef WIN32
|
||||
typedef unsigned __int8 uint8;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef unsigned __int32 uint32;
|
||||
@@ -25,4 +26,33 @@ typedef word dw;
|
||||
typedef dword dd;
|
||||
typedef qword dq;
|
||||
*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __linux
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned long long uint64;
|
||||
typedef char int8;
|
||||
typedef short int16;
|
||||
typedef long int32;
|
||||
typedef long long int64;
|
||||
typedef signed char sint8;
|
||||
typedef signed short sint16;
|
||||
typedef signed long sint32;
|
||||
typedef signed long long sint64;
|
||||
|
||||
/*
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
typedef unsigned long dword;
|
||||
typedef unsigned long long qword;
|
||||
|
||||
typedef byte db;
|
||||
typedef word dw;
|
||||
typedef dword dd;
|
||||
typedef qword dq;
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
135
include/keys.h
Normal file
135
include/keys.h
Normal file
@@ -0,0 +1,135 @@
|
||||
#ifdef WIN32
|
||||
#include <
|
||||
#define KEY_LBUTTON VK_LBUTTON
|
||||
#define KEY_RBUTTON VK_RBUTTON
|
||||
#define KEY_MBUTTON VK_MBUTTON
|
||||
#define KEY_LEFT VK_LEFT
|
||||
#define KEY_RIGHT VK_RIGHT
|
||||
#define KEY_UP VK_UP
|
||||
#define KEY_DOWN VK_DOWN
|
||||
#define KEY_SPACE VK_SPACE
|
||||
#define KEY_TAB VK_TAB
|
||||
#define KEY_RETURN VK_RETURN
|
||||
#define KEY_SHIFT VK_SHIFT
|
||||
#define KEY_PAUSE VK_PAUSE
|
||||
#define KEY_CONTROL VK_CONTROL
|
||||
#define KEY_CAPITAL VK_CAPITAL
|
||||
#define KEY_ESCAPE VK_ESCAPE
|
||||
#define KEY_PRIOR VK_PRIOR
|
||||
#define KEY_NEXT VK_NEXT
|
||||
#define KEY_END VK_END
|
||||
#define KEY_HOME VK_HOME
|
||||
#define KEY_INSERT VK_INSERT
|
||||
#define KEY_DELETE VK_DELETE
|
||||
#define KEY_LWIN VK_LWIN
|
||||
#define KEY_RWIN VK_RWIN
|
||||
#define KEY_APPS VK_APPS
|
||||
#define KEY_NUMPAD0 VK_NUMPAD0
|
||||
#define KEY_NUMPAD1 VK_NUMPAD1
|
||||
#define KEY_NUMPAD2 VK_NUMPAD2
|
||||
#define KEY_NUMPAD3 VK_NUMPAD3
|
||||
#define KEY_NUMPAD4 VK_NUMPAD4
|
||||
#define KEY_NUMPAD5 VK_NUMPAD5
|
||||
#define KEY_NUMPAD6 VK_NUMPAD6
|
||||
#define KEY_NUMPAD7 VK_NUMPAD7
|
||||
#define KEY_NUMPAD8 VK_NUMPAD8
|
||||
#define KEY_NUMPAD9 VK_NUMPAD9
|
||||
#define KEY_MULTIPLY VK_MULTIPLY
|
||||
#define KEY_ADD VK_ADD
|
||||
#define KEY_SUBTRACT VK_SUBTRACT
|
||||
#define KEY_DIVIDE VK_DIVIDE
|
||||
#define KEY_F1 VK_F1
|
||||
#define KEY_F2 VK_F2
|
||||
#define KEY_F3 VK_F3
|
||||
#define KEY_F4 VK_F4
|
||||
#define KEY_F5 VK_F5
|
||||
#define KEY_F6 VK_F6
|
||||
#define KEY_F7 VK_F7
|
||||
#define KEY_F8 VK_F8
|
||||
#define KEY_F9 VK_F9
|
||||
#define KEY_F10 VK_F10
|
||||
#define KEY_F11 VK_F11
|
||||
#define KEY_F12 VK_F12
|
||||
#define KEY_NUMLOCK VK_NUMLOCK
|
||||
#define KEY_SCROLL VK_SCROLL
|
||||
#define KEY_SEPARATOR VK_SEPARATOR
|
||||
#define KEY_OEM_1 VK_OEM_1
|
||||
#define KEY_OEM_2 VK_OEM_2
|
||||
#define KEY_OEM_3 VK_OEM_3
|
||||
#define KEY_OEM_4 VK_OEM_4
|
||||
#define KEY_OEM_5 VK_OEM_5
|
||||
#define KEY_OEM_6 VK_OEM_6
|
||||
#define KEY_OEM_7 VK_OEM_7
|
||||
#define KEY_OEM_PERIOD VK_OEM_PERIOD
|
||||
#define KEY_OEM_PLUS VK_OEM_PLUS
|
||||
#define KEY_OEM_MINUS VK_OEM_MINUS
|
||||
#define KEY_OEM_COMMA VK_OEM_COMMA
|
||||
#endif
|
||||
|
||||
#ifdef __linux
|
||||
//TODO make these correct
|
||||
#define KEY_LBUTTON 0
|
||||
#define KEY_RBUTTON 1
|
||||
#define KEY_MBUTTON 2
|
||||
#define KEY_LEFT 3
|
||||
#define KEY_RIGHT 4
|
||||
#define KEY_UP 5
|
||||
#define KEY_DOWN 6
|
||||
#define KEY_SPACE 7
|
||||
#define KEY_TAB 8
|
||||
#define KEY_RETURN 9
|
||||
#define KEY_SHIFT 10
|
||||
#define KEY_PAUSE 11
|
||||
#define KEY_CONTROL 12
|
||||
#define KEY_CAPITAL 13
|
||||
#define KEY_ESCAPE 14
|
||||
#define KEY_PRIOR 15
|
||||
#define KEY_NEXT 16
|
||||
#define KEY_END 17
|
||||
#define KEY_HOME 18
|
||||
#define KEY_INSERT 19
|
||||
#define KEY_DELETE 20
|
||||
#define KEY_LWIN 21
|
||||
#define KEY_RWIN 22
|
||||
#define KEY_APPS 23
|
||||
#define KEY_NUMPAD0 24
|
||||
#define KEY_NUMPAD1 25
|
||||
#define KEY_NUMPAD2 26
|
||||
#define KEY_NUMPAD3 27
|
||||
#define KEY_NUMPAD4 28
|
||||
#define KEY_NUMPAD5 29
|
||||
#define KEY_NUMPAD6 30
|
||||
#define KEY_NUMPAD7 31
|
||||
#define KEY_NUMPAD8 32
|
||||
#define KEY_NUMPAD9 33
|
||||
#define KEY_MULTIPLY 34
|
||||
#define KEY_ADD 35
|
||||
#define KEY_SUBTRACT 36
|
||||
#define KEY_DIVIDE 37
|
||||
#define KEY_F1 38
|
||||
#define KEY_F2 39
|
||||
#define KEY_F3 40
|
||||
#define KEY_F4 41
|
||||
#define KEY_F5 42
|
||||
#define KEY_F6 43
|
||||
#define KEY_F7 44
|
||||
#define KEY_F8 45
|
||||
#define KEY_F9 46
|
||||
#define KEY_F10 47
|
||||
#define KEY_F11 48
|
||||
#define KEY_F12 49
|
||||
#define KEY_NUMLOCK 50
|
||||
#define KEY_SCROLL 51
|
||||
#define KEY_SEPARATOR 52
|
||||
#define KEY_OEM_1 53
|
||||
#define KEY_OEM_2 54
|
||||
#define KEY_OEM_3 55
|
||||
#define KEY_OEM_4 56
|
||||
#define KEY_OEM_5 57
|
||||
#define KEY_OEM_6 58
|
||||
#define KEY_OEM_7 59
|
||||
#define KEY_OEM_PERIOD 60
|
||||
#define KEY_OEM_PLUS 61
|
||||
#define KEY_OEM_MINUS 62
|
||||
#define KEY_OEM_COMMA 63
|
||||
#endif
|
||||
@@ -1,22 +1,24 @@
|
||||
#ifndef __LEVEL_H__
|
||||
#define __LEVEL_H__
|
||||
|
||||
#include <windows.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //prolly used for alot but should be removed
|
||||
#endif
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
#include <gl/glaux.h> //for auxDIBImageLoad
|
||||
#include <stdio.h> //for file I/O
|
||||
#include <GL/gl.h>
|
||||
#include <cstdio> //for file I/O
|
||||
|
||||
#include "mydefs.h"
|
||||
#include "bmp.h"
|
||||
#include "tga.h"
|
||||
#include "list.h"
|
||||
#include "bass.h"
|
||||
#ifdef WIN32
|
||||
#include "bass.h" //for audio in windows only this should be replaced by oa_audio
|
||||
#endif
|
||||
#include "vector.h"
|
||||
#include "camera.h"
|
||||
#include "entities.h"
|
||||
@@ -29,7 +31,7 @@
|
||||
using namespace std;
|
||||
|
||||
const float piover180 = 0.0174532925f;
|
||||
const string DEFAULT_TEXTURE_NAME = "oa/textures/default.tga";
|
||||
const string DEFAULT_TEXTURE_NAME = "oa/textures/default.bmp";
|
||||
const unsigned int MAX_CONSOLE_LINES = 30; //The max number of lines to be displayed in the console
|
||||
const unsigned int MAX_CONSOLE_HISTORY_LINES = MAX_CONSOLE_LINES + 20; //The max number of console lines to store in the history
|
||||
const unsigned int MAX_CONSOLE_OUTPUT_LINES = MAX_CONSOLE_LINES;
|
||||
@@ -55,7 +57,6 @@ public:
|
||||
void UpdateConsole(char);
|
||||
uint32 FPS();
|
||||
void ParseCmds(LPSTR);
|
||||
|
||||
void Print(int x, int y, const char* string, unsigned int set);
|
||||
|
||||
/*Not Yet Implemented
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
void FirstPosition();
|
||||
void LastPosition();
|
||||
void Clear();
|
||||
bool Contains(ItemType) const;
|
||||
unsigned int Length();
|
||||
void operator=(const list<ItemType>&);
|
||||
ItemType operator[](LIST_ARRAY_INDEX_TYPE) const;
|
||||
@@ -341,7 +342,7 @@ ItemType& list<ItemType>::operator[](LIST_ARRAY_INDEX_TYPE index)
|
||||
}
|
||||
|
||||
template <class ItemType>
|
||||
unsigned int Length()
|
||||
unsigned int list<ItemType>::Length()
|
||||
{
|
||||
if (head == NULL)
|
||||
{
|
||||
@@ -354,10 +355,25 @@ unsigned int Length()
|
||||
while (temp != NULL)
|
||||
{
|
||||
temp = temp->next;
|
||||
len++
|
||||
len++;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
template<class ItemType>
|
||||
bool list<ItemType>::Contains(ItemType value)
|
||||
{
|
||||
listNodke<ItemType>* temp = head;
|
||||
while(temp != NULL)
|
||||
{
|
||||
if(temp->data == value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
temp = temp->next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef __mydefs_h__
|
||||
#define __mydefs_h__
|
||||
|
||||
#ifdef WIN32 //This whole file is windows specific right now
|
||||
#include <windows.h>
|
||||
|
||||
static HWND g_hWnd = NULL;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#ifndef __MYGL_H__
|
||||
#define __MYGL_H__
|
||||
|
||||
#include <windows.h>
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glu.h>
|
||||
#include <gl/glaux.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //Remove if possible
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
//#include <gl/glaux.h> //Hopefully nothing needs this remove if it works in windows
|
||||
#include <string>
|
||||
#include "datatypes.h"
|
||||
#include "screen.h"
|
||||
#include "tga.h"
|
||||
#include "bmp.h"
|
||||
@@ -13,13 +16,15 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef WIN32
|
||||
//These three are windows specific
|
||||
static HDC hDC=NULL; // Private GDI device context
|
||||
static HGLRC hRC=NULL; // Permanent rendering context
|
||||
static HINSTANCE hInstance; // Application instance
|
||||
#endif
|
||||
static SCREEN g_Screen;
|
||||
int InitGL(GLvoid);
|
||||
|
||||
bool LoadGLTexture(string , unsigned int&, int = GL_LINEAR, int = GL_LINEAR);
|
||||
void FreeGLTexture(unsigned int&);
|
||||
bool LoadGLTexture(string , GLuint&, GLuint = GL_LINEAR, GLuint = GL_LINEAR);
|
||||
void FreeGLTexture(GLuint&);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __glPrint_h__
|
||||
#define __glPrint_h__
|
||||
|
||||
#include "myGL.h"
|
||||
#include "mygl.h"
|
||||
|
||||
class GLFontClass
|
||||
{
|
||||
@@ -26,4 +26,4 @@ public:
|
||||
short ScreenHeight();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include "datatypes.h"
|
||||
#include "myGL.h"
|
||||
#include "mygl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -13,9 +13,9 @@ public:
|
||||
GL_MY_TEXTURE();
|
||||
~GL_MY_TEXTURE();
|
||||
string Filename();
|
||||
uint32 ID();
|
||||
GLuint ID();
|
||||
bool Load(string filename);
|
||||
bool Load(string filename, uint32 min, uint32 mag);
|
||||
bool Load(string filename, GLuint min, GLuint mag);
|
||||
void Free();
|
||||
bool Loaded();
|
||||
bool operator<(const GL_MY_TEXTURE&);
|
||||
@@ -26,10 +26,10 @@ public:
|
||||
bool operator>(const GL_MY_TEXTURE&);
|
||||
|
||||
private:
|
||||
uint32 minFilter;
|
||||
uint32 magFilter;
|
||||
GLuint minFilter;
|
||||
GLuint magFilter;
|
||||
string filename;
|
||||
uint32 id;
|
||||
GLuint id;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2,4 +2,4 @@ class WORLD_PHYSICS
|
||||
{
|
||||
public:
|
||||
WORLD_PHYSICS();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,5 +23,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -25,4 +25,4 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
#include <windows.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h>//WTF why did I need all of these
|
||||
#endif
|
||||
#include "keys.h"
|
||||
#include "datatypes.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -20,4 +23,3 @@ string toupper(string);
|
||||
string word(string, uint32);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,4 +10,4 @@ struct TextureImage
|
||||
unsigned int type;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
#define __TGA_H__
|
||||
|
||||
#pragma comment(lib, "OpenGL32.lib")
|
||||
#include <windows.h>
|
||||
#include <gl\gl.h>
|
||||
#include <stdio.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h> //I think this was only needed because gl.h uses it
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include "texture.h"
|
||||
|
||||
@@ -31,5 +33,4 @@ const GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0}; // Compressed TGA He
|
||||
TextureImage* LoadUncompressedTGA(FILE *); // Load an Uncompressed file
|
||||
TextureImage* LoadCompressedTGA(FILE *); // Load a Compressed file
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -54,4 +54,4 @@ public:
|
||||
|
||||
typedef Vec3d Vec3f;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user