From 634a10db5246baac7321c87485375876b722491c Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 22 Mar 2018 13:22:39 +0100 Subject: [PATCH] Adds "DI_MIRROR" flag to statusbar image drawing. Useful for rearview mirror camera textures, for example. --- src/g_statusbar/sbar.h | 1 + src/g_statusbar/shared_sbar.cpp | 1 + wadsrc/static/zscript/statusbar/statusbar.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/src/g_statusbar/sbar.h b/src/g_statusbar/sbar.h index ba3d379b8..31a33a99f 100644 --- a/src/g_statusbar/sbar.h +++ b/src/g_statusbar/sbar.h @@ -517,6 +517,7 @@ enum DI_Flags DI_ALWAYSSHOWCOUNT = 0x200, // only for DrawInventoryBar. DI_DIMDEPLETED = 0x400, DI_DONTANIMATE = 0x800, // do not animate the texture + DI_MIRROR = 0x1000, // flip the texture horizontally, like a mirror DI_SCREEN_AUTO = 0, // decide based on given offsets. DI_SCREEN_MANUAL_ALIGN = 0x4000, // If this is on, the following flags will have an effect diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index d95cca888..8ba00dd7d 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -1635,6 +1635,7 @@ void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int fla DTA_Alpha, Alpha, DTA_AlphaChannel, !!(flags & DI_ALPHAMAPPED), DTA_FillColor, (flags & DI_ALPHAMAPPED) ? 0 : -1, + DTA_FlipX, !!(flags & DI_MIRROR), TAG_DONE); } diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index 29a1a8457..6b74e3d01 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -171,6 +171,7 @@ class BaseStatusBar native ui DI_ALWAYSSHOWCOUNT = 0x200, // only for DrawInventoryBar. DI_DIMDEPLETED = 0x400, DI_DONTANIMATE = 0x800, // do not animate the texture + DI_MIRROR = 0x1000, // flip the texture horizontally, like a mirror DI_SCREEN_AUTO = 0, // decide based on given offsets. DI_SCREEN_MANUAL_ALIGN = 0x4000, // If this is on, the following flags will have an effect