- added a user-settable factor for earthquake intensity. Value can be between 0 (no shaking) and 1 (normal shaking.)

This commit is contained in:
Christoph Oelckers 2013-11-29 13:24:38 +01:00
parent b9c032461e
commit cbed4624fa
2 changed files with 10 additions and 4 deletions

View file

@ -89,6 +89,11 @@ CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
CVAR (Int, r_clearbuffer, 0, 0) CVAR (Int, r_clearbuffer, 0, 0)
CVAR (Bool, r_drawvoxels, true, 0) CVAR (Bool, r_drawvoxels, true, 0)
CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites? 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 DCanvas *RenderTarget; // [RH] canvas to render to
@ -837,10 +842,10 @@ void R_SetupFrame (AActor *actor)
int intensity = DEarthquake::StaticGetQuakeIntensity (camera); int intensity = DEarthquake::StaticGetQuakeIntensity (camera);
if (intensity != 0) if (intensity != 0)
{ {
viewx += ((pr_torchflicker() % (intensity<<2)) fixed_t quakefactor = FLOAT2FIXED(r_quakeintensity);
-(intensity<<1))<<FRACBITS;
viewy += ((pr_torchflicker() % (intensity<<2)) viewx += quakefactor * ((pr_torchflicker() % (intensity<<2)) - (intensity<<1));
-(intensity<<1))<<FRACBITS; viewy += quakefactor * ((pr_torchflicker() % (intensity<<2)) - (intensity<<1));
} }
} }

View file

@ -686,6 +686,7 @@ OptionMenu "VideoOptions"
Option "Show player sprites", "r_drawplayersprites", "OnOff" Option "Show player sprites", "r_drawplayersprites", "OnOff"
Option "Death camera", "r_deathcamera", "OnOff" Option "Death camera", "r_deathcamera", "OnOff"
Option "Teleporter zoom", "telezoom", "OnOff" Option "Teleporter zoom", "telezoom", "OnOff"
Slider "Earthquake shake intensity", "r_quakeintensity", 0.0, 1.0, 0.05, 2
Option "Interpolate monster movement", "nomonsterinterpolation", "NoYes" Option "Interpolate monster movement", "nomonsterinterpolation", "NoYes"
} }