diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 0c3daf38cb..923cb819fd 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -379,13 +379,14 @@ inline void GLSprite::PutSprite(bool translucent) void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight) { - bool smarterclip = false; // Set to true if one condition triggers the test below - if (((thing->player || thing->flags3&MF3_ISMONSTER || - thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || - !(thing->flags&MF_CORPSE))) || (gl_spriteclip == 3 && (smarterclip = true)) || gl_spriteclip > 1) + const float NO_VAL = 100000000.0f; + bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE)); + bool smarterclip = !clipthing && gl_spriteclip == 3; + if (clipthing || gl_spriteclip > 1) { - float btm = 100000000.0f; - float top = -100000000.0f; + + float btm = NO_VAL; + float top = -NO_VAL; extsector_t::xfloor &x = thing->Sector->e->XFloor; if (x.ffloors.Size()) @@ -403,7 +404,7 @@ void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp { top = ceilingh; } - if (btm != 100000000.0f && top != -100000000.0f) + if (btm != NO_VAL && top != -NO_VAL) { break; } @@ -418,9 +419,9 @@ void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp top = thing->ceilingz; } } - if (btm == 1000000.0f) + if (btm == NO_VAL) btm = thing->Sector->floorplane.ZatPoint(thing) - thing->Floorclip; - if (top == -1000000.0f) + if (top == NO_VAL) top = thing->Sector->ceilingplane.ZatPoint(thingpos); // +/-1 to account for the one pixel empty frame around the sprite. diff --git a/src/gl/scene/gl_weapon.cpp b/src/gl/scene/gl_weapon.cpp index 9c179e1481..1716924970 100644 --- a/src/gl/scene/gl_weapon.cpp +++ b/src/gl/scene/gl_weapon.cpp @@ -202,7 +202,7 @@ void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep) (r_deathcamera && camera->health <= 0)) return; - P_BobWeapon (player, &player->psprites[ps_weapon], &ofsx, &ofsy); + P_BobWeapon (player, &player->psprites[ps_weapon], &ofsx, &ofsy, r_TicFracF); // check for fullbright if (player->fixedcolormap==NOFIXEDCOLORMAP)