From c0ae3d926436205c2a0865e25b39b5f93a05e124 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 24 Mar 2013 01:54:39 +0000 Subject: [PATCH] Move player_ship_read bm.c -> player.c --- main/bm.c | 17 ----------------- main/player.c | 16 ++++++++++++++++ main/player.h | 5 +++++ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/main/bm.c b/main/bm.c index faa0a6355..4a1417d3d 100644 --- a/main/bm.c +++ b/main/bm.c @@ -108,23 +108,6 @@ int tmap_info_read_n(tmap_info *ti, int n, PHYSFS_file *fp) return i; } -int player_ship_read(player_ship *ps, PHYSFS_file *fp) -{ - int i; - ps->model_num = PHYSFSX_readInt(fp); - ps->expl_vclip_num = PHYSFSX_readInt(fp); - ps->mass = PHYSFSX_readFix(fp); - ps->drag = PHYSFSX_readFix(fp); - ps->max_thrust = PHYSFSX_readFix(fp); - ps->reverse_thrust = PHYSFSX_readFix(fp); - ps->brakes = PHYSFSX_readFix(fp); - ps->wiggle = PHYSFSX_readFix(fp); - ps->max_rotthrust = PHYSFSX_readFix(fp); - for (i = 0; i < N_PLAYER_GUNS; i++) - PHYSFSX_readVector(&ps->gun_points[i], fp); - return i; -} - void gamedata_close() { free_polygon_models(); diff --git a/main/player.c b/main/player.c index d7fd00e7b..4731baab3 100644 --- a/main/player.c +++ b/main/player.c @@ -43,3 +43,19 @@ void player_rw_swap(player_rw *p, int swap) p->hostages_total = SWAPSHORT(p->hostages_total); p->homing_object_dist = SWAPINT(p->homing_object_dist); } + +void player_ship_read(player_ship *ps, PHYSFS_file *fp) +{ + int i; + ps->model_num = PHYSFSX_readInt(fp); + ps->expl_vclip_num = PHYSFSX_readInt(fp); + ps->mass = PHYSFSX_readFix(fp); + ps->drag = PHYSFSX_readFix(fp); + ps->max_thrust = PHYSFSX_readFix(fp); + ps->reverse_thrust = PHYSFSX_readFix(fp); + ps->brakes = PHYSFSX_readFix(fp); + ps->wiggle = PHYSFSX_readFix(fp); + ps->max_rotthrust = PHYSFSX_readFix(fp); + for (i = 0; i < N_PLAYER_GUNS; i++) + PHYSFSX_readVector(&ps->gun_points[i], fp); +} diff --git a/main/player.h b/main/player.h index b186fb8ad..e19eb78df 100644 --- a/main/player.h +++ b/main/player.h @@ -181,6 +181,11 @@ extern int Player_num; // The player number who is on the console. extern player Players[MAX_PLAYERS]; // Misc player info extern player_ship *Player_ship; +/* + * reads a player_ship structure from a PHYSFS_file + */ +void player_ship_read(player_ship *ps, PHYSFS_file *fp); + void player_rw_swap(player_rw *p, int swap); #endif