- Added r_clearbuffer cvar. Valid values are:

* 0. Do not clear. This is the standard behavior.
  * 1. Clear to black.
  * 2. Clear to white.
  * 3. Alternate between black and white every 128 ms.
  * 4. Step through the palette one color at a time every 32 ms.
  * 5. Epileptic seizure inducing random colors every frame.

SVN r2491 (trunk)
This commit is contained in:
Randy Heit 2010-08-07 03:57:22 +00:00
parent b59162a33a
commit cb6e9b90fb

View file

@ -100,6 +100,7 @@ static float CurrentVisibility = 8.f;
static fixed_t MaxVisForWall; static fixed_t MaxVisForWall;
static fixed_t MaxVisForFloor; static fixed_t MaxVisForFloor;
static FRandom pr_torchflicker ("TorchFlicker"); static FRandom pr_torchflicker ("TorchFlicker");
static FRandom pr_hom ("HOM-Flasher");
static TArray<InterpolationViewer> PastViewers; static TArray<InterpolationViewer> PastViewers;
static int centerxwide; static int centerxwide;
static bool polyclipped; static bool polyclipped;
@ -111,6 +112,7 @@ bool r_dontmaplines;
CVAR (String, r_viewsize, "", CVAR_NOSET) CVAR (String, r_viewsize, "", CVAR_NOSET)
CVAR (Int, r_polymost, 0, 0) CVAR (Int, r_polymost, 0, 0)
CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE) CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
CVAR (Int, r_clearbuffer, 0, 0)
fixed_t r_BaseVisibility; fixed_t r_BaseVisibility;
fixed_t r_WallVisibility; fixed_t r_WallVisibility;
@ -1270,6 +1272,34 @@ void R_SetupFrame (AActor *actor)
{ {
polyclipped = RP_SetupFrame (false); polyclipped = RP_SetupFrame (false);
} }
if (RenderTarget == screen && r_clearbuffer != 0)
{
int color;
int hom = r_clearbuffer;
if (hom == 3)
{
hom = ((I_FPSTime() / 128) & 1) + 1;
}
if (hom == 1)
{
color = GPalette.BlackIndex;
}
else if (hom == 2)
{
color = GPalette.WhiteIndex;
}
else if (hom == 4)
{
color = (I_FPSTime() / 32) & 255;
}
else
{
color = pr_hom();
}
memset(RenderTarget->GetBuffer(), color, RenderTarget->GetPitch() * RenderTarget->GetHeight());
}
} }
//========================================================================== //==========================================================================