p_mobj.c: add P_InstaScale function

Previously was in objects/broly.c
This commit is contained in:
James R 2023-06-13 14:40:11 -07:00
parent ffcdce339e
commit c50e63ccd7
3 changed files with 12 additions and 7 deletions

View file

@ -6,13 +6,6 @@
#include "../p_local.h"
#include "../s_sound.h"
// TODO: generic function
static void P_InstaScale(mobj_t *thing, fixed_t scale)
{
P_SetScale(thing, scale);
thing->destscale = scale;
}
/* An object may not be visible on the same tic:
1) that it spawned
2) that it cycles to the next state */

View file

@ -4954,6 +4954,17 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale)
}
}
//
// P_InstaScale
//
// Set the object's current scale and destscale together
//
void P_InstaScale(mobj_t *thing, fixed_t scale)
{
P_SetScale(thing, scale);
thing->destscale = scale;
}
void P_Attract(mobj_t *source, mobj_t *dest, boolean nightsgrab) // Home in on your target
{
fixed_t dist, ndist, speedmul;

View file

@ -548,6 +548,7 @@ boolean P_PrecipThinker(precipmobj_t *mobj);
void P_NullPrecipThinker(precipmobj_t *mobj);
void P_FreePrecipMobj(precipmobj_t *mobj);
void P_SetScale(mobj_t *mobj, fixed_t newscale);
void P_InstaScale(mobj_t *mobj, fixed_t newscale);
void P_XYMovement(mobj_t *mo);
void P_RingXYMovement(mobj_t *mo);
void P_SceneryXYMovement(mobj_t *mo);