mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add P_SpawnMobjFromMobjUnscaled, does not scale offsets
This commit is contained in:
parent
a884e332ba
commit
8770d76a4e
2 changed files with 18 additions and 6 deletions
|
|
@ -330,6 +330,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo);
|
||||||
boolean P_CheckSolidLava(mobj_t *mobj, ffloor_t *rover);
|
boolean P_CheckSolidLava(mobj_t *mobj, ffloor_t *rover);
|
||||||
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
||||||
|
|
||||||
|
mobj_t *P_SpawnMobjFromMobjUnscaled(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
||||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
||||||
|
|
||||||
mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type);
|
mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type);
|
||||||
|
|
|
||||||
23
src/p_mobj.c
23
src/p_mobj.c
|
|
@ -14156,18 +14156,14 @@ fixed_t P_ScaleFromMap(fixed_t n, fixed_t scale)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_SpawnMobjFromMobj
|
// P_SpawnMobjFromMobjUnscaled
|
||||||
// Spawns an object with offsets relative to the position of another object.
|
// Spawns an object with offsets relative to the position of another object.
|
||||||
// Scale, gravity flip, etc. is taken into account automatically.
|
// Scale, gravity flip, etc. is taken into account automatically.
|
||||||
//
|
//
|
||||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type)
|
mobj_t *P_SpawnMobjFromMobjUnscaled(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type)
|
||||||
{
|
{
|
||||||
mobj_t *newmobj;
|
mobj_t *newmobj;
|
||||||
|
|
||||||
xofs = FixedMul(xofs, mobj->scale);
|
|
||||||
yofs = FixedMul(yofs, mobj->scale);
|
|
||||||
zofs = FixedMul(zofs, mobj->scale);
|
|
||||||
|
|
||||||
newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type);
|
newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type);
|
||||||
if (!newmobj)
|
if (!newmobj)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -14220,6 +14216,21 @@ mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zo
|
||||||
return newmobj;
|
return newmobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_SpawnMobjFromMobj
|
||||||
|
// Spawns an object with offsets relative to the position of another object.
|
||||||
|
// Scale, gravity flip, etc. is taken into account automatically.
|
||||||
|
// The offsets are automatically scaled by source object's scale.
|
||||||
|
//
|
||||||
|
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type)
|
||||||
|
{
|
||||||
|
xofs = FixedMul(xofs, mobj->scale);
|
||||||
|
yofs = FixedMul(yofs, mobj->scale);
|
||||||
|
zofs = FixedMul(zofs, mobj->scale);
|
||||||
|
|
||||||
|
return P_SpawnMobjFromMobjUnscaled(mobj, xofs, yofs, zofs, type);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_GetMobjHead & P_GetMobjFeet
|
// P_GetMobjHead & P_GetMobjFeet
|
||||||
// Returns the top and bottom of an object, follows appearance, not physics,
|
// Returns the top and bottom of an object, follows appearance, not physics,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue