From 2aa7cdc5a81e07abf701d67c5a6ae8fe10b80fe7 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Tue, 8 Jun 2010 23:32:01 +0000 Subject: [PATCH] - Fixed: drawbar didn't work right when scaled. SVN r2361 (trunk) --- src/g_shared/sbarinfo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_shared/sbarinfo.cpp b/src/g_shared/sbarinfo.cpp index 3a1462eb0..1966b58f6 100644 --- a/src/g_shared/sbarinfo.cpp +++ b/src/g_shared/sbarinfo.cpp @@ -1153,8 +1153,8 @@ public: double tmp = 0; dx += ST_X; dy += ST_Y - (Scaled ? script->resH : 200) + script->height; - w = forceWidth < 0 ? texture->GetScaledWidth() : forceWidth; - h = forceHeight < 0 ? texture->GetScaledHeight() : forceHeight; + w = forceWidth < 0 ? texture->GetScaledWidthDouble() : forceWidth; + h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight; double dcx = cx == 0 ? 0 : dx + ((double) cx / FRACUNIT) - texture->GetScaledLeftOffsetDouble(); double dcy = cy == 0 ? 0 : dy + ((double) cy / FRACUNIT) - texture->GetScaledTopOffsetDouble(); double dcr = cr == 0 ? INT_MAX : dx + w - ((double) cr / FRACUNIT); @@ -1174,6 +1174,7 @@ public: dcy += 200 - script->resH; dcb += 200 - script->resH; } + if(clearDontDraw) screen->Clear(static_cast(MAX(dx, dcx)), static_cast(MAX(dy, dcy)), static_cast(dcr), static_cast(dcb), GPalette.BlackIndex, 0); else @@ -1185,8 +1186,8 @@ public: DTA_DestHeightF, h, DTA_ClipLeft, static_cast(dcx), DTA_ClipTop, static_cast(dcy), - DTA_ClipRight, static_cast(dcr), - DTA_ClipBottom, static_cast(dcb), + DTA_ClipRight, static_cast(MIN(INT_MAX, dcr)), + DTA_ClipBottom, static_cast(MIN(INT_MAX, dcb)), DTA_Translation, translate ? GetTranslation() : 0, DTA_ColorOverlay, dim ? DIM_OVERLAY : 0, DTA_CenterBottomOffset, (offsetflags & SBarInfoCommand::CENTER_BOTTOM) == SBarInfoCommand::CENTER_BOTTOM, @@ -1202,8 +1203,8 @@ public: DTA_DestHeightF, h, DTA_ClipLeft, static_cast(dcx), DTA_ClipTop, static_cast(dcy), - DTA_ClipRight, static_cast(dcr), - DTA_ClipBottom, static_cast(dcb), + DTA_ClipRight, static_cast(MIN(INT_MAX, dcr)), + DTA_ClipBottom, static_cast(MIN(INT_MAX, dcb)), DTA_Translation, translate ? GetTranslation() : 0, DTA_ColorOverlay, dim ? DIM_OVERLAY : 0, DTA_CenterBottomOffset, (offsetflags & SBarInfoCommand::CENTER_BOTTOM) == SBarInfoCommand::CENTER_BOTTOM,