fix sprite scale and offset interpolation for ghost mobjs
and remove sprite roll interp that never worked
This commit is contained in:
1 parent
c49bb1bbc6
commit
40b37e9c31
3 files changed
+24
-22
No files matched your search
+6
-4
@@ -283,7 +283,7 @@ typedef struct mobj_s
|
||||
// More drawing info: to determine current sprite.
|
||||
angle_t angle, pitch, roll; // orientation
|
||||
angle_t old_angle, old_pitch, old_roll; // orientation interpolation
|
||||
angle_t old_angle2, old_pitch2, old_roll2;
|
||||
angle_t old_angle2;
|
||||
angle_t rollangle;
|
||||
spritenum_t sprite; // used to find patch_t and flip value
|
||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||
@@ -292,7 +292,9 @@ typedef struct mobj_s
|
||||
fixed_t spritexscale, spriteyscale;
|
||||
fixed_t spritexoffset, spriteyoffset;
|
||||
fixed_t old_spritexscale, old_spriteyscale;
|
||||
fixed_t old_spritexscale2, old_spriteyscale2;
|
||||
fixed_t old_spritexoffset, old_spriteyoffset;
|
||||
fixed_t old_spritexoffset2, old_spriteyoffset2;
|
||||
INT16 lightlevel; // Add to sector lightlevel, -255 - 255
|
||||
|
||||
fixed_t realxscale, realyscale; // funn-E streeetch
|
||||
@@ -302,7 +304,6 @@ typedef struct mobj_s
|
||||
//sloperollangle
|
||||
angle_t sloperoll, slopepitch;
|
||||
angle_t old_sloperoll, old_slopepitch;
|
||||
angle_t old_sloperoll2, old_slopepitch2;
|
||||
angle_t pitch_sprite, roll_sprite;
|
||||
|
||||
struct msecnode_s *touching_sectorlist; // a linked list of sectors where this object appears
|
||||
@@ -437,7 +438,7 @@ typedef struct precipmobj_s
|
||||
// More drawing info: to determine current sprite.
|
||||
angle_t angle, pitch, roll; // orientation
|
||||
angle_t old_angle, old_pitch, old_roll; // orientation interpolation
|
||||
angle_t old_angle2, old_pitch2, old_roll2;
|
||||
angle_t old_angle2;
|
||||
angle_t rollangle;
|
||||
spritenum_t sprite; // used to find patch_t and flip value
|
||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||
@@ -446,7 +447,9 @@ typedef struct precipmobj_s
|
||||
fixed_t spritexscale, spriteyscale;
|
||||
fixed_t spritexoffset, spriteyoffset;
|
||||
fixed_t old_spritexscale, old_spriteyscale;
|
||||
fixed_t old_spritexscale2, old_spriteyscale2;
|
||||
fixed_t old_spritexoffset, old_spriteyoffset;
|
||||
fixed_t old_spritexoffset2, old_spriteyoffset2;
|
||||
INT16 lightlevel; // Add to sector lightlevel, -255 - 255
|
||||
|
||||
fixed_t realxscale, realyscale; // funn-E streeetch
|
||||
@@ -456,7 +459,6 @@ typedef struct precipmobj_s
|
||||
//sloperollangle
|
||||
angle_t sloperoll, slopepitch;
|
||||
angle_t old_sloperoll, old_slopepitch;
|
||||
angle_t old_sloperoll2, old_slopepitch2;
|
||||
angle_t pitch_sprite, roll_sprite;
|
||||
|
||||
struct mprecipsecnode_s *touching_sectorlist; // a linked list of sectors where this object appears
|
||||
|
||||
+4
-4
@@ -1181,11 +1181,11 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
||||
ghost->old_y = mobj->old_y2;
|
||||
ghost->old_z = mobj->old_z2;
|
||||
ghost->old_angle = (mobj->player ? mobj->player->old_frameangle2 : mobj->old_angle2);
|
||||
ghost->old_pitch = mobj->old_pitch2;
|
||||
ghost->old_roll = mobj->old_roll2;
|
||||
ghost->old_sloperoll = mobj->old_sloperoll2;
|
||||
ghost->old_slopepitch = mobj->old_slopepitch2;
|
||||
ghost->old_scale = mobj->old_scale2;
|
||||
ghost->old_spritexscale = mobj->old_spritexscale2;
|
||||
ghost->old_spriteyscale = mobj->old_spriteyscale2;
|
||||
ghost->old_spritexoffset = mobj->old_spritexoffset2;
|
||||
ghost->old_spriteyoffset = mobj->old_spriteyoffset2;
|
||||
|
||||
return ghost;
|
||||
}
|
||||
|
||||
+14
-14
@@ -314,13 +314,15 @@ void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out)
|
||||
return;
|
||||
}
|
||||
|
||||
out->x = mobj->resetinterp && (mobj->type != MT_GHOST) ? mobj->x : R_LerpFixed(mobj->old_x, mobj->x, frac);
|
||||
out->y = mobj->resetinterp && (mobj->type != MT_GHOST) ? mobj->y : R_LerpFixed(mobj->old_y, mobj->y, frac);
|
||||
out->z = mobj->resetinterp && (mobj->type != MT_GHOST) ? mobj->z : R_LerpFixed(mobj->old_z, mobj->z, frac);
|
||||
out->spritexscale = mobj->resetinterp ? mobj->spritexscale : R_LerpFixed(mobj->old_spritexscale, mobj->spritexscale, frac);
|
||||
out->spriteyscale = mobj->resetinterp ? mobj->spriteyscale : R_LerpFixed(mobj->old_spriteyscale, mobj->spriteyscale, frac);
|
||||
out->spritexoffset = mobj->resetinterp ? mobj->spritexoffset : R_LerpFixed(mobj->old_spritexoffset, mobj->spritexoffset, frac);
|
||||
out->spriteyoffset = mobj->resetinterp ? mobj->spriteyoffset : R_LerpFixed(mobj->old_spriteyoffset, mobj->spriteyoffset, frac);
|
||||
const boolean doreset = mobj->resetinterp && mobj->type != MT_GHOST && mobj->type != MT_PLAYERRETICULE;
|
||||
|
||||
out->x = doreset ? mobj->x : R_LerpFixed(mobj->old_x, mobj->x, frac);
|
||||
out->y = doreset ? mobj->y : R_LerpFixed(mobj->old_y, mobj->y, frac);
|
||||
out->z = doreset ? mobj->z : R_LerpFixed(mobj->old_z, mobj->z, frac);
|
||||
out->spritexscale = doreset ? mobj->spritexscale : R_LerpFixed(mobj->old_spritexscale, mobj->spritexscale, frac);
|
||||
out->spriteyscale = doreset ? mobj->spriteyscale : R_LerpFixed(mobj->old_spriteyscale, mobj->spriteyscale, frac);
|
||||
out->spritexoffset = doreset ? mobj->spritexoffset : R_LerpFixed(mobj->old_spritexoffset, mobj->spritexoffset, frac);
|
||||
out->spriteyoffset = doreset ? mobj->spriteyoffset : R_LerpFixed(mobj->old_spriteyoffset, mobj->spriteyoffset, frac);
|
||||
out->scale = mobj->resetinterp ? mobj->scale : R_LerpFixed(mobj->old_scale, mobj->scale, frac);
|
||||
//out->subsector = R_PointInSubsector(out->x, out->y); // why was this even done?
|
||||
out->subsector = mobj->subsector;
|
||||
@@ -787,19 +789,17 @@ void R_ResetMobjInterpolationState(mobj_t *mobj)
|
||||
mobj->old_z2 = mobj->old_z;
|
||||
mobj->old_angle2 = mobj->old_angle;
|
||||
mobj->old_scale2 = mobj->old_scale;
|
||||
|
||||
// rotation humor
|
||||
mobj->old_pitch2 = mobj->old_pitch;
|
||||
mobj->old_roll2 = mobj->old_roll;
|
||||
mobj->old_slopepitch2 = mobj->old_slopepitch;
|
||||
mobj->old_sloperoll2 = mobj->old_sloperoll;
|
||||
mobj->old_spritexscale2 = mobj->old_spritexscale;
|
||||
mobj->old_spriteyscale2 = mobj->old_spriteyscale;
|
||||
mobj->old_spritexoffset2 = mobj->old_spritexoffset;
|
||||
mobj->old_spriteyoffset2 = mobj->old_spriteyoffset;
|
||||
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
mobj->old_angle = mobj->angle;
|
||||
|
||||
// rotation humor, again
|
||||
// rotation humor
|
||||
|
||||
// pitch and roll first
|
||||
mobj->old_pitch = mobj->pitch;
|
||||
|
||||
Reference in new issue
Block a user