From cbed4624faeb4b192f908b1a2a66b7f3744fb32a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 29 Nov 2013 13:24:38 +0100 Subject: [PATCH] - added a user-settable factor for earthquake intensity. Value can be between 0 (no shaking) and 1 (normal shaking.) --- src/r_utility.cpp | 13 +++++++++---- wadsrc/static/menudef.txt | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 606cca840..356bfe741 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -89,6 +89,11 @@ CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE) CVAR (Int, r_clearbuffer, 0, 0) CVAR (Bool, r_drawvoxels, true, 0) CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites? +CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +{ + if (self < 0.f) self = 0.f; + else if (self > 1.f) self = 1.f; +} DCanvas *RenderTarget; // [RH] canvas to render to @@ -837,10 +842,10 @@ void R_SetupFrame (AActor *actor) int intensity = DEarthquake::StaticGetQuakeIntensity (camera); if (intensity != 0) { - viewx += ((pr_torchflicker() % (intensity<<2)) - -(intensity<<1))<