diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 31dc116a6..f82e866f6 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -124,16 +124,16 @@ void SetHUDIcon(PClass *cls, FTextureID tex) //--------------------------------------------------------------------------- static void DrawImageToBox(FTexture * tex, int x, int y, int w, int h, int trans=0xc000) { - float scale1, scale2; + double scale1, scale2; if (tex) { int texwidth=tex->GetWidth(); int texheight=tex->GetHeight(); - if (wGetChar(text[i], &width); if (texc != NULL) { - int offset = texc->TopOffset - tex_zero->TopOffset + tex_zero->GetHeight(); + double offset = texc->GetScaledTopOffsetDouble() + - tex_zero->GetScaledTopOffsetDouble() + + tex_zero->GetScaledHeightDouble(); + screen->DrawChar(font, color, x, y, text[i], DTA_KeepRatio, true, DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans, - DTA_LeftOffset, width/2, DTA_TopOffset, offset, + DTA_LeftOffset, width/2, DTA_TopOffsetF, offset, /*DTA_CenterBottomOffset, 1,*/ TAG_DONE); } x += zerowidth; diff --git a/src/textures/textures.h b/src/textures/textures.h index 2045a19fb..a756a7036 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -182,13 +182,13 @@ public: int GetScaledWidth () { int foo = (Width << 17) / xScale; return (foo >> 1) + (foo & 1); } int GetScaledHeight () { int foo = (Height << 17) / yScale; return (foo >> 1) + (foo & 1); } - double GetScaledWidthDouble () { return (Width * 65536.f) / xScale; } - double GetScaledHeightDouble () { return (Height * 65536.f) / yScale; } + double GetScaledWidthDouble () { return (Width * 65536.) / xScale; } + double GetScaledHeightDouble () { return (Height * 65536.) / yScale; } int GetScaledLeftOffset () { int foo = (LeftOffset << 17) / xScale; return (foo >> 1) + (foo & 1); } int GetScaledTopOffset () { int foo = (TopOffset << 17) / yScale; return (foo >> 1) + (foo & 1); } - double GetScaledLeftOffsetDouble() { return (LeftOffset * 65536.f) / xScale; } - double GetScaledTopOffsetDouble() { return (TopOffset * 65536.f) / yScale; } + double GetScaledLeftOffsetDouble() { return (LeftOffset * 65536.) / xScale; } + double GetScaledTopOffsetDouble() { return (TopOffset * 65536.) / yScale; } virtual void SetFrontSkyLayer();