- palette related fixes.

This commit is contained in:
Christoph Oelckers 2020-04-11 19:18:47 +02:00
parent 940f1dc9a2
commit 1a0ace4f88
8 changed files with 11 additions and 8 deletions

View file

@ -203,7 +203,7 @@ FRemapTable* PaletteContainer::AddRemap(FRemapTable* remap)
for (auto uremap : uniqueRemaps)
{
if (uremap->crc32 == remap->crc32 && uremap->NumEntries == remap->NumEntries && *uremap == *remap)
if (uremap->crc32 == remap->crc32 && uremap->NumEntries == remap->NumEntries && *uremap == *remap && remap->Inactive == uremap->Inactive)
return uremap;
}
auto newremap = (FRemapTable*)remapArena.Alloc(sizeof(FRemapTable));
@ -250,7 +250,7 @@ int PaletteContainer::AddTranslation(int slot, FRemapTable* remap, int count)
void PaletteContainer::CopyTranslation(int dest, int src)
{
TranslationTables[GetTranslationType(dest)][GetTranslationType(src)] = TranslationToTable(src);
TranslationTables[GetTranslationType(dest)].SetVal(GetTranslationIndex(dest), TranslationToTable(src));
}
//----------------------------------------------------------------------------

View file

@ -34,6 +34,7 @@ struct FRemapTable
int Index;
int NumEntries; // # of elements in this table (usually 256)
bool Inactive = false; // This table is inactive and should be treated as if it was passed as NULL
bool ForFont = false; // Mark font translations because they may require different handling than the ones for sprites-
private:
};

View file

@ -637,6 +637,7 @@ void FFont::SetDefaultTranslation(uint32_t *othercolors)
FRemapTable remap(ActiveColors);
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (unsigned l = 1; l < myluminosity.Size(); l++)
{
@ -773,6 +774,7 @@ void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity
const TranslationParm *parmstart = (const TranslationParm *)ranges;
FRemapTable remap(total_colors);
remap.ForFont = true;
// Create different translations for different color ranges
Translations.Clear();
@ -808,6 +810,7 @@ void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (j = 1; j < ActiveColors; j++)
{

View file

@ -391,6 +391,7 @@ public:
FRemapTable remap(ActiveColors);
remap.Remap[0] = 0;
remap.Palette[0] = 0;
remap.ForFont = true;
for (unsigned l = 1; l < 18; l++)
{

View file

@ -79,13 +79,13 @@
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static int TranslationMapCompare (const void *a, const void *b);
void UpdateGenericUI(bool cvar);
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern int PrintColors[];
// PUBLIC DATA DEFINITIONS -------------------------------------------------
FFont* SmallFont, * SmallFont2, * BigFont, * BigUpper, * ConFont, * IntermissionFont, * NewConsoleFont, * NewSmallFont, * CurrentConsoleFont, * OriginalSmallFont, * AlternativeSmallFont, * OriginalBigFont;
FFont *FFont::FirstFont = nullptr;
int NumTextColors;
@ -826,7 +826,6 @@ void V_InitFonts()
BigFont = OriginalBigFont;
}
AlternativeSmallFont = OriginalSmallFont;
UpdateGenericUI(false);
}
void V_ClearFonts()

View file

@ -423,7 +423,7 @@ protected:
public:
FTextureBuffer CreateTexBuffer(int translation, int flags = 0);
bool GetTranslucency();
virtual bool GetTranslucency();
FMaterial* GetMaterial(int num)
{
return Material[num];

View file

@ -117,6 +117,7 @@ EXTERN_CVAR(Bool, cl_customizeinvulmap)
void DrawHUD();
void D_DoAnonStats();
void I_DetectOS();
void UpdateGenericUI(bool cvar);
// MACROS ------------------------------------------------------------------
@ -3070,6 +3071,7 @@ static int D_DoomMain_Internal (void)
StartScreen->Progress();
V_InitFonts();
UpdateGenericUI(false);
// [CW] Parse any TEAMINFO lumps.
if (!batchrun) Printf ("ParseTeamInfo: Load team definitions.\n");

View file

@ -167,9 +167,6 @@ public:
int DisplayWidth, DisplayHeight;
FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *NewSmallFont, *CurrentConsoleFont, *OriginalSmallFont, *AlternativeSmallFont, *OriginalBigFont;
// [RH] The framebuffer is no longer a mere byte array.
// There's also only one, not four.
DFrameBuffer *screen;