Merge branch 'master' of git://disenchant.net/tyrquake

This commit is contained in:
Kevin Shanahan 2013-04-24 16:53:29 +09:30
commit f9a1271e81
11 changed files with 277 additions and 202 deletions

View File

@ -1258,11 +1258,39 @@ $(DIST_DIR)/tyrquake-$(TYR_VERSION_NUM)-win32.zip: $(DIST_FILES_WIN32)
$(call do_zip,$(DIST_DIR)/win32)
# ----------------------------------------------------------------------------
# Source tarball creation
.PHONY: bundles snapshot
quiet_cmd_git_archive = ' GIT-ARCV $@'
cmd_git_archive = \
git archive --format=tar --prefix=tyrutils-$(TYR_VERSION_NUM)/ HEAD \
> $(@D)/.$(@F).tmp && \
mv $(@D)/.$(@F).tmp $@
define do_git_archive
$(do_mkdir)
@echo $(if $(quiet),$(quiet_cmd_git_archive),"$(cmd_git_archive)");
@$(cmd_git_archive)
endef
$(DIST_DIR)/tyrquake-$(TYR_VERSION_NUM).tar:
$(do_git_archive)
quiet_cmd_gzip = ' GZIP $@'
cmd_gzip = gzip -S .gz $<
define do_gzip
$(do_mkdir)
@echo $($(quiet)cmd_gzip)
@$(cmd_gzip)
endef
%.gz: %
$(do_gzip)
# ----------------------------------------------------------------------------
.PHONY: bundles tarball snapshot
#
# To test, do 'make bundles' or 'make snapshot'
#
bundles: $(ALL_BUNDLE_FILES)
snapshot: $(SNAPSHOT_TARGET)
tarball: $(DIST_DIR)/tyrquake-$(TYR_VERSION_NUM).tar.gz

View File

@ -901,8 +901,13 @@ CL_SetSolidEntities(physent_stack_t *pestack)
physent_t *physent;
int i;
physent = pestack->physents;
if (!cl.worldmodel) {
/* FIXME - Shouldn't be getting called without a world? */
pestack->numphysent = 0;
return;
}
physent = pestack->physents;
physent->brushmodel = ConstBrushModel(&cl.worldmodel->model);
VectorCopy(vec3_origin, physent->origin);
physent++;

View File

@ -266,7 +266,7 @@ static mplane_t *lightplane;
vec3_t lightspot;
static int
RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
RecursiveLightPoint(const mnode_t *node, const vec3_t start, const vec3_t end)
{
int r;
float front, back, frac;
@ -366,7 +366,7 @@ RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
}
int
R_LightPoint(vec3_t p)
R_LightPoint(const vec3_t point)
{
vec3_t end;
int r;
@ -374,11 +374,11 @@ R_LightPoint(vec3_t p)
if (!cl.worldmodel->lightdata)
return 255;
end[0] = p[0];
end[1] = p[1];
end[2] = p[2] - (8192 + 2); /* Max distance + error margin */
end[0] = point[0];
end[1] = point[1];
end[2] = point[2] - (8192 + 2); /* Max distance + error margin */
r = RecursiveLightPoint(cl.worldmodel->nodes, p, end);
r = RecursiveLightPoint(cl.worldmodel->nodes, point, end);
if (r == -1)
r = 0;

View File

@ -420,86 +420,88 @@ GL_AliasDrawModel
=============
*/
static void
GL_AliasDrawModel(const entity_t *e, float blend)
GL_AliasDrawModel(const entity_t *entity, float blend)
{
float l;
aliashdr_t *pahdr;
trivertx_t *vertbase, *verts1;
int *order;
aliashdr_t *aliashdr;
const trivertx_t *vertbase, *verts1;
const int *order;
float light;
int count;
lastposenum = e->currentpose;
lastposenum = entity->currentpose;
pahdr = Mod_Extradata(e->model);
vertbase = (trivertx_t *)((byte *)pahdr + pahdr->posedata);
verts1 = vertbase + e->currentpose * pahdr->numverts;
order = (int *)((byte *)pahdr + GL_Aliashdr(pahdr)->commands);
aliashdr = Mod_Extradata(entity->model);
vertbase = (trivertx_t *)((byte *)aliashdr + aliashdr->posedata);
verts1 = vertbase + entity->currentpose * aliashdr->numverts;
order = (int *)((byte *)aliashdr + GL_Aliashdr(aliashdr)->commands);
#ifdef NQ_HACK
if (r_lerpmodels.value && blend != 1.0f) {
trivertx_t *light;
trivertx_t *verts0 = vertbase + e->previouspose * pahdr->numverts;
float blend0 = 1.0f - blend;
light = (blend < 0.5f) ? verts0 : verts1;
const trivertx_t *lightvert;
const trivertx_t *verts0;
const float blend0 = 1.0f - blend;
verts0 = vertbase + entity->previouspose * aliashdr->numverts;
lightvert = (blend < 0.5f) ? verts0 : verts1;
while (1) {
// get the vertex count and primitive type
/* get the vertex count and primitive type */
count = *order++;
if (!count)
break; // done
break;
if (count < 0) {
count = -count;
glBegin(GL_TRIANGLE_FAN);
} else
} else {
glBegin(GL_TRIANGLE_STRIP);
}
do {
vec3_t glv;
while (count--) {
vec3_t glvertex;
// texture coordinates come from the draw list
/* texture coordinates come from the draw list */
glTexCoord2f(((float *)order)[0], ((float *)order)[1]);
order += 2;
// normals and vertexes come from the frame list
/* normals and vertexes come from the frame list */
if (r_fullbright.value) {
glColor3f(255.0f, 255.0f, 255.0f);
} else {
l = shadedots[light->lightnormalindex] * shadelight;
glColor3f(l, l, l);
light = shadedots[lightvert->lightnormalindex] * shadelight;
glColor3f(light, light, light);
}
glv[0] = verts0->v[0] * blend0 + verts1->v[0] * blend;
glv[1] = verts0->v[1] * blend0 + verts1->v[1] * blend;
glv[2] = verts0->v[2] * blend0 + verts1->v[2] * blend;
glVertex3f(glv[0], glv[1], glv[2]);
glvertex[0] = verts0->v[0] * blend0 + verts1->v[0] * blend;
glvertex[1] = verts0->v[1] * blend0 + verts1->v[1] * blend;
glvertex[2] = verts0->v[2] * blend0 + verts1->v[2] * blend;
glVertex3f(glvertex[0], glvertex[1], glvertex[2]);
verts0++;
verts1++;
light++;
} while (--count);
}
glEnd();
}
return;
}
#endif
while (1) {
// get the vertex count and primitive type
/* get the vertex count and primitive type */
count = *order++;
if (!count)
break; // done
break;
if (count < 0) {
count = -count;
glBegin(GL_TRIANGLE_FAN);
} else
} else {
glBegin(GL_TRIANGLE_STRIP);
}
do {
// texture coordinates come from the draw list
/* texture coordinates come from the draw list */
glTexCoord2f(((float *)order)[0], ((float *)order)[1]);
order += 2;
// normals and vertexes come from the frame list
l = shadedots[verts1->lightnormalindex] * shadelight;
glColor3f(l, l, l);
/* normals and vertexes come from the frame list */
light = shadedots[verts1->lightnormalindex] * shadelight;
glColor3f(light, light, light);
glVertex3f(verts1->v[0], verts1->v[1], verts1->v[2]);
verts1++;
} while (--count);
@ -510,11 +512,11 @@ GL_AliasDrawModel(const entity_t *e, float blend)
/*
=============
GL_DrawAliasShadow
GL_AliasDrawShadow
=============
*/
static void
GL_DrawAliasShadow(const entity_t *e, aliashdr_t *paliashdr, int posenum)
GL_AliasDrawShadow(const entity_t *entity, aliashdr_t *paliashdr, int posenum)
{
trivertx_t *verts;
int *order;
@ -522,7 +524,7 @@ GL_DrawAliasShadow(const entity_t *e, aliashdr_t *paliashdr, int posenum)
float height, lheight;
int count;
lheight = e->origin[2] - lightspot[2];
lheight = entity->origin[2] - lightspot[2];
height = -lheight + 1.0;
verts = (trivertx_t *)((byte *)paliashdr + paliashdr->posedata);
@ -576,31 +578,31 @@ R_AliasSetupSkin
===============
*/
static void
R_AliasSetupSkin(const entity_t *e, aliashdr_t *pahdr)
R_AliasSetupSkin(const entity_t *entity, aliashdr_t *aliashdr)
{
int skinnum;
int frame, numframes;
maliasskindesc_t *pskindesc;
float *intervals;
const maliasskindesc_t *skindesc;
const float *intervals;
int skinnum, numframes, frame;
GLuint *glt;
skinnum = e->skinnum;
if ((skinnum >= pahdr->numskins) || (skinnum < 0)) {
skinnum = entity->skinnum;
if ((skinnum >= aliashdr->numskins) || (skinnum < 0)) {
Con_DPrintf("%s: no such skin # %d\n", __func__, skinnum);
skinnum = 0;
}
pskindesc = ((maliasskindesc_t *)((byte *)pahdr + pahdr->skindesc));
pskindesc += skinnum;
frame = pskindesc->firstframe;
numframes = pskindesc->numframes;
skindesc = (maliasskindesc_t *)((byte *)aliashdr + aliashdr->skindesc);
skindesc += skinnum;
frame = skindesc->firstframe;
numframes = skindesc->numframes;
if (numframes > 1) {
intervals = (float *)((byte *)pahdr + pahdr->skinintervals) + frame;
frame += Mod_FindInterval(intervals, numframes, cl.time + e->syncbase);
const float frametime = cl.time + entity->syncbase;
intervals = (float *)((byte *)aliashdr + aliashdr->skinintervals);
frame += Mod_FindInterval(intervals + frame, numframes, frametime);
}
glt = (GLuint *)((byte *)pahdr + pahdr->skindata);
glt = (GLuint *)((byte *)aliashdr + aliashdr->skindata);
GL_Bind(glt[frame]);
}
@ -611,174 +613,170 @@ R_AliasSetupFrame
=================
*/
static void
R_AliasSetupFrame(entity_t *e, aliashdr_t *pahdr)
R_AliasSetupFrame(entity_t *entity, aliashdr_t *aliashdr)
{
int frame, pose, numposes;
float *intervals;
int framenum, pose, numposes;
const float *intervals;
frame = e->frame;
if ((frame >= pahdr->numframes) || (frame < 0)) {
Con_DPrintf("%s: no such frame %d\n", __func__, frame);
frame = 0;
framenum = entity->frame;
if ((framenum >= aliashdr->numframes) || (framenum < 0)) {
Con_DPrintf("%s: no such frame %d\n", __func__, framenum);
framenum = 0;
}
pose = pahdr->frames[frame].firstpose;
numposes = pahdr->frames[frame].numposes;
pose = aliashdr->frames[framenum].firstpose;
numposes = aliashdr->frames[framenum].numposes;
if (numposes > 1) {
intervals = (float *)((byte *)pahdr + pahdr->poseintervals) + pose;
pose += Mod_FindInterval(intervals, numposes, cl.time + e->syncbase);
const float frametime = cl.time + entity->syncbase;
intervals = (float *)((byte *)aliashdr + aliashdr->poseintervals);
pose += Mod_FindInterval(intervals + pose, numposes, frametime);
}
#ifdef NQ_HACK
if (r_lerpmodels.value) {
const maliasframedesc_t *currentframe, *previousframe;
float delta, time, blend;
/* A few quick sanity checks to abort lerping */
if (e->currentframetime < e->previousframetime)
if (entity->currentframetime < entity->previousframetime)
goto nolerp;
if (e->currentframetime - e->previousframetime > 1.0f)
if (entity->currentframetime - entity->previousframetime > 1.0f)
goto nolerp;
/* FIXME - hack to skip the viewent (weapon) */
if (e == &cl.viewent)
if (entity == &cl.viewent)
goto nolerp;
currentframe = &aliashdr->frames[entity->currentframe];
if (numposes > 1) {
/* FIXME - merge with Mod_FindInterval? */
int i;
float fullinterval, targettime;
fullinterval = intervals[numposes - 1];
time = cl.time + e->syncbase;
time = cl.time + entity->syncbase;
targettime = time - (int)(time / fullinterval) * fullinterval;
for (i = 0; i < numposes - 1; i++)
if (intervals[i] > targettime)
break;
e->currentpose = pahdr->frames[e->currentframe].firstpose + i;
entity->currentpose = currentframe->firstpose + i;
if (i == 0) {
e->previouspose = pahdr->frames[e->currentframe].firstpose;
e->previouspose += numposes - 1;
entity->previouspose = currentframe->firstpose + numposes - 1;
time = targettime;
delta = intervals[0];
} else {
e->previouspose = e->currentpose - 1;
entity->previouspose = entity->currentpose - 1;
time = targettime - intervals[i - 1];
delta = intervals[i] - intervals[i - 1];
}
} else {
e->currentpose = pahdr->frames[e->currentframe].firstpose;
e->previouspose = pahdr->frames[e->previousframe].firstpose;
time = cl.time - e->currentframetime;
delta = e->currentframetime - e->previousframetime;
previousframe = &aliashdr->frames[entity->previousframe];
entity->currentpose = currentframe->firstpose;
entity->previouspose = previousframe->firstpose;
time = cl.time - entity->currentframetime;
delta = entity->currentframetime - entity->previousframetime;
}
blend = qclamp(time / delta, 0.0f, 1.0f);
GL_AliasDrawModel(e, blend);
GL_AliasDrawModel(entity, blend);
return;
}
nolerp:
#endif
e->currentpose = pose;
e->previouspose = pose;
entity->currentpose = pose;
entity->previouspose = pose;
GL_AliasDrawModel(e, 1.0f);
GL_AliasDrawModel(entity, 1.0f);
}
/*
=================
R_AliasDrawModel
R_AliasCalcLerp
=================
*/
static void
R_AliasDrawModel(entity_t *e)
R_AliasCalcLerp(entity_t *entity, vec3_t origin, vec3_t angles)
{
int i;
int lnum, shadequant;
vec3_t dist;
float add;
model_t *clmodel;
vec3_t mins, maxs;
aliashdr_t *paliashdr;
float an;
vec3_t lerp_origin, lerp_angles;
#ifdef NQ_HACK
/* FIXME - hack to skip viewent (weapon) lerp */
if (entity == &cl.viewent)
goto nolerp_origin;
/* Origin LERP */
if (r_lerpmove.value) {
float delta = e->currentorigintime - e->previousorigintime;
float frac = qclamp((cl.time - e->currentorigintime) / delta, 0.0, 1.0);
float delta, frac;
vec3_t lerpvec;
/* FIXME - hack to skip the viewent (weapon) */
if (e == &cl.viewent)
goto nolerp_origin;
VectorSubtract(e->currentorigin, e->previousorigin, lerpvec);
VectorMA(e->previousorigin, frac, lerpvec, lerp_origin);
delta = entity->currentorigintime - entity->previousorigintime;
frac = qclamp((cl.time - entity->currentorigintime) / delta, 0.0, 1.0);
VectorSubtract(entity->currentorigin, entity->previousorigin, lerpvec);
VectorMA(entity->previousorigin, frac, lerpvec, origin);
} else {
nolerp_origin:
VectorCopy(e->origin, lerp_origin);
VectorCopy(entity->origin, origin);
}
/* FIXME - hack to skip the viewent (weapon) */
if (entity == &cl.viewent)
goto nolerp_angles;
/* Angles lerp */
if (r_lerpmove.value && e->previousanglestime != e->currentanglestime) {
float delta = e->currentanglestime - e->previousanglestime;
float frac = qclamp((cl.time - e->currentanglestime) / delta, 0.0, 1.0);
if (entity->previousanglestime == entity->currentanglestime)
goto nolerp_angles;
if (r_lerpmove.value) {
float delta, frac;
vec3_t lerpvec;
int i;
/* FIXME - hack to skip the viewent (weapon) */
if (e == &cl.viewent)
goto nolerp_angles;
VectorSubtract(e->currentangles, e->previousangles, lerpvec);
delta = entity->currentanglestime - entity->previousanglestime;
frac = qclamp((cl.time - entity->currentanglestime) / delta, 0.0, 1.0);
VectorSubtract(entity->currentangles, entity->previousangles, lerpvec);
for (i = 0; i < 3; i++) {
if (lerpvec[i] > 180.0f)
lerpvec[i] -= 360.0f;
else if (lerpvec[i] < -180.0f)
lerpvec[i] += 360.0f;
}
VectorMA(e->previousangles, frac, lerpvec, lerp_angles);
VectorMA(entity->previousangles, frac, lerpvec, angles);
//angles[PITCH] = -angles[PITCH];
} else {
nolerp_angles:
VectorCopy(e->angles, lerp_angles);
VectorCopy(entity->angles, angles);
}
#endif
#ifdef QW_HACK
VectorCopy(e->origin, lerp_origin);
VectorCopy(e->angles, lerp_angles);
VectorCopy(entity->origin, origin);
VectorCopy(entity->angles, angles);
#endif
}
clmodel = e->model;
static void
R_AliasCalcLight(const entity_t *entity,
const vec3_t origin, const vec3_t angles)
{
const model_t *model = entity->model;
const dlight_t *dlight;
int i, shadequant;
float angle;
VectorAdd(lerp_origin, clmodel->mins, mins);
VectorAdd(lerp_origin, clmodel->maxs, maxs);
ambientlight = shadelight = R_LightPoint(origin);
if (R_CullBox(mins, maxs))
return;
VectorCopy(lerp_origin, r_entorigin);
//
// get lighting information
//
ambientlight = shadelight = R_LightPoint(lerp_origin);
// allways give the gun some light
if (e == &cl.viewent && ambientlight < 24)
/* always give the viewmodel some light */
if (entity == &cl.viewent && ambientlight < 24)
ambientlight = shadelight = 24;
for (lnum = 0; lnum < MAX_DLIGHTS; lnum++) {
if (cl_dlights[lnum].die >= cl.time) {
VectorSubtract(lerp_origin, cl_dlights[lnum].origin, dist);
add = cl_dlights[lnum].radius - Length(dist);
dlight = cl_dlights;
for (i = 0; i < MAX_DLIGHTS; i++, dlight++) {
if (dlight->die >= cl.time) {
vec3_t lightvec;
vec_t add;
VectorSubtract(origin, dlight->origin, lightvec);
add = dlight->radius - Length(lightvec);
if (add > 0) {
ambientlight += add;
/* ZOID: models should be affected by dlights as well */
shadelight += add;
}
}
@ -792,81 +790,104 @@ R_AliasDrawModel(entity_t *e)
// ZOID: never allow players to go totally black
#ifdef NQ_HACK
if (CL_PlayerEntity(e)) {
if (CL_PlayerEntity(entity)) {
#endif
#ifdef QW_HACK
if (!strcmp(clmodel->name, "progs/player.mdl")) {
if (!strcmp(model->name, "progs/player.mdl")) {
#endif
if (ambientlight < 8)
ambientlight = shadelight = 8;
} else if (!strcmp(clmodel->name, "progs/flame.mdl")
|| !strcmp(clmodel->name, "progs/flame2.mdl")) {
} else if (!strcmp(model->name, "progs/flame.mdl")
|| !strcmp(model->name, "progs/flame2.mdl")) {
// HACK HACK HACK -- no fullbright colors, so make torches full light
ambientlight = shadelight = 256;
}
shadequant = (int)(lerp_angles[1] * (SHADEDOT_QUANT / 360.0));
shadequant = (int)(angles[1] * (SHADEDOT_QUANT / 360.0));
shadedots = r_avertexnormal_dots[shadequant & (SHADEDOT_QUANT - 1)];
shadelight /= 200.0;
an = lerp_angles[1] / 180 * M_PI;
shadevector[0] = cos(-an);
shadevector[1] = sin(-an);
angle = angles[1] / 180 * M_PI;
shadevector[0] = cos(-angle);
shadevector[1] = sin(-angle);
shadevector[2] = 1;
VectorNormalize(shadevector);
}
//
// locate the proper data
//
paliashdr = Mod_Extradata(e->model);
/*
=================
R_AliasDrawModel
=================
*/
static void
R_AliasDrawModel(entity_t *entity)
{
const model_t *model = entity->model;
vec3_t origin, angles, mins, maxs;
aliashdr_t *aliashdr;
c_alias_polys += paliashdr->numtris;
/* Calculate position and cull if out of view */
R_AliasCalcLerp(entity, origin, angles);
VectorAdd(origin, model->mins, mins);
VectorAdd(origin, model->maxs, maxs);
if (R_CullBox(mins, maxs))
return;
/* Calculate lighting at the lerp origin */
R_AliasCalcLight(entity, origin, angles);
/* locate the proper data */
aliashdr = Mod_Extradata(entity->model);
/* draw all the triangles */
c_alias_polys += aliashdr->numtris;
VectorCopy(origin, r_entorigin);
//
// draw all the triangles
//
GL_DisableMultitexture();
glPushMatrix();
R_RotateForEntity(lerp_origin, lerp_angles);
R_RotateForEntity(origin, angles);
/* double size of eyes, since they are really hard to see in gl */
#ifdef NQ_HACK
if (!strcmp(clmodel->name, "progs/eyes.mdl") && gl_doubleeyes.value) {
if (!strcmp(model->name, "progs/eyes.mdl") && gl_doubleeyes.value) {
#endif
#ifdef QW_HACK
if (!strcmp(clmodel->name, "progs/eyes.mdl")) {
if (!strcmp(model->name, "progs/eyes.mdl")) {
#endif
glTranslatef(paliashdr->scale_origin[0], paliashdr->scale_origin[1],
paliashdr->scale_origin[2] - (22 + 8));
// double size of eyes, since they are really hard to see in gl
glScalef(paliashdr->scale[0] * 2, paliashdr->scale[1] * 2,
paliashdr->scale[2] * 2);
glTranslatef(aliashdr->scale_origin[0], aliashdr->scale_origin[1],
aliashdr->scale_origin[2] - (22 + 8));
glScalef(aliashdr->scale[0] * 2, aliashdr->scale[1] * 2,
aliashdr->scale[2] * 2);
} else {
glTranslatef(paliashdr->scale_origin[0], paliashdr->scale_origin[1],
paliashdr->scale_origin[2]);
glScalef(paliashdr->scale[0], paliashdr->scale[1],
paliashdr->scale[2]);
glTranslatef(aliashdr->scale_origin[0], aliashdr->scale_origin[1],
aliashdr->scale_origin[2]);
glScalef(aliashdr->scale[0], aliashdr->scale[1],
aliashdr->scale[2]);
}
R_AliasSetupSkin(e, paliashdr);
R_AliasSetupSkin(entity, aliashdr);
// we can't dynamically colormap textures, so they are cached
// seperately for the players. Heads are just uncolored.
/*
* We can't dynamically colormap textures, so they are cached
* seperately for the players. Heads are just uncolored.
*/
#ifdef NQ_HACK
if (e->colormap != vid.colormap && !gl_nocolors.value) {
i = CL_PlayerEntity(e);
if (i)
GL_Bind(playertextures[i - 1]);
if (entity->colormap != vid.colormap && !gl_nocolors.value) {
const int playernum = CL_PlayerEntity(entity);
if (playernum)
GL_Bind(playertextures[playernum - 1]);
}
#endif
#ifdef QW_HACK
if (e->scoreboard && !gl_nocolors.value) {
i = e->scoreboard - cl.players;
if (!e->scoreboard->skin) {
Skin_Find(e->scoreboard);
R_TranslatePlayerSkin(i);
if (entity->scoreboard && !gl_nocolors.value) {
const int playernum = entity->scoreboard - cl.players;
if (!entity->scoreboard->skin) {
Skin_Find(entity->scoreboard);
R_TranslatePlayerSkin(playernum);
}
if (i >= 0 && i < MAX_CLIENTS)
GL_Bind(playertextures[i]);
if (playernum >= 0 && playernum < MAX_CLIENTS)
GL_Bind(playertextures[playernum]);
}
#endif
@ -877,7 +898,7 @@ R_AliasDrawModel(entity_t *e)
if (gl_affinemodels.value)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
R_AliasSetupFrame(e, paliashdr);
R_AliasSetupFrame(entity, aliashdr);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@ -889,11 +910,11 @@ R_AliasDrawModel(entity_t *e)
if (r_shadows.value) {
glPushMatrix();
R_RotateForEntity(lerp_origin, lerp_angles);
R_RotateForEntity(origin, angles);
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glColor4f(0, 0, 0, 0.5);
GL_DrawAliasShadow(e, paliashdr, lastposenum);
GL_AliasDrawShadow(entity, aliashdr, lastposenum);
glEnable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glColor4f(1, 1, 1, 1);

View File

@ -156,6 +156,10 @@ keyname_t keynames[] = {
{"PAUSE", K_PAUSE},
{"SHIFT", K_SHIFT},
{"CTRL", K_CTRL},
{"ALT", K_ALT},
{"MWHEELUP", K_MWHEELUP},
{"MWHEELDOWN", K_MWHEELDOWN},

View File

@ -378,7 +378,15 @@ Mod_FindName(const char *name)
model = brushmodel ? &brushmodel->model : NULL;
#ifndef SERVERONLY
/* Otherwise, search the alias cache */
/* Search the sprite and alias lists */
if (!model) {
model = loaded_sprites;
while (model) {
if (!strcmp(model->name, name))
break;
model = model->next;
}
}
if (!model)
model = Mod_FindAliasName(name);
#endif

View File

@ -134,7 +134,7 @@ LIGHT SAMPLING
*/
int
RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
RecursiveLightPoint(const mnode_t *node, const vec3_t start, const vec3_t end)
{
int r;
float front, back, frac;
@ -242,7 +242,7 @@ RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
* a func_plat or similar...
*/
int
R_LightPoint(vec3_t p)
R_LightPoint(const vec3_t point)
{
vec3_t end;
int r;
@ -250,11 +250,11 @@ R_LightPoint(vec3_t p)
if (!cl.worldmodel->lightdata)
return 255;
end[0] = p[0];
end[1] = p[1];
end[2] = p[2] - (8192 + 2); /* Max distance + error margin */
end[0] = point[0];
end[1] = point[1];
end[2] = point[2] - (8192 + 2); /* Max distance + error margin */
r = RecursiveLightPoint(cl.worldmodel->nodes, p, end);
r = RecursiveLightPoint(cl.worldmodel->nodes, point, end);
if (r == -1)
r = 0;

View File

@ -1372,6 +1372,8 @@ SCR_UpdateScreen(void)
if (scr_drawdialog) {
Sbar_Draw();
if (con_forcedup)
Draw_ConsoleBackground(vid.height);
Draw_FadeScreen();
SCR_DrawNotifyString();
scr_copyeverything = true;

View File

@ -269,7 +269,7 @@ const model_loader_t *R_ModelLoader(void);
void R_MarkLights(dlight_t *light, int bit, mnode_t *node);
void R_AnimateLight(void);
void R_RenderDlights(void);
int R_LightPoint(vec3_t p);
int R_LightPoint(const vec3_t point);
//
// gl_refrag.c

View File

@ -204,8 +204,6 @@ typedef enum {
K_MOUSE3,
K_MOUSE4,
K_MOUSE5,
#define K_MWHEELUP K_MOUSE4
#define K_MWHEELDOWN K_MOUSE5
K_MOUSE6,
K_MOUSE7,
K_MOUSE8,
@ -257,6 +255,15 @@ typedef enum {
K_LAST
} knum_t;
/* Backward compatibility */
#define K_SHIFT K_LSHIFT
#define K_CTRL K_LCTRL
#define K_ALT K_LALT
#define K_MWHEELUP K_MOUSE4
#define K_MWHEELDOWN K_MOUSE5
typedef enum {
key_game,
key_console,

View File

@ -259,7 +259,7 @@ void R_PrintAliasStats(void);
void R_PrintTimes(void);
void R_PrintDSpeeds(void);
void R_AnimateLight(void);
int R_LightPoint(vec3_t p);
int R_LightPoint(const vec3_t point);
void R_SetupFrame(void);
void R_cshift_f(void);
void R_EmitEdge(mvertex_t *pv0, mvertex_t *pv1);