From 53d8a1b6e5aa9dc5959baf97951c1062c165ca59 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 26 Sep 2004 13:23:06 +0000 Subject: [PATCH] minor cleanup - merged R_UpdateWorld into other places git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4545 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 9 +++++++++ gl_rmain.c | 32 ++++---------------------------- host.c | 1 - 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index 59074cc4..7dd9fefb 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -1363,6 +1363,15 @@ void SCR_UpdateScreen (void) if (gl_combine.integer && (!gl_combine_extension || r_textureunits.integer < 2)) Cvar_SetValueQuick(&gl_combine, 0); + // don't allow cheats in multiplayer + if (!cl.islocalgame && cl.worldmodel) + { + if (r_fullbright.integer != 0) + Cvar_Set ("r_fullbright", "0"); + if (r_ambient.value != 0) + Cvar_Set ("r_ambient", "0"); + } + // bound viewsize if (scr_viewsize.value < 30) Cvar_Set ("viewsize","30"); diff --git a/gl_rmain.c b/gl_rmain.c index 6816a436..2f9d3f31 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -566,33 +566,6 @@ static void R_BlendView(void) R_Mesh_Draw(3, 1, polygonelements); } -void R_UpdateWorld(void) -{ - if (!r_refdef.entities/* || !cl.worldmodel*/) - return; //Host_Error ("R_RenderView: NULL worldmodel"); - - /* - if (r_shadow_realtime_world.integer && !gl_stencil) - { - Con_Print("Realtime world lighting requires 32bit color; turning off r_shadow_realtime_world, please type vid_bitsperpixel 32;vid_restart and try again\n"); - Cvar_SetValueQuick(&r_shadow_realtime_world, 0); - } - */ - - // don't allow cheats in multiplayer - if (!cl.islocalgame && cl.worldmodel) - { - if (r_fullbright.integer != 0) - Cvar_Set ("r_fullbright", "0"); - if (r_ambient.value != 0) - Cvar_Set ("r_ambient", "0"); - } - - R_Textures_Frame(); - R_UpdateFog(); - R_UpdateLights(); -} - void R_RenderScene(void); /* @@ -604,7 +577,7 @@ void R_RenderView(void) { if (!r_refdef.entities/* || !cl.worldmodel*/) return; //Host_Error ("R_RenderView: NULL worldmodel"); - + r_view_width = bound(0, r_refdef.width, vid.realwidth); r_view_height = bound(0, r_refdef.height, vid.realheight); r_view_depth = 1; @@ -627,6 +600,9 @@ void R_RenderView(void) GL_ScissorTest(true); GL_DepthMask(true); R_ClearScreen(); + R_Textures_Frame(); + R_UpdateFog(); + R_UpdateLights(); R_TimeReport("setup"); qglDepthFunc(GL_LEQUAL); diff --git a/host.c b/host.c index 5cd787a9..27df77f3 100644 --- a/host.c +++ b/host.c @@ -756,7 +756,6 @@ void _Host_Frame (float time) if (host_speeds.integer) time1 = Sys_DoubleTime(); - R_UpdateWorld(); CL_UpdateScreen(); if (host_speeds.integer) -- 2.39.2