Removed some dead code.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2075 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f9f6ea773c
commit
176b5688eb
1 changed files with 0 additions and 426 deletions
|
@ -155,8 +155,6 @@ int scenepp_ww_parm_texture1i;
|
||||||
int scenepp_ww_parm_texture2i;
|
int scenepp_ww_parm_texture2i;
|
||||||
int scenepp_ww_parm_ampscalef;
|
int scenepp_ww_parm_ampscalef;
|
||||||
|
|
||||||
int scenepp_bloom_program;
|
|
||||||
|
|
||||||
// KrimZon - init post processing - called in GL_CheckExtensions, when they're called
|
// KrimZon - init post processing - called in GL_CheckExtensions, when they're called
|
||||||
// I put it here so that only this file need be changed when messing with the post
|
// I put it here so that only this file need be changed when messing with the post
|
||||||
// processing shaders
|
// processing shaders
|
||||||
|
@ -225,39 +223,9 @@ void GL_InitSceneProcessingShaders_WaterWarp (void)
|
||||||
if (qglGetError())
|
if (qglGetError())
|
||||||
Con_Printf("GL Error initing shader object\n");
|
Con_Printf("GL Error initing shader object\n");
|
||||||
}
|
}
|
||||||
void GL_InitSceneProcessingShaders_Bloom(void)
|
|
||||||
{
|
|
||||||
int texnum;
|
|
||||||
char *genericvert = "\
|
|
||||||
varying vec2 v_texCoord0;\
|
|
||||||
/*varying vec2 v_texCoord1;*/\
|
|
||||||
/*varying vec2 v_texCoord2;*/\
|
|
||||||
void main (void)\
|
|
||||||
{\
|
|
||||||
vec4 v = vec4( gl_Vertex.x, gl_Vertex.y, gl_Vertex.z, 1.0 );\
|
|
||||||
gl_Position = gl_ModelViewProjectionMatrix * v;\
|
|
||||||
v_texCoord0 = gl_MultiTexCoord0.xy;\
|
|
||||||
/*v_texCoord1 = gl_MultiTexCoord1.xy;*/\
|
|
||||||
/*v_texCoord2 = gl_MultiTexCoord2.xy;*/\
|
|
||||||
}\
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
char *frag = COM_LoadTempFile("bloom.glsl");
|
|
||||||
|
|
||||||
if (!frag)
|
|
||||||
return;
|
|
||||||
|
|
||||||
scenepp_bloom_program = GLSlang_CreateProgram(NULL, genericvert, frag);
|
|
||||||
if (!scenepp_bloom_program)
|
|
||||||
return;
|
|
||||||
texnum = GLSlang_GetUniformLocation(scenepp_bloom_program, "theTexture0");
|
|
||||||
GLSlang_SetUniform1i(texnum, 0);
|
|
||||||
}
|
|
||||||
void GL_InitSceneProcessingShaders (void)
|
void GL_InitSceneProcessingShaders (void)
|
||||||
{
|
{
|
||||||
GL_InitSceneProcessingShaders_WaterWarp();
|
GL_InitSceneProcessingShaders_WaterWarp();
|
||||||
GL_InitSceneProcessingShaders_Bloom();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PP_WARP_TEX_SIZE 64
|
#define PP_WARP_TEX_SIZE 64
|
||||||
|
@ -674,167 +642,6 @@ void R_DrawSpriteModel (entity_t *e)
|
||||||
if (e->flags & Q2RF_ADDATIVE) //back to regular blending for us!
|
if (e->flags & Q2RF_ADDATIVE) //back to regular blending for us!
|
||||||
qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
extern int gldepthfunc;
|
|
||||||
typedef struct decal_s {
|
|
||||||
vec3_t origin;
|
|
||||||
vec3_t normal;
|
|
||||||
int modelindex;
|
|
||||||
float endtime;
|
|
||||||
float starttime;
|
|
||||||
float size;
|
|
||||||
struct decal_s *next;
|
|
||||||
} decal_t;
|
|
||||||
decal_t *firstdecal;
|
|
||||||
void vectoangles(vec3_t vec, vec3_t ang);
|
|
||||||
void R_DrawDecals(void)
|
|
||||||
{
|
|
||||||
// vec3_t point;
|
|
||||||
// vec3_t right, up;
|
|
||||||
|
|
||||||
entity_t ent;
|
|
||||||
extern int cl_spikeindex;
|
|
||||||
extern model_t mod_known[];
|
|
||||||
|
|
||||||
decal_t *dec = firstdecal;
|
|
||||||
// glDisable(GL_TEXTURE_2D);
|
|
||||||
glDisable (GL_ALPHA_TEST);
|
|
||||||
glEnable (GL_BLEND);
|
|
||||||
// glDepthFunc(GL_LEQUAL);
|
|
||||||
// glDisable(GL_CULL_TEST);
|
|
||||||
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
|
||||||
GL_Bind(particletexture);
|
|
||||||
// glDepthMask(0);
|
|
||||||
// glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
glColor4f(0, 0, 0, 0.5);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// glClearStencil(0x0);
|
|
||||||
// glEnable(GL_STENCIL_TEST);
|
|
||||||
|
|
||||||
|
|
||||||
memset(&ent, 0, sizeof(ent));
|
|
||||||
|
|
||||||
while(dec)
|
|
||||||
{
|
|
||||||
// if (dec->modelindex)
|
|
||||||
{
|
|
||||||
ent.origin[0] = dec->origin[0];
|
|
||||||
ent.origin[1] = dec->origin[1];
|
|
||||||
ent.origin[2] = dec->origin[2];
|
|
||||||
ent.angles[0] = -dec->normal[0];
|
|
||||||
ent.angles[1] = -dec->normal[1];
|
|
||||||
ent.angles[2] = -dec->normal[2];
|
|
||||||
vectoangles(ent.angles, ent.angles);
|
|
||||||
ent.model = &mod_known[cl_spikeindex];//dec->modelindex;
|
|
||||||
currententity = &ent;
|
|
||||||
switch(currententity->model->type)
|
|
||||||
{
|
|
||||||
case mod_alias:
|
|
||||||
R_DrawAliasModel(currententity);
|
|
||||||
break;
|
|
||||||
case mod_alias3:
|
|
||||||
R_DrawAlias3Model(currententity);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
dec = dec->next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
PerpendicularVector(up, dec->normal);
|
|
||||||
CrossProduct(dec->normal, up, right);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
glClear(GL_STENCIL_BUFFER_BIT);
|
|
||||||
glStencilFunc (GL_ALWAYS, 0x1, 0x1);
|
|
||||||
glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
|
||||||
glBegin(GL_QUADS);
|
|
||||||
glVertex2f (-1.0, 0.0);
|
|
||||||
glVertex2f (0.0, 1.0);
|
|
||||||
glVertex2f (1.0, 0.0);
|
|
||||||
glVertex2f (0.0, -1.0);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glStencilFunc (GL_EQUAL, 0x1, 0x1); //where we drew to the stencil buffer.
|
|
||||||
glStencilOp (GL_ZERO, GL_KEEP, GL_KEEP);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// glColor4f(1, 1, 1, (dec->starttime-dec->endtime) * (cl.time-dec->starttime));
|
|
||||||
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
|
|
||||||
glTexCoord2f (0, 0.5);
|
|
||||||
VectorMA (dec->origin, dec->size, up, point);
|
|
||||||
VectorMA (point, -dec->size, right, point);
|
|
||||||
glVertex3fv (point);
|
|
||||||
|
|
||||||
glTexCoord2f (0, 0);
|
|
||||||
VectorMA (dec->origin, -dec->size, up, point);
|
|
||||||
VectorMA (point, -dec->size, right, point);
|
|
||||||
glVertex3fv (point);
|
|
||||||
|
|
||||||
glTexCoord2f (0.5, 0);
|
|
||||||
VectorMA (dec->origin, -dec->size, up, point);
|
|
||||||
VectorMA (point, dec->size, right, point);
|
|
||||||
glVertex3fv (point);
|
|
||||||
|
|
||||||
glTexCoord2f (0.5, 0.5);
|
|
||||||
VectorMA (dec->origin, dec->size, up, point);
|
|
||||||
VectorMA (point, dec->size, right, point);
|
|
||||||
glVertex3fv (point);
|
|
||||||
glEnd ();
|
|
||||||
|
|
||||||
dec = dec->next;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
// glDisable(GL_STENCIL_TEST);
|
|
||||||
// glDepthMask(1);
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
glDisable (GL_BLEND);
|
|
||||||
|
|
||||||
// glDepthFunc(gldepthfunc);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TraceLineN (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal);
|
|
||||||
void GLR_AddDecals(vec3_t org)
|
|
||||||
{
|
|
||||||
decal_t *dec;
|
|
||||||
vec3_t end, impact, norm;
|
|
||||||
vec3_t dir[] = {
|
|
||||||
{0, 0, 10},
|
|
||||||
{0, 0, -10},
|
|
||||||
{0, 10, 0},
|
|
||||||
{0, -10, 0},
|
|
||||||
{10, 0, 0},
|
|
||||||
{-10, 0, 0}
|
|
||||||
};
|
|
||||||
int i;
|
|
||||||
#define STOP_EPSILON 0.01
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
|
||||||
{
|
|
||||||
VectorAdd(org, dir[i], end);
|
|
||||||
TraceLineN(org, end, impact, norm);
|
|
||||||
|
|
||||||
if (!((end[0]==impact[0] && end[1]==impact[1] && end[2]==impact[2]) || (!impact[0] && !impact[1] && !impact[2])))
|
|
||||||
{
|
|
||||||
dec = Z_Malloc(sizeof(decal_t));
|
|
||||||
VectorCopy(norm, dec->normal);
|
|
||||||
// VectorCopy(impact, dec->origin);
|
|
||||||
VectorMA(impact, STOP_EPSILON, norm, dec->origin);
|
|
||||||
dec->next = firstdecal;
|
|
||||||
firstdecal = dec;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================
|
//==================================================================================
|
||||||
|
|
||||||
|
@ -954,127 +761,7 @@ R_DrawViewModel
|
||||||
*/
|
*/
|
||||||
void GLR_DrawViewModel (void)
|
void GLR_DrawViewModel (void)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
// float ambient[4], diffuse[4];
|
|
||||||
// int j;
|
|
||||||
// int lnum;
|
|
||||||
// vec3_t dist;
|
|
||||||
// float add;
|
|
||||||
// dlight_t *dl;
|
|
||||||
// int ambientlight, shadelight;
|
|
||||||
|
|
||||||
static struct model_s *oldmodel[MAX_SPLITS];
|
|
||||||
static float lerptime[MAX_SPLITS];
|
|
||||||
static int prevframe[MAX_SPLITS];
|
|
||||||
|
|
||||||
#ifdef SIDEVIEWS
|
|
||||||
extern qboolean r_secondaryview;
|
|
||||||
if (r_secondaryview==1)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!r_drawviewmodel.value || !Cam_DrawViewModel(r_refdef.currentplayernum))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (envmap)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef Q2CLIENT
|
|
||||||
if (cls.q2server)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!r_drawentities.value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (cl.stats[r_refdef.currentplayernum][STAT_ITEMS] & IT_INVISIBILITY)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (cl.stats[r_refdef.currentplayernum][STAT_HEALTH] <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
currententity = &cl.viewent[r_refdef.currentplayernum];
|
|
||||||
if (!currententity->model)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// if (cls.allow_anyparticles || currententity->visframe) //allowed or static
|
|
||||||
{
|
|
||||||
if (currententity->model->particleeffect>=0)
|
|
||||||
{
|
|
||||||
if (currententity->model->particleengulphs)
|
|
||||||
{
|
|
||||||
if (gl_part_flame.value)
|
|
||||||
{
|
|
||||||
P_TorchEffect(currententity->origin, currententity->model->particleeffect);
|
|
||||||
currententity->model = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (gl_part_torch.value)
|
|
||||||
{
|
|
||||||
P_TorchEffect(currententity->origin, currententity->model->particleeffect);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef PEXT_SCALE
|
|
||||||
currententity->scale = 1;
|
|
||||||
#endif
|
|
||||||
if (r_drawviewmodel.value > 0 && r_drawviewmodel.value < 1)
|
|
||||||
currententity->alpha = r_drawviewmodel.value;
|
|
||||||
else
|
|
||||||
currententity->alpha = 1;
|
|
||||||
|
|
||||||
if (currententity->frame != prevframe[r_refdef.currentplayernum])
|
|
||||||
{
|
|
||||||
currententity->oldframe = prevframe[r_refdef.currentplayernum];
|
|
||||||
lerptime[r_refdef.currentplayernum] = realtime;
|
|
||||||
}
|
|
||||||
prevframe[r_refdef.currentplayernum] = currententity->frame;
|
|
||||||
|
|
||||||
if (currententity->model != oldmodel[r_refdef.currentplayernum])
|
|
||||||
{
|
|
||||||
oldmodel[r_refdef.currentplayernum] = currententity->model;
|
|
||||||
currententity->oldframe = currententity->frame;
|
|
||||||
lerptime[r_refdef.currentplayernum] = realtime;
|
|
||||||
}
|
|
||||||
currententity->lerptime = 1-(realtime-lerptime[r_refdef.currentplayernum])*10;
|
|
||||||
if (currententity->lerptime<0)currententity->lerptime=0;
|
|
||||||
if (currententity->lerptime>1)currententity->lerptime=1;
|
|
||||||
|
|
||||||
|
|
||||||
currententity->flags = Q2RF_WEAPONMODEL|Q2RF_DEPTHHACK;
|
|
||||||
|
|
||||||
switch(currententity->model->type)
|
|
||||||
{
|
|
||||||
case mod_sprite:
|
|
||||||
R_DrawSpriteModel (currententity);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case mod_alias:
|
|
||||||
R_DrawGAliasModel (currententity);
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef HALFLIFEMODELS
|
|
||||||
case mod_halflife:
|
|
||||||
R_DrawHLModel (currententity);
|
|
||||||
break;
|
|
||||||
#else
|
|
||||||
case mod_halflife: //no gcc warning please
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//we don't support these as view models
|
|
||||||
case mod_brush:
|
|
||||||
case mod_dummy:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1731,119 +1418,6 @@ void R_Clear (void)
|
||||||
qglDepthRange (gldepthmin, gldepthmax);
|
qglDepthRange (gldepthmin, gldepthmax);
|
||||||
}
|
}
|
||||||
|
|
||||||
//#if 0 //!!! FIXME, Zoid, mirror is disabled for now
|
|
||||||
/*
|
|
||||||
=============
|
|
||||||
R_Mirror
|
|
||||||
=============
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
void CL_AddFlagModels (entity_t *ent, int team);
|
|
||||||
void R_MirrorAddPlayerModels (void)
|
|
||||||
{
|
|
||||||
extern int cl_playerindex;
|
|
||||||
extern cvar_t cl_predict_players, cl_predict_players2;
|
|
||||||
player_state_t *state;
|
|
||||||
player_state_t exact;
|
|
||||||
player_info_t *info=cl.players + cl.playernum[0];
|
|
||||||
double playertime;
|
|
||||||
entity_t *ent;
|
|
||||||
int msec;
|
|
||||||
frame_t *frame;
|
|
||||||
int oldphysent;
|
|
||||||
extern cvar_t spectator;
|
|
||||||
|
|
||||||
playertime = realtime - cls.latency + 0.02;
|
|
||||||
if (playertime > realtime)
|
|
||||||
playertime = realtime;
|
|
||||||
|
|
||||||
frame = &cl.frames[cl.parsecount&UPDATE_MASK];
|
|
||||||
|
|
||||||
state=&frame->playerstate[cl.playernum[0]];
|
|
||||||
|
|
||||||
if (!state->modelindex || spectator.value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ent = &cl_visedicts[cl_numvisedicts];
|
|
||||||
cl_numvisedicts++;
|
|
||||||
|
|
||||||
ent->keynum = cl.playernum[0]+1;
|
|
||||||
|
|
||||||
ent->model = cl.model_precache[state->modelindex];
|
|
||||||
ent->skinnum = state->skinnum;
|
|
||||||
ent->frame = state->frame;
|
|
||||||
ent->oldframe = state->oldframe;
|
|
||||||
if (state->lerpstarttime)
|
|
||||||
{
|
|
||||||
ent->lerptime = 1-(realtime - state->lerpstarttime)*10;
|
|
||||||
if (ent->lerptime < 0)
|
|
||||||
ent->lerptime = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ent->lerptime = 0;
|
|
||||||
|
|
||||||
ent->colormap = cl.players[cl.playernum[0]].translations;
|
|
||||||
if (state->modelindex == cl_playerindex)
|
|
||||||
ent->scoreboard = &cl.players[cl.playernum[0]]; // use custom skin
|
|
||||||
else
|
|
||||||
ent->scoreboard = NULL;
|
|
||||||
|
|
||||||
#ifdef PEXT_SCALE
|
|
||||||
ent->scale = state->scale;
|
|
||||||
if (!ent->scale)
|
|
||||||
ent->scale = 1;
|
|
||||||
#endif
|
|
||||||
#ifdef PEXT_TRANS
|
|
||||||
ent->alpha = state->trans;
|
|
||||||
if (!ent->alpha)
|
|
||||||
ent->alpha = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// angles
|
|
||||||
//
|
|
||||||
ent->angles[PITCH] = -r_refdef.viewangles[PITCH]/3;
|
|
||||||
ent->angles[YAW] = r_refdef.viewangles[YAW];
|
|
||||||
// ent->angles[ROLL] = 0;
|
|
||||||
ent->angles[ROLL] = V_CalcRoll (ent->angles, state->velocity)*4;
|
|
||||||
AngleVectors(ent->angles, ent->axis[0], ent->axis[1], ent->axis[2]);
|
|
||||||
VectorInverse(ent->axis[1]);
|
|
||||||
|
|
||||||
// only predict half the move to minimize overruns
|
|
||||||
msec = 500*(playertime - state->state_time);
|
|
||||||
if (msec <= 0 || (!cl_predict_players.value && !cl_predict_players2.value))
|
|
||||||
{
|
|
||||||
VectorCopy (state->origin, ent->origin);
|
|
||||||
//Con_DPrintf ("nopredict\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// predict players movement
|
|
||||||
if (msec > 255)
|
|
||||||
msec = 255;
|
|
||||||
state->command.msec = msec;
|
|
||||||
//Con_DPrintf ("predict: %i\n", msec);
|
|
||||||
|
|
||||||
oldphysent = pmove.numphysent;
|
|
||||||
CL_SetSolidPlayers (cl.playernum[0]);
|
|
||||||
CL_PredictUsercmd (0, state, &exact, &state->command);
|
|
||||||
pmove.numphysent = oldphysent;
|
|
||||||
VectorCopy (exact.origin, ent->origin);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorCopy(cl.simorg[0], ent->origin);
|
|
||||||
|
|
||||||
if (state->effects & QWEF_FLAG1)
|
|
||||||
CL_AddFlagModels (ent, 0);
|
|
||||||
else if (state->effects & QWEF_FLAG2)
|
|
||||||
CL_AddFlagModels (ent, 1);
|
|
||||||
|
|
||||||
if (info->vweapindex)
|
|
||||||
CL_AddVWeapModel(ent, info->vweapindex);
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void R_Mirror (void)
|
void R_Mirror (void)
|
||||||
{
|
{
|
||||||
msurface_t *s, *prevs, *prevr, *rejects;
|
msurface_t *s, *prevs, *prevr, *rejects;
|
||||||
|
|
Loading…
Reference in a new issue