diff options
-rw-r--r-- | src/GameDraw.cpp | 16 | ||||
-rw-r--r-- | src/GameInitDispose.cpp | 21 | ||||
-rw-r--r-- | src/GameTick.cpp | 39 | ||||
-rw-r--r-- | src/Person.cpp | 16 | ||||
-rw-r--r-- | src/Quaternions.cpp | 15 | ||||
-rw-r--r-- | src/Skeleton.cpp | 4 | ||||
-rw-r--r-- | src/Sprites.cpp | 1 | ||||
-rw-r--r-- | src/TGALoader.cpp | 1 |
8 files changed, 16 insertions, 97 deletions
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp index c79d87e..999b5e3 100644 --- a/src/GameDraw.cpp +++ b/src/GameDraw.cpp @@ -765,7 +765,7 @@ int Game::DrawGLScene(void) GLfloat LightAmbient[]= { fogcolorr/4, fogcolorg/4, fogcolorb/4, 1.0f}; - GLfloat LightDiffuse[]= { fogcolorr*1.6, fogcolorg*1.6, fogcolorr*1.6, 1.0f }; + GLfloat LightDiffuse[]= { fogcolorr*1.6f, fogcolorg*1.6f, fogcolorr*1.6f, 1.0f }; glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient); @@ -775,9 +775,9 @@ int Game::DrawGLScene(void) if(environment!=sunny_environment){ - GLfloat LightAmbient[]= { fogcolorr*.8, fogcolorg*.8, fogcolorb*.8, 1.0f}; + GLfloat LightAmbient[]= { fogcolorr*.8f, fogcolorg*.8f, fogcolorb*.8f, 1.0f}; - GLfloat LightDiffuse[]= { fogcolorr*.8, fogcolorg*.8, fogcolorr*.8, 1.0f }; + GLfloat LightDiffuse[]= { fogcolorr*.8f, fogcolorg*.8f, fogcolorr*.8f, 1.0f }; glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient); @@ -809,7 +809,7 @@ int Game::DrawGLScene(void) GLfloat LightAmbient[]= { 0, 0, 0, 1.0f}; - GLfloat LightDiffuse[]= { .1+sinefluct/5, 0, 0, 1.0f }; + GLfloat LightDiffuse[]= { .1f+sinefluct/5.0f, 0, 0, 1.0f }; @@ -969,18 +969,12 @@ int Game::DrawGLScene(void) glEnable(GL_BLEND); - XYZ move2; - XYZ move; int beginx,endx; int beginz,endz; - int beginoccludex,endoccludex; - - int beginoccludez,endoccludez; - int distsquared; @@ -1009,8 +1003,6 @@ int Game::DrawGLScene(void) bool draw; - int numfail; - int whichtri; XYZ collpoint; diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp index 7f22344..0f303fc 100644 --- a/src/GameInitDispose.cpp +++ b/src/GameInitDispose.cpp @@ -86,21 +86,9 @@ void LoadSounds(bool musictoggle) ALenum formatBuffer1; ALsizei freqBuffer1; - - Str255 sFileName; - - short fRefNum; SInt16 iNumSources, iNumSampleSets; - // EAX test - - unsigned long ulEAXVal; - - long lGlobalReverb; - - - // initialize OpenAL alutInit(NULL, 0); @@ -1161,23 +1149,14 @@ void LoadSounds(bool musictoggle) void Game::LoadingScreen(float percent) { - - float size=1; - glLoadIdentity(); //Clear to black - glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - //Background - - - glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); // Disables Depth Testing diff --git a/src/GameTick.cpp b/src/GameTick.cpp index ce597df..6b28436 100644 --- a/src/GameTick.cpp +++ b/src/GameTick.cpp @@ -328,23 +328,11 @@ void Game::Tick(){ } if(!mainmenu){ - - - - - XYZ facing; - XYZ flatfacing; - float speed=10; - - - if(person[1].health<=0||person[0].health<=0||killedinnocent){ - losedelay-=multiplier/6; - } @@ -530,15 +518,9 @@ void Game::Tick(){ if(visions==2)visions=0; if(visions==0){ - - float rad2deg=56.54866776; - flashamount=1; - flashr=1;flashg=1;flashb=1; - - if(person[0].playercoords.x!=bodycoords.x||person[0].playercoords.z!=bodycoords.z){ XYZ towards; @@ -831,20 +813,12 @@ void Game::Tick(){ int beginz,endz; - int distsquared; - XYZ collpoint; XYZ move; - float howmuchintersect; - int whichtri; - float olddist; - - XYZ nothing; - XYZ underpoint; XYZ overpoint; @@ -855,8 +829,6 @@ void Game::Tick(){ XYZ normalrotated; - XYZ pointrotated; - bool inblock; @@ -4090,11 +4062,11 @@ void Game::Tick(){ //Firing - XYZ end, aim, oldend; + XYZ end, aim; HitStruct hitstruct,temphitstruct; - float olddistance; + float olddistance = 0.0f; float distance; @@ -4334,7 +4306,7 @@ void Game::Tick(){ //Grenade collision - int wherex,wherey,whichsound,severwhat; + int wherex, wherey, whichsound; bool impact; @@ -4514,7 +4486,7 @@ void Game::Tick(){ }else{ - float totalarea; + float totalarea = 0.0f; alSourcefv(gSourceID[bodywhacksound], AL_POSITION, gLoc); @@ -4887,9 +4859,6 @@ void Game::Tick(){ //3d sound - - ALint tempInt; - float gLoc[3]; gLoc[0]=camera.position.x/soundscalefactor; diff --git a/src/Person.cpp b/src/Person.cpp index 43aa873..6490658 100644 --- a/src/Person.cpp +++ b/src/Person.cpp @@ -24,15 +24,11 @@ extern int psychicaimkey; extern int psychickey; HitStruct Person::BulletCollideWithPlayer(int who, XYZ start, XYZ end){ - float damage=20; XYZ tempbulletloc[2]; XYZ collisionpoint; - XYZ sparkpos; GLfloat M[16]; int collide; - float howfar; XYZ average; - XYZ facing; int howmany; float distancemax; HitStruct hitstruct; @@ -198,17 +194,15 @@ void Person::DoAnimations(int who){ if(target>1&&!skeleton.free){ //Footstep sounds if(who==0&&slomo==0&&(targetanimation==joganim||targetanimation==walkanim)&&(targetframe==0||targetframe==8)&&visions==0&&(onground||abs(velocity.y)<1)){ - int whichsound; float gLoc[3]; gLoc[0]=playercoords.x/soundscalefactor; gLoc[1]=playercoords.y/soundscalefactor; gLoc[2]=playercoords.z/soundscalefactor; - whichsound=footstepsound+abs(Random())%5; + int whichsound = footstepsound+abs(Random())%5; alSourcefv(gSourceID[whichsound], AL_POSITION, gLoc); alSourcePlay(gSourceID[whichsound]); } if(targetanimation==zombieeatanim&&(targetframe==3)){ - int whichsound; float gLoc[3]; XYZ soundpoint=(DoRotation(skeleton.joints[skeleton.jointlabels[head]].position,0,playerrotation,0)+playercoords); gLoc[0]=soundpoint.x/soundscalefactor; @@ -303,7 +297,6 @@ void Person::DoAnimations(int who){ XYZ facingdown; XYZ facinghalf; XYZ facingright; - int oldanimation=currentanimation; if(who==0){ playerrotation2=camera.rotation2; //Facing @@ -559,22 +552,18 @@ void Person::DoAnimations(int who){ } void Person::DoAnimationslite(int who){ - - int oldanimation=currentanimation; if(target>1&&!skeleton.free){ //Footstep sounds if(who==0&&(targetanimation==joganim||targetanimation==walkanim)&&(targetframe==0||targetframe==8)&&visions==0&&(onground||abs(velocity.y)<1)){ - int whichsound; float gLoc[3]; gLoc[0]=playercoords.x/soundscalefactor; gLoc[1]=playercoords.y/soundscalefactor; gLoc[2]=playercoords.z/soundscalefactor; - whichsound=footstepsound+abs(Random())%5; + int whichsound = footstepsound+abs(Random())%5; alSourcefv(gSourceID[whichsound], AL_POSITION, gLoc); alSourcePlay(gSourceID[whichsound]); } if(targetanimation==zombieeatanim&&(targetframe==3)){ - int whichsound; float gLoc[3]; XYZ soundpoint=(DoRotation(skeleton.joints[skeleton.jointlabels[head]].position,0,playerrotation,0)+playercoords); gLoc[0]=soundpoint.x/soundscalefactor; @@ -777,7 +766,6 @@ void Person::FindRotationGun(XYZ start, XYZ target) extern Model skeletonmodels[10]; extern Costume costume[2]; int Person::DrawSkeleton(int who){ - GLfloat M[16]; //Guns if(whichgun==sniperrifle){ FindRotationGun(skeleton.joints[skeleton.jointlabels[righthand]].position,skeleton.joints[skeleton.jointlabels[lefthand]].position); diff --git a/src/Quaternions.cpp b/src/Quaternions.cpp index 464c0f2..6edbd3a 100644 --- a/src/Quaternions.cpp +++ b/src/Quaternions.cpp @@ -392,9 +392,8 @@ bool PointInTriangle(Vector *p, Vector normal, float p11, float p12, float p13, bool LineFacet(Vector p1,Vector p2,Vector pa,Vector pb,Vector pc,Vector *p) { float d; - float a1,a2,a3; - float total,denom,mu; - Vector n,pa1,pa2,pa3; + float denom, mu; + Vector n, pa1, pa2, pa3; //Calculate the parameters for the plane n.x = (pb.y - pa.y)*(pc.z - pa.z) - (pb.z - pa.z)*(pc.y - pa.y); @@ -487,9 +486,8 @@ bool PointInTriangle(XYZ *p, XYZ normal, XYZ *p1, XYZ *p2, XYZ *p3) bool LineFacet(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p) { float d; - float a1,a2,a3; - float total,denom,mu; - XYZ n,pa1,pa2,pa3; + float denom, mu; + XYZ n; //Calculate the parameters for the plane n.x = (pb.y - pa.y)*(pc.z - pa.z) - (pb.z - pa.z)*(pc.y - pa.y); @@ -686,9 +684,8 @@ bool sphere_line_intersection ( // This function returns a pointer array which first index indicates // the number of intersection point, followed by coordinate pairs. - float x , y , z; - float a, b, c, mu, i ; - + float a, b, c, i; + if(x1>x3+r&&x2>x3+r)return(0); if(x1<x3-r&&x2<x3-r)return(0); if(y1>y3+r&&y2>y3+r)return(0); diff --git a/src/Skeleton.cpp b/src/Skeleton.cpp index 5f1880f..e039bc4 100644 --- a/src/Skeleton.cpp +++ b/src/Skeleton.cpp @@ -468,7 +468,6 @@ extern Skeleton testskeleton; void Animation::Load(char *fileName) { - float placeholder[3]; files.OpenFile((unsigned char*)fileName); if(files.sFile){ ReadInt(files.sFile, 1, &numframes); @@ -612,7 +611,6 @@ void Animation::Load(char *fileName) void Animation::Load(char *fileName, float rotate) { - float placeholder[3]; files.OpenFile((unsigned char*)fileName); if(files.sFile){ ReadInt(files.sFile, 1, &numframes); @@ -758,8 +756,6 @@ void Skeleton::Load(char *fileName) { int parentID; bool what; - bool lock; - float placeholder[3]; files.OpenFile((unsigned char*)fileName); if(files.sFile){ ReadInt(files.sFile, 1, &num_joints); diff --git a/src/Sprites.cpp b/src/Sprites.cpp index f800282..9c7bd44 100644 --- a/src/Sprites.cpp +++ b/src/Sprites.cpp @@ -177,7 +177,6 @@ void Sprites::draw() { float M[16]; XYZ begProj,endProj,avgProj,persp; - XYZ between; float oolen,dx,dy; float bulletsize; XYZ point; diff --git a/src/TGALoader.cpp b/src/TGALoader.cpp index 3090764..27fd5b9 100644 --- a/src/TGALoader.cpp +++ b/src/TGALoader.cpp @@ -11,7 +11,6 @@ TGAImageRec* LoadTGA( char *filename ) GLuint bytesPerPixel; // Holds Number Of Bytes Per Pixel Used In The TGA File GLuint imageSize; // Used To Store The Image Size When Setting Aside Ram GLuint temp; // Temporary Variable - GLuint type = GL_RGBA; // Set The Default GL Mode To RBGA (32 BPP) TGAImageRec *texture; FILE *file; |