mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
gl: use local currentmodel
This commit is contained in:
parent
2c942d83f1
commit
2d1a090feb
6 changed files with 37 additions and 41 deletions
|
@ -137,7 +137,7 @@ LM_AllocBlock(int w, int h, int *x, int *y)
|
|||
}
|
||||
|
||||
void
|
||||
LM_BuildPolygonFromSurface(msurface_t *fa)
|
||||
LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa)
|
||||
{
|
||||
int i, lindex, lnumverts;
|
||||
medge_t *pedges, *r_pedge;
|
||||
|
|
|
@ -40,7 +40,6 @@ image_t *r_notexture; /* use for bad textures */
|
|||
image_t *r_particletexture; /* little dot for particles */
|
||||
|
||||
entity_t *currententity;
|
||||
model_t *currentmodel;
|
||||
|
||||
cplane_t frustum[4];
|
||||
|
||||
|
@ -176,7 +175,7 @@ R_RotateForEntity(entity_t *e)
|
|||
}
|
||||
|
||||
void
|
||||
R_DrawSpriteModel(entity_t *e)
|
||||
R_DrawSpriteModel(entity_t *e, const model_t *currentmodel)
|
||||
{
|
||||
float alpha = 1.0F;
|
||||
vec3_t point[4];
|
||||
|
@ -343,7 +342,7 @@ R_DrawEntitiesOnList(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
currentmodel = currententity->model;
|
||||
const model_t *currentmodel = currententity->model;
|
||||
|
||||
if (!currentmodel)
|
||||
{
|
||||
|
@ -354,13 +353,13 @@ R_DrawEntitiesOnList(void)
|
|||
switch (currentmodel->type)
|
||||
{
|
||||
case mod_alias:
|
||||
R_DrawAliasModel(currententity);
|
||||
R_DrawAliasModel(currententity, currentmodel);
|
||||
break;
|
||||
case mod_brush:
|
||||
R_DrawBrushModel(currententity);
|
||||
R_DrawBrushModel(currententity, currentmodel);
|
||||
break;
|
||||
case mod_sprite:
|
||||
R_DrawSpriteModel(currententity);
|
||||
R_DrawSpriteModel(currententity, currentmodel);
|
||||
break;
|
||||
default:
|
||||
ri.Sys_Error(ERR_DROP, "Bad modeltype");
|
||||
|
@ -389,7 +388,7 @@ R_DrawEntitiesOnList(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
currentmodel = currententity->model;
|
||||
const model_t *currentmodel = currententity->model;
|
||||
|
||||
if (!currentmodel)
|
||||
{
|
||||
|
@ -400,13 +399,13 @@ R_DrawEntitiesOnList(void)
|
|||
switch (currentmodel->type)
|
||||
{
|
||||
case mod_alias:
|
||||
R_DrawAliasModel(currententity);
|
||||
R_DrawAliasModel(currententity, currentmodel);
|
||||
break;
|
||||
case mod_brush:
|
||||
R_DrawBrushModel(currententity);
|
||||
R_DrawBrushModel(currententity, currentmodel);
|
||||
break;
|
||||
case mod_sprite:
|
||||
R_DrawSpriteModel(currententity);
|
||||
R_DrawSpriteModel(currententity, currentmodel);
|
||||
break;
|
||||
default:
|
||||
ri.Sys_Error(ERR_DROP, "Bad modeltype");
|
||||
|
|
|
@ -330,7 +330,7 @@ R_DrawAliasShadow(dmdl_t *paliashdr, int posenum)
|
|||
}
|
||||
|
||||
static qboolean
|
||||
R_CullAliasModel(vec3_t bbox[8], entity_t *e)
|
||||
R_CullAliasModel(const model_t *currentmodel, vec3_t bbox[8], entity_t *e)
|
||||
{
|
||||
int i;
|
||||
vec3_t mins, maxs;
|
||||
|
@ -482,7 +482,7 @@ R_CullAliasModel(vec3_t bbox[8], entity_t *e)
|
|||
}
|
||||
|
||||
void
|
||||
R_DrawAliasModel(entity_t *e)
|
||||
R_DrawAliasModel(entity_t *e, const model_t *currentmodel)
|
||||
{
|
||||
int i;
|
||||
dmdl_t *paliashdr;
|
||||
|
@ -492,7 +492,7 @@ R_DrawAliasModel(entity_t *e)
|
|||
|
||||
if (!(e->flags & RF_WEAPONMODEL))
|
||||
{
|
||||
if (R_CullAliasModel(bbox, e))
|
||||
if (R_CullAliasModel(currentmodel, bbox, e))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ int registration_sequence;
|
|||
void LoadSP2(model_t *mod, void *buffer, int modfilelen);
|
||||
static void Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen);
|
||||
void LoadMD2(model_t *mod, void *buffer, int modfilelen);
|
||||
void LM_BuildPolygonFromSurface(msurface_t *fa);
|
||||
void LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa);
|
||||
void LM_CreateSurfaceLightmap(msurface_t *surf);
|
||||
void LM_EndBuildingLightmaps(void);
|
||||
void LM_BeginBuildingLightmaps(model_t *m);
|
||||
|
@ -611,8 +611,6 @@ Mod_LoadFaces(model_t *loadmodel, byte *mod_base, lump_t *l)
|
|||
loadmodel->surfaces = out;
|
||||
loadmodel->numsurfaces = count;
|
||||
|
||||
currentmodel = loadmodel;
|
||||
|
||||
LM_BeginBuildingLightmaps(loadmodel);
|
||||
|
||||
for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
|
||||
|
@ -691,7 +689,7 @@ Mod_LoadFaces(model_t *loadmodel, byte *mod_base, lump_t *l)
|
|||
|
||||
if (!(out->texinfo->flags & SURF_WARP))
|
||||
{
|
||||
LM_BuildPolygonFromSurface(out);
|
||||
LM_BuildPolygonFromSurface(loadmodel, out);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ void R_BuildLightMap(msurface_t *surf, byte *dest, int stride);
|
|||
/*
|
||||
* Returns the proper texture for a given time and base texture
|
||||
*/
|
||||
image_t *
|
||||
static image_t *
|
||||
R_TextureAnimation(mtexinfo_t *tex)
|
||||
{
|
||||
int c;
|
||||
|
@ -66,7 +66,7 @@ R_TextureAnimation(mtexinfo_t *tex)
|
|||
return tex->image;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawGLPoly(glpoly_t *p)
|
||||
{
|
||||
float *v;
|
||||
|
@ -84,7 +84,7 @@ R_DrawGLPoly(glpoly_t *p)
|
|||
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawGLFlowingPoly(msurface_t *fa)
|
||||
{
|
||||
int i;
|
||||
|
@ -124,7 +124,7 @@ R_DrawGLFlowingPoly(msurface_t *fa)
|
|||
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawTriangleOutlines(void)
|
||||
{
|
||||
int i, j;
|
||||
|
@ -179,7 +179,7 @@ R_DrawTriangleOutlines(void)
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawGLPolyChain(glpoly_t *p, float soffset, float toffset)
|
||||
{
|
||||
if ((soffset == 0) && (toffset == 0))
|
||||
|
@ -238,8 +238,8 @@ R_DrawGLPolyChain(glpoly_t *p, float soffset, float toffset)
|
|||
* This routine takes all the given light mapped surfaces
|
||||
* in the world and blends them into the framebuffer.
|
||||
*/
|
||||
void
|
||||
R_BlendLightmaps(void)
|
||||
static void
|
||||
R_BlendLightmaps(const model_t *currentmodel)
|
||||
{
|
||||
int i;
|
||||
msurface_t *surf, *newdrawsurf = 0;
|
||||
|
@ -420,7 +420,7 @@ R_BlendLightmaps(void)
|
|||
glDepthMask(1);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_RenderBrushPoly(msurface_t *fa)
|
||||
{
|
||||
int maps;
|
||||
|
@ -604,7 +604,7 @@ R_DrawAlphaSurfaces(void)
|
|||
r_alpha_surfaces = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawTextureChains(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -640,8 +640,8 @@ R_DrawTextureChains(void)
|
|||
R_TexEnv(GL_REPLACE);
|
||||
}
|
||||
|
||||
void
|
||||
R_DrawInlineBModel(void)
|
||||
static void
|
||||
R_DrawInlineBModel(const model_t *currentmodel)
|
||||
{
|
||||
int i, k;
|
||||
cplane_t *pplane;
|
||||
|
@ -697,7 +697,7 @@ R_DrawInlineBModel(void)
|
|||
if (!(currententity->flags & RF_TRANSLUCENT))
|
||||
{
|
||||
|
||||
R_BlendLightmaps();
|
||||
R_BlendLightmaps(currentmodel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -708,7 +708,7 @@ R_DrawInlineBModel(void)
|
|||
}
|
||||
|
||||
void
|
||||
R_DrawBrushModel(entity_t *e)
|
||||
R_DrawBrushModel(entity_t *e, const model_t *currentmodel)
|
||||
{
|
||||
vec3_t mins, maxs;
|
||||
int i;
|
||||
|
@ -784,7 +784,7 @@ R_DrawBrushModel(entity_t *e)
|
|||
R_TexEnv(GL_MODULATE);
|
||||
}
|
||||
|
||||
R_DrawInlineBModel();
|
||||
R_DrawInlineBModel(currentmodel);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
|
@ -794,7 +794,7 @@ R_DrawBrushModel(entity_t *e)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_RecursiveWorldNode(mnode_t *node)
|
||||
{
|
||||
int c, side, sidebit;
|
||||
|
@ -927,6 +927,7 @@ void
|
|||
R_DrawWorld(void)
|
||||
{
|
||||
entity_t ent;
|
||||
const model_t *currentmodel;
|
||||
|
||||
if (!r_drawworld->value)
|
||||
{
|
||||
|
@ -955,7 +956,7 @@ R_DrawWorld(void)
|
|||
R_ClearSkyBox();
|
||||
R_RecursiveWorldNode(r_worldmodel->nodes);
|
||||
R_DrawTextureChains();
|
||||
R_BlendLightmaps();
|
||||
R_BlendLightmaps(currentmodel);
|
||||
R_DrawSkyBox();
|
||||
R_DrawTriangleOutlines();
|
||||
|
||||
|
|
|
@ -146,7 +146,6 @@ extern int numgltextures;
|
|||
extern image_t *r_notexture;
|
||||
extern image_t *r_particletexture;
|
||||
extern entity_t *currententity;
|
||||
extern model_t *currentmodel;
|
||||
extern int r_visframecount;
|
||||
extern int r_framecount;
|
||||
extern cplane_t frustum[4];
|
||||
|
@ -255,14 +254,13 @@ void V_AddBlend(float r, float g, float b, float a, float *v_blend);
|
|||
|
||||
void R_RenderView(refdef_t *fd);
|
||||
void R_ScreenShot(void);
|
||||
void R_DrawAliasModel(entity_t *e);
|
||||
void R_DrawBrushModel(entity_t *e);
|
||||
void R_DrawSpriteModel(entity_t *e);
|
||||
void R_DrawAliasModel(entity_t *e, const model_t *currentmodel);
|
||||
void R_DrawBrushModel(entity_t *e, const model_t *currentmodel);
|
||||
void R_DrawSpriteModel(entity_t *e, const model_t *currentmodel);
|
||||
void R_DrawBeam(entity_t *e);
|
||||
void R_DrawWorld(void);
|
||||
void R_RenderDlights(void);
|
||||
void R_DrawAlphaSurfaces(void);
|
||||
void R_RenderBrushPoly(msurface_t *fa);
|
||||
void R_InitParticleTexture(void);
|
||||
void Draw_InitLocal(void);
|
||||
void R_SubdivideSurface(model_t *loadmodel, msurface_t *fa);
|
||||
|
|
Loading…
Reference in a new issue