- switched the entire status bar code to use FGameTexture.

- scale the automap parchment to clean 320x200 dimensions.
This commit is contained in:
Christoph Oelckers 2020-04-14 00:55:16 +02:00
commit c7db5b932e
16 changed files with 129 additions and 105 deletions

View file

@ -95,7 +95,7 @@ DBaseStatusBar *StatusBar;
extern int setblocks;
FTexture *CrosshairImage;
FGameTexture *CrosshairImage;
static int CrosshairNum;
CVAR (Int, paletteflash, 0, CVAR_ARCHIVE)
@ -192,7 +192,7 @@ void ST_LoadCrosshair(bool alwaysload)
}
}
CrosshairNum = num;
CrosshairImage = TexMan.GetTexture(texid);
CrosshairImage = TexMan.GetGameTexture(texid);
}
//---------------------------------------------------------------------------
@ -1015,11 +1015,12 @@ void DBaseStatusBar::RefreshBackground () const
if (setblocks >= 10)
{
FTexture *p = TexMan.GetTextureByName(gameinfo.Border.b);
FGameTexture *p = TexMan.GetGameTextureByName(gameinfo.Border.b);
if (p != NULL)
{
twod->AddFlatFill(0, y, x, y + p->GetDisplayHeight(), p, true);
twod->AddFlatFill(x2, y, twod->GetWidth(), y + p->GetDisplayHeight(), p, true);
int h = int(0.5 + p->GetDisplayHeight());
twod->AddFlatFill(0, y, x, y + h, p, true);
twod->AddFlatFill(x2, y, twod->GetWidth(), y + h, p, true);
}
}
}
@ -1546,10 +1547,10 @@ void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int fla
if (!texture.isValid())
return;
FTexture *tex = TexMan.GetTexture(texture, !(flags & DI_DONTANIMATE));
FGameTexture *tex = TexMan.GetGameTexture(texture, !(flags & DI_DONTANIMATE));
double texwidth = tex->GetDisplayWidthDouble() * scaleX;
double texheight = tex->GetDisplayHeightDouble() * scaleY;
double texwidth = tex->GetDisplayWidth() * scaleX;
double texheight = tex->GetDisplayHeight() * scaleY;
if (boxwidth > 0 || boxheight > 0)
{
@ -1601,14 +1602,14 @@ void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int fla
{
case DI_ITEM_HCENTER: x -= boxwidth / 2; break;
case DI_ITEM_RIGHT: x -= boxwidth; break;
case DI_ITEM_HOFFSET: x -= tex->GetDisplayLeftOffsetDouble() * boxwidth / texwidth; break;
case DI_ITEM_HOFFSET: x -= tex->GetDisplayLeftOffset() * boxwidth / texwidth; 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->GetDisplayTopOffsetDouble() * boxheight / texheight; break;
case DI_ITEM_VOFFSET: y -= tex->GetDisplayTopOffset() * boxheight / texheight; break;
}
if (!fullscreenOffsets)
@ -1737,20 +1738,20 @@ void DBaseStatusBar::DrawString(FFont *font, const FString &cstring, double x, d
}
int width;
FTexture* c = font->GetChar(ch, fontcolor, &width);
auto c = font->GetChar(ch, fontcolor, &width);
if (c == NULL) //missing character.
{
continue;
}
if (!monospaced) //If we are monospaced lets use the offset
x += (c->GetDisplayLeftOffsetDouble() + 1); //ignore x offsets since we adapt to character size
x += (c->GetDisplayLeftOffset() + 1); //ignore x offsets since we adapt to character size
double rx, ry, rw, rh;
rx = x + drawOffset.X;
ry = y + drawOffset.Y;
rw = c->GetDisplayWidthDouble();
rh = c->GetDisplayHeightDouble();
rw = c->GetDisplayWidth();
rh = c->GetDisplayHeight();
if (monospacing == EMonospacing::CellCenter)
rx += (spacing - rw) / 2;