summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Game.h3
-rw-r--r--src/GameDraw.cpp71
-rw-r--r--src/GameInitDispose.cpp1
-rw-r--r--src/Skeleton.cpp64
-rw-r--r--src/Skeleton.h1
-rw-r--r--src/config.h1
-rw-r--r--src/config.zig3
7 files changed, 25 insertions, 119 deletions
diff --git a/src/Game.h b/src/Game.h
index f10c136..05bb4d6 100644
--- a/src/Game.h
+++ b/src/Game.h
@@ -110,9 +110,6 @@ public:
 	bool lasersight;
 	bool debug;
 
-	bool blur;
-	bool blurness;
-
 	bool paused;
 	bool menu;
 
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp
index c5f6ec5..e783559 100644
--- a/src/GameDraw.cpp
+++ b/src/GameDraw.cpp
@@ -595,60 +595,39 @@ void Game::DrawGLScene(void)
 			if(person[0].currentanimation!=idleanim)alSourcef(gSourceID[visionsound], AL_PITCH, 2);
 		}
 
-		//Camera
-
-		float bluramount=.1*blurness;
-
-		blur=1-blur;
-
-		//Set rotation/position
-
-		if(thirdperson)glTranslatef(camera.targetoffset.x,camera.targetoffset.y,camera.targetoffset.z);
-
-		if(thirdperson!=2&&(person[0].skeleton.free!=1||thirdperson!=0)){
-
-			glRotatef(camera.visrotation2+-bluramount/2+(float)blur*bluramount,1,0,0);
-
-			glRotatef(camera.visrotation+-bluramount/2+(float)blur*bluramount,0,1,0);
-
-		}
-
-		if(thirdperson==0&&person[0].skeleton.free==1){
-			glRotatef(person[0].skeleton.joints[head].rotate3,0,1,0);
-			glRotatef(180-(person[0].skeleton.joints[head].rotate2+90),0,0,1);
-			glRotatef(person[0].skeleton.joints[head].rotate1+90,0,1,0);
-		}
-
-		if(thirdperson==2){
-
-			glRotatef(oldrot2+-bluramount/2+(float)blur*bluramount,1,0,0);
-
-			glRotatef(oldrot+-bluramount/2+(float)blur*bluramount,0,1,0);
-
+		// Set rotation/position
+		if (thirdperson)
+			glTranslatef(camera.targetoffset.x,
+				camera.targetoffset.y, camera.targetoffset.z);
+		if (thirdperson == 2) {
+			glRotatef(oldrot2, 1, 0, 0);
+			glRotatef(oldrot, 0, 1, 0);
+		} else if (thirdperson == 0 && person[0].skeleton.free) {
+			glRotatef(person[0].skeleton.joints[head].rotate3,
+				0, 1, 0);
+			glRotatef(90 - person[0].skeleton.joints[head].rotate2,
+				0, 0, 1);
+			glRotatef(person[0].skeleton.joints[head].rotate1 + 90,
+				0, 1, 0);
+		} else {
+			glRotatef(camera.visrotation2, 1, 0, 0);
+			glRotatef(camera.visrotation, 0, 1, 0);
 		}
 
-		//Shake camera if grenade explosion
-
-		if(camerashake>0){
-
-			if(!(person[0].aiming<1||person[0].whichgun==grenade||thirdperson)){
-
-				camerashake=0;
-
-			}
-
-			glTranslatef((float)(Random()%100)/100*camerashake,(float)(Random()%100)/100*camerashake,(float)(Random()%100)/100*camerashake);
-
+		// Shake camera if grenade explosion
+		if (camerashake > 0) {
+			if (person[0].aiming && person[0].whichgun != grenade
+			    && thirdperson == 0)
+				camerashake = 0;
+			glTranslatef(Random() % 100 / 100.0f * camerashake,
+				Random() % 100 / 100.0f * camerashake,
+				Random() % 100 / 100.0f * camerashake);
 		}
-
 		camera.Apply();
 
 		glPushMatrix();
-
 			glClipPlane(GL_CLIP_PLANE0, eqn);
-
 			glDisable(GL_CLIP_PLANE0);
-
 		glPopMatrix();
 
 		frustum.GetFrustum();
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 57dca01..6052b66 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -68,7 +68,6 @@ Game* makeGame(Config config, Scores scores)
 	auto game = new Game();
 	game->screenwidth = config.width;
 	game->screenheight = config.height;
-	game->blurness = config.blur;
 	blood = config.blood;
 
 	game->musictoggle = config.music;
diff --git a/src/Skeleton.cpp b/src/Skeleton.cpp
index 58f6035..4a6910b 100644
--- a/src/Skeleton.cpp
+++ b/src/Skeleton.cpp
@@ -207,70 +207,6 @@ void Skeleton::Draw(int  muscleview)
 		jointcolor[2]=0;
 		jointcolor[3]=.5;
 	}
-	//Calc motionblur-ness
-	for(int i=0; i<max_joints; i++){
-		joints[i].oldposition=joints[i].position;
-		joints[i].blurred=findDistance(joints[i].position,joints[i].oldposition)*100;
-		if(joints[i].blurred<1)joints[i].blurred=1;
-	}
-
-	//Do Motionblur
-	glDepthMask(0);
-	glEnable(GL_BLEND);
-	glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-	glBegin(GL_QUADS);
-		for(int i=0; i<max_joints; i++){
-			if(joints[i].hasparent){
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].blurred);
-				glVertex3f(joints[i].position.x,joints[i].position.y,joints[i].position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].parent->blurred);
-				glVertex3f(joints[i].parent->position.x,joints[i].parent->position.y,joints[i].parent->position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].parent->blurred);
-				glVertex3f(joints[i].parent->oldposition.x,joints[i].parent->oldposition.y,joints[i].parent->oldposition.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].blurred);
-				glVertex3f(joints[i].oldposition.x,joints[i].oldposition.y,joints[i].oldposition.z);
-			}
-		}
-		for(int i=0; i<num_muscles; i++){
-			if(muscles[i].type==boneconnect){
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent2->blurred);
-				glVertex3f(muscles[i].parent1->position.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent2->blurred);
-				glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent2->blurred);
-				glVertex3f(muscles[i].parent2->oldposition.x,muscles[i].parent2->oldposition.y,muscles[i].parent2->oldposition.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent1->blurred);
-				glVertex3f(muscles[i].parent1->oldposition.x,muscles[i].parent1->oldposition.y,muscles[i].parent1->oldposition.z);
-			}
-		}
-	glEnd();
-
-	glBegin(GL_LINES);
-		for(int i=0; i<max_joints; i++){
-			if(joints[i].hasparent){
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].blurred);
-				glVertex3f(joints[i].position.x,joints[i].position.y,joints[i].position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/joints[i].parent->blurred);
-				glVertex3f(joints[i].parent->position.x,joints[i].parent->position.y,joints[i].parent->position.z);
-			}
-		}
-		for(int i=0; i<num_muscles; i++){
-			if(muscles[i].type==boneconnect){
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent1->blurred);
-				glVertex3f(muscles[i].parent1->position.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z);
-				glColor4f(jointcolor[0],jointcolor[1],jointcolor[2],jointcolor[3]/muscles[i].parent2->blurred);
-				glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z);
-			}
-		}
-		glColor3f(.6,.6,0);
-		if(muscleview==1)
-		for(int i=0; i<num_muscles; i++){
-			if(muscles[i].type!=boneconnect){
-				glVertex3f(muscles[i].parent1->position.x,muscles[i].parent1->position.y,muscles[i].parent1->position.z);
-				glVertex3f(muscles[i].parent2->position.x,muscles[i].parent2->position.y,muscles[i].parent2->position.z);
-			}
-		}
-	glEnd();
 
 	if(muscleview!=2){
 		glPointSize(3);
diff --git a/src/Skeleton.h b/src/Skeleton.h
index 487c3c8..1f55966 100644
--- a/src/Skeleton.h
+++ b/src/Skeleton.h
@@ -47,7 +47,6 @@ class Joint
 		XYZ realoldposition;
 		XYZ velocity;
 		XYZ offset;
-		float blurred;
 		float length;
 		bool lower;
 		bool hasparent;
diff --git a/src/config.h b/src/config.h
index 9adaab1..c43f1a0 100644
--- a/src/config.h
+++ b/src/config.h
@@ -26,7 +26,6 @@ struct Config {
 	int width;
 	int height;
 	bool vsync;
-	bool blur;
 	bool blood;
 
 	bool music;
diff --git a/src/config.zig b/src/config.zig
index d204ead..ecb199f 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -117,7 +117,6 @@ pub const Config = extern struct {
     width: c_int = 800,
     height: c_int = 600,
     vsync: bool = true,
-    blur: bool = false,
     blood: bool = true,
 
     music: bool = true,
@@ -176,8 +175,6 @@ pub fn parse(base_dir: []const u8) !Config {
                     config.height = try parseInt(c_int, kv.value, 10)
                 else if (eql(u8, kv.key, "vsync"))
                     config.vsync = try parseBool(kv.value)
-                else if (eql(u8, kv.key, "blur"))
-                    config.blur = try parseBool(kv.value)
                 else if (eql(u8, kv.key, "blood"))
                     config.blood = try parseBool(kv.value)
                 else return error.InvalidData;