Pass PHYSFSX_readVector vector by &

This commit is contained in:
Kp 2014-10-26 22:08:58 +00:00
parent af318b9eb2
commit 44084ff261
8 changed files with 23 additions and 23 deletions

View file

@ -402,13 +402,13 @@ define_read_helper(fix, PHYSFSX_readFix, PHYSFS_readSLE32);
define_read_helper(fixang, PHYSFSX_readFixAng, PHYSFS_readSLE16);
#define PHYSFSX_readFixAng(F) ((PHYSFSX_readFixAng)(__func__, __LINE__, (F)))
static inline void PHYSFSX_readVector(const char *func, const unsigned line, vms_vector *v, PHYSFS_file *file)
static inline void PHYSFSX_readVector(const char *func, const unsigned line, PHYSFS_file *file, vms_vector &v)
{
v->x = (PHYSFSX_readFix)(func, line, file);
v->y = (PHYSFSX_readFix)(func, line, file);
v->z = (PHYSFSX_readFix)(func, line, file);
v.x = (PHYSFSX_readFix)(func, line, file);
v.y = (PHYSFSX_readFix)(func, line, file);
v.z = (PHYSFSX_readFix)(func, line, file);
}
#define PHYSFSX_readVector(V,F) ((PHYSFSX_readVector(__func__, __LINE__, (V), (F))))
#define PHYSFSX_readVector(F,V) PHYSFSX_readVector(__func__, __LINE__, (F), (V))
static inline void PHYSFSX_readAngleVec(const char *func, const unsigned line, vms_angvec *v, PHYSFS_file *file)
{
@ -420,9 +420,9 @@ static inline void PHYSFSX_readAngleVec(const char *func, const unsigned line, v
static inline void PHYSFSX_readMatrix(const char *func, const unsigned line, vms_matrix *m,PHYSFS_file *file)
{
(PHYSFSX_readVector)(func, line, &m->rvec,file);
(PHYSFSX_readVector)(func, line, &m->uvec,file);
(PHYSFSX_readVector)(func, line, &m->fvec,file);
(PHYSFSX_readVector)(func, line, file, m->rvec);
(PHYSFSX_readVector)(func, line, file, m->uvec);
(PHYSFSX_readVector)(func, line, file, m->fvec);
}
#define PHYSFSX_readMatrix(M,F) ((PHYSFSX_readMatrix)(__func__, __LINE__, (M), (F)))

View file

@ -366,7 +366,7 @@ static int read_d2_robot_info(PHYSFS_file *fp, robot_info *ri)
ri->model_num = PHYSFSX_readInt(fp);
for (j = 0; j < MAX_GUNS; j++)
PHYSFSX_readVector(&ri->gun_points[j], fp);
PHYSFSX_readVector(fp, ri->gun_points[j]);
for (j = 0; j < MAX_GUNS; j++)
ri->gun_submodels[j] = PHYSFSX_readByte(fp);
ri->exp1_vclip_num = PHYSFSX_readShort(fp);

View file

@ -225,9 +225,9 @@ void properties_read_cmp(PHYSFS_file * fp)
Reactors[0].n_guns = PHYSFSX_readInt(fp);
for (i = 0; i < MAX_CONTROLCEN_GUNS; i++)
PHYSFSX_readVector(&Reactors[0].gun_points[i], fp);
PHYSFSX_readVector(fp, Reactors[0].gun_points[i]);
for (i = 0; i < MAX_CONTROLCEN_GUNS; i++)
PHYSFSX_readVector(&Reactors[0].gun_dirs[i], fp);
PHYSFSX_readVector(fp, Reactors[0].gun_dirs[i]);
exit_modelnum = PHYSFSX_readInt(fp);
destroyed_exit_modelnum = PHYSFSX_readInt(fp);

View file

@ -537,9 +537,9 @@ int reactor_read_n(reactor *r, int n, PHYSFS_file *fp)
r[i].model_num = PHYSFSX_readInt(fp);
r[i].n_guns = PHYSFSX_readInt(fp);
for (j = 0; j < MAX_CONTROLCEN_GUNS; j++)
PHYSFSX_readVector(&(r[i].gun_points[j]), fp);
PHYSFSX_readVector(fp, r[i].gun_points[j]);
for (j = 0; j < MAX_CONTROLCEN_GUNS; j++)
PHYSFSX_readVector(&(r[i].gun_dirs[j]), fp);
PHYSFSX_readVector(fp, r[i].gun_dirs[j]);
}
return i;
}

View file

@ -904,7 +904,7 @@ int load_mine_data_compiled(PHYSFS_file *LoadFile)
Assert( Num_segments <= MAX_SEGMENTS );
range_for (auto &i, partial_range(Vertices, Num_vertices))
PHYSFSX_readVector( &(i), LoadFile);
PHYSFSX_readVector(LoadFile, i);
for (segnum_t segnum=0; segnum < Num_segments; segnum++ ) {

View file

@ -385,13 +385,13 @@ static void read_object(object *obj,PHYSFS_file *f,int version)
obj->segnum = PHYSFSX_readShort(f);
obj->attached_obj = object_none;
PHYSFSX_readVector(&obj->pos,f);
PHYSFSX_readVector(f, obj->pos);
PHYSFSX_readMatrix(&obj->orient,f);
obj->size = PHYSFSX_readFix(f);
obj->shields = PHYSFSX_readFix(f);
PHYSFSX_readVector(&obj->last_pos,f);
PHYSFSX_readVector(f, obj->last_pos);
obj->contains_type = PHYSFSX_readByte(f);
obj->contains_id = PHYSFSX_readByte(f);
@ -401,15 +401,15 @@ static void read_object(object *obj,PHYSFS_file *f,int version)
case MT_PHYSICS:
PHYSFSX_readVector(&obj->mtype.phys_info.velocity,f);
PHYSFSX_readVector(&obj->mtype.phys_info.thrust,f);
PHYSFSX_readVector(f, obj->mtype.phys_info.velocity);
PHYSFSX_readVector(f, obj->mtype.phys_info.thrust);
obj->mtype.phys_info.mass = PHYSFSX_readFix(f);
obj->mtype.phys_info.drag = PHYSFSX_readFix(f);
PHYSFSX_readFix(f); /* brakes */
PHYSFSX_readVector(&obj->mtype.phys_info.rotvel,f);
PHYSFSX_readVector(&obj->mtype.phys_info.rotthrust,f);
PHYSFSX_readVector(f, obj->mtype.phys_info.rotvel);
PHYSFSX_readVector(f, obj->mtype.phys_info.rotthrust);
obj->mtype.phys_info.turnroll = PHYSFSX_readFixAng(f);
obj->mtype.phys_info.flags = PHYSFSX_readShort(f);
@ -418,7 +418,7 @@ static void read_object(object *obj,PHYSFS_file *f,int version)
case MT_SPINNING:
PHYSFSX_readVector(&obj->mtype.spin_rate,f);
PHYSFSX_readVector(f, obj->mtype.spin_rate);
break;
case MT_NONE:

View file

@ -70,5 +70,5 @@ void player_ship_read(player_ship *ps, PHYSFS_file *fp)
ps->wiggle = PHYSFSX_readFix(fp);
ps->max_rotthrust = PHYSFSX_readFix(fp);
for (int i = 0; i < N_PLAYER_GUNS; i++)
PHYSFSX_readVector(&(ps->gun_points[i]), fp);
PHYSFSX_readVector(fp, ps->gun_points[i]);
}

View file

@ -248,7 +248,7 @@ int robot_info_read_n(robot_info *ri, int n, PHYSFS_file *fp)
ri[i].n_guns = PHYSFSX_readInt(fp);
#endif
for (j = 0; j < MAX_GUNS; j++)
PHYSFSX_readVector(&(ri[i].gun_points[j]), fp);
PHYSFSX_readVector(fp, ri[i].gun_points[j]);
for (j = 0; j < sizeof(ri[i].gun_submodels) / sizeof(ri[i].gun_submodels[0]); j++)
ri[i].gun_submodels[j] = PHYSFSX_readByte(fp);