mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- Make floatbobbing a purely cosmetic effect that does not alter an actor's real position in the world.
SVN r3744 (trunk)
This commit is contained in:
parent
154e83331d
commit
5e2b4bddda
4 changed files with 16 additions and 53 deletions
|
@ -379,10 +379,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
|
|||
else
|
||||
{
|
||||
self->z = self->SpawnPoint[2] + self->floorz;
|
||||
if (self->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
self->z += FloatBobOffsets[(self->FloatBobPhase + level.maptime) & 63];
|
||||
}
|
||||
}
|
||||
// Redo floor/ceiling check, in case of 3D floors
|
||||
P_FindFloorCeiling(self, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT);
|
||||
|
|
|
@ -1471,12 +1471,7 @@ bool P_TestMobjLocation (AActor *mobj)
|
|||
if (P_CheckPosition(mobj, mobj->x, mobj->y))
|
||||
{ // XY is ok, now check Z
|
||||
mobj->flags = flags;
|
||||
fixed_t z = mobj->z;
|
||||
if (mobj->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
z -= FloatBobOffsets[(mobj->FloatBobPhase + level.maptime - 1) & 63];
|
||||
}
|
||||
if ((z < mobj->floorz) || (z + mobj->height > mobj->ceilingz))
|
||||
if ((mobj->z < mobj->floorz) || (mobj->z + mobj->height > mobj->ceilingz))
|
||||
{ // Bad Z
|
||||
return false;
|
||||
}
|
||||
|
@ -4975,15 +4970,7 @@ void PIT_FloorDrop (AActor *thing, FChangePosition *cpos)
|
|||
{
|
||||
fixed_t oldz = thing->z;
|
||||
|
||||
// If float bob, always stay the same approximate distance above
|
||||
// the floor; otherwise only move things standing on the floor,
|
||||
// and only do it if the drop is slow enough.
|
||||
if (thing->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
thing->z = thing->z - oldfloorz + thing->floorz;
|
||||
P_CheckFakeFloorTriggers (thing, oldz);
|
||||
}
|
||||
else if ((thing->flags & MF_NOGRAVITY) || (thing->flags5 & MF5_MOVEWITHSECTOR) ||
|
||||
if ((thing->flags & MF_NOGRAVITY) || (thing->flags5 & MF5_MOVEWITHSECTOR) ||
|
||||
(((cpos->sector->Flags & SECF_FLOORDROP) || cpos->moveamt < 9*FRACUNIT)
|
||||
&& thing->z - thing->floorz <= cpos->moveamt))
|
||||
{
|
||||
|
@ -5008,8 +4995,7 @@ void PIT_FloorRaise (AActor *thing, FChangePosition *cpos)
|
|||
if (oldfloorz == thing->floorz) return;
|
||||
|
||||
// Move things intersecting the floor up
|
||||
if (thing->z <= thing->floorz ||
|
||||
(!(thing->flags & MF_NOGRAVITY) && (thing->flags2 & MF2_FLOATBOB)))
|
||||
if (thing->z <= thing->floorz)
|
||||
{
|
||||
if (thing->flags4 & MF4_ACTLIKEBRIDGE)
|
||||
{
|
||||
|
@ -5018,14 +5004,7 @@ void PIT_FloorRaise (AActor *thing, FChangePosition *cpos)
|
|||
}
|
||||
intersectors.Clear ();
|
||||
fixed_t oldz = thing->z;
|
||||
if (!(thing->flags2 & MF2_FLOATBOB))
|
||||
{
|
||||
thing->z = thing->floorz;
|
||||
}
|
||||
else
|
||||
{
|
||||
thing->z = thing->z - oldfloorz + thing->floorz;
|
||||
}
|
||||
thing->z = thing->floorz;
|
||||
switch (P_PushUp (thing, cpos))
|
||||
{
|
||||
default:
|
||||
|
|
|
@ -2168,10 +2168,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
|||
mo->player->deltaviewheight = mo->player->GetDeltaViewHeight();
|
||||
}
|
||||
|
||||
if (!(mo->flags2 & MF2_FLOATBOB))
|
||||
{
|
||||
mo->z += mo->velz;
|
||||
}
|
||||
mo->z += mo->velz;
|
||||
|
||||
//
|
||||
// apply gravity
|
||||
|
@ -2252,11 +2249,6 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
|||
}
|
||||
}
|
||||
|
||||
if (mo->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
mo->z += mo->velz;
|
||||
}
|
||||
|
||||
//
|
||||
// adjust height
|
||||
//
|
||||
|
@ -3368,14 +3360,7 @@ void AActor::Tick ()
|
|||
}
|
||||
|
||||
}
|
||||
if (flags2 & MF2_FLOATBOB)
|
||||
{ // Floating item bobbing motion
|
||||
z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63];
|
||||
}
|
||||
if (velz || BlockingMobj ||
|
||||
(z != floorz && (!(flags2 & MF2_FLOATBOB) ||
|
||||
(z - FloatBobOffsets[(FloatBobPhase + level.maptime) & 63] != floorz)
|
||||
)))
|
||||
if (velz || BlockingMobj || z != floorz)
|
||||
{ // Handle Z velocity and gravity
|
||||
if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
|
||||
{
|
||||
|
@ -3808,11 +3793,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->SpawnPoint[2] = (actor->z - actor->floorz);
|
||||
}
|
||||
|
||||
if (actor->flags2 & MF2_FLOATBOB)
|
||||
{ // Prime the bobber
|
||||
actor->FloatBobPhase = rng();
|
||||
actor->z += FloatBobOffsets[(actor->FloatBobPhase + level.maptime - 1) & 63];
|
||||
}
|
||||
actor->FloatBobPhase = rng(); // Don't make everything bob in sync
|
||||
if (actor->flags2 & MF2_FLOORCLIP)
|
||||
{
|
||||
actor->AdjustFloorClip ();
|
||||
|
@ -4967,7 +4948,7 @@ int P_GetThingFloorType (AActor *thing)
|
|||
|
||||
bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool checkabove, bool alert)
|
||||
{
|
||||
if (thing->flags2 & MF2_FLOATBOB || thing->flags3 & MF3_DONTSPLASH)
|
||||
if (thing->flags3 & MF3_DONTSPLASH)
|
||||
return false;
|
||||
|
||||
if (thing->player && (thing->player->cheats & CF_PREDICTING))
|
||||
|
@ -5128,7 +5109,7 @@ bool P_HitFloor (AActor *thing)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (thing->flags2 & MF2_FLOATBOB || thing->flags3 & MF3_DONTSPLASH)
|
||||
if (thing->flags3 & MF3_DONTSPLASH)
|
||||
return false;
|
||||
|
||||
// don't splash if landing on the edge above water/lava/etc....
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include "r_data/r_translate.h"
|
||||
#include "r_data/colormaps.h"
|
||||
#include "r_data/voxels.h"
|
||||
#include "p_local.h"
|
||||
|
||||
// [RH] A c-buffer. Used for keeping track of offscreen voxel spans.
|
||||
|
||||
|
@ -513,6 +514,12 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
|||
fy = thing->PrevY + FixedMul (r_TicFrac, thing->y - thing->PrevY);
|
||||
fz = thing->PrevZ + FixedMul (r_TicFrac, thing->z - thing->PrevZ);
|
||||
|
||||
// [RH] Make floatbobbing a renderer-only effect.
|
||||
if (thing->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
fz += finesine[(Scale(thing->FloatBobPhase + level.maptime, FINEANGLES, 64) + r_TicFrac * ((FINEANGLES/64) / 1000)) & FINEMASK] * 8;
|
||||
}
|
||||
|
||||
// transform the origin point
|
||||
tr_x = fx - viewx;
|
||||
tr_y = fy - viewy;
|
||||
|
|
Loading…
Reference in a new issue