aboutsummaryrefslogtreecommitdiff
path: root/src/GameDraw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameDraw.cpp')
-rw-r--r--src/GameDraw.cpp65
1 files changed, 9 insertions, 56 deletions
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp
index 6db98b9..846a7fa 100644
--- a/src/GameDraw.cpp
+++ b/src/GameDraw.cpp
@@ -28,7 +28,6 @@
extern int thirdperson;
extern float multiplier;
-extern int nocolors;
extern bool visions;
extern unsigned int gSourceID[37];
extern Camera camera;
@@ -376,11 +375,10 @@ void Game::DrawGLScene(void)
glEnable(GL_LIGHT0);
// Change fov if zooming with scope
- if (zoom)
+ if (this->zoom)
ReSizeGLScene(this, 10.0f, 0.6f);
else
ReSizeGLScene(this, 90.0f, 0.1f);
- nocolors=0;
} else {
glLightfv(GL_LIGHT0, GL_AMBIENT, (GLfloat[]) { 0.0f, 0.0f, 0.0f, 1.0f });
glLightfv(GL_LIGHT0, GL_DIFFUSE, (GLfloat[]) { 0.1f + sinefluct / 5.0f, 0.0f, 0.0f, 1.0f });
@@ -394,7 +392,6 @@ void Game::DrawGLScene(void)
ReSizeGLScene(this, 120.0f - sinefluct * 20.0f, 0.3f);
glRotatef(sinefluct*10,0,0,.1);
- nocolors=1;
//Pitch higher if moving for effect
if(person[0].currentanimation==idleanim)alSourcef(gSourceID[visionsound], AL_PITCH, 1);
@@ -621,9 +618,9 @@ void Game::DrawGLScene(void)
}
if(draw&&person[i].existing==1){
- if ((sqrlen(person[i].playercoords - camera.position) < 100000 + zoom * 3000000
+ if ((sqrlen(person[i].playercoords - camera.position) < 100000 + this->zoom * 3000000
&& !person[i].skeleton.free)
- || (sqrlen(person[i].averageloc - camera.position) < 100000 + zoom * 3000000
+ || (sqrlen(person[i].averageloc - camera.position) < 100000 + this->zoom * 3000000
&& person[i].skeleton.free)) {
glPushMatrix();
if(person[i].skeleton.free==0){
@@ -634,10 +631,9 @@ void Game::DrawGLScene(void)
else
person[i].DoAnimationslite(i);
}
- if(visions==1)nocolors=1;
- if(visions==1&&person[i].type==eviltype)nocolors=2;
- if(visions==1&&person[i].type==viptype)nocolors=3;
- if(!(visions==1&&i==0)&&!(zoom==1&&i==0))person[i].DrawSkeleton(i);
+ if (!(visions && i == 0)
+ && !(this->zoom && i == 0))
+ person[i].drawSkeleton();
glPopMatrix();
} else {
glPushMatrix();
@@ -705,94 +701,51 @@ void Game::DrawGLScene(void)
}
- //Sprites
-
+ // Sprites
glEnable(GL_CLIP_PLANE0);
-
sprites.draw();
-
glDisable(GL_CLIP_PLANE0);
-
glDisable(GL_FOG);
- //Zoom
-
+ // Zoom
glAlphaFunc(GL_GREATER, 0.01);
-
- if(zoom){
-
+ if (this->zoom) {
glDisable(GL_DEPTH_TEST); // Disables Depth Testing
-
glDisable(GL_CULL_FACE);
-
glDisable(GL_LIGHTING);
-
glDepthMask(0);
-
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
-
glPushMatrix(); // Store The Projection Matrix
-
glLoadIdentity(); // Reset The Projection Matrix
-
glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen
-
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
-
glPushMatrix(); // Store The Modelview Matrix
-
glLoadIdentity(); // Reset The Modelview Matrix
-
glScalef(screenwidth,screenheight,1);
-
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-
glEnable(GL_BLEND);
-
glEnable(GL_TEXTURE_2D);
-
glColor4f(.5,.5,.5,1);
-
glBindTexture(GL_TEXTURE_2D, scopetextureptr);
-
glBegin(GL_QUADS);
-
glTexCoord2f(0,0);
-
glVertex3f(0, 0, 0.0f);
-
glTexCoord2f(1,0);
-
glVertex3f(1, 0, 0.0f);
-
glTexCoord2f(1,1);
-
glVertex3f(1, 1, 0.0f);
-
glTexCoord2f(0,1);
-
glVertex3f(0, 1, 0.0f);
-
glEnd();
-
glDisable(GL_TEXTURE_2D);
-
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
-
glPopMatrix(); // Restore The Old Projection Matrix
-
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
-
glPopMatrix(); // Restore The Old Projection Matrix
-
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
-
glEnable(GL_CULL_FACE);
-
glDisable(GL_BLEND);
-
glDepthMask(1);
-
}
//Flash