From 6b0b7ea0493dfe7daab28f53af7a6d9fac585e6f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Jul 2016 01:00:01 +0200 Subject: [PATCH] - fixed sprite z coordinate calculation for flatsprites. --- src/gl/scene/gl_sprite.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 7b8c48d8f..2e7992fbc 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -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); bottomclip = rendersector->PortalBlocksMovement(sector_t::floor) ? -LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::floor); + DWORD spritetype = (thing->renderflags & RF_SPRITETYPEMASK); x = thingpos.X; + z = thingpos.Z; y = thingpos.Y; + if (spritetype == RF_FLATSPRITE) z -= thing->Floorclip; - DWORD spritetype = thing->renderflags & RF_SPRITETYPEMASK; - - switch (spritetype) + // [RH] Make floatbobbing a renderer-only effect. + if (thing->flags2 & MF2_FLOATBOB) { - case RF_FLATSPRITE: - z = thingpos.Z; - 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; + float fz = thing->GetBobOffset(r_TicFracF); + z += fz; } + modelframe = gl_FindModelFrame(thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED)); if (!modelframe) {