+//[515]: csqc
+void CSQC_R_ClearScreen (void)
+{
+ if (!r_refdef.entities/* || !r_refdef.worldmodel*/)
+ return; //Host_Error ("R_RenderView: NULL worldmodel");
+
+ r_view_width = bound(0, r_refdef.width, vid.width);
+ r_view_height = bound(0, r_refdef.height, vid.height);
+ r_view_depth = 1;
+ r_view_x = bound(0, r_refdef.x, vid.width - r_refdef.width);
+ r_view_y = bound(0, r_refdef.y, vid.height - r_refdef.height);
+ r_view_z = 0;
+ r_view_matrix = r_refdef.viewentitymatrix;
+ GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
+ r_rtworld = r_shadow_realtime_world.integer;
+ r_rtworldshadows = r_shadow_realtime_world_shadows.integer && gl_stencil;
+ r_rtdlight = (r_shadow_realtime_world.integer || r_shadow_realtime_dlight.integer) && !gl_flashblend.integer;
+ r_rtdlightshadows = r_rtdlight && (r_rtworld ? r_shadow_realtime_world_dlightshadows.integer : r_shadow_realtime_dlight_shadows.integer) && gl_stencil;
+ r_lightmapintensity = r_rtworld ? r_shadow_realtime_world_lightmaps.value : 1;
+
+ // GL is weird because it's bottom to top, r_view_y is top to bottom
+ qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
+ GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
+ GL_ScissorTest(true);
+ GL_DepthMask(true);
+ R_ClearScreen();
+ R_Textures_Frame();
+ R_UpdateFog();
+ R_TimeReport("setup");
+}
+
+//[515]: csqc
+void CSQC_R_RenderScene (void)
+{
+ qglDepthFunc(GL_LEQUAL);
+ qglPolygonOffset(0, 0);
+ qglEnable(GL_POLYGON_OFFSET_FILL);
+
+ R_RenderScene();
+
+ qglPolygonOffset(0, 0);
+ qglDisable(GL_POLYGON_OFFSET_FILL);
+
+ R_BlendView();
+ R_TimeReport("blendview");
+
+ GL_Scissor(0, 0, vid.width, vid.height);
+ GL_ScissorTest(false);
+}
+