void R_ShadowPassDrawSolidEntities( const plight_t *pl ) { glState.drawTrans = false; // draw solid entities only. for( int i = 0; i < tr.num_solid_entities; i++ ) { RI.currententity = tr.solid_entities[i]; RI.currentmodel = RI.currententity->model; // tell engine about current entity SET_CURRENT_ENTITY( RI.currententity ); assert( RI.currententity != NULL ); assert( RI.currententity->model != NULL ); switch( RI.currentmodel->type ) { case mod_brush: R_ShadowPassDrawBrushModel( RI.currententity, pl ); break; case mod_studio: R_DrawStudioModel( RI.currententity ); break; case mod_sprite: // R_DrawSpriteModel( RI.currententity ); break; default: break; } } // may be solid cables CL_DrawBeams( false ); // NOTE: some mods with custom renderer may generate glErrors // so we clear it here while( pglGetError() != GL_NO_ERROR ); }
/* ============= R_DrawEntitiesOnList ============= */ void R_DrawEntitiesOnList( void ) { int i; glState.drawTrans = false; // draw the solid submodels fog R_DrawFog (); // first draw solid entities for( i = 0; i < tr.num_solid_entities; i++ ) { if( RI.refdef.onlyClientDraw ) break; RI.currententity = tr.solid_entities[i]; RI.currentmodel = RI.currententity->model; ASSERT( RI.currententity != NULL ); ASSERT( RI.currententity->model != NULL ); switch( RI.currentmodel->type ) { case mod_brush: R_DrawBrushModel( RI.currententity ); break; case mod_studio: R_DrawStudioModel( RI.currententity ); break; case mod_sprite: R_DrawSpriteModel( RI.currententity ); break; default: break; } } if( !RI.refdef.onlyClientDraw ) { CL_DrawBeams( false ); } if( RI.drawWorld ) clgame.dllFuncs.pfnDrawNormalTriangles(); // NOTE: some mods with custom renderer may generate glErrors // so we clear it here while( pglGetError() != GL_NO_ERROR ); // don't fogging translucent surfaces if( !RI.fogCustom ) pglDisable( GL_FOG ); pglDepthMask( GL_FALSE ); glState.drawTrans = true; // then draw translucent entities for( i = 0; i < tr.num_trans_entities; i++ ) { if( RI.refdef.onlyClientDraw ) break; RI.currententity = tr.trans_entities[i]; RI.currentmodel = RI.currententity->model; ASSERT( RI.currententity != NULL ); ASSERT( RI.currententity->model != NULL ); switch( RI.currentmodel->type ) { case mod_brush: R_DrawBrushModel( RI.currententity ); break; case mod_studio: R_DrawStudioModel( RI.currententity ); break; case mod_sprite: R_DrawSpriteModel( RI.currententity ); break; default: break; } } if( RI.drawWorld ) clgame.dllFuncs.pfnDrawTransparentTriangles (); if( !RI.refdef.onlyClientDraw ) { CL_DrawBeams( true ); CL_DrawParticles(); } // NOTE: some mods with custom renderer may generate glErrors // so we clear it here while( pglGetError() != GL_NO_ERROR ); glState.drawTrans = false; pglDepthMask( GL_TRUE ); pglDisable( GL_BLEND ); // Trinity Render issues R_DrawViewModel(); CL_ExtraUpdate(); }