Use enum weapon_type_t in more places

This commit is contained in:
Kp 2013-10-08 03:20:09 +00:00
parent f51e9e8cfc
commit 852a4c7f4d
6 changed files with 15 additions and 15 deletions

View file

@ -154,8 +154,7 @@ enum laser_level_t
struct object;
void Laser_render(struct object *obj);
int Laser_player_fire(struct object * obj, int type, int gun_num, int make_sound, int harmless_flag);
int Laser_player_fire_spread(struct object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless);
int Laser_player_fire(struct object * obj, enum weapon_type_t type, int gun_num, int make_sound, int harmless_flag);
void Laser_do_weapon_sequence(struct object *obj);
void Flare_create(struct object *obj);
int laser_are_related(int o1, int o2);

View file

@ -30,6 +30,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "gr.h"
#include "piggy.h"
#include "polyobj.h"
#include "laser.h"
#ifdef __cplusplus
extern "C" {

View file

@ -273,7 +273,7 @@ void verify_object( object * obj ) {
if ( obj->type == OBJ_WEAPON ) {
if ( obj->id >= N_weapon_types ) {
obj->id = 0;
obj->id = LASER_ID_L1;
Assert( obj->render_type != RT_POLYOBJ );
}

View file

@ -1321,7 +1321,7 @@ int track_track_goal(int track_goal, object *tracker, fix *dot)
//-------------- Initializes a laser after Fire is pressed -----------------
int Laser_player_fire_spread_delay(object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, fix delay_time, int make_sound, int harmless)
static int Laser_player_fire_spread_delay(object *obj, enum weapon_type_t laser_type, int gun_num, fix spreadr, fix spreadu, fix delay_time, int make_sound, int harmless)
{
int LaserSeg, Fate;
vms_vector LaserPos, LaserDir;
@ -1456,14 +1456,14 @@ int Laser_player_fire_spread_delay(object *obj, int laser_type, int gun_num, fix
}
// -----------------------------------------------------------------------------------------------------------
int Laser_player_fire_spread(object *obj, int laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless)
static int Laser_player_fire_spread(object *obj, enum weapon_type_t laser_type, int gun_num, fix spreadr, fix spreadu, int make_sound, int harmless)
{
return Laser_player_fire_spread_delay(obj, laser_type, gun_num, spreadr, spreadu, 0, make_sound, harmless);
}
// -----------------------------------------------------------------------------------------------------------
int Laser_player_fire(object *obj, int laser_type, int gun_num, int make_sound, int harmless)
int Laser_player_fire(object *obj, enum weapon_type_t laser_type, int gun_num, int make_sound, int harmless)
{
return Laser_player_fire_spread(obj, laser_type, gun_num, 0, 0, make_sound, harmless);
}
@ -1982,7 +1982,7 @@ int do_laser_firing(int objnum, int weapon_num, int level, int flags, int nfires
// -------------------------------------------------------------------------------------------
// if goal_obj == -1, then create random vector
int create_homing_missile(object *objp, int goal_obj, int objtype, int make_sound)
static int create_homing_missile(object *objp, int goal_obj, enum weapon_type_t objtype, int make_sound)
{
int objnum;
vms_vector vector_to_goal;
@ -2021,7 +2021,7 @@ void create_smart_children(object *objp, int num_smart_children)
int parent_type, parent_num;
int numobjs=0, objnum = 0, sel_objnum, last_sel_objnum = -1;
int objlist[MAX_OBJDISTS];
int blob_id;
enum weapon_type_t blob_id;
#if defined(DXX_BUILD_DESCENT_I)
parent_type = objp->ctype.laser_info.parent_type;
@ -2113,7 +2113,7 @@ void create_smart_children(object *objp, int num_smart_children)
}
#elif defined(DXX_BUILD_DESCENT_II)
if (objp->type == OBJ_WEAPON) {
blob_id = Weapon_info[objp->id].children;
blob_id = (enum weapon_type_t) Weapon_info[objp->id].children;
Assert(blob_id != -1); // Hmm, missing data in bitmaps.tbl. Need "children=NN" parameter.
} else {
Assert(objp->type == OBJ_ROBOT);
@ -2184,11 +2184,12 @@ void do_missile_firing(int drop_bomb)
if (!Player_is_dead && (Players[Player_num].secondary_ammo[weapon] > 0)) {
int weapon_index,weapon_gun;
enum weapon_type_t weapon_index;
int weapon_gun;
Players[Player_num].secondary_ammo[weapon]--;
weapon_index = Secondary_weapon_to_weapon_info[weapon];
weapon_index = (enum weapon_type_t) Secondary_weapon_to_weapon_info[weapon];
if (!cheats.rapidfire)
Next_missile_fire_time = GameTime64 + Weapon_info[weapon_index].fire_wait - fire_frame_overhead;

View file

@ -1562,9 +1562,8 @@ multi_do_fire(const ubyte *buf)
Laser_player_fire( Objects+Players[pnum].objnum, FLARE_ID, 6, 1, 0);
else
if (weapon >= MISSILE_ADJUST) {
int weapon_id,weapon_gun,objnum,remote_objnum;
weapon_id = Secondary_weapon_to_weapon_info[weapon-MISSILE_ADJUST];
int weapon_gun,objnum,remote_objnum;
enum weapon_type_t weapon_id = (enum weapon_type_t) Secondary_weapon_to_weapon_info[weapon-MISSILE_ADJUST];
weapon_gun = Secondary_weapon_to_gun_num[weapon-MISSILE_ADJUST] + (flags & 1);
#if defined(DXX_BUILD_DESCENT_II)

View file

@ -817,7 +817,7 @@ multi_do_robot_fire(const ubyte *buf)
{
calc_gun_point(&gun_point, &Objects[botnum], gun_num);
robptr = &Robot_info[Objects[botnum].id];
Laser_create_new_easy( &fire, &gun_point, botnum, robptr->weapon_type, 1);
Laser_create_new_easy( &fire, &gun_point, botnum, (enum weapon_type_t) robptr->weapon_type, 1);
}
}