From 924cdf917d02b376b564277d01e25f6c6fa81741 Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Sun, 13 May 2001 23:15:34 +0000 Subject: [PATCH] Fix a new bug with dlights, more cleanups. --- nq/source/cl_main.c | 27 +++++++++++++++++++++++---- nq/source/gl_rmain.c | 2 ++ nq/source/r_view.c | 3 --- qw/source/cl_main.c | 6 +++--- qw/source/cl_parse.c | 1 - qw/source/gl_rmain.c | 10 ++++------ 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index f0b77385a..236593137 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -187,6 +187,22 @@ CL_ClearState (void) } +/* + CL_StopCshifts + + Cleans the Cshifts, so your screen doesn't stay red after a timedemo :) +*/ +void +CL_StopCshifts (void) +{ + int i; + for (i = 0; i < NUM_CSHIFTS; i++) + cl.cshifts[i].percent = 0; + for (i = 0; i < MAX_CL_STATS; i++) + cl.stats[i] = 0; +} + + /* CL_Disconnect @@ -196,13 +212,16 @@ CL_ClearState (void) void CL_Disconnect (void) { -// stop sounds (especially looping!) + // stop sounds (especially looping!) S_StopAllSounds (true); -// bring the console down and fade the colors back to normal -// SCR_BringDownConsole (); + // Clean the Cshifts + CL_StopCshifts (); -// if running a local server, shut it down + // bring the console down and fade the colors back to normal +// SCR_BringDownConsole (); + + // if running a local server, shut it down if (cls.demoplayback) CL_StopPlayback (); else if (cls.state == ca_connected) { diff --git a/nq/source/gl_rmain.c b/nq/source/gl_rmain.c index 5d910f3d9..f05b9234e 100644 --- a/nq/source/gl_rmain.c +++ b/nq/source/gl_rmain.c @@ -888,6 +888,8 @@ R_RenderView (void) R_SetupGL (); + R_PushDlights (vec3_origin); + R_MarkLeaves (); // done here so we know if we're in water R_DrawWorld (); // adds static entities to the list diff --git a/nq/source/r_view.c b/nq/source/r_view.c index f4c786bbe..f319536e5 100644 --- a/nq/source/r_view.c +++ b/nq/source/r_view.c @@ -690,9 +690,6 @@ V_RenderView (void) V_CalcRefdef (); } -// nq thinks dlights should be here - R_PushDlights (vec3_origin); - R_RenderView (); } diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 737e3e243..ec656b764 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -471,13 +471,13 @@ CL_Disconnect (void) VID_SetCaption ("Disconnected"); -// stop sounds (especially looping!) + // stop sounds (especially looping!) S_StopAllSounds (true); -// Clean the Cshifts + // Clean the Cshifts CL_StopCshifts (); -// if running a local server, shut it down + // if running a local server, shut it down if (cls.demoplayback) CL_StopPlayback (); else if (cls.state != ca_disconnected) { diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 83ac1a60d..a55af3808 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -67,7 +67,6 @@ #include "sbar.h" #include "view.h" -extern cvar_t *gl_dlight_polyblend; extern cvar_t *cl_autoexec; char *svc_strings[] = { diff --git a/qw/source/gl_rmain.c b/qw/source/gl_rmain.c index 2aee9948d..cbf17bc5a 100644 --- a/qw/source/gl_rmain.c +++ b/qw/source/gl_rmain.c @@ -1073,7 +1073,7 @@ R_RenderView (void) R_Clear (); // render normal view - R_SetupFrame (); // Setup stuff for frame. + R_SetupFrame (); R_SetFrustum (); @@ -1081,13 +1081,11 @@ R_RenderView (void) R_PushDlights (vec3_origin); - R_MarkLeaves (); // done here so we know if we're in - // water + R_MarkLeaves (); // done here so we know if we're in water - R_DrawWorld (); // adds static entities to the list + R_DrawWorld (); // adds static entities to the list - S_ExtraUpdate (); // don't let sound get messed up if - // going slow + S_ExtraUpdate (); // don't let sound get messed up if going slow R_DrawEntitiesOnList ();