Get global fog working in mtex mode.

This commit is contained in:
Bill Currie 2010-12-10 21:40:36 +09:00
parent d470094a55
commit 8919aec663
4 changed files with 19 additions and 7 deletions

View File

@ -769,8 +769,10 @@ R_DrawAliasModel (entity_t *e)
qfglColor4fv (e->colormod);
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
Fog_StartAdditive ();
GL_DrawAliasFrameTri (vo);
Fog_StopAdditive ();
if (gl_vector_light->int_val) {
qfglEnable (GL_LIGHTING);
@ -790,7 +792,9 @@ R_DrawAliasModel (entity_t *e)
qfglColor4fv (e->colormod);
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
Fog_StartAdditive ();
GL_DrawAliasFrame (vo);
Fog_StopAdditive ();
if (gl_vector_light->int_val) {
qfglEnable (GL_LIGHTING);

View File

@ -407,6 +407,8 @@ R_SetupFrame (void)
r_framecount++;
Fog_SetupFrame ();
// build the transformation matrix for the given view angles
VectorCopy (r_refdef.vieworg, r_origin);
@ -524,6 +526,7 @@ R_RenderScene (void)
R_SetupFrame ();
R_SetupGL ();
Fog_EnableGFog ();
R_MarkLeaves (); // done here so we know if we're in water
R_PushDlights (vec3_origin);
R_DrawWorld (); // adds static entities to the list
@ -531,6 +534,13 @@ R_RenderScene (void)
R_DrawEntitiesOnList ();
R_RenderDlights ();
R_DrawWaterSurfaces ();
R_DrawParticles ();
Fog_DisableGFog ();
R_DrawViewModel ();
if (R_TestErrors (0))
R_DisplayErrors ();
R_ClearErrors ();
@ -628,9 +638,6 @@ R_RenderView_ (void)
// render normal view
R_RenderScene ();
R_DrawViewModel ();
R_DrawWaterSurfaces ();
R_DrawParticles ();
// render mirror view
R_Mirror ();

View File

@ -153,6 +153,7 @@ R_Init (void)
r_init = 1;
R_InitParticles ();
R_InitSprites ();
Fog_Init ();
}
VISIBLE void

View File

@ -638,10 +638,11 @@ test_node (mnode_t *node)
static void
R_RecursiveWorldNode (mnode_t *node)
{
#define NODE_STACK 1024
struct {
mnode_t *node;
int side;
} *node_ptr, node_stack[1024];
} *node_ptr, node_stack[NODE_STACK];
mnode_t *front;
int side;
@ -652,8 +653,7 @@ R_RecursiveWorldNode (mnode_t *node)
side = get_side (node);
front = node->children[side];
if (test_node (front)) {
if (node_ptr - node_stack
== sizeof (node_stack) / sizeof (node_stack[0]))
if (node_ptr - node_stack == NODE_STACK)
Sys_Error ("node_stack overflow");
node_ptr->node = node;
node_ptr->side = side;