mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-21 07:22:33 +00:00
Merge branch 'hitlagjitter-interp' into 'master'
Interpolate hitlag jitters See merge request KartKrew/RingRacers!112
This commit is contained in:
commit
c2cafcdbfb
5 changed files with 31 additions and 10 deletions
|
|
@ -3115,11 +3115,15 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
||||||
R_InterpolateMobjState(thing, FRACUNIT, &interp);
|
R_InterpolateMobjState(thing, FRACUNIT, &interp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hitlag vibrating (todo: interp somehow?)
|
// hitlag vibrating
|
||||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
fixed_t jitters = HITLAGJITTERS;
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
jitters += (rendertimefrac / HITLAGDIV);
|
||||||
|
fixed_t mul = thing->hitlag * jitters;
|
||||||
|
|
||||||
|
// perhaps there could be a way to interp this too?
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
{
|
{
|
||||||
mul = -mul;
|
mul = -mul;
|
||||||
|
|
@ -4685,10 +4689,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
dispoffset = thing->dispoffset;
|
dispoffset = thing->dispoffset;
|
||||||
|
|
||||||
// hitlag vibrating (todo: interp somehow?)
|
// hitlag vibrating
|
||||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
fixed_t jitters = HITLAGJITTERS;
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
jitters += (rendertimefrac / HITLAGDIV);
|
||||||
|
|
||||||
|
fixed_t mul = thing->hitlag * jitters;
|
||||||
|
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1405,7 +1405,10 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
// hitlag vibrating
|
// hitlag vibrating
|
||||||
if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG))
|
if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = spr->mobj->hitlag * HITLAGJITTERS;
|
fixed_t jitters = HITLAGJITTERS;
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
jitters += (rendertimefrac / HITLAGDIV);
|
||||||
|
fixed_t mul = spr->mobj->hitlag * jitters;
|
||||||
|
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAXHITLAGTICS (30)
|
#define MAXHITLAGTICS (30)
|
||||||
#define HITLAGJITTERS (FRACUNIT / 20)
|
#define HITLAGDIV (20) // define this so we arent using a magic number
|
||||||
|
#define HITLAGJITTERS (FRACUNIT / HITLAGDIV)
|
||||||
#define NUM_HITLAG_STATES (9)
|
#define NUM_HITLAG_STATES (9)
|
||||||
#define NUM_HITLAG_SOUNDS (4)
|
#define NUM_HITLAG_SOUNDS (4)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5339,7 +5339,11 @@ static void K_drawKartFirstPerson(void)
|
||||||
// hitlag vibrating
|
// hitlag vibrating
|
||||||
if (stplyr->mo->hitlag > 0 && (stplyr->mo->eflags & MFE_DAMAGEHITLAG))
|
if (stplyr->mo->hitlag > 0 && (stplyr->mo->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = stplyr->mo->hitlag * HITLAGJITTERS;
|
fixed_t jitters = HITLAGJITTERS;
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
jitters += (rendertimefrac / HITLAGDIV);
|
||||||
|
|
||||||
|
fixed_t mul = stplyr->mo->hitlag * jitters;
|
||||||
if (r_splitscreen && mul > FRACUNIT)
|
if (r_splitscreen && mul > FRACUNIT)
|
||||||
mul = FRACUNIT;
|
mul = FRACUNIT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1794,7 +1794,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
this_scale = interp.scale;
|
this_scale = interp.scale;
|
||||||
|
|
||||||
// hitlag vibrating (todo: interp somehow?)
|
// hitlag vibrating
|
||||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
fixed_t mul = thing->hitlag * HITLAGJITTERS;
|
||||||
|
|
@ -2172,10 +2172,15 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
R_InterpolateMobjState(thing, FRACUNIT, &tracer_interp);
|
R_InterpolateMobjState(thing, FRACUNIT, &tracer_interp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hitlag vibrating (todo: interp somehow?)
|
// hitlag vibrating
|
||||||
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG))
|
||||||
{
|
{
|
||||||
fixed_t mul = thing->hitlag * (FRACUNIT / 10);
|
// previous code multiplied by (FRACUNIT / 10) instead of HITLAGJITTERS, um wadaflip
|
||||||
|
fixed_t jitters = HITLAGJITTERS;
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
jitters += (rendertimefrac / HITLAGDIV);
|
||||||
|
|
||||||
|
fixed_t mul = thing->hitlag * jitters;
|
||||||
|
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue