- made menu dimming a mapping option but kept the CVARS as user override.

SVN r1790 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-04 22:25:46 +00:00
commit 44974ff28f
11 changed files with 43 additions and 11 deletions

View file

@ -168,11 +168,11 @@ CUSTOM_CVAR (Int, vid_refreshrate, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
}
}
CUSTOM_CVAR (Float, dimamount, 0.2f, CVAR_ARCHIVE)
CUSTOM_CVAR (Float, dimamount, -1.f, CVAR_ARCHIVE)
{
if (self < 0.f)
if (self < 0.f && self != -1.f)
{
self = 0.f;
self = -1.f;
}
else if (self > 1.f)
{
@ -296,14 +296,24 @@ void DCanvas::FlatFill (int left, int top, int right, int bottom, FTexture *src,
void DCanvas::Dim (PalEntry color)
{
PalEntry dimmer;
float amount = dimamount;
float amount;
if (dimamount >= 0)
{
dimmer = PalEntry(dimcolor);
amount = dimamount;
}
else
{
dimmer = gameinfo.dimcolor;
amount = gameinfo.dimamount;
}
if (gameinfo.gametype == GAME_Hexen && gamestate == GS_DEMOSCREEN)
{ // On the Hexen title screen, the default dimming is not
// enough to make the menus readable.
amount = MIN<float> (1.f, amount*2.f);
}
dimmer = PalEntry(dimcolor);
// Add the cvar's dimming on top of the color passed to the function
if (color.a != 0)
{