diff --git a/src/p_mobj.c b/src/p_mobj.c index f16f55f1b..69bb6dd81 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9855,7 +9855,6 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster) mobj->radius = info->radius; mobj->height = info->height; mobj->flags = info->flags; - mobj->blendmode = AST_TRANSLUCENT; mobj->health = info->spawnhealth; @@ -9891,7 +9890,10 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster) } // Sprite rendering - mobj->spritexscale = mobj->spriteyscale = mobj->scale; + mobj->blendmode = AST_TRANSLUCENT; + mobj->realxscale = mobj->realyscale = mobj->scale; + mobj->spritexscale = mobj->realxscale; + mobj->spriteyscale = mobj->realyscale; // set subsector and/or block links P_SetThingPosition(mobj); diff --git a/src/p_tick.c b/src/p_tick.c index 90f7202c2..9a2b6e60c 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -627,38 +627,6 @@ static void P_RunQuakes(void) --quake.time; } -// Reset our Sprite scales and offsets -// at the start of our tic -// this is just to make things simpler -// as we dont have to reset it ourselves after use -// done at the start so lua can still overwrite everything -static inline void P_ResetSpriteStuff(void) -{ - thinker_t *th; - - if (rendermode == render_none) - return; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - mobj_t *mo; - - if (th->function != (actionf_p1)P_MobjThinker) // not a mobj - continue; - - mo = (mobj_t *)th; - - if (!mo || (mo->sprite == SPR_NULL) - || (mo->flags2 & MF2_DONTDRAW) || (mo->type == MT_SHADOW)) - continue; - - mo->spritexscale = mo->realxscale; - mo->spriteyscale = mo->realyscale; - mo->spritexoffset = mo->realxoffset; - mo->spriteyoffset = mo->realyoffset; - } -} - // // P_Ticker // @@ -760,8 +728,6 @@ void P_Ticker(boolean run) ps_lua_mobjhooks.value.i = 0; ps_checkposition_calls.value.i = 0; - P_ResetSpriteStuff(); - PS_START_TIMING(ps_lua_prethinkframe_time); LUA_HookPreThinkFrame(); PS_STOP_TIMING(ps_lua_prethinkframe_time); diff --git a/src/r_fps.c b/src/r_fps.c index 710210939..6bd385066 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -860,6 +860,19 @@ void R_ResetMobjInterpolationState(mobj_t *mobj) mobj->player->old_frameangle = mobj->player->frameangle; } + // Reset our Sprite scales and offsets + // at the start of the tic + // this is just to make things simpler + // as we dont have to reset it ourselves after use + // done at the start so lua can still overwrite everything + + // technically not interpolation related + // but this saves us another thinkerloop and multiple checks lel + mobj->spritexscale = mobj->realxscale; + mobj->spriteyscale = mobj->realyscale; + mobj->spritexoffset = mobj->realxoffset; + mobj->spriteyoffset = mobj->realyoffset; + mobj->resetinterp = false; }