mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Scale Chaos Chute objects
This commit is contained in:
parent
abf784cc79
commit
2bdc055139
3 changed files with 41 additions and 6 deletions
22
src/k_kart.c
22
src/k_kart.c
|
|
@ -3802,13 +3802,33 @@ void K_RemoveGrowShrink(player_t *player)
|
||||||
|
|
||||||
boolean K_IsBigger(mobj_t *compare, mobj_t *other)
|
boolean K_IsBigger(mobj_t *compare, mobj_t *other)
|
||||||
{
|
{
|
||||||
|
fixed_t compareScale, otherScale;
|
||||||
|
|
||||||
if ((compare == NULL || P_MobjWasRemoved(compare) == true)
|
if ((compare == NULL || P_MobjWasRemoved(compare) == true)
|
||||||
|| (other == NULL || P_MobjWasRemoved(other) == true))
|
|| (other == NULL || P_MobjWasRemoved(other) == true))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (compare->scale > other->scale + (mapobjectscale / 4));
|
if ((compareScale = P_GetMobjDefaultScale(compare)) != FRACUNIT)
|
||||||
|
{
|
||||||
|
compareScale = FixedDiv(compare->scale, compareScale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
compareScale = compare->scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((otherScale = P_GetMobjDefaultScale(other)) != FRACUNIT)
|
||||||
|
{
|
||||||
|
otherScale = FixedDiv(other->scale, otherScale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
otherScale = other->scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (compareScale > otherScale + (mapobjectscale / 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input)
|
static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input)
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ mobjtype_t P_GetMobjtype(UINT16 mthingtype);
|
||||||
|
|
||||||
void P_RespawnSpecials(void);
|
void P_RespawnSpecials(void);
|
||||||
|
|
||||||
|
fixed_t P_GetMobjDefaultScale(mobj_t *mobj);
|
||||||
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
|
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
|
||||||
|
|
||||||
void P_CalculatePrecipFloor(precipmobj_t *mobj);
|
void P_CalculatePrecipFloor(precipmobj_t *mobj);
|
||||||
|
|
|
||||||
24
src/p_mobj.c
24
src/p_mobj.c
|
|
@ -10496,6 +10496,20 @@ void P_SceneryThinker(mobj_t *mobj)
|
||||||
// GAME SPAWN FUNCTIONS
|
// GAME SPAWN FUNCTIONS
|
||||||
//
|
//
|
||||||
|
|
||||||
|
fixed_t P_GetMobjDefaultScale(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
switch(mobj->type)
|
||||||
|
{
|
||||||
|
case MT_SPECIALSTAGEARCH:
|
||||||
|
return 5*FRACUNIT;
|
||||||
|
case MT_SPECIALSTAGEBOMB:
|
||||||
|
return 3*FRACUNIT/4;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FRACUNIT;
|
||||||
|
}
|
||||||
|
|
||||||
static void P_DefaultMobjShadowScale(mobj_t *thing)
|
static void P_DefaultMobjShadowScale(mobj_t *thing)
|
||||||
{
|
{
|
||||||
thing->shadowscale = 0;
|
thing->shadowscale = 0;
|
||||||
|
|
@ -10596,6 +10610,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
SINT8 sc = -1;
|
SINT8 sc = -1;
|
||||||
state_t *st;
|
state_t *st;
|
||||||
mobj_t *mobj;
|
mobj_t *mobj;
|
||||||
|
fixed_t scale;
|
||||||
|
|
||||||
if (type == MT_NULL)
|
if (type == MT_NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -10648,13 +10663,12 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
|
|
||||||
// All mobjs are created at 100% scale.
|
// All mobjs are created at 100% scale.
|
||||||
mobj->scale = FRACUNIT;
|
mobj->scale = FRACUNIT;
|
||||||
mobj->destscale = mobj->scale;
|
|
||||||
mobj->scalespeed = FRACUNIT/12;
|
|
||||||
|
|
||||||
if (mapobjectscale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN)
|
|
||||||
{
|
|
||||||
mobj->destscale = mapobjectscale;
|
mobj->destscale = mapobjectscale;
|
||||||
mobj->scalespeed = mapobjectscale/12;
|
mobj->scalespeed = mapobjectscale/12;
|
||||||
|
|
||||||
|
if ((scale = P_GetMobjDefaultScale(mobj)) != FRACUNIT)
|
||||||
|
{
|
||||||
|
mobj->destscale = FixedMul(mobj->destscale, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sprite rendering
|
// Sprite rendering
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue