merge in the QSG stuff (bringing gl_rmain closer)

This commit is contained in:
Bill Currie 2001-05-18 22:33:35 +00:00
parent 18e6b43168
commit c7527ed664
4 changed files with 29 additions and 7 deletions

View file

@ -187,6 +187,13 @@ typedef struct entity_state_s
int colormap;
int skin;
int effects;
// LordHavoc: Endy neglected to mark this as a QSG version 2 thingy...
byte alpha;
byte scale;
byte glow_size;
byte glow_color;
byte colormod;
} entity_state_t;
#endif // __protocol_h

View file

@ -182,6 +182,13 @@ CL_ClearState (void)
for (i = 0; i < MAX_EFRAGS - 1; i++)
cl.free_efrags[i].entnext = &cl.free_efrags[i + 1];
cl.free_efrags[i].entnext = NULL;
for (i = 0; i < MAX_EDICTS; i++) {
cl_entities[i].baseline.alpha = 255;
cl_entities[i].baseline.scale = 16;
cl_entities[i].baseline.glow_color = 254;
cl_entities[i].baseline.glow_size = 0;
cl_entities[i].baseline.colormod = 255;
}
}

View file

@ -489,6 +489,13 @@ CL_ParseBaseline (entity_t *ent)
ent->baseline.origin[i] = MSG_ReadCoord (net_message);
ent->baseline.angles[i] = MSG_ReadAngle (net_message);
}
// LordHavoc: set up the baseline to account for new effects (alpha,
// colormod, etc)
ent->alpha = 1;
ent->scale = 16;
ent->glow_color = 254;
ent->glow_size = 0;
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1;
}

View file

@ -620,9 +620,9 @@ R_DrawAliasModel (entity_t *e)
// FIXME: shadecolor is supposed to be the lighting for the model, not
// just colormod
shadecolor[0] = 255;//currententity->colormod[0];
shadecolor[1] = 255;//currententity->colormod[1];
shadecolor[2] = 255;//currententity->colormod[2];
shadecolor[0] = currententity->colormod[0];
shadecolor[1] = currententity->colormod[1];
shadecolor[2] = currententity->colormod[2];
if (!lighthalf) {
shadecolor[0] *= 2.0;
shadecolor[1] *= 2.0;
@ -822,7 +822,7 @@ R_DrawEntitiesOnList (void)
if (cl_visedicts[i]->model->type != mod_brush)
continue;
currententity = cl_visedicts[i];
modelalpha = 1.0;//currententity->alpha;
modelalpha = currententity->alpha;
R_DrawBrushModel (currententity);
}
@ -831,7 +831,7 @@ R_DrawEntitiesOnList (void)
if (cl_visedicts[i]->model->type != mod_alias)
continue;
currententity = cl_visedicts[i];
modelalpha = 1.0;//currententity->alpha;
modelalpha = currententity->alpha;
if (currententity == &cl_entities[cl.viewentity])
currententity->angles[PITCH] *= 0.3;
@ -843,7 +843,7 @@ R_DrawEntitiesOnList (void)
if (cl_visedicts[i]->model->type != mod_sprite)
continue;
currententity = cl_visedicts[i];
modelalpha = 1.0;//currententity->alpha;
modelalpha = currententity->alpha;
R_DrawSpriteModel (currententity);
}
@ -861,7 +861,8 @@ R_DrawViewModel (void)
|| cl.stats[STAT_HEALTH] <= 0 || !currententity->model)
return;
modelalpha = 1.0;//currententity->alpha;
// this is a HACK! --KB
modelalpha = currententity->alpha;
// hack the depth range to prevent view model from poking into walls
glDepthRange (gldepthmin, gldepthmin + 0.3 * (gldepthmax - gldepthmin));