diff options
| author | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-07 23:44:53 +0000 |
|---|---|---|
| committer | relnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-07 23:44:53 +0000 |
| commit | 15eec693c359b0cc3e55219af22b94dcfea889c8 (patch) | |
| tree | d8588ad794b6901c890168854184b95a8b9b374d /Source | |
| parent | 59d189e9eb3f6570b73d8f6be1a372eb875330e1 (diff) | |
| download | blackshades-15eec693c359b0cc3e55219af22b94dcfea889c8.tar.gz | |
more changes
git-svn-id: svn://svn.icculus.org/blackshades/trunk@18 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Decals.h | 6 | ||||
| -rw-r--r-- | Source/Files.h | 6 | ||||
| -rw-r--r-- | Source/Frustum.cpp | 4 | ||||
| -rw-r--r-- | Source/Game.h | 42 | ||||
| -rw-r--r-- | Source/GameDraw.cpp | 15 | ||||
| -rw-r--r-- | Source/Models.h | 2 | ||||
| -rw-r--r-- | Source/Person.h | 8 | ||||
| -rw-r--r-- | Source/Skeleton.h | 7 | ||||
| -rw-r--r-- | Source/Sprites.h | 21 | ||||
| -rw-r--r-- | Source/Text.h | 9 |
10 files changed, 89 insertions, 31 deletions
diff --git a/Source/Decals.h b/Source/Decals.h index 6092b47..c9a66e9 100644 --- a/Source/Decals.h +++ b/Source/Decals.h @@ -48,9 +48,9 @@ class Decals{ void LoadBloodTexture(char *fileName, int which); Decals() { - glDeleteTextures( 1, (const unsigned long *)bulletholetextureptr ); - glDeleteTextures( 1, (const unsigned long *)cratertextureptr ); - glDeleteTextures( 11, (const unsigned long *)bloodtextureptr ); + glDeleteTextures( 1, (const GLuint *)bulletholetextureptr ); + glDeleteTextures( 1, (const GLuint *)cratertextureptr ); + glDeleteTextures( 11, (const GLuint *)bloodtextureptr ); }; }; diff --git a/Source/Files.h b/Source/Files.h index 2a8b80c..96a0518 100644 --- a/Source/Files.h +++ b/Source/Files.h @@ -70,11 +70,14 @@ class Files public: char szSavedGameName[FILE_NAME_SIZE + 1]; short sSavedGameVolume; +#ifdef MAC SFReply sfReply; Boolean bGameSaved; +#endif short sFile; long lSize; - + +#ifdef MAC short OpenFile(Str255 Name); short PromptForSaveAS( short sPromptID, short sNameID, @@ -87,6 +90,7 @@ class Files short OpenFileDialog(); void LoadNamedMap(Str255 Name); void LoadGame(Str255 Name, int animnum); +#endif void LoadMap(); void StartSave(); void EndSave(); diff --git a/Source/Frustum.cpp b/Source/Frustum.cpp index 481593c..5d808c4 100644 --- a/Source/Frustum.cpp +++ b/Source/Frustum.cpp @@ -1,6 +1,10 @@ #include "Frustum.h" #include <math.h> +#ifdef MAC #include "gl.h" +#else +#include <GL/gl.h> +#endif void FRUSTUM:: GetFrustum() { diff --git a/Source/Game.h b/Source/Game.h index ab93377..156a14f 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -1,18 +1,28 @@ #ifndef _GAME_H_ #define _GAME_H_ +#ifdef MAC #include <gl.h> +#include <glu.h> +#include <tk.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> -#include <glu.h> -#include <tk.h> +#ifdef MAC #include <Sound.h> #include <Resources.h> +#endif #include <cstdarg> +#ifdef MAC #include <glm.h> #include <TextUtils.h> +#endif #include "Timer.h" #ifdef MAC #include "AGL_DSp.h" @@ -28,7 +38,12 @@ #include "Models.h" #include "Text.h" #include "TGALoader.h" +#ifdef MAC #include "alut.h" +#else +#include <AL/al.h> +#include <AL/alut.h> +#endif #include "Fog.h" #include "Frustum.h" #include "Sprites.h" @@ -45,15 +60,18 @@ class Game { public: //Eventloop +#ifdef MAC Boolean gQuit; +#endif float gamespeed; double multiplier2,multiplier3,multiplier4,multiplier5,end,start,timetaken,framespersecond; timer theTimer; float sps; int maxfps; +#ifdef MAC AGLContext gOpenGLContext; CGrafPtr theScreen; - +#endif //Graphics int screenwidth,screenheight; float viewdistance; @@ -66,7 +84,9 @@ class Game //Game Functions void HandleKeyDown( char theChar ); +#ifdef MAC void DoEvent( EventRecord *event ); +#endif void EventLoop( void ); void Tick(); void Splat(int k); @@ -74,8 +94,10 @@ class Game void Dispose(); //Mouse +#ifdef MAC Point mouseloc; Point oldmouseloc; +#endif float mouserotation,mouserotation2; float oldmouserotation,oldmouserotation2; float mousesensitivity; @@ -144,9 +166,11 @@ class Game bool reloadtoggle; bool aimtoggle; - + +#ifdef MAC Point olddrawmouse; - +#endif + XYZ vipgoal; XYZ aimer[2]; @@ -202,10 +226,10 @@ class Game bool oldvisionkey; ~Game() { - glDeleteTextures( 1, (const unsigned long *)personspritetextureptr ); - glDeleteTextures( 1, (const unsigned long *)deadpersonspritetextureptr ); - glDeleteTextures( 1, (const unsigned long *)scopetextureptr ); - glDeleteTextures( 1, (const unsigned long *)flaretextureptr ); + glDeleteTextures( 1, (const GLuint *)personspritetextureptr ); + glDeleteTextures( 1, (const GLuint *)deadpersonspritetextureptr ); + glDeleteTextures( 1, (const GLuint *)scopetextureptr ); + glDeleteTextures( 1, (const GLuint *)flaretextureptr ); } }; diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 179eaf6..741dd73 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -1,6 +1,10 @@ #include "Game.h" - +#ifdef POOLOOPS +#include <stdio.h> +#include <unistd.h> +#define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid()) +#endif extern int thirdperson; @@ -493,7 +497,7 @@ int Game::DrawGLScene(GLvoid) - +#ifdef MAC //Mouse (draw) glMatrixMode(GL_PROJECTION); // Select The Projection Matrix @@ -508,12 +512,12 @@ int Game::DrawGLScene(GLvoid) glDisable(GL_TEXTURE_2D); + Point mouseloc; GetMouse(&mouseloc); mouseloc.v=screenheight-mouseloc.v; - glColor4f(.1,0,0,1); @@ -575,9 +579,10 @@ int Game::DrawGLScene(GLvoid) glPopMatrix(); - olddrawmouse=mouseloc; - +#else + STUB_FUNCTION; +#endif //Flash diff --git a/Source/Models.h b/Source/Models.h index 8992beb..1bedfab 100644 --- a/Source/Models.h +++ b/Source/Models.h @@ -47,7 +47,9 @@ class Model{ int LineCheck3(XYZ p1,XYZ p2, XYZ *p,XYZ move,float rotate,float *d); void UpdateVertexArray(); +#ifdef MAC bool load(Str255 Name); +#endif void Scale(float xscale,float yscale,float zscale); void ScaleNormals(float xscale,float yscale,float zscale); void Translate(float xtrans,float ytrans,float ztrans); diff --git a/Source/Person.h b/Source/Person.h index feb2abd..ac31cd4 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -2,10 +2,18 @@ #define _PERSON_H_ /**> HEADER FILES <**/ +#ifdef MAC #include <gl.h> +#else +#include <GL/gl.h> +#endif #include "Quaternions.h" #include "Constants.h" +#ifdef MAC #include "alut.h" +#else +#include <AL/alut.h> +#endif #include "Skeleton.h" #include "Models.h" #include "math.h" diff --git a/Source/Skeleton.h b/Source/Skeleton.h index e59228f..98e59c2 100644 --- a/Source/Skeleton.h +++ b/Source/Skeleton.h @@ -32,10 +32,15 @@ #define rightfoot 20 /**> HEADER FILES <**/ +#ifdef MAC #include <gl.h> +#include "alut.h" +#else +#include <GL/gl.h> +#include <AL/alut.h> +#endif #include "Quaternions.h" #include "Constants.h" -#include "alut.h" #include "Files.h" #include "Models.h" #include "Camera.h" diff --git a/Source/Sprites.h b/Source/Sprites.h index 49ceab5..4383427 100644 --- a/Source/Sprites.h +++ b/Source/Sprites.h @@ -2,13 +2,16 @@ #define _SPRITE_H_ #include "Quaternions.h" +#ifdef MAC #include <gl.h> #include <glu.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#endif #include "Files.h" #include "TGALoader.h" #include "Quaternions.h" -#include "gl.h" -#include "glut.h" #include "Camera.h" #include "Models.h" #include "Fog.h" @@ -78,13 +81,13 @@ class Sprites{ void LoadRainTexture(char *fileName); ~Sprites() { - glDeleteTextures( 1, (const unsigned long *)muzzleflaretextureptr ); - glDeleteTextures( 1, (const unsigned long *)flaretextureptr ); - glDeleteTextures( 1, (const unsigned long *)bullettextureptr ); - glDeleteTextures( 1, (const unsigned long *)smoketextureptr ); - glDeleteTextures( 1, (const unsigned long *)bloodtextureptr ); - glDeleteTextures( 1, (const unsigned long *)raintextureptr ); - glDeleteTextures( 1, (const unsigned long *)snowtextureptr ); + glDeleteTextures( 1, (const GLuint *)muzzleflaretextureptr ); + glDeleteTextures( 1, (const GLuint *)flaretextureptr ); + glDeleteTextures( 1, (const GLuint *)bullettextureptr ); + glDeleteTextures( 1, (const GLuint *)smoketextureptr ); + glDeleteTextures( 1, (const GLuint *)bloodtextureptr ); + glDeleteTextures( 1, (const GLuint *)raintextureptr ); + glDeleteTextures( 1, (const GLuint *)snowtextureptr ); }; }; diff --git a/Source/Text.h b/Source/Text.h index 541dc03..b67f959 100644 --- a/Source/Text.h +++ b/Source/Text.h @@ -4,12 +4,15 @@ /**> HEADER FILES <**/ #include "Quaternions.h" +#ifdef MAC #include <gl.h> #include <glu.h> +#else +#include <GL/gl.h> +#include <GL/glu.h> +#endif #include "Files.h" #include "Quaternions.h" -#include "gl.h" -#include "glut.h" #include "TGALoader.h" class Text{ @@ -22,7 +25,7 @@ class Text{ void glPrint(GLint x, GLint y, char *string, int set, float size, float width, float height); ~Text(){ - glDeleteTextures( 1, (const unsigned long *)FontTexture ); + glDeleteTextures( 1, (const GLuint *)FontTexture ); } }; |
