- fixed sprite z coordinate calculation for flatsprites.

This commit is contained in:
Christoph Oelckers 2016-07-04 01:00:01 +02:00
parent cc784fff14
commit 6b0b7ea049

View file

@ -689,25 +689,19 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
topclip = rendersector->PortalBlocksMovement(sector_t::ceiling) ? LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::ceiling); topclip = rendersector->PortalBlocksMovement(sector_t::ceiling) ? LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::ceiling);
bottomclip = rendersector->PortalBlocksMovement(sector_t::floor) ? -LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::floor); bottomclip = rendersector->PortalBlocksMovement(sector_t::floor) ? -LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::floor);
DWORD spritetype = (thing->renderflags & RF_SPRITETYPEMASK);
x = thingpos.X; x = thingpos.X;
z = thingpos.Z;
y = thingpos.Y; y = thingpos.Y;
if (spritetype == RF_FLATSPRITE) z -= thing->Floorclip;
DWORD spritetype = thing->renderflags & RF_SPRITETYPEMASK; // [RH] Make floatbobbing a renderer-only effect.
if (thing->flags2 & MF2_FLOATBOB)
switch (spritetype)
{ {
case RF_FLATSPRITE: float fz = thing->GetBobOffset(r_TicFracF);
z = thingpos.Z; z += fz;
default:
z = thingpos.Z - thing->Floorclip;
// [RH] Make floatbobbing a renderer-only effect.
if (thing->flags2 & MF2_FLOATBOB)
{
float fz = thing->GetBobOffset(r_TicFracF);
z += fz;
}
break;
} }
modelframe = gl_FindModelFrame(thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED)); modelframe = gl_FindModelFrame(thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED));
if (!modelframe) if (!modelframe)
{ {