- use 2D size in 2D code, not the engine's screen dimensions.

This commit is contained in:
Christoph Oelckers 2021-02-27 12:33:47 +01:00
parent 2094b6420f
commit d0cf9d65e7
3 changed files with 8 additions and 6 deletions

View file

@ -99,7 +99,7 @@ void CGameMenuItemQAV::Draw(void)
if (bWideScreen) if (bWideScreen)
{ {
int xdim43 = scale(ydim, 4, 3); int xdim43 = scale(ydim, 4, 3);
int nCount = (xdim + xdim43 - 1) / xdim43; int nCount = (twod->GetWidth() + xdim43 - 1) / xdim43;
int backX = data->x; int backX = data->x;
for (int i = 0; i < nCount; i++) for (int i = 0; i < nCount; i++)
{ {

View file

@ -58,7 +58,7 @@ static void drawTextScreenBackground(void)
} }
else else
{ {
int width = scale(xdim, 240, ydim); int width = scale(twod->GetWidth(), 240, twod->GetHeight());
int nCount = (width + kLoadScreenWideBackWidth - 1) / kLoadScreenWideBackWidth; int nCount = (width + kLoadScreenWideBackWidth - 1) / kLoadScreenWideBackWidth;
for (int i = 0; i < nCount; i++) for (int i = 0; i < nCount; i++)
{ {

View file

@ -631,7 +631,7 @@ private:
} }
drawInventory(pPlayer, 166, 200 - tileHeight(2200)); drawInventory(pPlayer, 166, 200 - tileHeight(2200));
// Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already. // Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already.
PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scalefactor < 0.7) && double(xdim)/ydim > 1.6? 28 : 56); PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scalefactor < 0.7) && double(twod->GetWidth())/twod->GetHeight() > 1.6? 28 : 56);
} }
@ -842,11 +842,13 @@ IMPLEMENT_CLASS(DBloodStatusBar, false, false)
static void UpdateFrame(void) static void UpdateFrame(void)
{ {
auto tex = tileGetTexture(kBackTile); auto tex = tileGetTexture(kBackTile);
int width = twod->GetWidth();
int height = twod->GetHeight();
twod->AddFlatFill(0, 0, xdim, windowxy1.y - 3, tex); twod->AddFlatFill(0, 0, width, windowxy1.y - 3, tex);
twod->AddFlatFill(0, windowxy2.y + 4, xdim, ydim, tex); twod->AddFlatFill(0, windowxy2.y + 4, width, height, tex);
twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.x - 3, windowxy2.y + 4, tex); twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.x - 3, windowxy2.y + 4, tex);
twod->AddFlatFill(windowxy2.x + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex); twod->AddFlatFill(windowxy2.x + 4, windowxy1.y - 3, width, windowxy2.y + 4, tex);
twod->AddFlatFill(windowxy1.x - 3, windowxy1.y - 3, windowxy1.x, windowxy2.y + 1, tex, 0, 1, 0xff545454); twod->AddFlatFill(windowxy1.x - 3, windowxy1.y - 3, windowxy1.x, windowxy2.y + 1, tex, 0, 1, 0xff545454);
twod->AddFlatFill(windowxy1.x, windowxy1.y - 3, windowxy2.x + 4, windowxy1.y, tex, 0, 1, 0xff545454); twod->AddFlatFill(windowxy1.x, windowxy1.y - 3, windowxy2.x + 4, windowxy1.y, tex, 0, 1, 0xff545454);