[Quake2world-dev] r52 - quake2world/trunk/src
jdolan at jdolan.dyndns.org
jdolan at jdolan.dyndns.org
Mon Dec 29 15:46:43 UTC 2008
Author: jdolan
Date: 2008-12-29 15:46:43 +0000 (Mon, 29 Dec 2008)
New Revision: 52
Modified:
quake2world/trunk/src/r_main.c
quake2world/trunk/src/r_surface.c
quake2world/trunk/src/r_surface_pro.c
quake2world/trunk/src/renderer.h
Log:
Fix state leaks in pro renderer by wrapping calls to warp surface drawing routines.
Modified: quake2world/trunk/src/r_main.c
===================================================================
--- quake2world/trunk/src/r_main.c 2008-12-29 03:42:44 UTC (rev 51)
+++ quake2world/trunk/src/r_main.c 2008-12-29 15:46:43 UTC (rev 52)
@@ -273,8 +273,10 @@
r_state.rendermode = rendermode_pro;
R_DrawOpaqueSurfaces = R_DrawOpaqueSurfaces_pro;
+ R_DrawOpaqueWarpSurfaces = R_DrawOpaqueWarpSurfaces_pro;
R_DrawAlphaTestSurfaces = R_DrawAlphaTestSurfaces_pro;
R_DrawBlendSurfaces = R_DrawBlendSurfaces_pro;
+ R_DrawBlendWarpSurfaces = R_DrawBlendWarpSurfaces_pro;
R_DrawBackSurfaces = R_DrawBackSurfaces_pro;
}
}
Modified: quake2world/trunk/src/r_surface.c
===================================================================
--- quake2world/trunk/src/r_surface.c 2008-12-29 03:42:44 UTC (rev 51)
+++ quake2world/trunk/src/r_surface.c 2008-12-29 15:46:43 UTC (rev 52)
@@ -128,10 +128,10 @@
R_EnableColorArray(true);
+ R_SetArrayState(r_worldmodel);
+
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- R_SetArrayState(r_worldmodel);
-
for(i = 0; i < surfs->count; i++){
if(surfs->surfaces[i]->frame != r_locals.frame)
Modified: quake2world/trunk/src/r_surface_pro.c
===================================================================
--- quake2world/trunk/src/r_surface_pro.c 2008-12-29 03:42:44 UTC (rev 51)
+++ quake2world/trunk/src/r_surface_pro.c 2008-12-29 15:46:43 UTC (rev 52)
@@ -94,6 +94,20 @@
/*
+R_DrawOpaqueWarpSurfaces_pro
+*/
+void R_DrawOpaqueWarpSurfaces_pro(msurfaces_t *surfs){
+
+ if(!surfs->count)
+ return;
+
+ r_locals.model = NULL;
+
+ R_DrawOpaqueWarpSurfaces_default(surfs);
+}
+
+
+/*
R_DrawAlphaTestSurfaces_pro
*/
void R_DrawAlphaTestSurfaces_pro(msurfaces_t *surfs){
@@ -139,6 +153,20 @@
/*
+R_DrawBlendWarpSurfaces_pro
+*/
+void R_DrawBlendWarpSurfaces_pro(msurfaces_t *surfs){
+
+ if(!surfs->count)
+ return;
+
+ r_locals.model = NULL;
+
+ R_DrawBlendWarpSurfaces_default(surfs);
+}
+
+
+/*
R_DrawBackSurfaces_pro
*/
void R_DrawBackSurfaces_pro(msurfaces_t *surfs){
Modified: quake2world/trunk/src/renderer.h
===================================================================
--- quake2world/trunk/src/renderer.h 2008-12-29 03:42:44 UTC (rev 51)
+++ quake2world/trunk/src/renderer.h 2008-12-29 15:46:43 UTC (rev 52)
@@ -408,11 +408,11 @@
void R_DrawBackSurfaces_default(msurfaces_t *surfs);
// r_surface_pro.c
-void R_SetArrayState_pro(const model_t *mod);
-void R_ResetArrayState_pro(void);
void R_DrawOpaqueSurfaces_pro(msurfaces_t *surfs);
+void R_DrawOpaqueWarpSurfaces_pro(msurfaces_t *surfs);
void R_DrawAlphaTestSurfaces_pro(msurfaces_t *surfs);
void R_DrawBlendSurfaces_pro(msurfaces_t *surfs);
+void R_DrawBlendWarpSurfaces_pro(msurfaces_t *surfs);
void R_DrawBackSurfaces_pro(msurfaces_t *surfs);
// r_thread.c
More information about the Quake2World-dev
mailing list