about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-19 10:57:25 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-01-19 10:57:25 +0000
commitdd21ae1bc7a648138d33727628983a3b25a07570 (patch)
treecaf87523cda90c3a0fb235ea6e642765136d3f88 /src/game
parent4eb71856948077b4c0cf9b5ef7178075433b7259 (diff)
downloadzcatch-dd21ae1bc7a648138d33727628983a3b25a07570.tar.gz
zcatch-dd21ae1bc7a648138d33727628983a3b25a07570.zip
large commit. documented a bit. editor updates. general cleanup of everything
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/gc_client.cpp5
-rw-r--r--src/game/client/gc_console.cpp4
-rw-r--r--src/game/client/gc_hooks.cpp2
-rw-r--r--src/game/client/gc_map_image.cpp2
-rw-r--r--src/game/client/gc_menu.cpp6
-rw-r--r--src/game/client/gc_render.cpp2
-rw-r--r--src/game/client/gc_render_map.cpp2
-rw-r--r--src/game/client/gc_render_obj.cpp6
-rw-r--r--src/game/client/gc_skin.cpp2
-rw-r--r--src/game/client/gc_ui.cpp2
-rw-r--r--src/game/editor/ed_editor.cpp2
-rw-r--r--src/game/editor/ed_editor.hpp2
-rw-r--r--src/game/g_collision.cpp2
-rw-r--r--src/game/g_game.cpp4
-rw-r--r--src/game/g_game.h2
-rw-r--r--src/game/g_layers.cpp2
-rw-r--r--src/game/server/gs_game.cpp3
-rw-r--r--src/game/server/gs_game_ctf.cpp3
-rw-r--r--src/game/server/gs_server.cpp11
19 files changed, 34 insertions, 30 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index bbb00c27..f4af5cc3 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -7,6 +7,7 @@
 extern "C" {
 	#include <engine/e_config.h>
 	#include <engine/client/ec_font.h>
+	#include <engine/e_client_interface.h>
 };
 
 #include "../g_game.h"
@@ -1140,7 +1141,7 @@ void render_game()
 			// don't use predicted
 		}
 		else
-			local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_intrapredtick());
+			local_character_pos = mix(predicted_prev_player.pos, predicted_player.pos, client_predintratick());
 	}
 	else if(local_character && local_prev_character)
 	{
@@ -1211,7 +1212,7 @@ void render_game()
 
 			for(int i = 0; i < inp_num_events(); i++)
 			{
-				INPUTEVENT e = inp_get_event(i);
+				INPUT_EVENT e = inp_get_event(i);
 
 				if (!(e.ch >= 0 && e.ch < 32))
 				{
diff --git a/src/game/client/gc_console.cpp b/src/game/client/gc_console.cpp
index ddfb4b48..9cf417e2 100644
--- a/src/game/client/gc_console.cpp
+++ b/src/game/client/gc_console.cpp
@@ -2,7 +2,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_config.h>
 	#include <engine/e_console.h>
 	#include <engine/client/ec_font.h>
@@ -71,7 +71,7 @@ void console_handle_input()
 
 	for(int i = 0; i < inp_num_events(); i++)
 	{
-		INPUTEVENT e = inp_get_event(i);
+		INPUT_EVENT e = inp_get_event(i);
 
 		if (e.key == KEY_F3)
 		{
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index 34196eaa..3f45251e 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -1,6 +1,6 @@
 #include <string.h>
 
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 
 extern "C" {
 	#include <engine/e_config.h>
diff --git a/src/game/client/gc_map_image.cpp b/src/game/client/gc_map_image.cpp
index ab4d9aa7..c2c695ba 100644
--- a/src/game/client/gc_map_image.cpp
+++ b/src/game/client/gc_map_image.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <game/g_mapitems.h>
 #include "gc_map_image.h"
 
diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp
index 09c55d9c..9b72d4b5 100644
--- a/src/game/client/gc_menu.cpp
+++ b/src/game/client/gc_menu.cpp
@@ -9,7 +9,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_config.h>
 	#include <engine/client/ec_font.h>
 }
@@ -206,7 +206,7 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo
 			
 		for(int i = 0; i < inp_num_events(); i++)
 		{
-			INPUTEVENT e = inp_get_event(i);
+			INPUT_EVENT e = inp_get_event(i);
 			char c = e.ch;
 			int k = e.key;
 
@@ -415,7 +415,7 @@ int ui_do_key_reader(void *id, const RECT *rect, int key)
 	{
 		for(int i = 0; i < inp_num_events(); i++)
 		{
-			INPUTEVENT e = inp_get_event(i);
+			INPUT_EVENT e = inp_get_event(i);
 			if(e.key && e.key != KEY_ESC)
 			{
 				new_key = e.key;
diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp
index 1999cb0a..91ae5662 100644
--- a/src/game/client/gc_render.cpp
+++ b/src/game/client/gc_render.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include <game/generated/gc_data.h>
 #include <game/g_protocol.h>
diff --git a/src/game/client/gc_render_map.cpp b/src/game/client/gc_render_map.cpp
index 931fdd18..ec96f583 100644
--- a/src/game/client/gc_render_map.cpp
+++ b/src/game/client/gc_render_map.cpp
@@ -1,5 +1,5 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include "../g_math.h"
 #include "gc_client.h"
 
diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp
index ba248907..bdb4cfac 100644
--- a/src/game/client/gc_render_obj.cpp
+++ b/src/game/client/gc_render_obj.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include "../generated/gc_data.h"
 #include "../g_protocol.h"
@@ -202,7 +202,7 @@ void render_player(
 			// apply predicted results
 			predicted_player.write(&player);
 			predicted_prev_player.write(&prev);
-			intratick = client_intrapredtick();
+			intratick = client_predintratick();
 		}
 	}
 
@@ -254,7 +254,7 @@ void render_player(
 			if(local_info && player_char->hooked_player == local_info->clientid)
 			{
 				hook_pos = mix(vec2(predicted_prev_player.pos.x, predicted_prev_player.pos.y),
-					vec2(predicted_player.pos.x, predicted_player.pos.y), client_intrapredtick());
+					vec2(predicted_player.pos.x, predicted_player.pos.y), client_predintratick());
 			}
 			else
 				hook_pos = mix(vec2(prev_char->hook_x, prev_char->hook_y), vec2(player_char->hook_x, player_char->hook_y), client_intratick());
diff --git a/src/game/client/gc_skin.cpp b/src/game/client/gc_skin.cpp
index ea215edd..6136f76f 100644
--- a/src/game/client/gc_skin.cpp
+++ b/src/game/client/gc_skin.cpp
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include "gc_skin.h"
 #include "../g_math.h"
 
diff --git a/src/game/client/gc_ui.cpp b/src/game/client/gc_ui.cpp
index 25693d02..a7580d5d 100644
--- a/src/game/client/gc_ui.cpp
+++ b/src/game/client/gc_ui.cpp
@@ -1,6 +1,6 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <engine/e_system.h>
-#include <engine/e_interface.h>
+#include <engine/e_client_interface.h>
 #include <engine/e_config.h>
 #include "gc_ui.h"
 
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 6af991b9..15e3fc39 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -6,7 +6,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_common_interface.h>
 	#include <engine/e_datafile.h>
 	#include <engine/e_config.h>
 }
diff --git a/src/game/editor/ed_editor.hpp b/src/game/editor/ed_editor.hpp
index 2c391488..b4061587 100644
--- a/src/game/editor/ed_editor.hpp
+++ b/src/game/editor/ed_editor.hpp
@@ -8,7 +8,7 @@
 
 extern "C" {
 	#include <engine/e_system.h>
-	#include <engine/e_interface.h>
+	#include <engine/e_client_interface.h>
 	#include <engine/e_datafile.h>
 	#include <engine/e_config.h>
 }
diff --git a/src/game/g_collision.cpp b/src/game/g_collision.cpp
index ffccab05..b15af913 100644
--- a/src/game/g_collision.cpp
+++ b/src/game/g_collision.cpp
@@ -2,7 +2,7 @@
 #include <engine/e_system.h>
 #include <game/g_vmath.h>
 #include <math.h>
-#include <engine/e_interface.h>
+#include <engine/e_common_interface.h>
 #include <game/g_math.h>
 #include <game/g_mapitems.h>
 #include <game/g_layers.h>
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp
index ba70c31c..4befc33e 100644
--- a/src/game/g_game.cpp
+++ b/src/game/g_game.cpp
@@ -118,9 +118,9 @@ void player_core::tick()
 	triggered_events = 0;
 	
 	bool grounded = false;
-	if(col_is_solid((int)(pos.x+phys_size/2), (int)(pos.y+phys_size/2+5)))
+	if(col_check_point((int)(pos.x+phys_size/2), (int)(pos.y+phys_size/2+5)))
 		grounded = true;
-	if(col_is_solid((int)(pos.x-phys_size/2), (int)(pos.y+phys_size/2+5)))
+	if(col_check_point((int)(pos.x-phys_size/2), (int)(pos.y+phys_size/2+5)))
 		grounded = true;
 	
 	vec2 direction = normalize(vec2(input.target_x, input.target_y));
diff --git a/src/game/g_game.h b/src/game/g_game.h
index 005f315b..5cece9d9 100644
--- a/src/game/g_game.h
+++ b/src/game/g_game.h
@@ -3,9 +3,9 @@
 #define GAME_GAME_H
 
 #include <engine/e_system.h>
+#include <engine/e_common_interface.h>
 #include <game/g_math.h>
 #include <math.h>
-#include "../engine/e_interface.h"
 #include "g_collision.h"
 
 #include "g_protocol.h"
diff --git a/src/game/g_layers.cpp b/src/game/g_layers.cpp
index f60f13d7..1e46168c 100644
--- a/src/game/g_layers.cpp
+++ b/src/game/g_layers.cpp
@@ -1,4 +1,4 @@
-#include <engine/e_interface.h>
+#include <engine/e_common_interface.h>
 #include "g_layers.h"
 
 static MAPITEM_LAYER_TILEMAP *game_layer;
diff --git a/src/game/server/gs_game.cpp b/src/game/server/gs_game.cpp
index 2d44a499..14b5a2c7 100644
--- a/src/game/server/gs_game.cpp
+++ b/src/game/server/gs_game.cpp
@@ -1,6 +1,7 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
 #include <string.h>
 #include <engine/e_config.h>
+#include <engine/e_server_interface.h>
 #include <game/g_mapitems.h>
 #include "gs_common.h"
 
@@ -190,7 +191,7 @@ int gameobject::on_player_death(class player *victim, class player *killer, int
 
 void gameobject::do_warmup(int seconds)
 {
-	warmup = seconds*SERVER_TICK_SPEED;
+	warmup = seconds*server_tickspeed();
 }
 
 bool gameobject::is_friendly_fire(int cid1, int cid2)
diff --git a/src/game/server/gs_game_ctf.cpp b/src/game/server/gs_game_ctf.cpp
index 7581f015..ee9dae08 100644
--- a/src/game/server/gs_game_ctf.cpp
+++ b/src/game/server/gs_game_ctf.cpp
@@ -1,4 +1,5 @@
 /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#include <engine/e_server_interface.h>
 #include <game/g_mapitems.h>
 #include "gs_common.h"
 #include "gs_game_ctf.h"
@@ -134,7 +135,7 @@ void gameobject_ctf::tick()
 			
 			if(!f->carrying_player && !f->at_stand)
 			{
-				if(server_tick() > f->drop_tick + SERVER_TICK_SPEED*30)
+				if(server_tick() > f->drop_tick + server_tickspeed()*30)
 				{
 					create_sound_global(SOUND_CTF_RETURN);
 					f->reset();
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index d4538ba1..31b1975e 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <engine/e_config.h>
+#include <engine/e_server_interface.h>
 #include <game/g_version.h>
 #include <game/g_collision.h>
 #include <game/g_layers.h>
@@ -371,7 +372,7 @@ projectile::projectile(int type, int owner, vec2 pos, vec2 vel, int span, entity
 {
 	this->type = type;
 	this->pos = pos;
-	this->vel = vel * SERVER_TICK_SPEED; // TODO: remove this
+	this->vel = vel * server_tickspeed(); // TODO: remove this
 	this->lifespan = span;
 	this->owner = owner;
 	this->powner = powner;
@@ -398,8 +399,8 @@ void projectile::tick()
 	if(type == WEAPON_BOMB)
 		gravity = 0;
 	
-	float pt = (server_tick()-start_tick-1)/(float)SERVER_TICK_SPEED;
-	float ct = (server_tick()-start_tick)/(float)SERVER_TICK_SPEED;
+	float pt = (server_tick()-start_tick-1)/(float)server_tickspeed();
+	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
 	vec2 prevpos = calc_pos(pos, vel, gravity, pt);
 	vec2 curpos = calc_pos(pos, vel, gravity, ct);
 
@@ -435,8 +436,8 @@ void projectile::tick()
 
 void projectile::snap(int snapping_client)
 {
-	float ct = (server_tick()-start_tick)/(float)SERVER_TICK_SPEED;
-	vec2 curpos = calc_pos(pos, vel, -7.5f*SERVER_TICK_SPEED, ct);
+	float ct = (server_tick()-start_tick)/(float)server_tickspeed();
+	vec2 curpos = calc_pos(pos, vel, -7.5f*server_tickspeed(), ct);
 
 	if(distance(players[snapping_client].pos, curpos) > 1000.0f)
 		return;