- added custom automap overlay colors.

- extended am_drawmapback so that map backgrounds can only be drawn if used with custom colorsets and Raven's, assuming that these sets were specifically made for the accompanying backgrounds.
This commit is contained in:
Christoph Oelckers 2013-08-09 11:00:24 +02:00
parent 5b228ae5a7
commit 9f35788164
4 changed files with 43 additions and 16 deletions

View File

@ -85,7 +85,7 @@ CVAR (Bool, am_showtotaltime, false, CVAR_ARCHIVE);
CVAR (Int, am_colorset, 0, CVAR_ARCHIVE);
CVAR (Bool, am_customcolors, true, CVAR_ARCHIVE);
CVAR (Int, am_map_secrets, 1, CVAR_ARCHIVE);
CVAR (Bool, am_drawmapback, true, CVAR_ARCHIVE);
CVAR (Int, am_drawmapback, 1, CVAR_ARCHIVE);
CVAR (Bool, am_showkeys, true, CVAR_ARCHIVE);
CVAR (Bool, am_showtriggerlines, false, CVAR_ARCHIVE);
CVAR (Int, am_showthingsprites, 0, CVAR_ARCHIVE);
@ -435,6 +435,7 @@ static unsigned char RavenColors[]= {
static AMColorset AMColors;
static AMColorset AMMod;
static AMColorset AMModOverlay;
//=============================================================================
@ -443,12 +444,14 @@ static AMColorset AMMod;
//
//=============================================================================
void FMapInfoParser::ParseAMColors()
void FMapInfoParser::ParseAMColors(bool overlay)
{
bool colorset = false;
AMMod.setWhite();
AMMod.defined = true;
AMColorset &cset = overlay? AMModOverlay : AMMod;
cset.setWhite();
cset.defined = true;
sc.MustGetToken('{');
while(sc.GetToken())
{
@ -464,15 +467,15 @@ void FMapInfoParser::ParseAMColors()
sc.MustGetToken(TK_StringConst);
if (sc.Compare("doom"))
{
AMMod.initFromColors(DoomColors, false);
cset.initFromColors(DoomColors, false);
}
else if (sc.Compare("raven"))
{
AMMod.initFromColors(RavenColors, true);
cset.initFromColors(RavenColors, true);
}
else if (sc.Compare("strife"))
{
AMMod.initFromColors(StrifeColors, false);
cset.initFromColors(StrifeColors, false);
}
else
{
@ -482,11 +485,11 @@ void FMapInfoParser::ParseAMColors()
else if (nextKey.CompareNoCase("showlocks") == 0)
{
if(sc.CheckToken(TK_False))
AMMod.displayLocks = false;
cset.displayLocks = false;
else
{
sc.MustGetToken(TK_True);
AMMod.displayLocks = true;
cset.displayLocks = true;
}
}
else
@ -501,7 +504,7 @@ void FMapInfoParser::ParseAMColors()
FString colorName = V_GetColorStringByName(color);
if(!colorName.IsEmpty()) color = colorName;
int colorval = V_GetColorFromString(NULL, color);
AMMod.c[i].FromRGB(RPART(colorval), GPART(colorval), BPART(colorval));
cset.c[i].FromRGB(RPART(colorval), GPART(colorval), BPART(colorval));
colorset = true;
break;
}
@ -1244,7 +1247,14 @@ static void AM_initColors (bool overlayed)
{
if (overlayed)
{
AMColors.initFromCVars(cv_overlay);
if (am_customcolors && AMModOverlay.defined)
{
AMColors = AMModOverlay;
}
else
{
AMColors.initFromCVars(cv_overlay);
}
}
else if (am_customcolors && AMMod.defined)
{
@ -1598,7 +1608,17 @@ void AM_Ticker ()
void AM_clearFB (const AMColor &color)
{
if (!mapback.isValid() || !am_drawmapback)
bool drawback = mapback.isValid() && am_drawmapback != 0;
if (am_drawmapback == 2)
{
// only draw background when using a mod defined custom color set or Raven colors, if am_drawmapback is 2.
if (!am_customcolors || !AMMod.defined)
{
drawback &= (am_colorset == 3);
}
}
if (!drawback)
{
screen->Clear (0, 0, f_w, f_h, color.Index, color.RGB);
}

View File

@ -103,7 +103,7 @@ struct FMapInfoParser
void ParseIntermissionAction(FIntermissionDescriptor *Desc);
void ParseIntermission();
void ParseAMColors();
void ParseAMColors(bool);
FName CheckEndSequence();
FName ParseEndGame();
};

View File

@ -1842,12 +1842,12 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
sc.ScriptError("intermission definitions not supported with old MAPINFO syntax");
}
}
else if (sc.Compare("automap"))
else if (sc.Compare("automap") || sc.Compare("automap_overlay"))
{
if (format_type != FMT_Old)
{
format_type = FMT_New;
ParseAMColors();
ParseAMColors(sc.Compare("automap_overlay"));
}
else
{

View File

@ -928,6 +928,13 @@ OptionValue STSTypes
3, "Rotated"
}
OptionValue MapBackTypes
{
0, "Off"
1, "On"
2, "Map defined colors only"
}
OptionMenu AutomapOptions
{
Title "AUTOMAP OPTIONS"
@ -948,7 +955,7 @@ OptionMenu AutomapOptions
Option "Show total time elapsed", "am_showtotaltime", "OnOff"
Option "Show secrets on map", "am_map_secrets", "SecretTypes"
Option "Show map label", "am_showmaplabel", "MaplabelTypes"
Option "Draw map background", "am_drawmapback", "OnOff"
Option "Draw map background", "am_drawmapback", "MapBackTypes"
Option "Show keys (cheat)", "am_showkeys", "OnOff"
Option "Show trigger lines", "am_showtriggerlines", "OnOff"
Option "Show things as sprites", "am_showthingsprites", "STSTypes"