summaryrefslogtreecommitdiff
path: root/src/renderer/tr_scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/tr_scene.c')
-rw-r--r--src/renderer/tr_scene.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/renderer/tr_scene.c b/src/renderer/tr_scene.c
index 49c0e593..6ee77dc6 100644
--- a/src/renderer/tr_scene.c
+++ b/src/renderer/tr_scene.c
@@ -39,20 +39,12 @@ int r_numpolyverts;
/*
====================
-R_ToggleSmpFrame
+R_InitNextFrame
====================
*/
-void R_ToggleSmpFrame( void ) {
- if ( r_smp->integer ) {
- // use the other buffers next frame, because another CPU
- // may still be rendering into the current ones
- tr.smpFrame ^= 1;
- } else {
- tr.smpFrame = 0;
- }
-
- backEndData[tr.smpFrame]->commands.used = 0;
+void R_InitNextFrame( void ) {
+ backEndData->commands.used = 0;
r_firstSceneDrawSurf = 0;
@@ -144,11 +136,11 @@ void RE_AddPolyToScene( qhandle_t hShader, int numVerts, const polyVert_t *verts
return;
}
- poly = &backEndData[tr.smpFrame]->polys[r_numpolys];
+ poly = &backEndData->polys[r_numpolys];
poly->surfaceType = SF_POLY;
poly->hShader = hShader;
poly->numVerts = numVerts;
- poly->verts = &backEndData[tr.smpFrame]->polyVerts[r_numpolyverts];
+ poly->verts = &backEndData->polyVerts[r_numpolyverts];
Com_Memcpy( poly->verts, &verts[numVerts*j], numVerts * sizeof( *verts ) );
@@ -225,8 +217,8 @@ void RE_AddRefEntityToScene( const refEntity_t *ent ) {
ri.Error( ERR_DROP, "RE_AddRefEntityToScene: bad reType %i", ent->reType );
}
- backEndData[tr.smpFrame]->entities[r_numentities].e = *ent;
- backEndData[tr.smpFrame]->entities[r_numentities].lightingCalculated = qfalse;
+ backEndData->entities[r_numentities].e = *ent;
+ backEndData->entities[r_numentities].lightingCalculated = qfalse;
r_numentities++;
}
@@ -254,7 +246,7 @@ void RE_AddDynamicLightToScene( const vec3_t org, float intensity, float r, floa
if ( glConfig.hardwareType == GLHW_RIVA128 || glConfig.hardwareType == GLHW_PERMEDIA2 ) {
return;
}
- dl = &backEndData[tr.smpFrame]->dlights[r_numdlights++];
+ dl = &backEndData->dlights[r_numdlights++];
VectorCopy (org, dl->origin);
dl->radius = intensity;
dl->color[0] = r;
@@ -356,16 +348,16 @@ void RE_RenderScene( const refdef_t *fd ) {
tr.refdef.floatTime = tr.refdef.time * 0.001f;
tr.refdef.numDrawSurfs = r_firstSceneDrawSurf;
- tr.refdef.drawSurfs = backEndData[tr.smpFrame]->drawSurfs;
+ tr.refdef.drawSurfs = backEndData->drawSurfs;
tr.refdef.num_entities = r_numentities - r_firstSceneEntity;
- tr.refdef.entities = &backEndData[tr.smpFrame]->entities[r_firstSceneEntity];
+ tr.refdef.entities = &backEndData->entities[r_firstSceneEntity];
tr.refdef.num_dlights = r_numdlights - r_firstSceneDlight;
- tr.refdef.dlights = &backEndData[tr.smpFrame]->dlights[r_firstSceneDlight];
+ tr.refdef.dlights = &backEndData->dlights[r_firstSceneDlight];
tr.refdef.numPolys = r_numpolys - r_firstScenePoly;
- tr.refdef.polys = &backEndData[tr.smpFrame]->polys[r_firstScenePoly];
+ tr.refdef.polys = &backEndData->polys[r_firstScenePoly];
// turn off dynamic lighting globally by clearing all the
// dlights if it needs to be disabled or if vertex lighting is enabled