Avoid redundant vsegptridx calculation in object_move_one
This commit is contained in:
parent
fa82c1bd3b
commit
e99a9236cf
|
@ -40,7 +40,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
// these global vars are set after a call to do_physics_sim(). Ugly, I know.
|
// these global vars are set after a call to do_physics_sim(). Ugly, I know.
|
||||||
// list of segments went through
|
// list of segments went through
|
||||||
extern unsigned n_phys_segs;
|
extern unsigned n_phys_segs;
|
||||||
extern array<int, MAX_FVI_SEGS> phys_seglist;
|
extern array<segnum_t, MAX_FVI_SEGS> phys_seglist;
|
||||||
|
|
||||||
// Simulate a physics object for this frame
|
// Simulate a physics object for this frame
|
||||||
void do_physics_sim(vobjptridx_t obj);
|
void do_physics_sim(vobjptridx_t obj);
|
||||||
|
|
|
@ -1711,9 +1711,10 @@ static void object_move_one(const vobjptridx_t obj)
|
||||||
int old_level = Current_level_num;
|
int old_level = Current_level_num;
|
||||||
#endif
|
#endif
|
||||||
for (int i=0;i<n_phys_segs-1;i++) {
|
for (int i=0;i<n_phys_segs-1;i++) {
|
||||||
auto connect_side = find_connect_side(&Segments[phys_seglist[i+1]], &Segments[phys_seglist[i]]);
|
const auto seg0 = vsegptridx(phys_seglist[i]);
|
||||||
|
const auto connect_side = find_connect_side(vcsegptridx(phys_seglist[i+1]), seg0);
|
||||||
if (connect_side != -1)
|
if (connect_side != -1)
|
||||||
check_trigger(&Segments[phys_seglist[i]], connect_side, obj,0);
|
check_trigger(seg0, connect_side, obj,0);
|
||||||
#if defined(DXX_BUILD_DESCENT_II)
|
#if defined(DXX_BUILD_DESCENT_II)
|
||||||
//maybe we've gone on to the next level. if so, bail!
|
//maybe we've gone on to the next level. if so, bail!
|
||||||
if (Current_level_num != old_level)
|
if (Current_level_num != old_level)
|
||||||
|
|
|
@ -159,7 +159,7 @@ static void set_object_turnroll(const vobjptr_t obj)
|
||||||
|
|
||||||
//list of segments went through
|
//list of segments went through
|
||||||
unsigned n_phys_segs;
|
unsigned n_phys_segs;
|
||||||
array<int, MAX_FVI_SEGS> phys_seglist;
|
array<segnum_t, MAX_FVI_SEGS> phys_seglist;
|
||||||
|
|
||||||
|
|
||||||
#define MAX_IGNORE_OBJS 100
|
#define MAX_IGNORE_OBJS 100
|
||||||
|
|
Loading…
Reference in a new issue