From 5a450b5eaa3dcc937223e083c8733b519c344279 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 3 May 2017 15:56:33 -0400 Subject: [PATCH] - fixed: +FLIPSPRITE works in mirrors in OpenGL now. --- src/gl/scene/gl_sprite.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 1cd2070b8..629f8acb9 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -814,7 +814,12 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) if (thing->renderflags & RF_YFLIP) std::swap(vt, vb); gltexture->GetSpriteRect(&r); - if ((mirror ^ !!(thing->renderflags & RF_XFLIP)) || (thing->flags7 & MF7_SPRITEFLIP)) + + // [SP] SpriteFlip + if (thing->flags7 & MF7_SPRITEFLIP) + thing->renderflags ^= RF_XFLIP; + + if (mirror ^ !!(thing->renderflags & RF_XFLIP)) { r.left = -r.width - r.left; // mirror the sprite's x-offset ul = gltexture->GetSpriteUL(); @@ -826,6 +831,9 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) ur = gltexture->GetSpriteUL(); } + if (thing->flags7 & MF7_SPRITEFLIP) // [SP] Flip back + thing->renderflags ^= RF_XFLIP; + r.Scale(sprscale.X, sprscale.Y); float rightfac = -r.left;