- got rid of all DTA_Translation uses.

This commit is contained in:
Christoph Oelckers 2017-02-05 00:17:29 +01:00
parent dadc8e2ec2
commit 470dc138c6
5 changed files with 11 additions and 24 deletions

View File

@ -332,7 +332,6 @@ void DTextEnterMenu::Drawer ()
const int ch = InputGridChars[y * INPUTGRID_WIDTH + x];
FTexture *pic = SmallFont->GetChar(ch, &width);
EColorRange color;
FRemapTable *remap;
// The highlighted character is yellow; the rest are dark gray.
color = (x == InputGridX && y == InputGridY) ? CR_YELLOW : CR_DARKGRAY;
@ -344,13 +343,14 @@ void DTextEnterMenu::Drawer ()
}
else if (ch == ' ')
{
FRemapTable *remap = SmallFont->GetColorTranslation(color);
// Draw the space as a box outline. We also draw it 50% wider than it really is.
const int x1 = xx + cell_width/2 - width * CleanXfac * 3 / 4;
const int x2 = x1 + width * 3 * CleanXfac / 2;
const int y1 = yy + top_padding;
const int y2 = y1 + SmallFont->GetHeight() * CleanYfac;
const int palentry = remap->Remap[remap->NumEntries*2/3];
const uint32 palcolor = remap->Palette[remap->NumEntries*2/3];
const int palentry = remap->Remap[remap->NumEntries * 2 / 3];
const uint32 palcolor = remap->Palette[remap->NumEntries * 2 / 3];
screen->Clear(x1, y1, x2, y1+CleanYfac, palentry, palcolor); // top
screen->Clear(x1, y2, x2, y2+CleanYfac, palentry, palcolor); // bottom
screen->Clear(x1, y1+CleanYfac, x1+CleanXfac, y2, palentry, palcolor); // left

View File

@ -360,13 +360,14 @@ DListMenuItemPlayerDisplay::DListMenuItemPlayerDisplay(FListMenuDescriptor *menu
{
mOwner = menu;
FRemapTable *bdremap = translationtables[TRANSLATION_Players][MAXPLAYERS + 1];
for (int i = 0; i < 256; i++)
{
int r = c1.r + c2.r * i / 255;
int g = c1.g + c2.g * i / 255;
int b = c1.b + c2.b * i / 255;
mRemap.Remap[i] = ColorMatcher.Pick (r, g, b);
mRemap.Palette[i] = PalEntry(255, r, g, b);
bdremap->Remap[i] = ColorMatcher.Pick (r, g, b);
bdremap->Palette[i] = PalEntry(255, r, g, b);
}
mBackdrop = new FBackdropTexture;
mPlayerClass = NULL;
@ -574,10 +575,10 @@ void DListMenuItemPlayerDisplay::Drawer(bool selected)
int x = (mXpos - 160) * CleanXfac + (SCREENWIDTH>>1);
int y = (mYpos - 100) * CleanYfac + (SCREENHEIGHT>>1);
screen->DrawTexture (mBackdrop, x, y - 1,
screen->DrawTexture(mBackdrop, x, y - 1,
DTA_DestWidth, 72 * CleanXfac,
DTA_DestHeight, 80 * CleanYfac,
DTA_Translation, &mRemap,
DTA_TranslationIndex, TRANSLATION(TRANSLATION_Players, MAXPLAYERS + 1),
DTA_Masked, true,
TAG_DONE);

View File

@ -740,6 +740,8 @@ void R_InitTranslationTables ()
}
// The menu player also gets a separate translation table
PushIdentityTable(TRANSLATION_Players);
// This one is for the backdrop in the menu
PushIdentityTable(TRANSLATION_Players);
// The three standard translations from Doom or Heretic (seven for Strife),
// plus the generic ice translation.

View File

@ -472,11 +472,6 @@ static inline double ListGetDouble(va_list &tags)
return va_arg(tags, double);
}
static inline FRemapTable* ListGetTranslation(va_list &tags)
{
return va_arg(tags, FRemapTable*);
}
// These two options are only being used by the D3D version of the HUD weapon drawer, they serve no purpose anywhere else.
static inline FSpecialColormap * ListGetSpecialColormap(va_list &tags)
{
@ -512,12 +507,6 @@ static inline double ListGetDouble(VMVa_List &tags)
return 0;
}
static inline FRemapTable* ListGetTranslation(VMVa_List &tags)
{
ThrowAbortException(X_OTHER, "Invalid tag in draw function");
return nullptr;
}
static inline FSpecialColormap * ListGetSpecialColormap(VMVa_List &tags)
{
ThrowAbortException(X_OTHER, "Invalid tag in draw function");
@ -731,10 +720,6 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag,
fillcolorset = true;
break;
case DTA_Translation:
parms->remap = ListGetTranslation(tags);
break;
case DTA_TranslationIndex:
parms->remap = TranslationToTable(ListGetInt(tags));
break;

View File

@ -76,8 +76,7 @@ enum
DTA_DestHeight, // height of area to draw to
DTA_Alpha, // alpha value for translucency
DTA_FillColor, // color to stencil onto the destination (RGB is the color for truecolor drawers, A is the palette index for paletted drawers)
DTA_Translation, // translation table to recolor the source
DTA_TranslationIndex,
DTA_TranslationIndex, // translation table to recolor the source
DTA_AlphaChannel, // bool: the source is an alpha channel; used with DTA_FillColor
DTA_Clean, // bool: scale texture size and position by CleanXfac and CleanYfac
DTA_320x200, // bool: scale texture size and position to fit on a virtual 320x200 screen