From a98d533ae1645dc494745d5309a3adc514b232ec Mon Sep 17 00:00:00 2001 From: Yamagi Date: Sun, 10 Jan 2021 18:30:49 +0100 Subject: [PATCH] Add `cl_r1q2_lighstyle`, set to `0` for Vanilla Q2 dlight colors. Since the first release Yamagi Quake II used the more fanzy R1Q2 colors for some dynamic lights: * In R1Q2 the rocket has orange light, matching the color of the fire trail and the generic explosion. Vanilla Quake II had yellow light, the same as the blaster and several muzzle flashs. * In R1Q2 hyperblaster projectiles are emitting yellow light, like the normal blaster. That matches the projectile colors, the muzzle flash and the effect when hitting a wall. And it's more logical, since the hyperblaster is just a blaster on steroids. Vanilla Quake II had white / uncolored lights. Add an option to revert to Vanilla Quake II colors, leave the R1Q2 colors as default. Closes #640. --- doc/040_cvarlist.md | 5 +++++ src/client/cl_entities.c | 20 +++++++++++++++++--- src/client/cl_main.c | 2 ++ src/client/header/client.h | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/doc/040_cvarlist.md b/doc/040_cvarlist.md index a834f2ec..2b9a261b 100644 --- a/doc/040_cvarlist.md +++ b/doc/040_cvarlist.md @@ -81,6 +81,11 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable` loading. If set to `0` pause mode is never entered, this is the Vanilla Quake II behaviour. +* **cl_r1q2_lightstyle**: Since the first release Yamagi Quake II used + the R1Q2 colors for the dynamic lights of rockets and hyperblaster + projectiles. Set to `0` to get the Vanilla Quake II colors. Defaults + to `1`. + * **cl_showfps**: Shows the framecounter. Set to `2` for more and to `3` for even more informations. diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index 0a9cdee6..80d390b3 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -445,7 +445,15 @@ CL_AddPacketEntities(frame_t *frame) if (effects & EF_ROCKET) { CL_RocketTrail(cent->lerp_origin, ent.origin, cent); - V_AddLight(ent.origin, 200, 1, 0.25f, 0); + + if (cl_r1q2_lightstyle->value) + { + V_AddLight(ent.origin, 200, 1, 0.23f, 0); + } + else + { + V_AddLight(ent.origin, 200, 1, 1, 0); + } } /* Do not reorder EF_BLASTER and EF_HYPERBLASTER. @@ -470,10 +478,16 @@ CL_AddPacketEntities(frame_t *frame) { V_AddLight(ent.origin, 200, 0, 1, 0); } - else { - V_AddLight(ent.origin, 200, 1, 1, 0); + if (cl_r1q2_lightstyle->value) + { + V_AddLight(ent.origin, 200, 1, 1, 0); + } + else + { + V_AddLight(ent.origin, 200, 1, 1, 1); + } } } else if (effects & EF_GIB) diff --git a/src/client/cl_main.c b/src/client/cl_main.c index c02bd929..077deb9f 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -58,6 +58,7 @@ cvar_t *cl_paused; cvar_t *cl_loadpaused; cvar_t *cl_lightlevel; +cvar_t *cl_r1q2_lightstyle; /* userinfo */ cvar_t *name; @@ -524,6 +525,7 @@ CL_InitLocal(void) rcon_address = Cvar_Get("rcon_address", "", 0); cl_lightlevel = Cvar_Get("r_lightlevel", "0", 0); + cl_r1q2_lightstyle = Cvar_Get("cl_r1q2_lightstyle", "1", CVAR_ARCHIVE); /* userinfo */ name = Cvar_Get("name", "unnamed", CVAR_USERINFO | CVAR_ARCHIVE); diff --git a/src/client/header/client.h b/src/client/header/client.h index 3ebfaefd..666952ff 100644 --- a/src/client/header/client.h +++ b/src/client/header/client.h @@ -315,6 +315,7 @@ extern cvar_t *horplus; extern cvar_t *cin_force43; extern cvar_t *vid_fullscreen; extern cvar_t *cl_anglekicks; +extern cvar_t *cl_r1q2_lightstyle; typedef struct {