#define _GAME_H_
#ifndef WIN32
+#ifdef PLATFORM_MACOSX
#include <Carbon.h>
#include "Quicktime.h"
#endif
+#endif
+
//Jordan included glut.h
//#include <glut.h>
#include "TGALoader.h"
#ifdef WIN32
#include "WinInput.h"
+#elif USE_SDL
+#include "SDL.h"
+//#include "SDLInput.h"
#else
#include "Macinput.h"
#endif
#include "Weapons.h"
#include "binio.h"
#include <fstream>
-#include "gl.h"
+#include "gamegl.h"
extern GLuint rabbittexture;
Game();
~Game() {
for(int i=0;i<10;i++){
- if(Mainmenuitems[i])glDeleteTextures( 1, (const unsigned long *)&Mainmenuitems[i] );
+ if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] );
}
- glDeleteTextures( 1, (const unsigned long *)&cursortexture );
- glDeleteTextures( 1, (const unsigned long *)&Maparrowtexture );
- glDeleteTextures( 1, (const unsigned long *)&Mapboxtexture );
- glDeleteTextures( 1, (const unsigned long *)&Mapcircletexture );
- glDeleteTextures( 1, (const unsigned long *)&terraintexture );
- glDeleteTextures( 1, (const unsigned long *)&terraintexture2 );
- if(screentexture>0)glDeleteTextures( 1, (const unsigned long *)&screentexture );
- if(screentexture2>0)glDeleteTextures( 1, (const unsigned long *)&screentexture2 );
- glDeleteTextures( 1, (const unsigned long *)&hawktexture );
- glDeleteTextures( 1, (const unsigned long *)&logotexture );
- glDeleteTextures( 1, (const unsigned long *)&loadscreentexture );
+ glDeleteTextures( 1, &cursortexture );
+ glDeleteTextures( 1, &Maparrowtexture );
+ glDeleteTextures( 1, &Mapboxtexture );
+ glDeleteTextures( 1, &Mapcircletexture );
+ glDeleteTextures( 1, &terraintexture );
+ glDeleteTextures( 1, &terraintexture2 );
+ if(screentexture>0)glDeleteTextures( 1, &screentexture );
+ if(screentexture2>0)glDeleteTextures( 1, &screentexture2 );
+ glDeleteTextures( 1, &hawktexture );
+ glDeleteTextures( 1, &logotexture );
+ glDeleteTextures( 1, &loadscreentexture );
Dispose();
}
extern float screenwidth,screenheight;
#ifdef WIN32
extern HDC hDC;
-#else
+#elif PLATFORM_MACOSX
extern AGLContext gaglContext;
+#elif USE_SDL
+extern SDL_Surface *sdlscreen;
+#else
+#error please define your platform.
#endif
extern int kTextureSize;
extern FRUSTUM frustum;
extern int channels[100];
extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
+#ifdef __GNUC__
+#define LONGLONGCONST(x) (x##ll)
+#else
+#define LONGLONGCONST(x) (x)
+#endif
+
/*********************> DrawGLScene() <*****/
long long Game::MD5_string (char *string){
char temp[256]="";
num=abs(num);
if(num==0)num+=1452;
- while(num<5000000000000000){
+ while(num<LONGLONGCONST(5000000000000000)){
num*=1.85421521;
}
- while(num>9900000000000000){
+ while(num>LONGLONGCONST(9900000000000000)){
num/=1.235421521;
}
color2.red=0;
color2.green=0;
color2.blue=0;
-#ifndef WIN32
+#if PLATFORM_MACOSX
DSpContext_FadeGamma(NULL,200,&color2);
#endif
}
//#include "Carbon.h"
#include "math.h"
-#include "Physicsmath.h"
-#include "gl.h"
+#include "PhysicsMath.h"
+#include "gamegl.h"
/**> Quaternion Structures <**/
#define PI 3.14159265355555897932384626
inline float fast_sqrt (register float arg)
{
-#ifdef WIN32
- return sqrtf( arg);
-#else
+#if PLATFORM_MACOSX
// Can replace with slower return std::sqrt(arg);
register float result;
result = result + 0.5 * result * (1.0 - arg * result * result);
return result * arg;
+#else
+ return sqrtf( arg);
#endif
}
--- /dev/null
+#ifndef _LUGARU_GL_H_
+#define _LUGARU_GL_H_
+
+
+#include <cstring>
+#include <iostream>
+#include <fstream>
+#include <algorithm>
+#include <map>
+#include <string>
+
+#ifndef WIN32
+ #if PLATFORM_LINUX
+ #include "gl.h"
+ #include "glu.h"
+ #include "glext.h"
+ #else
+ #include <gl.h>
+ #include <glu.h>
+ #include <glext.h>
+ #endif
+#else
+ #define WIN32_LEAN_AND_MEAN
+ #define Polygon WinPolygon
+ #include <windows.h>
+ #undef Polygon
+ #define GL_GLEXT_PROTOTYPES
+ #include <gl/gl.h>
+ #include <gl/glu.h>
+ #include <gl/glaux.h>
+ #include <gl/glext.h>
+ #include "WinDefs.h"
+ #include "il/ilut.h"
+
+ #define glDeleteTextures( a, b) glDeleteTextures( (a), (const unsigned int *)(b) );
+#endif
+
+#if !PLATFORM_MACOSX
+struct RGBColor
+{
+ unsigned short red;
+ unsigned short green;
+ unsigned short blue;
+};
+typedef struct RGBColor RGBColor;
+typedef RGBColor * RGBColorPtr;
+#endif
+
+using namespace std;
+
+#include "logger/logger.h"
+
+#endif
+
+++ /dev/null
-#ifndef _LUGARU_GL_H_
-#define _LUGARU_GL_H_
-
-
-#include <cstring>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-#include <map>
-#include <string>
-
-#ifndef WIN32
-
-#include <gl.h>
-#include <glu.h>
-#include <glext.h>
-
-#else
-
-#define WIN32_LEAN_AND_MEAN
-#define Polygon WinPolygon
-#include <windows.h>
-#undef Polygon
-#define GL_GLEXT_PROTOTYPES
-#include <gl/gl.h>
-#include <gl/glu.h>
-#include <gl/glaux.h>
-#include <gl/glext.h>
-#include "WinDefs.h"
-#include "il/ilut.h"
-
-#define glDeleteTextures( a, b) glDeleteTextures( (a), (const unsigned int *)(b) );
-
-struct RGBColor
-{
- unsigned short red;
- unsigned short green;
- unsigned short blue;
-};
-typedef struct RGBColor RGBColor;
-typedef RGBColor * RGBColorPtr;
-
-#endif
-
-using namespace std;
-
-#include "logger/logger.h"
-
-#endif
\ No newline at end of file