about summary refs log tree commit diff
path: root/src/game/client/gc_client.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:32:17 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:32:17 +0000
commit4a3c2e2c8c3a8dee5828258f920f1c175e952cb0 (patch)
treee0fda9dfad5e605c0810c8f27d719078cd48fd63 /src/game/client/gc_client.cpp
parent727c9a3a3249deec1c5a96025e99c0c654e7ff80 (diff)
downloadzcatch-4a3c2e2c8c3a8dee5828258f920f1c175e952cb0.tar.gz
zcatch-4a3c2e2c8c3a8dee5828258f920f1c175e952cb0.zip
loads of fixes, skidding, velocity ramping and other stuff
Diffstat (limited to 'src/game/client/gc_client.cpp')
-rw-r--r--src/game/client/gc_client.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 7b191fbf..2526ab83 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -1373,11 +1373,15 @@ void render_game()
 	{
 		gfx_mapscreen(0, 0, 300*gfx_screenaspect(), 300);
 		
-		float speed = distance(vec2(netobjects.local_prev_character->x, netobjects.local_prev_character->y),
-			vec2(netobjects.local_character->x, netobjects.local_character->y));
+		/*float speed = distance(vec2(netobjects.local_prev_character->x, netobjects.local_prev_character->y),
+			vec2(netobjects.local_character->x, netobjects.local_character->y));*/
+
+		float velspeed = length(vec2(netobjects.local_character->vx/256.0f, netobjects.local_character->vy/256.0f))*50;
+		
+		float ramp = velocity_ramp(velspeed, tuning.velramp_start, tuning.velramp_range, tuning.velramp_curvature);
 		
 		char buf[512];
-		str_format(buf, sizeof(buf), "%.2f %d", speed/2, netobj_num_corrections());
+		str_format(buf, sizeof(buf), "%.0f\n%.0f\n%.2f\n%d", velspeed, velspeed*ramp, ramp, netobj_num_corrections());
 		gfx_text(0, 150, 50, 12, buf, -1);
 	}
 
@@ -1481,6 +1485,24 @@ void render_game()
 				
 				count++;
 			}
+			
+			y = y+count*6;
+			
+			gfx_texture_set(-1);
+			gfx_blend_normal();
+			gfx_lines_begin();
+			float height = 50.0f;
+			float pv = 1;
+			for(int i = 0; i < 100; i++)
+			{
+				float speed = i/100.0f * 3000;
+				float ramp = velocity_ramp(speed, tuning.velramp_start, tuning.velramp_range, tuning.velramp_curvature);
+				float rampedspeed = (speed * ramp)/1000.0f;
+				gfx_lines_draw((i-1)*2, y+height-pv*height, i*2, y+height-rampedspeed*height);
+				//gfx_lines_draw((i-1)*2, 200, i*2, 200);
+				pv = rampedspeed;
+			}
+			gfx_lines_end();
 		}
 		
 		gfx_text_color(1,1,1,1);