mirror of
https://github.com/nzp-team/quakespasm.git
synced 2025-02-21 10:50:54 +00:00
Merge pull request #9 from ScatterBox/main
Fix map crash if there is no skybox specified
This commit is contained in:
commit
461909e146
8 changed files with 69 additions and 83 deletions
|
@ -865,7 +865,7 @@ void Draw_ConsoleBackground (void)
|
||||||
|
|
||||||
//GL_SetCanvas (CANVAS_CONSOLE); //in case this is called from weird places
|
//GL_SetCanvas (CANVAS_CONSOLE); //in case this is called from weird places
|
||||||
|
|
||||||
Draw_FillByColor (0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 1);
|
Draw_FillByColor (0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1205,10 +1205,10 @@ gltexture_t *loadtextureimage (char* filename)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
data = Image_LoadImage (filename, &w, &h);
|
data = Image_LoadImage (filename, &w, &h);
|
||||||
if(data == NULL)
|
if(!data)
|
||||||
{
|
{
|
||||||
Sys_Error("loadtextureimage: Cannot load the image %s\n", filename);
|
Sys_Error("loadtextureimage: Cannot load the image %s\n", filename);
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.gltexture = TexMgr_LoadImage (NULL, filename, w, h, SRC_RGBA, data, filename, sizeof(int)*2, TEXPREF_ALPHA | TEXPREF_NEAREST | TEXPREF_NOPICMIP);
|
gl.gltexture = TexMgr_LoadImage (NULL, filename, w, h, SRC_RGBA, data, filename, sizeof(int)*2, TEXPREF_ALPHA | TEXPREF_NEAREST | TEXPREF_NOPICMIP);
|
||||||
|
|
|
@ -337,6 +337,8 @@ qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash)
|
||||||
buf = (unsigned*)COM_LoadStackFile ("models/missing_model.mdl", stackbuf, sizeof(stackbuf), NULL);
|
buf = (unsigned*)COM_LoadStackFile ("models/missing_model.mdl", stackbuf, sizeof(stackbuf), NULL);
|
||||||
if (buf){
|
if (buf){
|
||||||
Con_Printf ("Missing model %s substituted\n", mod->name);
|
Con_Printf ("Missing model %s substituted\n", mod->name);
|
||||||
|
}else if(!buf){
|
||||||
|
Con_Printf ("Missing model could not be substituted", mod->name);
|
||||||
}
|
}
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
@ -702,7 +704,7 @@ void Mod_LoadTextures (lump_t *l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strcpy(loading_name, mt->name);
|
strcpy(loading_name, mt->name);
|
||||||
//free (pixels);
|
//free (tx_pixels);
|
||||||
loading_cur_step++;
|
loading_cur_step++;
|
||||||
SCR_UpdateScreen();
|
SCR_UpdateScreen();
|
||||||
//johnfitz
|
//johnfitz
|
||||||
|
|
|
@ -225,14 +225,14 @@ void Sky_NewMap (void)
|
||||||
skybox_name[0] = 0;
|
skybox_name[0] = 0;
|
||||||
for (i=0; i<6; i++)
|
for (i=0; i<6; i++)
|
||||||
skybox_textures[i] = NULL;
|
skybox_textures[i] = NULL;
|
||||||
skyfog = r_skyfog.value;
|
//skyfog = r_skyfog.value;
|
||||||
|
|
||||||
//
|
//
|
||||||
// read worldspawn (this is so ugly, and shouldn't it be done on the server?)
|
// read worldspawn (this is so ugly, and shouldn't it be done on the server?)
|
||||||
//
|
//
|
||||||
data = cl.worldmodel->entities;
|
data = cl.worldmodel->entities;
|
||||||
if (!data)
|
if (!data)
|
||||||
return; //FIXME: how could this possibly ever happen? -- if there's no
|
Sys_Error("Could not init Sky_NewMap"); //FIXME: how could this possibly ever happen? -- if there's no
|
||||||
// worldspawn then the sever wouldn't send the loadmap message to the client
|
// worldspawn then the sever wouldn't send the loadmap message to the client
|
||||||
|
|
||||||
data = COM_Parse(data);
|
data = COM_Parse(data);
|
||||||
|
@ -261,8 +261,8 @@ void Sky_NewMap (void)
|
||||||
if (!strcmp("sky", key))
|
if (!strcmp("sky", key))
|
||||||
Sky_LoadSkyBox(value);
|
Sky_LoadSkyBox(value);
|
||||||
|
|
||||||
if (!strcmp("skyfog", key))
|
//if (!strcmp("skyfog", key))
|
||||||
skyfog = atof(value);
|
//skyfog = atof(value);
|
||||||
|
|
||||||
#if 1 //also accept non-standard keys
|
#if 1 //also accept non-standard keys
|
||||||
else if (!strcmp("skyname", key)) //half-life
|
else if (!strcmp("skyname", key)) //half-life
|
||||||
|
@ -808,7 +808,7 @@ void Sky_DrawFaceQuad (glpoly_t *p)
|
||||||
float *v;
|
float *v;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (gl_mtexable && r_skyalpha.value >= 1.0)
|
if (gl_mtexable) // && r_skyalpha.value >= 1.0
|
||||||
{
|
{
|
||||||
GL_Bind (solidskytexture);
|
GL_Bind (solidskytexture);
|
||||||
GL_EnableMultitexture();
|
GL_EnableMultitexture();
|
||||||
|
@ -836,7 +836,7 @@ void Sky_DrawFaceQuad (glpoly_t *p)
|
||||||
GL_Bind (solidskytexture);
|
GL_Bind (solidskytexture);
|
||||||
|
|
||||||
//if (r_skyalpha.value < 1.0)
|
//if (r_skyalpha.value < 1.0)
|
||||||
glColor3f (1, 1, 1);
|
//glColor3f (1, 1, 1);
|
||||||
|
|
||||||
glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
for (i=0, v=p->verts[0] ; i<4 ; i++, v+=VERTEXSIZE)
|
for (i=0, v=p->verts[0] ; i<4 ; i++, v+=VERTEXSIZE)
|
||||||
|
@ -847,22 +847,22 @@ void Sky_DrawFaceQuad (glpoly_t *p)
|
||||||
}
|
}
|
||||||
glEnd ();
|
glEnd ();
|
||||||
|
|
||||||
//GL_Bind (alphaskytexture);
|
GL_Bind (alphaskytexture);
|
||||||
//glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
|
|
||||||
//if (r_skyalpha.value < 1.0)
|
//if (r_skyalpha.value < 1.0)
|
||||||
//glColor4f (1, 1, 1, r_skyalpha.value);
|
//glColor4f (1, 1, 1, r_skyalpha.value);
|
||||||
|
|
||||||
//glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
//for (i=0, v=p->verts[0] ; i<4 ; i++, v+=VERTEXSIZE)
|
for (i=0, v=p->verts[0] ; i<4 ; i++, v+=VERTEXSIZE)
|
||||||
//{
|
{
|
||||||
//Sky_GetTexCoord (v, 16, &s, &t);
|
Sky_GetTexCoord (v, 16, &s, &t);
|
||||||
//glTexCoord2f (s, t);
|
glTexCoord2f (s, t);
|
||||||
//glVertex3fv (v);
|
glVertex3fv (v);
|
||||||
//}
|
}
|
||||||
//glEnd ();
|
glEnd ();
|
||||||
|
|
||||||
//glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
|
|
||||||
rs_skypolys++;
|
rs_skypolys++;
|
||||||
rs_skypasses += 2;
|
rs_skypasses += 2;
|
||||||
|
@ -959,15 +959,15 @@ void Sky_DrawSkyLayers (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//if (r_skyalpha.value < 1.0)
|
if (r_skyalpha.value < 1.0)
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
|
||||||
for (i=0 ; i<6 ; i++)
|
for (i=0 ; i<6 ; i++)
|
||||||
if (skymins[0][i] < skymaxs[0][i] && skymins[1][i] < skymaxs[1][i])
|
if (skymins[0][i] < skymaxs[0][i] && skymins[1][i] < skymaxs[1][i])
|
||||||
Sky_DrawFace (i);
|
Sky_DrawFace (i);
|
||||||
|
|
||||||
//if (r_skyalpha.value < 1.0)
|
if (r_skyalpha.value < 1.0)
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1002,18 +1002,18 @@ void Sky_DrawSky (void)
|
||||||
/*if (Fog_GetDensity() > 0)
|
/*if (Fog_GetDensity() > 0)
|
||||||
glColor3fv (Fog_GetColor());
|
glColor3fv (Fog_GetColor());
|
||||||
else*/
|
else*/
|
||||||
//glColor3fv (skyflatcolor);
|
//glColor3fv (skyflatcolor);
|
||||||
|
|
||||||
//glColor3fv (Fog_GetColor());
|
//glColor3fv (Fog_GetColor());
|
||||||
Sky_ProcessTextureChains ();
|
Sky_ProcessTextureChains ();
|
||||||
Sky_ProcessEntities ();
|
Sky_ProcessEntities ();
|
||||||
glColor3f (1, 1, 1);
|
//glColor3f (1, 1, 1);
|
||||||
glEnable (GL_TEXTURE_2D);
|
glEnable (GL_TEXTURE_2D);
|
||||||
|
|
||||||
//
|
//
|
||||||
// render slow sky: cloud layers or skybox
|
// render slow sky: cloud layers or skybox
|
||||||
//
|
//
|
||||||
/*if (!r_fastsky.value && !(Fog_GetDensity() > 0))
|
if (!r_fastsky.value)
|
||||||
{
|
{
|
||||||
glDepthFunc(GL_GEQUAL);
|
glDepthFunc(GL_GEQUAL);
|
||||||
glDepthMask(0);
|
glDepthMask(0);
|
||||||
|
@ -1025,11 +1025,6 @@ void Sky_DrawSky (void)
|
||||||
|
|
||||||
glDepthMask(1);
|
glDepthMask(1);
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
}*/
|
}
|
||||||
glDepthFunc(GL_GEQUAL);
|
|
||||||
glDepthMask(0);
|
|
||||||
Sky_DrawSkyBox ();
|
|
||||||
glDepthMask(1);
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
|
||||||
Fog_EnableGFog ();
|
Fog_EnableGFog ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1191,9 +1191,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
glBlendFunc (GL_ONE, GL_ONE);
|
glBlendFunc (GL_ONE, GL_ONE);
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
glColor3f(entalpha,entalpha,entalpha);
|
glColor3f(entalpha,entalpha,entalpha);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (paliashdr, lerpdata);
|
GL_DrawAliasFrame (paliashdr, lerpdata);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
@ -1254,9 +1254,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
shading = false;
|
shading = false;
|
||||||
glColor3f(entalpha,entalpha,entalpha);
|
glColor3f(entalpha,entalpha,entalpha);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (paliashdr, lerpdata);
|
GL_DrawAliasFrame (paliashdr, lerpdata);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
@ -1273,9 +1273,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc (GL_ONE, GL_ONE);
|
glBlendFunc (GL_ONE, GL_ONE);
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (paliashdr, lerpdata);
|
GL_DrawAliasFrame (paliashdr, lerpdata);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
@ -1290,9 +1290,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
shading = false;
|
shading = false;
|
||||||
glColor3f(entalpha,entalpha,entalpha);
|
glColor3f(entalpha,entalpha,entalpha);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (paliashdr, lerpdata);
|
GL_DrawAliasFrame (paliashdr, lerpdata);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
@ -1331,9 +1331,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
shading = false;
|
shading = false;
|
||||||
glColor3f(entalpha,entalpha,entalpha);
|
glColor3f(entalpha,entalpha,entalpha);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (paliashdr, lerpdata);
|
GL_DrawAliasFrame (paliashdr, lerpdata);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
|
@ -373,7 +373,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
Fog_DisableGFog ();
|
Fog_DisableGFog ();
|
||||||
GL_Bind (t->gltexture);
|
GL_Bind (t->gltexture);
|
||||||
DrawGLPoly (s->polys);
|
DrawGLPoly (s->polys);
|
||||||
//
|
Fog_EnableGFog ();
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
|
|
||||||
//second pass -- lightmap with black fog, modulate blended
|
//second pass -- lightmap with black fog, modulate blended
|
||||||
|
@ -382,7 +382,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glDepthMask (GL_FALSE);
|
glDepthMask (GL_FALSE);
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
|
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
#else
|
#else
|
||||||
|
@ -395,11 +395,11 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glVertex3fv (v);
|
glVertex3fv (v);
|
||||||
}
|
}
|
||||||
glEnd ();
|
glEnd ();
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
|
|
||||||
//third pass -- black geo with normal fog, additive blended
|
//third pass -- black geo with normal fog, additive blended
|
||||||
/*if (Fog_GetDensity() > 0)
|
if (Fog_GetDensity() > 0)
|
||||||
{
|
{
|
||||||
glBlendFunc(GL_ONE, GL_ONE); //add
|
glBlendFunc(GL_ONE, GL_ONE); //add
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
@ -408,19 +408,17 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glColor3f(1,1,1);
|
glColor3f(1,1,1);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
glDepthMask (GL_TRUE);
|
glDepthMask (GL_TRUE);
|
||||||
Fog_EnableGFog ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gl_mtexable) //case 4: texture and lightmap in one pass, regular modulation
|
if (gl_mtexable) //case 4: texture and lightmap in one pass, regular modulation
|
||||||
{
|
{
|
||||||
Fog_DisableGFog ();
|
|
||||||
GL_DisableMultitexture(); // selects TEXTURE0
|
GL_DisableMultitexture(); // selects TEXTURE0
|
||||||
GL_Bind (t->gltexture);
|
GL_Bind (t->gltexture);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
@ -443,15 +441,12 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glEnd ();
|
glEnd ();
|
||||||
GL_DisableMultitexture ();
|
GL_DisableMultitexture ();
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
Fog_EnableGFog ();
|
|
||||||
}
|
}
|
||||||
else if (entalpha < 1 || (s->flags & SURF_DRAWFENCE)) //case 5: can't do multipass if entity has alpha, so just draw the texture
|
else if (entalpha < 1 || (s->flags & SURF_DRAWFENCE)) //case 5: can't do multipass if entity has alpha, so just draw the texture
|
||||||
{
|
{
|
||||||
Fog_DisableGFog ();
|
|
||||||
GL_Bind (t->gltexture);
|
GL_Bind (t->gltexture);
|
||||||
DrawGLPoly (s->polys);
|
DrawGLPoly (s->polys);
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
Fog_EnableGFog ();
|
|
||||||
}
|
}
|
||||||
else //case 6: texture in one pass, lightmap in a second pass, fog in third pass
|
else //case 6: texture in one pass, lightmap in a second pass, fog in third pass
|
||||||
{
|
{
|
||||||
|
@ -459,7 +454,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
Fog_DisableGFog ();
|
Fog_DisableGFog ();
|
||||||
GL_Bind (t->gltexture);
|
GL_Bind (t->gltexture);
|
||||||
DrawGLPoly (s->polys);
|
DrawGLPoly (s->polys);
|
||||||
//
|
Fog_EnableGFog ();
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
|
|
||||||
//second pass -- lightmap with black fog, modulate blended
|
//second pass -- lightmap with black fog, modulate blended
|
||||||
|
@ -468,7 +463,7 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glDepthMask (GL_FALSE);
|
glDepthMask (GL_FALSE);
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
glBlendFunc (GL_ZERO, GL_SRC_COLOR); //modulate
|
glBlendFunc (GL_ZERO, GL_SRC_COLOR); //modulate
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
#else
|
#else
|
||||||
|
@ -481,11 +476,11 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glVertex3fv (v);
|
glVertex3fv (v);
|
||||||
}
|
}
|
||||||
glEnd ();
|
glEnd ();
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
|
|
||||||
//third pass -- black geo with normal fog, additive blended
|
//third pass -- black geo with normal fog, additive blended
|
||||||
/*if (Fog_GetDensity() > 0)
|
if (Fog_GetDensity() > 0)
|
||||||
{
|
{
|
||||||
glBlendFunc(GL_ONE, GL_ONE); //add
|
glBlendFunc(GL_ONE, GL_ONE); //add
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
@ -494,13 +489,11 @@ void R_DrawSequentialPoly (msurface_t *s)
|
||||||
glColor3f(1,1,1);
|
glColor3f(1,1,1);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
rs_brushpasses++;
|
rs_brushpasses++;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
glDepthMask (GL_TRUE);
|
glDepthMask (GL_TRUE);
|
||||||
|
|
||||||
Fog_EnableGFog ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,9 +517,9 @@ fullbrights:
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
glColor3f (entalpha, entalpha, entalpha);
|
glColor3f (entalpha, entalpha, entalpha);
|
||||||
GL_Bind (t->fullbright);
|
GL_Bind (t->fullbright);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
DrawGLPoly (s->polys);
|
DrawGLPoly (s->polys);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glColor3f(1, 1, 1);
|
glColor3f(1, 1, 1);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
|
@ -139,8 +139,6 @@ void R_DrawSpriteModel (entity_t *e)
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fog_DisableGFog ();
|
|
||||||
|
|
||||||
//johnfitz: offset decals
|
//johnfitz: offset decals
|
||||||
if (psprite->type == SPR_ORIENTED)
|
if (psprite->type == SPR_ORIENTED)
|
||||||
|
@ -181,6 +179,4 @@ void R_DrawSpriteModel (entity_t *e)
|
||||||
//johnfitz: offset decals
|
//johnfitz: offset decals
|
||||||
if (psprite->type == SPR_ORIENTED)
|
if (psprite->type == SPR_ORIENTED)
|
||||||
GL_PolygonOffset (OFFSET_NONE);
|
GL_PolygonOffset (OFFSET_NONE);
|
||||||
|
|
||||||
Fog_EnableGFog ();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1197,21 +1197,21 @@ void R_DrawTextureChains (qmodel_t *model, entity_t *ent, texchain_t chain)
|
||||||
//to make fog work with multipass lightmapping, need to do one pass
|
//to make fog work with multipass lightmapping, need to do one pass
|
||||||
//with no fog, one modulate pass with black fog, and one additive
|
//with no fog, one modulate pass with black fog, and one additive
|
||||||
//pass with black geometry and normal fog
|
//pass with black geometry and normal fog
|
||||||
//Fog_DisableGFog ();
|
Fog_DisableGFog ();
|
||||||
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
||||||
//Fog_EnableGFog ();
|
Fog_EnableGFog ();
|
||||||
glDepthMask (GL_FALSE);
|
glDepthMask (GL_FALSE);
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
glBlendFunc (GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
|
glBlendFunc (GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
R_DrawLightmapChains ();
|
R_DrawLightmapChains ();
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
//if (Fog_GetDensity() > 0)
|
//if (Fog_GetDensity() > 0)
|
||||||
//{
|
//{
|
||||||
//glBlendFunc(GL_ONE, GL_ONE); //add
|
//glBlendFunc(GL_ONE, GL_ONE); //add
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
//glColor3f(0,0,0);
|
//glColor3f(0,0,0);
|
||||||
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
//R_DrawTextureChains_TextureOnly (model, ent, chain);
|
||||||
//glColor3f(1,1,1);
|
//glColor3f(1,1,1);
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
//}
|
//}
|
||||||
|
@ -1239,21 +1239,21 @@ void R_DrawTextureChains (qmodel_t *model, entity_t *ent, texchain_t chain)
|
||||||
//to make fog work with multipass lightmapping, need to do one pass
|
//to make fog work with multipass lightmapping, need to do one pass
|
||||||
//with no fog, one modulate pass with black fog, and one additive
|
//with no fog, one modulate pass with black fog, and one additive
|
||||||
//pass with black geometry and normal fog
|
//pass with black geometry and normal fog
|
||||||
//Fog_DisableGFog ();
|
Fog_DisableGFog ();
|
||||||
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
||||||
//Fog_EnableGFog ();
|
Fog_EnableGFog ();
|
||||||
glDepthMask (GL_FALSE);
|
glDepthMask (GL_FALSE);
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
glBlendFunc(GL_ZERO, GL_SRC_COLOR); //modulate
|
glBlendFunc(GL_ZERO, GL_SRC_COLOR); //modulate
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
R_DrawLightmapChains ();
|
R_DrawLightmapChains ();
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
//if (Fog_GetDensity() > 0)
|
//if (Fog_GetDensity() > 0)
|
||||||
//{
|
//{
|
||||||
//glBlendFunc(GL_ONE, GL_ONE); //add
|
//glBlendFunc(GL_ONE, GL_ONE); //add
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
//glColor3f(0,0,0);
|
//glColor3f(0,0,0);
|
||||||
R_DrawTextureChains_TextureOnly (model, ent, chain);
|
//R_DrawTextureChains_TextureOnly (model, ent, chain);
|
||||||
//glColor3f(1,1,1);
|
//glColor3f(1,1,1);
|
||||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
//}
|
//}
|
||||||
|
@ -1273,9 +1273,9 @@ fullbrights:
|
||||||
glBlendFunc (GL_ONE, GL_ONE);
|
glBlendFunc (GL_ONE, GL_ONE);
|
||||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
glColor3f (entalpha, entalpha, entalpha);
|
glColor3f (entalpha, entalpha, entalpha);
|
||||||
//Fog_StartAdditive ();
|
Fog_StartAdditive ();
|
||||||
R_DrawTextureChains_Glow (model, ent, chain);
|
R_DrawTextureChains_Glow (model, ent, chain);
|
||||||
//Fog_StopAdditive ();
|
Fog_StopAdditive ();
|
||||||
glColor3f (1, 1, 1);
|
glColor3f (1, 1, 1);
|
||||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
|
@ -1676,13 +1676,13 @@ void SV_Physics (void)
|
||||||
//
|
//
|
||||||
ent = sv.edicts;
|
ent = sv.edicts;
|
||||||
|
|
||||||
/* if (sv_freezenonclients.value)
|
if (sv_freezenonclients.value)
|
||||||
entity_cap = svs.maxclients + 1; // Only run physics on clients and the world
|
entity_cap = svs.maxclients + 1; // Only run physics on clients and the world
|
||||||
else
|
else
|
||||||
entity_cap = sv.num_edicts;
|
entity_cap = sv.num_edicts;
|
||||||
*/
|
|
||||||
for (i=0 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
|
//for (i=0 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
|
||||||
//for (i=0 ; i<entity_cap ; i++, ent = NEXT_EDICT(ent))
|
for (i=0 ; i<entity_cap ; i++, ent = NEXT_EDICT(ent))
|
||||||
{
|
{
|
||||||
if (ent->free)
|
if (ent->free)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue