mirror of
https://git.code.sf.net/p/quake/nuq
synced 2024-11-22 12:11:36 +00:00
fb model fixups, optimizations, spaced indents fixed, minor cleanup
This commit is contained in:
parent
bf1a322439
commit
d1cecd1018
1 changed files with 40 additions and 44 deletions
|
@ -313,9 +313,6 @@ static void R_DrawSpriteModel (entity_t *e)
|
||||||
glEnable (GL_ALPHA_TEST);
|
glEnable (GL_ALPHA_TEST);
|
||||||
glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
|
|
||||||
glEnable (GL_ALPHA_TEST);
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
|
|
||||||
glTexCoord2f (0, 1);
|
glTexCoord2f (0, 1);
|
||||||
VectorMA (e->origin, frame->down, up, point);
|
VectorMA (e->origin, frame->down, up, point);
|
||||||
VectorMA (point, frame->left, right, point);
|
VectorMA (point, frame->left, right, point);
|
||||||
|
@ -387,6 +384,10 @@ static void GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum, qboolean fb)
|
||||||
verts += posenum * paliashdr->poseverts;
|
verts += posenum * paliashdr->poseverts;
|
||||||
order = (int *)((byte *)paliashdr + paliashdr->commands);
|
order = (int *)((byte *)paliashdr + paliashdr->commands);
|
||||||
|
|
||||||
|
if (fb)
|
||||||
|
glColor3f(1,1,1);
|
||||||
|
else if (lighthalf)
|
||||||
|
shadelight *= 2;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
// get the vertex count and primitive type
|
// get the vertex count and primitive type
|
||||||
|
@ -407,17 +408,11 @@ static void GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum, qboolean fb)
|
||||||
glTexCoord2f (((float *)order)[0], ((float *)order)[1]);
|
glTexCoord2f (((float *)order)[0], ((float *)order)[1]);
|
||||||
order += 2;
|
order += 2;
|
||||||
|
|
||||||
if (fb) {
|
if (!fb)
|
||||||
glColor4f (1, 1, 1, 1);
|
{
|
||||||
} else {
|
|
||||||
// normals and vertexes come from the frame list
|
// normals and vertexes come from the frame list
|
||||||
l = shadedots[verts->lightnormalindex] * shadelight;
|
l = shadedots[verts->lightnormalindex] * shadelight;
|
||||||
|
glColor3f(l, l, l);
|
||||||
// LordHavoc: cleanup after Endy
|
|
||||||
if (!lighthalf) {
|
|
||||||
l *= 2;
|
|
||||||
}
|
|
||||||
glColor4f(l, l, l, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glVertex3f (verts->v[0], verts->v[1], verts->v[2]);
|
glVertex3f (verts->v[0], verts->v[1], verts->v[2]);
|
||||||
|
@ -591,9 +586,9 @@ static void R_DrawAliasModel (entity_t *e)
|
||||||
{
|
{
|
||||||
if (ambientlight < 8)
|
if (ambientlight < 8)
|
||||||
ambientlight = shadelight = 8;
|
ambientlight = shadelight = 8;
|
||||||
} else if (!gl_fb_models->value && (
|
}
|
||||||
!strcmp (clmodel->name, "progs/flame.mdl") ||
|
else if (!gl_fb_models->value && (!strcmp (clmodel->name, "progs/flame.mdl") || !strcmp (clmodel->name, "progs/flame2.mdl")))
|
||||||
!strcmp (clmodel->name, "progs/flame2.mdl"))) {
|
{
|
||||||
// HACK HACK HACK -- no fullbright colors, so make torches full light
|
// HACK HACK HACK -- no fullbright colors, so make torches full light
|
||||||
ambientlight = shadelight = 256;
|
ambientlight = shadelight = 256;
|
||||||
}
|
}
|
||||||
|
@ -621,6 +616,9 @@ static void R_DrawAliasModel (entity_t *e)
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
R_RotateForEntity (e);
|
R_RotateForEntity (e);
|
||||||
|
|
||||||
|
// LordHavoc: must be in modulate mode for reasons of lighting as well as fullbright support
|
||||||
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
|
||||||
if (!strcmp (clmodel->name, "progs/eyes.mdl") )
|
if (!strcmp (clmodel->name, "progs/eyes.mdl") )
|
||||||
{
|
{
|
||||||
glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2] - (22 + 8));
|
glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2] - (22 + 8));
|
||||||
|
@ -654,17 +652,16 @@ static void R_DrawAliasModel (entity_t *e)
|
||||||
R_SetupAliasFrame (currententity->frame, paliashdr, false);
|
R_SetupAliasFrame (currententity->frame, paliashdr, false);
|
||||||
|
|
||||||
// This block is GL fullbright support for objects...
|
// This block is GL fullbright support for objects...
|
||||||
if (clmodel->hasfullbrights && gl_fb_models->value &&
|
if (clmodel->hasfullbrights && gl_fb_models->value && paliashdr->gl_fb_texturenum[currententity->skinnum][anim])
|
||||||
paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) {
|
{
|
||||||
/*
|
glBlendFunc(GL_ONE, GL_ONE);
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
|
||||||
*/
|
|
||||||
|
|
||||||
glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]);
|
glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]);
|
||||||
R_SetupAliasFrame (currententity->frame, paliashdr, true);
|
R_SetupAliasFrame (currententity->frame, paliashdr, true);
|
||||||
|
|
||||||
//glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
|
gkBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
|
@ -841,8 +838,7 @@ static void R_SetupFrame (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void MYgluPerspective( GLdouble fovy, GLdouble aspect,
|
static void MYgluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar )
|
||||||
GLdouble zNear, GLdouble zFar )
|
|
||||||
{
|
{
|
||||||
GLdouble xmin, xmax, ymin, ymax;
|
GLdouble xmin, xmax, ymin, ymax;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue