1
0
Fork 0
forked from fte/fteqw

that's mirrors working properly then.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@184 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-09-08 17:58:00 +00:00
parent 1472d7ee24
commit c680b957a2
2 changed files with 9 additions and 1 deletions

View file

@ -67,6 +67,7 @@ int playertextures; // up to 16 color translated skins
int mirrortexturenum; // quake texturenum, not gltexturenum int mirrortexturenum; // quake texturenum, not gltexturenum
qboolean mirror; qboolean mirror;
mplane_t *mirror_plane; mplane_t *mirror_plane;
msurface_t *r_mirror_chain;
void R_DrawAliasModel (entity_t *e); void R_DrawAliasModel (entity_t *e);
@ -1381,6 +1382,8 @@ void R_MirrorAddPlayerModels (void)
VectorCopy (exact.origin, ent->origin); VectorCopy (exact.origin, ent->origin);
} }
VectorCopy(cl.simorg[0], ent->origin);
if (state->effects & EF_FLAG1) if (state->effects & EF_FLAG1)
CL_AddFlagModels (ent, 0); CL_AddFlagModels (ent, 0);
else if (state->effects & EF_FLAG2) else if (state->effects & EF_FLAG2)
@ -1428,6 +1431,8 @@ void R_Mirror (void)
r_refdef.vieworg[2] = 64; r_refdef.vieworg[2] = 64;
*/ */
AngleVectors (r_refdef.viewangles, vpn, vright, vup);
gldepthmin = 0.5; gldepthmin = 0.5;
gldepthmax = 1; gldepthmax = 1;
@ -1461,8 +1466,9 @@ void R_Mirror (void)
// blend on top // blend on top
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f (1,1,1,r_mirroralpha.value); glColor4f (1,1,1,r_mirroralpha.value);
s = cl.worldmodel->textures[mirrortexturenum]->texturechain; s = r_mirror_chain;
for ( ; s ; s=s->texturechain) for ( ; s ; s=s->texturechain)
R_RenderBrushPoly (s); R_RenderBrushPoly (s);
cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL; cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL;

View file

@ -53,6 +53,7 @@ lightmapinfo_t **lightmap;
int numlightmaps; int numlightmaps;
msurface_t *r_alpha_surfaces = NULL; msurface_t *r_alpha_surfaces = NULL;
extern msurface_t *r_mirror_chain;
mleaf_t *r_vischain; // linked list of visible leafs mleaf_t *r_vischain; // linked list of visible leafs
@ -1698,6 +1699,7 @@ void R_MirrorChain (msurface_t *s)
{ {
if (mirror) if (mirror)
return; return;
r_mirror_chain = s;
mirror = true; mirror = true;
mirror_plane = s->plane; mirror_plane = s->plane;
} }