mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 14:01:26 +00:00
Allow mixing lit and unlit textures in the same map
This commit is contained in:
parent
58bf9dff65
commit
616e77dc61
1 changed files with 18 additions and 0 deletions
|
@ -573,10 +573,15 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
|
||||||
qboolean bound;
|
qboolean bound;
|
||||||
float entalpha;
|
float entalpha;
|
||||||
int lastlightmap;
|
int lastlightmap;
|
||||||
|
qboolean has_lit_water;
|
||||||
|
qboolean has_unlit_water;
|
||||||
|
|
||||||
if (r_drawflat_cheatsafe || r_lightmap_cheatsafe) // ericw -- !r_drawworld_cheatsafe check moved to R_DrawWorld_Water ()
|
if (r_drawflat_cheatsafe || r_lightmap_cheatsafe) // ericw -- !r_drawworld_cheatsafe check moved to R_DrawWorld_Water ()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
has_lit_water = false;
|
||||||
|
has_unlit_water = false;
|
||||||
|
|
||||||
if (r_oldwater.value)
|
if (r_oldwater.value)
|
||||||
{
|
{
|
||||||
for (i=0 ; i<model->numtextures ; i++)
|
for (i=0 ; i<model->numtextures ; i++)
|
||||||
|
@ -606,6 +611,8 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
|
||||||
}
|
}
|
||||||
else if (cl.worldmodel->haslitwater && r_litwater.value && r_world_program != 0)
|
else if (cl.worldmodel->haslitwater && r_litwater.value && r_world_program != 0)
|
||||||
{
|
{
|
||||||
|
has_lit_water = true;
|
||||||
|
|
||||||
GL_UseProgramFunc (r_world_program);
|
GL_UseProgramFunc (r_world_program);
|
||||||
|
|
||||||
// Bind the buffers
|
// Bind the buffers
|
||||||
|
@ -635,6 +642,12 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
|
||||||
if (!t || !t->texturechains[chain] || !(t->texturechains[chain]->flags & SURF_DRAWTURB))
|
if (!t || !t->texturechains[chain] || !(t->texturechains[chain]->flags & SURF_DRAWTURB))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (t->texturechains[chain]->texinfo->flags & TEX_SPECIAL)
|
||||||
|
{
|
||||||
|
has_unlit_water = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
bound = false;
|
bound = false;
|
||||||
entalpha = 1.0f;
|
entalpha = 1.0f;
|
||||||
lastlightmap = 0;
|
lastlightmap = 0;
|
||||||
|
@ -686,6 +699,9 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
|
||||||
GL_SelectTexture (GL_TEXTURE0);
|
GL_SelectTexture (GL_TEXTURE0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
has_unlit_water = true;
|
||||||
|
|
||||||
|
if (has_unlit_water)
|
||||||
{
|
{
|
||||||
// Unlit water
|
// Unlit water
|
||||||
for (i=0 ; i<model->numtextures ; i++)
|
for (i=0 ; i<model->numtextures ; i++)
|
||||||
|
@ -693,6 +709,8 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
|
||||||
t = model->textures[i];
|
t = model->textures[i];
|
||||||
if (!t || !t->texturechains[chain] || !(t->texturechains[chain]->flags & SURF_DRAWTURB))
|
if (!t || !t->texturechains[chain] || !(t->texturechains[chain]->flags & SURF_DRAWTURB))
|
||||||
continue;
|
continue;
|
||||||
|
if (has_lit_water && !(t->texturechains[chain]->texinfo->flags & TEX_SPECIAL))
|
||||||
|
continue;
|
||||||
bound = false;
|
bound = false;
|
||||||
entalpha = 1.0f;
|
entalpha = 1.0f;
|
||||||
for (s = t->texturechains[chain]; s; s = s->texturechain)
|
for (s = t->texturechains[chain]; s; s = s->texturechain)
|
||||||
|
|
Loading…
Reference in a new issue