From cb6e9b90fb99eb1bca219d9b7e70a0e5fecfac95 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 7 Aug 2010 03:57:22 +0000 Subject: [PATCH] - 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) --- src/r_main.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/r_main.cpp b/src/r_main.cpp index 93131b149..e3008862f 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -100,6 +100,7 @@ static float CurrentVisibility = 8.f; static fixed_t MaxVisForWall; static fixed_t MaxVisForFloor; static FRandom pr_torchflicker ("TorchFlicker"); +static FRandom pr_hom ("HOM-Flasher"); static TArray PastViewers; static int centerxwide; static bool polyclipped; @@ -111,6 +112,7 @@ bool r_dontmaplines; CVAR (String, r_viewsize, "", CVAR_NOSET) CVAR (Int, r_polymost, 0, 0) CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE) +CVAR (Int, r_clearbuffer, 0, 0) fixed_t r_BaseVisibility; fixed_t r_WallVisibility; @@ -1270,6 +1272,34 @@ void R_SetupFrame (AActor *actor) { 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()); + } } //==========================================================================