- some cleanup of the texture code

* removed unneeded includes
* moved global brightmap to GPalette
* took Build tile init code out of the FTextureManager class, because this code is not compatible with how real Build games need to go about it, making the texture manager not shareable.
* removed dependency on higher level info from the Image class.
This commit is contained in:
Christoph Oelckers 2020-04-11 18:53:56 +02:00
commit 7d192decc7
29 changed files with 261 additions and 315 deletions

View file

@ -158,6 +158,18 @@ void InitPalette ()
GPalette.Init(NUM_TRANSLATION_TABLES);
GPalette.SetPalette (pal, 0);
int lump = fileSystem.CheckNumForName("COLORMAP");
if (lump == -1) lump = fileSystem.CheckNumForName("COLORMAP", ns_colormaps);
if (lump != -1)
{
FileData cmap = fileSystem.ReadFile(lump);
uint8_t palbuffer[768];
ReadPalette(fileSystem.GetNumForName("PLAYPAL"), palbuffer);
const unsigned char* cmapdata = (const unsigned char*)cmap.GetMem();
GPalette.GenerateGlobalBrightmapFromColormap(cmapdata, 32);
}
MakeGoodRemap ((uint32_t*)GPalette.BaseColors, GPalette.Remap);
ColorMatcher.SetPalette ((uint32_t *)GPalette.BaseColors);