about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/gc_anim.h20
-rw-r--r--src/game/client/gc_client.cpp60
-rw-r--r--src/game/client/gc_client.h42
-rw-r--r--src/game/client/gc_effects.cpp18
-rw-r--r--src/game/client/gc_hooks.cpp36
-rw-r--r--src/game/client/gc_menu.cpp14
-rw-r--r--src/game/client/gc_particles.cpp4
-rw-r--r--src/game/client/gc_render.cpp10
-rw-r--r--src/game/client/gc_render.h12
-rw-r--r--src/game/client/gc_render_obj.cpp78
10 files changed, 147 insertions, 147 deletions
diff --git a/src/game/client/gc_anim.h b/src/game/client/gc_anim.h
index 115f7353..f6e9aac3 100644
--- a/src/game/client/gc_anim.h
+++ b/src/game/client/gc_anim.h
@@ -1,14 +1,14 @@
 
-struct animstate
+struct ANIM_STATE
 {
-	keyframe body;
-	keyframe back_foot;
-	keyframe front_foot;
-	keyframe attach;
+	ANIM_KEYFRAME body;
+	ANIM_KEYFRAME back_foot;
+	ANIM_KEYFRAME front_foot;
+	ANIM_KEYFRAME attach;
 };
 
-void anim_seq_eval(sequence *seq, float time, keyframe *frame);
-void anim_eval(animation *anim, float time, animstate *state);
-void anim_add_keyframe(keyframe *seq, keyframe *added, float amount);
-void anim_add(animstate *state, animstate *added, float amount);
-void anim_eval_add(animstate *state, animation *anim, float time, float amount);
+void anim_seq_eval(ANIM_SEQUENCE *seq, float time, ANIM_KEYFRAME *frame);
+void anim_eval(ANIMATION *anim, float time, ANIM_STATE *state);
+void anim_add_keyframe(ANIM_KEYFRAME *seq, ANIM_KEYFRAME *added, float amount);
+void anim_add(ANIM_STATE *state, ANIM_STATE *added, float amount);
+void anim_eval_add(ANIM_STATE *state, ANIMATION *anim, float time, float amount);
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index ae22a479..89c7ffcd 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -24,7 +24,7 @@ extern "C" {
 #include "gc_anim.h"
 #include "gc_console.h"
 
-struct data_container *data = 0;
+//struct data_container *data = 0;
 int64 debug_firedelay = 0;
 
 NETOBJ_PLAYER_INPUT input_data = {0};
@@ -39,7 +39,7 @@ int emoticon_selector_active = 0;
 int scoreboard_active = 0;
 static int emoticon_selected_emote = -1;
 
-tuning_params tuning;
+TUNING_PARAMS tuning;
 
 vec2 mouse_pos;
 vec2 local_character_pos;
@@ -53,12 +53,12 @@ const NETOBJ_FLAG *flags[2] = {0,0};
 const NETOBJ_GAME *gameobj = 0;
 */
 
-snapstate netobjects;
+SNAPSTATE netobjects;
 
 int picked_up_weapon = -1;
 
-client_data client_datas[MAX_CLIENTS];
-void client_data::update_render_info()
+CLIENT_DATA client_datas[MAX_CLIENTS];
+void CLIENT_DATA::update_render_info()
 {
 	render_info = skin_info;
 
@@ -82,7 +82,7 @@ int64 broadcast_time = 0;
 
 void snd_play_random(int chn, int setid, float vol, vec2 pos)
 {
-	soundset *set = &data->sounds[setid];
+	SOUNDSET *set = &data->sounds[setid];
 
 	if(!set->num_sounds)
 		return;
@@ -280,7 +280,7 @@ void chat_add_line(int client_id, int team, const char *line)
 }
 
 
-killmsg killmsgs[killmsg_max];
+KILLMSG killmsgs[killmsg_max];
 int killmsg_current = 0;
 
 //bool add_trail = false;
@@ -347,18 +347,18 @@ void line_input::process_input(INPUT_EVENT e)
 	}
 }
 
-input_stack_handler::input_stack_handler()
+INPUT_STACK_HANDLER::INPUT_STACK_HANDLER()
 {
 	num_handlers = 0;
 }
 
-void input_stack_handler::add_handler(callback cb, void *user)
+void INPUT_STACK_HANDLER::add_handler(CALLBACK cb, void *user)
 {
 	user_data[num_handlers] = user;
 	handlers[num_handlers++] = cb;
 }
 
-void input_stack_handler::dispatch_input()
+void INPUT_STACK_HANDLER::dispatch_input()
 {
 	for(int i = 0; i < inp_num_events(); i++)
 	{
@@ -378,7 +378,7 @@ void input_stack_handler::dispatch_input()
 }
 
 
-input_stack_handler input_stack;
+INPUT_STACK_HANDLER input_stack;
 
 extern int render_popup(const char *caption, const char *text, const char *button_text);
 
@@ -395,7 +395,7 @@ void process_events(int snaptype)
 			NETEVENT_DAMAGEIND *ev = (NETEVENT_DAMAGEIND *)data;
 			effect_damage_indicator(vec2(ev->x, ev->y), get_direction(ev->angle));
 		}
-		else if(item.type == NETEVENTTYPE_AIR_JUMP)
+		else if(item.type == NETEVENTTYPE_AIRJUMP)
 		{
 			NETEVENT_COMMON *ev = (NETEVENT_COMMON *)data;
 			effect_air_jump(vec2(ev->x, ev->y));
@@ -420,9 +420,9 @@ void process_events(int snaptype)
 			NETEVENT_DEATH *ev = (NETEVENT_DEATH *)data;
 			effect_playerdeath(vec2(ev->x, ev->y), ev->cid);
 		}
-		else if(item.type == NETEVENTTYPE_SOUND_WORLD)
+		else if(item.type == NETEVENTTYPE_SOUNDWORLD)
 		{
-			NETEVENT_SOUND_WORLD *ev = (NETEVENT_SOUND_WORLD *)data;
+			NETEVENT_SOUNDWORLD *ev = (NETEVENT_SOUNDWORLD *)data;
 			snd_play_random(CHN_WORLD, ev->soundid, 1.0f, vec2(ev->x, ev->y));
 		}
 	}
@@ -474,7 +474,7 @@ void send_kill(int client_id)
 	client_send_msg();
 }
 
-void anim_seq_eval(sequence *seq, float time, keyframe *frame)
+void anim_seq_eval(ANIM_SEQUENCE *seq, float time, ANIM_KEYFRAME *frame)
 {
 	if(seq->num_frames == 0)
 	{
@@ -490,8 +490,8 @@ void anim_seq_eval(sequence *seq, float time, keyframe *frame)
 	else
 	{
 		//time = max(0.0f, min(1.0f, time / duration)); // TODO: use clamp
-		keyframe *frame1 = 0;
-		keyframe *frame2 = 0;
+		ANIM_KEYFRAME *frame1 = 0;
+		ANIM_KEYFRAME *frame2 = 0;
 		float blend = 0.0f;
 
 		// TODO: make this smarter.. binary search
@@ -516,7 +516,7 @@ void anim_seq_eval(sequence *seq, float time, keyframe *frame)
 	}
 }
 
-void anim_eval(animation *anim, float time, animstate *state)
+void anim_eval(ANIMATION *anim, float time, ANIM_STATE *state)
 {
 	anim_seq_eval(&anim->body, time, &state->body);
 	anim_seq_eval(&anim->back_foot, time, &state->back_foot);
@@ -524,14 +524,14 @@ void anim_eval(animation *anim, float time, animstate *state)
 	anim_seq_eval(&anim->attach, time, &state->attach);
 }
 
-void anim_add_keyframe(keyframe *seq, keyframe *added, float amount)
+void anim_add_keyframe(ANIM_KEYFRAME *seq, ANIM_KEYFRAME *added, float amount)
 {
 	seq->x += added->x*amount;
 	seq->y += added->y*amount;
 	seq->angle += added->angle*amount;
 }
 
-void anim_add(animstate *state, animstate *added, float amount)
+void anim_add(ANIM_STATE *state, ANIM_STATE *added, float amount)
 {
 	anim_add_keyframe(&state->body, &added->body, amount);
 	anim_add_keyframe(&state->back_foot, &added->back_foot, amount);
@@ -539,9 +539,9 @@ void anim_add(animstate *state, animstate *added, float amount)
 	anim_add_keyframe(&state->attach, &added->attach, amount);
 }
 
-void anim_eval_add(animstate *state, animation *anim, float time, float amount)
+void anim_eval_add(ANIM_STATE *state, ANIMATION *anim, float time, float amount)
 {
-	animstate add;
+	ANIM_STATE add;
 	anim_eval(anim, time, &add);
 	anim_add(state, &add, amount);
 }
@@ -694,7 +694,7 @@ void render_spectators(float x, float y, float w)
 
 void render_scoreboard(float x, float y, float w, int team, const char *title)
 {
-	animstate idlestate;
+	ANIM_STATE idlestate;
 	anim_eval(&data->animations[ANIM_BASE], 0, &idlestate);
 	anim_eval_add(&idlestate, &data->animations[ANIM_IDLE], 0, 1.0f);
 
@@ -892,7 +892,7 @@ void render_game()
 	if(netobjects.local_info && netobjects.local_info->team == -1)
 		spectate = true;
 
-	animstate idlestate;
+	ANIM_STATE idlestate;
 	anim_eval(&data->animations[ANIM_BASE], 0, &idlestate);
 	anim_eval_add(&idlestate, &data->animations[ANIM_IDLE], 0, 1.0f);
 
@@ -1117,7 +1117,7 @@ void render_game()
 		// render cursor
 		if (!menu_active && !emoticon_selector_active)
 		{
-			select_sprite(data->weapons[netobjects.local_character->weapon%data->num_weapons].sprite_cursor);
+			select_sprite(data->weapons.id[netobjects.local_character->weapon%NUM_WEAPONS].sprite_cursor);
 			float cursorsize = 64;
 			draw_sprite(local_target_pos.x, local_target_pos.y, cursorsize);
 		}
@@ -1132,7 +1132,7 @@ void render_game()
 		gfx_mapscreen(0,0,300*gfx_screenaspect(),300);
 		
 		// if weaponstage is active, put a "glow" around the stage ammo
-		select_sprite(data->weapons[netobjects.local_character->weapon%data->num_weapons].sprite_proj);
+		select_sprite(data->weapons.id[netobjects.local_character->weapon%NUM_WEAPONS].sprite_proj);
 		for (int i = 0; i < min(netobjects.local_character->ammocount, 10); i++)
 			gfx_quads_drawTL(x+i*12,y+24,10,10);
 
@@ -1215,7 +1215,7 @@ void render_game()
 			{
 				gfx_texture_set(data->images[IMAGE_GAME].id);
 				gfx_quads_begin();
-				select_sprite(data->weapons[killmsgs[r].weapon].sprite_body);
+				select_sprite(data->weapons.id[killmsgs[r].weapon].sprite_body);
 				draw_sprite(x, y+28, 96);
 				gfx_quads_end();
 			}
@@ -1410,7 +1410,7 @@ void render_game()
 							const char *name = client_datas[id].name;
 							float w = gfx_text_width(0, 10, name, -1);
 							gfx_text(0, whole-40-5-w, 300-40-15+t*20+2, 10, name, -1);
-							tee_render_info info = client_datas[id].render_info;
+							TEE_RENDER_INFO info = client_datas[id].render_info;
 							info.size = 18.0f;
 							
 							render_tee(&idlestate, &info, EMOTE_NORMAL, vec2(1,0),
@@ -1588,11 +1588,11 @@ void render_game()
 			gfx_text(0, 150*gfx_screenaspect()-w/2, 35, 14, broadcast_text, -1);
 		}
 		
-		tuning_params standard_tuning;
+		TUNING_PARAMS standard_tuning;
 
 		// render warning about non standard tuning
 		bool flash = time_get()/(time_freq()/2)%2 == 0;
-		if(config.cl_warning_tuning && memcmp(&standard_tuning, &tuning, sizeof(tuning_params)) != 0)
+		if(config.cl_warning_tuning && memcmp(&standard_tuning, &tuning, sizeof(TUNING_PARAMS)) != 0)
 		{
 			const char *text = "Warning! Server is running non-standard tuning.";
 			if(flash)
diff --git a/src/game/client/gc_client.h b/src/game/client/gc_client.h
index 15df5dc2..bb8a69cf 100644
--- a/src/game/client/gc_client.h
+++ b/src/game/client/gc_client.h
@@ -13,14 +13,14 @@ enum
 	CHN_GLOBAL,
 };
 
-extern struct data_container *data;
+//extern struct data_container *data;
 
 extern vec2 mouse_pos;
 extern vec2 local_character_pos;
 extern vec2 local_target_pos;
 
 // snap pointers
-struct snapstate
+struct SNAPSTATE
 {
 	const NETOBJ_PLAYER_CHARACTER *local_character;
 	const NETOBJ_PLAYER_CHARACTER *local_prev_character;
@@ -33,7 +33,7 @@ struct snapstate
 	int num_players;
 };
 
-extern snapstate netobjects;
+extern SNAPSTATE netobjects;
 
 /*
 extern const NETOBJ_PLAYER_CHARACTER *local_character;
@@ -43,11 +43,11 @@ extern const NETOBJ_FLAG *flags[2];
 extern const NETOBJ_GAME *gameobj;
 * */
 
-extern tuning_params tuning;
+extern TUNING_PARAMS tuning;
 
 // predicted players
-extern player_core predicted_prev_player;
-extern player_core predicted_player;
+extern PLAYER_CORE predicted_prev_player;
+extern PLAYER_CORE predicted_player;
 
 // input
 extern NETOBJ_PLAYER_INPUT input_data;
@@ -112,13 +112,13 @@ public:
 	unsigned cursor_offset() const { return cursor_pos; }
 };
 
-class input_stack_handler
+class INPUT_STACK_HANDLER
 {
 public:
-	typedef bool (*callback)(INPUT_EVENT e, void *user);
+	typedef bool (*CALLBACK)(INPUT_EVENT e, void *user);
 	
-	input_stack_handler();
-	void add_handler(callback cb, void *user_data);
+	INPUT_STACK_HANDLER();
+	void add_handler(CALLBACK cb, void *user_data);
 	void dispatch_input();
 	
 private:
@@ -127,19 +127,19 @@ private:
 		MAX_HANDLERS=16
 	};
 	
-	callback handlers[MAX_HANDLERS];
+	CALLBACK handlers[MAX_HANDLERS];
 	void *user_data[MAX_HANDLERS];
 	int num_handlers;
 };
 
-extern input_stack_handler input_stack;
+extern INPUT_STACK_HANDLER input_stack;
 
 
 extern int emoticon_selector_active; // TODO: ugly
 extern int scoreboard_active; // TODO: ugly
 
 // client data
-struct client_data
+struct CLIENT_DATA
 {
 	char name[64];
 	char skin_name[64];
@@ -148,20 +148,20 @@ struct client_data
 	int team;
 	int emoticon;
 	int emoticon_start;
-	player_core predicted;
+	PLAYER_CORE predicted;
 	
-	tee_render_info skin_info; // this is what the server reports
-	tee_render_info render_info; // this is what we use
+	TEE_RENDER_INFO skin_info; // this is what the server reports
+	TEE_RENDER_INFO render_info; // this is what we use
 	
 	float angle;
 	
 	void update_render_info();
 };
 
-extern client_data client_datas[MAX_CLIENTS];
+extern CLIENT_DATA client_datas[MAX_CLIENTS];
 
 // kill messages
-struct killmsg
+struct KILLMSG
 {
 	int weapon;
 	int victim;
@@ -171,7 +171,7 @@ struct killmsg
 };
 
 const int killmsg_max = 5;
-extern killmsg killmsgs[killmsg_max];
+extern KILLMSG killmsgs[killmsg_max];
 extern int killmsg_current;
 
 //
@@ -205,7 +205,7 @@ void effect_playerdeath(vec2 pos, int cid);
 void effect_powerupshine(vec2 pos, vec2 size);
 
 // particles
-struct particle
+struct PARTICLE
 {
 	void set_default()
 	{
@@ -255,7 +255,7 @@ enum
 	NUM_PARTGROUPS
 };
 
-void particle_add(int group, particle *part);
+void particle_add(int group, PARTICLE *part);
 void particle_render(int group);
 void particle_update(float time_passed);
 void particle_reset();
diff --git a/src/game/client/gc_effects.cpp b/src/game/client/gc_effects.cpp
index 79bac29e..5a9ebfc6 100644
--- a/src/game/client/gc_effects.cpp
+++ b/src/game/client/gc_effects.cpp
@@ -8,7 +8,7 @@ static bool add_100hz = false;
 
 void effect_air_jump(vec2 pos)
 {
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_AIRJUMP;
 	p.pos = pos + vec2(-6.0f, 16.0f);
@@ -32,7 +32,7 @@ void effect_powerupshine(vec2 pos, vec2 size)
 	if(!add_50hz)
 		return;
 		
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_SLICE;
 	p.pos = pos + vec2((frandom()-0.5f)*size.x, (frandom()-0.5f)*size.y);
@@ -53,7 +53,7 @@ void effect_smoketrail(vec2 pos, vec2 vel)
 	if(!add_50hz)
 		return;
 		
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_SMOKE;
 	p.pos = pos;
@@ -72,7 +72,7 @@ void effect_skidtrail(vec2 pos, vec2 vel)
 	if(!add_100hz)
 		return;
 	
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_SMOKE;
 	p.pos = pos;
@@ -91,7 +91,7 @@ void effect_bullettrail(vec2 pos)
 	if(!add_100hz)
 		return;
 		
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_BALL;
 	p.pos = pos;
@@ -106,7 +106,7 @@ void effect_playerspawn(vec2 pos)
 {
 	for(int i = 0; i < 32; i++)
 	{
-		particle p;
+		PARTICLE p;
 		p.set_default();
 		p.spr = SPRITE_PART_SHELL;
 		p.pos = pos;
@@ -137,7 +137,7 @@ void effect_playerdeath(vec2 pos, int cid)
 	
 	for(int i = 0; i < 64; i++)
 	{
-		particle p;
+		PARTICLE p;
 		p.set_default();
 		p.spr = SPRITE_PART_SPLAT01 + (rand()%3);
 		p.pos = pos;
@@ -170,7 +170,7 @@ void effect_explosion(vec2 pos)
 		}
 		
 	// add the explosion
-	particle p;
+	PARTICLE p;
 	p.set_default();
 	p.spr = SPRITE_PART_EXPL01;
 	p.pos = pos;
@@ -183,7 +183,7 @@ void effect_explosion(vec2 pos)
 	// add the smoke
 	for(int i = 0; i < 24; i++)
 	{
-		particle p;
+		PARTICLE p;
 		p.set_default();
 		p.spr = SPRITE_PART_SMOKE;
 		p.pos = pos;
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index 36e166d4..61e5f2e8 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -83,7 +83,7 @@ extern "C" void modc_init()
 	snd_set_channel(CHN_GLOBAL, 1.0f, 0.0f);
 
 	// load the data container
-	data = load_data_from_memory(internal_data);
+	//data = load_data_from_memory(internal_data);
 
 	// TODO: should be removed
 	snd_set_listener_pos(0.0f, 0.0f);
@@ -128,18 +128,18 @@ extern "C" void modc_shutdown()
 }
 
 
-player_core predicted_prev_player;
-player_core predicted_player;
+PLAYER_CORE predicted_prev_player;
+PLAYER_CORE predicted_player;
 static int predicted_tick = 0;
 static int last_new_predicted_tick = -1;
 
 extern "C" void modc_predict()
 {
-	player_core before_prev_player = predicted_prev_player;
-	player_core before_player = predicted_player;
+	PLAYER_CORE before_prev_player = predicted_prev_player;
+	PLAYER_CORE before_player = predicted_player;
 
 	// repredict player
-	world_core world;
+	WORLD_CORE world;
 	world.tuning = tuning;
 	int local_cid = -1;
 
@@ -271,10 +271,10 @@ extern "C" void modc_newsnapshot()
 		{
 			SNAP_ITEM item;
 			void *data = snap_get_item(SNAP_CURRENT, index, &item);
-			if(netobj_secure(item.type, data, item.datasize) != 0)
+			if(netobj_validate(item.type, data, item.datasize) != 0)
 			{
 				if(config.debug)
-					dbg_msg("game", "invalidated %d %d (%s) %d", index, item.type, netobj_get_name(item.type), item.id);
+					dbg_msg("game", "invalidated index=%d type=%d (%s) size=%d id=%d", index, item.type, netobj_get_name(item.type), item.datasize, item.id);
 				snap_invalidate_item(SNAP_CURRENT, index);
 			}
 		}
@@ -477,7 +477,7 @@ int64 server_motd_time = 0;
 extern "C" void modc_message(int msgtype)
 {
 	// special messages
-	if(msgtype == NETMSGTYPE_SV_EXTRA_PROJECTILE)
+	if(msgtype == NETMSGTYPE_SV_EXTRAPROJECTILE)
 	{
 		int num = msg_unpack_int();
 		
@@ -499,12 +499,12 @@ extern "C" void modc_message(int msgtype)
 		
 		return;
 	}
-	else if(msgtype == NETMSGTYPE_SV_TUNE_PARAMS)
+	else if(msgtype == NETMSGTYPE_SV_TUNEPARAMS)
 	{
 		// unpack the new tuning
-		tuning_params new_tuning;
+		TUNING_PARAMS new_tuning;
 		int *params = (int *)&new_tuning;
-		for(unsigned i = 0; i < sizeof(tuning_params)/sizeof(int); i++)
+		for(unsigned i = 0; i < sizeof(TUNING_PARAMS)/sizeof(int); i++)
 			params[i] = msg_unpack_int();
 
 		// check for unpacking errors
@@ -595,13 +595,13 @@ extern "C" void modc_message(int msgtype)
 
 		client_datas[msg->cid].update_render_info();
 	}
-    else if(msgtype == NETMSGTYPE_SV_WEAPON_PICKUP)
+    else if(msgtype == NETMSGTYPE_SV_WEAPONPICKUP)
     {
-    	NETMSG_SV_WEAPON_PICKUP *msg = (NETMSG_SV_WEAPON_PICKUP *)rawmsg;
+    	NETMSG_SV_WEAPONPICKUP *msg = (NETMSG_SV_WEAPONPICKUP *)rawmsg;
         if(config.cl_autoswitch_weapons)
         	input_data.wanted_weapon = msg->weapon+1;
     }
-	else if(msgtype == NETMSGTYPE_SV_READY_TO_ENTER)
+	else if(msgtype == NETMSGTYPE_SV_READYTOENTER)
 	{
 		client_entergame();
 	}
@@ -610,7 +610,7 @@ extern "C" void modc_message(int msgtype)
 		NETMSG_SV_KILLMSG *msg = (NETMSG_SV_KILLMSG *)rawmsg;
 		
 		// unpack messages
-		killmsg kill;
+		KILLMSG kill;
 		kill.killer = msg->killer;
 		kill.victim = msg->victim;
 		kill.weapon = msg->weapon;
@@ -629,9 +629,9 @@ extern "C" void modc_message(int msgtype)
 		client_datas[msg->cid].emoticon = msg->emoticon;
 		client_datas[msg->cid].emoticon_start = client_tick();
 	}
-	else if(msgtype == NETMSGTYPE_SV_SOUND_GLOBAL)
+	else if(msgtype == NETMSGTYPE_SV_SOUNDGLOBAL)
 	{
-		NETMSG_SV_SOUND_GLOBAL *msg = (NETMSG_SV_SOUND_GLOBAL *)rawmsg;
+		NETMSG_SV_SOUNDGLOBAL *msg = (NETMSG_SV_SOUNDGLOBAL *)rawmsg;
 		snd_play_random(CHN_GLOBAL, msg->soundid, 1.0f, vec2(0,0));
 	}
 }
diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp
index 10319f0b..3a41aee4 100644
--- a/src/game/client/gc_menu.cpp
+++ b/src/game/client/gc_menu.cpp
@@ -25,7 +25,7 @@ extern "C" {
 #include "gc_client.h"
 #include <mastersrv/mastersrv.h>
 
-extern data_container *data;
+//extern data_container *data;
 
 extern bool menu_active;
 //extern bool menu_game_active;
@@ -959,7 +959,7 @@ static void menu2_render_serverbrowser(RECT main_view)
 	if (selected_server)
 	{
 		RECT row;
-		static char *labels[] = { "Version:", "Game Type:", "Progression:", "Ping:" };
+		static const char *labels[] = { "Version:", "Game Type:", "Progression:", "Ping:" };
 
 		RECT left_column;
 		RECT right_column;
@@ -977,7 +977,7 @@ static void menu2_render_serverbrowser(RECT main_view)
 		ui_do_label(&row, selected_server->version, font_size, -1);
 
 		ui_hsplit_t(&right_column, 15.0f, &row, &right_column);
-		static char *game_types[] = { "DM", "TDM", "CTF" };
+		static const char *game_types[] = { "DM", "TDM", "CTF" };
 		if (selected_server->game_type >= 0 && selected_server->game_type < (int)(sizeof(game_types)/sizeof(*game_types)))
 			ui_do_label(&row, game_types[selected_server->game_type], font_size, -1);
 
@@ -1285,7 +1285,7 @@ static void menu2_render_settings_player(RECT main_view)
 	if(start < 0)
 		start = 0;
 		
-	animstate state;
+	ANIM_STATE state;
 	anim_eval(&data->animations[ANIM_BASE], 0, &state);
 	anim_eval_add(&state, &data->animations[ANIM_IDLE], 0, 1.0f);
 	//anim_eval_add(&state, &data->animations[ANIM_WALK], fmod(client_localtime(), 1.0f), 1.0f);
@@ -1307,7 +1307,7 @@ static void menu2_render_settings_player(RECT main_view)
 		if(strcmp(s->name, config.player_skin) == 0)
 			selected = 1;
 		
-		tee_render_info info;
+		TEE_RENDER_INFO info;
 		info.texture = s->org_texture;
 		info.color_body = vec4(1,1,1,1);
 		info.color_feet = vec4(1,1,1,1);
@@ -1831,7 +1831,7 @@ int menu2_render()
 		gfx_mapscreen(0,0,10*4/3.0f,10);
 		gfx_clear(gui_color.r, gui_color.g, gui_color.b);
 		
-		animstate state;
+		ANIM_STATE state;
 		anim_eval(&data->animations[ANIM_BASE], 0, &state);
 		anim_eval_add(&state, &data->animations[ANIM_IDLE], 0, 1.0f);
 		//anim_eval_add(&state, &data->animations[ANIM_WALK], fmod(client_localtime(), 1.0f), 1.0f);
@@ -1846,7 +1846,7 @@ int menu2_render()
 				//int colors[2] = {65432, 9895832}; // NEW
 				int colors[2] = {65387, 10223467}; // NEW
 				
-				tee_render_info info;
+				TEE_RENDER_INFO info;
 				info.texture = skin_get(i)->color_texture;
 				info.color_feet = info.color_body = skin_get_color(colors[c]);
 				//info.color_feet = info.color_body = vec4(1,1,1,1);
diff --git a/src/game/client/gc_particles.cpp b/src/game/client/gc_particles.cpp
index a0b1ff92..2c3ef36c 100644
--- a/src/game/client/gc_particles.cpp
+++ b/src/game/client/gc_particles.cpp
@@ -9,7 +9,7 @@ enum
 	MAX_PARTICLES=1024*8,
 };
 
-static particle particles[MAX_PARTICLES];
+static PARTICLE particles[MAX_PARTICLES];
 static int first_free = -1;
 static int first_part[NUM_PARTGROUPS] = {-1};
 
@@ -31,7 +31,7 @@ void particle_reset()
 }
 
 
-void particle_add(int group, particle *part)
+void particle_add(int group, PARTICLE *part)
 {
 	if (first_free == -1)
 		return;
diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp
index 91986b6f..364b33eb 100644
--- a/src/game/client/gc_render.cpp
+++ b/src/game/client/gc_render.cpp
@@ -14,7 +14,7 @@
 static float sprite_w_scale;
 static float sprite_h_scale;
 
-void select_sprite(sprite *spr, int flags, int sx, int sy)
+void select_sprite(SPRITE *spr, int flags, int sx, int sy)
 {
 	int x = spr->x+sx;
 	int y = spr->y+sy;
@@ -134,7 +134,7 @@ void ui_draw_rect(const RECT *r, vec4 color, int corners, float rounding)
 	gfx_quads_end();
 }
 
-void render_tee(animstate *anim, tee_render_info *info, int emote, vec2 dir, vec2 pos)
+void render_tee(ANIM_STATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos)
 {
 	vec2 direction = dir;
 	vec2 position = pos;
@@ -196,7 +196,7 @@ void render_tee(animstate *anim, tee_render_info *info, int emote, vec2 dir, vec
 			}
 
 			// draw feet
-			keyframe *foot = f ? &anim->front_foot : &anim->back_foot;
+			ANIM_KEYFRAME *foot = f ? &anim->front_foot : &anim->back_foot;
 
 			float w = basesize;
 			float h = basesize/2;
@@ -433,11 +433,11 @@ static void render_items()
 		{
 			render_projectile((const NETOBJ_PROJECTILE *)data, item.id);
 		}
-		else if(item.type == NETOBJTYPE_POWERUP)
+		else if(item.type == NETOBJTYPE_PICKUP)
 		{
 			const void *prev = snap_find_item(SNAP_PREV, item.type, item.id);
 			if(prev)
-				render_powerup((const NETOBJ_POWERUP *)prev, (const NETOBJ_POWERUP *)data);
+				render_pickup((const NETOBJ_PICKUP *)prev, (const NETOBJ_PICKUP *)data);
 		}
 		else if(item.type == NETOBJTYPE_LASER)
 		{
diff --git a/src/game/client/gc_render.h b/src/game/client/gc_render.h
index b3439e93..508ab195 100644
--- a/src/game/client/gc_render.h
+++ b/src/game/client/gc_render.h
@@ -6,9 +6,9 @@
 #include "../g_mapitems.h"
 #include "gc_ui.h"
 
-struct tee_render_info
+struct TEE_RENDER_INFO
 {
-	tee_render_info()
+	TEE_RENDER_INFO()
 	{
 		texture = -1;
 		color_body = vec4(1,1,1,1);
@@ -36,9 +36,9 @@ enum
 	TILERENDERFLAG_EXTEND=4,
 };
 
-typedef struct sprite;
+typedef struct SPRITE;
 
-void select_sprite(sprite *spr, int flags=0, int sx=0, int sy=0);
+void select_sprite(SPRITE *spr, int flags=0, int sx=0, int sy=0);
 void select_sprite(int id, int flags=0, int sx=0, int sy=0);
 
 void draw_sprite(float x, float y, float size);
@@ -60,9 +60,9 @@ void render_particles();
 void render_tilemap_generate_skip();
 
 // object render methods (gc_render_obj.cpp)
-void render_tee(class animstate *anim, tee_render_info *info, int emote, vec2 dir, vec2 pos);
+void render_tee(class ANIM_STATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos);
 void render_flag(const struct NETOBJ_FLAG *prev, const struct NETOBJ_FLAG *current);
-void render_powerup(const struct NETOBJ_POWERUP *prev, const struct NETOBJ_POWERUP *current);
+void render_pickup(const struct NETOBJ_PICKUP *prev, const struct NETOBJ_PICKUP *current);
 void render_projectile(const struct NETOBJ_PROJECTILE *current, int itemid);
 void render_laser(const struct NETOBJ_LASER *current);
 void render_player(
diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp
index 580ca259..a6cd2b69 100644
--- a/src/game/client/gc_render_obj.cpp
+++ b/src/game/client/gc_render_obj.cpp
@@ -49,7 +49,7 @@ void render_projectile(const NETOBJ_PROJECTILE *current, int itemid)
 	vec2 pos = calc_pos(startpos, startvel, curvature, speed, ct);
 	vec2 prevpos = calc_pos(startpos, startvel, curvature, speed, ct-0.001f);
 
-	select_sprite(data->weapons[clamp(current->type, 0, NUM_WEAPONS-1)].sprite_proj);
+	select_sprite(data->weapons.id[clamp(current->type, 0, NUM_WEAPONS-1)].sprite_proj);
 	vec2 vel = pos-prevpos;
 	//vec2 pos = mix(vec2(prev->x, prev->y), vec2(current->x, current->y), client_intratick());
 	
@@ -78,7 +78,7 @@ void render_projectile(const NETOBJ_PROJECTILE *current, int itemid)
 	gfx_quads_end();
 }
 
-void render_powerup(const NETOBJ_POWERUP *prev, const NETOBJ_POWERUP *current)
+void render_pickup(const NETOBJ_PICKUP *prev, const NETOBJ_PICKUP *current)
 {
 	gfx_texture_set(data->images[IMAGE_GAME].id);
 	gfx_quads_begin();
@@ -88,21 +88,20 @@ void render_powerup(const NETOBJ_POWERUP *prev, const NETOBJ_POWERUP *current)
 	if (current->type == POWERUP_WEAPON)
 	{
 		angle = 0; //-pi/6;//-0.25f * pi * 2.0f;
-		select_sprite(data->weapons[clamp(current->subtype, 0, NUM_WEAPONS-1)].sprite_body);
-		size = data->weapons[clamp(current->subtype, 0, NUM_WEAPONS-1)].visual_size;
+		select_sprite(data->weapons.id[clamp(current->subtype, 0, NUM_WEAPONS-1)].sprite_body);
+		size = data->weapons.id[clamp(current->subtype, 0, NUM_WEAPONS-1)].visual_size;
 	}
 	else
 	{
 		const int c[] = {
-			SPRITE_POWERUP_HEALTH,
-			SPRITE_POWERUP_ARMOR,
-			SPRITE_POWERUP_WEAPON,
-			SPRITE_POWERUP_NINJA,
-			SPRITE_POWERUP_TIMEFIELD
+			SPRITE_PICKUP_HEALTH,
+			SPRITE_PICKUP_ARMOR,
+			SPRITE_PICKUP_WEAPON,
+			SPRITE_PICKUP_NINJA
 			};
 		select_sprite(c[current->type]);
 
-		if(c[current->type] == SPRITE_POWERUP_NINJA)
+		if(c[current->type] == SPRITE_PICKUP_NINJA)
 		{
 			effect_powerupshine(pos, vec2(96,18));
 			size *= 2.0f;
@@ -157,7 +156,7 @@ void render_laser(const struct NETOBJ_LASER *current)
 	vec2 from = vec2(current->from_x, current->from_y);
 	vec2 dir = normalize(pos-from);
 
-	float ticks = client_tick() + client_intratick() - current->eval_tick;
+	float ticks = client_tick() + client_intratick() - current->start_tick;
 	float ms = (ticks/50.0f) * 1000.0f;
 	float a =  ms / tuning.laser_bounce_delay;
 	a = clamp(a, 0.0f, 1.0f);
@@ -222,7 +221,7 @@ void render_laser(const struct NETOBJ_LASER *current)
 
 
 
-static void render_hand(tee_render_info *info, vec2 center_pos, vec2 dir, float angle_offset, vec2 post_rot_offset)
+static void render_hand(TEE_RENDER_INFO *info, vec2 center_pos, vec2 dir, float angle_offset, vec2 post_rot_offset)
 {
 	// for drawing hand
 	//const skin *s = skin_get(skin_id);
@@ -278,7 +277,7 @@ void render_player(
 	player = *player_char;
 
 	NETOBJ_PLAYER_INFO info = *player_info;
-	tee_render_info render_info = client_datas[info.cid].render_info;
+	TEE_RENDER_INFO render_info = client_datas[info.cid].render_info;
 
 	// check for teamplay modes
 	bool is_teamplay = false;
@@ -353,7 +352,7 @@ void render_player(
 
 	// evaluate animation
 	float walk_time = fmod(position.x, 100.0f)/100.0f;
-	animstate state;
+	ANIM_STATE state;
 	anim_eval(&data->animations[ANIM_BASE], 0, &state);
 
 	if(inair)
@@ -445,7 +444,7 @@ void render_player(
 
 		// normal weapons
 		int iw = clamp(player.weapon, 0, NUM_WEAPONS-1);
-		select_sprite(data->weapons[iw].sprite_body, direction.x < 0 ? SPRITE_FLAG_FLIP_Y : 0);
+		select_sprite(data->weapons.id[iw].sprite_body, direction.x < 0 ? SPRITE_FLAG_FLIP_Y : 0);
 
 		vec2 dir = direction;
 		float recoil = 0.0f;
@@ -454,28 +453,28 @@ void render_player(
 		{
 			// Static position for hammer
 			p = position + vec2(state.attach.x, state.attach.y);
-			p.y += data->weapons[iw].offsety;
+			p.y += data->weapons.id[iw].offsety;
 			// if attack is under way, bash stuffs
 			if(direction.x < 0)
 			{
 				gfx_quads_setrotation(-pi/2-state.attach.angle*pi*2);
-				p.x -= data->weapons[iw].offsetx;
+				p.x -= data->weapons.id[iw].offsetx;
 			}
 			else
 			{
 				gfx_quads_setrotation(-pi/2+state.attach.angle*pi*2);
 			}
-			draw_sprite(p.x, p.y, data->weapons[iw].visual_size);
+			draw_sprite(p.x, p.y, data->weapons.id[iw].visual_size);
 		}
 		else if (player.weapon == WEAPON_NINJA)
 		{
 			p = position;
-			p.y += data->weapons[iw].offsety;
+			p.y += data->weapons.id[iw].offsety;
 
 			if(direction.x < 0)
 			{
 				gfx_quads_setrotation(-pi/2-state.attach.angle*pi*2);
-				p.x -= data->weapons[iw].offsetx;
+				p.x -= data->weapons.id[iw].offsetx;
 				effect_powerupshine(p+vec2(32,0), vec2(32,12));
 			}
 			else
@@ -483,24 +482,24 @@ void render_player(
 				gfx_quads_setrotation(-pi/2+state.attach.angle*pi*2);
 				effect_powerupshine(p-vec2(32,0), vec2(32,12));
 			}
-			draw_sprite(p.x, p.y, data->weapons[iw].visual_size);
+			draw_sprite(p.x, p.y, data->weapons.id[iw].visual_size);
 
 			// HADOKEN
-			if ((client_tick()-player.attacktick) <= (SERVER_TICK_SPEED / 6) && data->weapons[iw].nummuzzlesprites)
+			if ((client_tick()-player.attacktick) <= (SERVER_TICK_SPEED / 6) && data->weapons.id[iw].num_sprite_muzzles)
 			{
-				int itex = rand() % data->weapons[iw].nummuzzlesprites;
+				int itex = rand() % data->weapons.id[iw].num_sprite_muzzles;
 				float alpha = 1.0f;
-				if (alpha > 0.0f && data->weapons[iw].sprite_muzzle[itex].psprite)
+				if (alpha > 0.0f && data->weapons.id[iw].sprite_muzzles[itex])
 				{
 					vec2 dir = vec2(player_char->x,player_char->y) - vec2(prev_char->x, prev_char->y);
 					dir = normalize(dir);
 					float hadokenangle = get_angle(dir);
 					gfx_quads_setrotation(hadokenangle);
 					//float offsety = -data->weapons[iw].muzzleoffsety;
-					select_sprite(data->weapons[iw].sprite_muzzle[itex].psprite, 0);
+					select_sprite(data->weapons.id[iw].sprite_muzzles[itex], 0);
 					vec2 diry(-dir.y,dir.x);
 					p = position;
-					float offsetx = data->weapons[iw].muzzleoffsetx;
+					float offsetx = data->weapons.id[iw].muzzleoffsetx;
 					p -= dir * offsetx;
 					draw_sprite(p.x, p.y, 160.0f);
 				}
@@ -513,36 +512,37 @@ void render_player(
 			float a = (client_tick()-player.attacktick+intratick)/5.0f;
 			if(a < 1)
 				recoil = sinf(a*pi);
-			p = position + dir * data->weapons[iw].offsetx - dir*recoil*10.0f;
-			p.y += data->weapons[iw].offsety;
-			draw_sprite(p.x, p.y, data->weapons[iw].visual_size);
+			p = position + dir * data->weapons.id[iw].offsetx - dir*recoil*10.0f;
+			p.y += data->weapons.id[iw].offsety;
+			draw_sprite(p.x, p.y, data->weapons.id[iw].visual_size);
 		}
 
 		if (player.weapon == WEAPON_GUN || player.weapon == WEAPON_SHOTGUN)
 		{
 			// check if we're firing stuff
-			if (true)//prev.attackticks)
+			if(data->weapons.id[iw].num_sprite_muzzles)//prev.attackticks)
 			{
 				float alpha = 0.0f;
 				int phase1tick = (client_tick() - player.attacktick);
-				if (phase1tick < (data->weapons[iw].muzzleduration + 3))
+				if (phase1tick < (data->weapons.id[iw].muzzleduration + 3))
 				{
-					float t = ((((float)phase1tick) + intratick)/(float)data->weapons[iw].muzzleduration);
+					float t = ((((float)phase1tick) + intratick)/(float)data->weapons.id[iw].muzzleduration);
 					alpha = LERP(2.0, 0.0f, min(1.0f,max(0.0f,t)));
 				}
 
-				int itex = rand() % data->weapons[iw].nummuzzlesprites;
-				if (alpha > 0.0f && data->weapons[iw].sprite_muzzle[itex].psprite)
+				int itex = rand() % data->weapons.id[iw].num_sprite_muzzles;
+				if (alpha > 0.0f && data->weapons.id[iw].sprite_muzzles[itex])
 				{
-					float offsety = -data->weapons[iw].muzzleoffsety;
-					select_sprite(data->weapons[iw].sprite_muzzle[itex].psprite, direction.x < 0 ? SPRITE_FLAG_FLIP_Y : 0);
+					float offsety = -data->weapons.id[iw].muzzleoffsety;
+					select_sprite(data->weapons.id[iw].sprite_muzzles[itex], direction.x < 0 ? SPRITE_FLAG_FLIP_Y : 0);
 					if(direction.x < 0)
 						offsety = -offsety;
 
 					vec2 diry(-dir.y,dir.x);
-					vec2 muzzlepos = p + dir * data->weapons[iw].muzzleoffsetx + diry * offsety;
+					vec2 muzzlepos = p + dir * data->weapons.id[iw].muzzleoffsetx + diry * offsety;
 
-					draw_sprite(muzzlepos.x, muzzlepos.y, data->weapons[iw].visual_size);
+					dbg_msg("", "%d", data->weapons.id[iw].num_sprite_muzzles);
+					draw_sprite(muzzlepos.x, muzzlepos.y, data->weapons.id[iw].visual_size);
 				}
 			}
 		}
@@ -561,7 +561,7 @@ void render_player(
 	if(info.local && config.debug)
 	{
 		vec2 ghost_position = mix(vec2(prev_char->x, prev_char->y), vec2(player_char->x, player_char->y), client_intratick());
-		tee_render_info ghost = render_info;
+		TEE_RENDER_INFO ghost = render_info;
 		ghost.color_body.a = 0.5f;
 		ghost.color_feet.a = 0.5f;
 		render_tee(&state, &ghost, player.emote, direction, ghost_position); // render ghost