From e2de6d9dc366db4f37212ca6939ec3194b17c3b9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 24 Jul 2020 21:08:33 +0200 Subject: [PATCH] - changed status bar drawer to pass the texture offsets to the low level code instead of adding them itself. This is needed for rotating around the pivot point, if the offset is applied here the low level code cannot do the rotation properly anymore. --- source/core/statusbar.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/core/statusbar.cpp b/source/core/statusbar.cpp index c5a225ac8..6aab8a582 100644 --- a/source/core/statusbar.cpp +++ b/source/core/statusbar.cpp @@ -465,18 +465,19 @@ void DBaseStatusBar::DrawGraphic(FGameTexture* tex, double x, double y, int flag x += drawOffset.X; y += drawOffset.Y; + double xo = 0, yo = 0; switch (flags & DI_ITEM_HMASK) { - case DI_ITEM_HCENTER: x -= boxwidth / 2; break; - case DI_ITEM_RIGHT: x -= boxwidth; break; - case DI_ITEM_HOFFSET: x -= tex->GetDisplayLeftOffset() * boxwidth / texwidth; break; + case DI_ITEM_HCENTER: xo = texwidth / 2; break; + case DI_ITEM_RIGHT: xo = texwidth; break; + case DI_ITEM_HOFFSET: xo = tex->GetDisplayLeftOffset(); break; } switch (flags & DI_ITEM_VMASK) { - case DI_ITEM_VCENTER: y -= boxheight / 2; break; - case DI_ITEM_BOTTOM: y -= boxheight; break; - case DI_ITEM_VOFFSET: y -= tex->GetDisplayTopOffset() * boxheight / texheight; break; + case DI_ITEM_VCENTER: yo = texheight / 2; break; + case DI_ITEM_BOTTOM: yo = texheight; break; + case DI_ITEM_VOFFSET: yo = tex->GetDisplayTopOffset(); break; } if (!fullscreenOffsets) @@ -513,9 +514,10 @@ void DBaseStatusBar::DrawGraphic(FGameTexture* tex, double x, double y, int flag x += orgx; y += orgy; } + // Now reapply the texture offsets. We will need them DrawTexture(twod, tex, x, y, - DTA_TopOffset, 0, - DTA_LeftOffset, 0, + DTA_TopOffsetF, yo, + DTA_LeftOffsetF, xo, DTA_DestWidthF, boxwidth, DTA_DestHeightF, boxheight, DTA_Color, color,