Allow setting the colormap from mapinfo (dsda-doom)

This commit is contained in:
Ricardo Luís Vaz Silva 2023-10-28 00:01:06 -03:00 committed by Christoph Oelckers
parent 478a832515
commit e12f2ce0fe
4 changed files with 20 additions and 1 deletions

View file

@ -1821,6 +1821,12 @@ void FLevelLocals::Init()
flags |= LEVEL_HASFADETABLE;
}
}
if (strnicmp (info->CustomColorMap.GetChars(), "COLORMAP", 8) != 0)
{
flags3 |= LEVEL3_HAS_CUSTOM_COLORMAP;
}
airsupply = info->airsupply*TICRATE;
outsidefog = info->outsidefog;
WallVertLight = info->WallVertLight*2;

View file

@ -254,6 +254,7 @@ void level_info_t::Reset()
LevelName = "";
AuthorName = "";
FadeTable = "COLORMAP";
CustomColorMap = "COLORMAP";
WallHorizLight = -8;
WallVertLight = +8;
F1Pic = "";
@ -1154,6 +1155,12 @@ DEFINE_MAP_OPTION(fadetable, true)
parse.ParseLumpOrTextureName(info->FadeTable);
}
DEFINE_MAP_OPTION(colormap, true)
{
parse.ParseAssign();
parse.ParseLumpOrTextureName(info->CustomColorMap);
}
DEFINE_MAP_OPTION(evenlighting, true)
{
info->WallVertLight = info->WallHorizLight = 0;

View file

@ -270,6 +270,7 @@ enum ELevelFlags : unsigned int
LEVEL3_AVOIDMELEE = 0x00020000, // global flag needed for proper MBF support.
LEVEL3_NOJUMPDOWN = 0x00040000, // only for MBF21. Inverse of MBF's dog_jumping flag.
LEVEL3_LIGHTCREATED = 0x00080000, // a light had been created in the last frame
LEVEL3_HAS_CUSTOM_COLORMAP = 0x00100000, // custom colormap property from dsda-doom
};
@ -330,6 +331,7 @@ struct level_info_t
FString SkyPic1;
FString SkyPic2;
FString FadeTable;
FString CustomColorMap;
FString F1Pic;
FString BorderTexture;
FString MapBackground;

View file

@ -271,7 +271,11 @@ void FSoftwareRenderer::SetColormap(FLevelLocals *Level)
NormalLight.Maps = realcolormaps.Maps;
NormalLight.ChangeColor(PalEntry(255, 255, 255), 0);
NormalLight.ChangeFade(Level->fadeto);
if (Level->fadeto == 0)
if(Level->info->flags3 & LEVEL3_HAS_CUSTOM_COLORMAP)
{
SetDefaultColormap(Level->info->CustomColorMap.GetChars());
}
else if (Level->fadeto == 0)
{
SetDefaultColormap(Level->info->FadeTable.GetChars());
}