From c759076f09375f8dc2165935f1d2fdeede522f25 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 27 Aug 2002 09:49:54 +0000 Subject: [PATCH] got rid of lots of unnecessary m.transparent = lines, as well as some depthdisable =, and depthwrite = git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2291 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_particles.c | 1 - gl_models.c | 12 ------------ gl_rsurf.c | 33 --------------------------------- r_crosshairs.c | 1 - r_explosion.c | 1 - r_light.c | 1 - r_sky.c | 2 -- r_sprites.c | 2 -- 8 files changed, 53 deletions(-) diff --git a/cl_particles.c b/cl_particles.c index 2c9f2147..be86db56 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -1266,7 +1266,6 @@ void R_DrawParticleCallback(void *calldata1, int calldata2) } memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; if (additive) m.blendfunc2 = GL_ONE; diff --git a/gl_models.c b/gl_models.c index acfd701b..bf87df5a 100644 --- a/gl_models.c +++ b/gl_models.c @@ -276,19 +276,16 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) memset(&m, 0, sizeof(m)); if (ent->effects & EF_ADDITIVE) { - m.transparent = true; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; } else if (ent->alpha != 1.0 || skinframe->fog != NULL) { - m.transparent = true; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; } else { - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; } @@ -336,19 +333,16 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) memset(&m, 0, sizeof(m)); if (ent->effects & EF_ADDITIVE) { - m.transparent = true; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; } else if (ent->alpha != 1.0 || skinframe->fog != NULL) { - m.transparent = true; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; } else { - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; } @@ -370,7 +364,6 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) if (skinframe->pants) { memset(&m, 0, sizeof(m)); - m.transparent = ent->effects & EF_ADDITIVE || ent->alpha != 1.0 || skinframe->fog != NULL; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.numtriangles = model->numtris; @@ -392,7 +385,6 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) if (skinframe->shirt) { memset(&m, 0, sizeof(m)); - m.transparent = ent->effects & EF_ADDITIVE || ent->alpha != 1.0 || skinframe->fog != NULL; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.numtriangles = model->numtris; @@ -415,7 +407,6 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) if (skinframe->glow) { memset(&m, 0, sizeof(m)); - m.transparent = ent->effects & EF_ADDITIVE || ent->alpha != 1.0 || skinframe->fog != NULL; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.numtriangles = model->numtris; @@ -434,7 +425,6 @@ void R_DrawQ1Q2AliasModelCallback (void *calldata1, int calldata2) if (fog) { memset(&m, 0, sizeof(m)); - m.transparent = ent->effects & EF_ADDITIVE || ent->alpha != 1.0 || skinframe->fog != NULL; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.numtriangles = model->numtris; @@ -760,7 +750,6 @@ void R_DrawZymoticModelMeshCallback (void *calldata1, int calldata2) memset(&mbuf, 0, sizeof(mbuf)); mbuf.numverts = m->numverts; mbuf.numtriangles = renderlist[0]; - mbuf.transparent = false; if (ent->effects & EF_ADDITIVE) { mbuf.blendfunc1 = GL_SRC_ALPHA; @@ -793,7 +782,6 @@ void R_DrawZymoticModelMeshCallback (void *calldata1, int calldata2) memset(&mbuf, 0, sizeof(mbuf)); mbuf.numverts = m->numverts; mbuf.numtriangles = renderlist[0]; - mbuf.transparent = false; mbuf.blendfunc1 = GL_SRC_ALPHA; mbuf.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; // FIXME: need alpha mask for fogging... diff --git a/gl_rsurf.c b/gl_rsurf.c index c0dbab46..10002fff 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -641,7 +641,6 @@ static void RSurfShader_Sky(entity_render_t *ent, msurface_t *firstsurf) { // draw depth-only polys memset(&m, 0, sizeof(m)); - m.transparent = false; if (skyrendermasked) { m.blendfunc1 = GL_ZERO; @@ -652,7 +651,6 @@ static void RSurfShader_Sky(entity_render_t *ent, msurface_t *firstsurf) { m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; - m.depthwrite = false; } for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -757,12 +755,9 @@ static void RSurfShader_Water_Pass_Base(entity_render_t *ent, msurface_t *surf) } else { - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; } - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); if (surf->flags & SURF_DRAWFULLBRIGHT || ent->effects & EF_FULLBRIGHT) { @@ -871,8 +866,6 @@ static void RSurfShader_Water_Pass_Fog(entity_render_t *ent, msurface_t *surf) m.transparent = ent->effects & EF_ADDITIVE || surf->currenttexture->fogtexture != NULL || alpha < 1; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->fogtexture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -938,12 +931,9 @@ static void RSurfShader_Wall_Pass_BaseVertex(entity_render_t *ent, msurface_t *s } else { - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; } - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); size3 = ((surf->extents[0]>>4)+1)*((surf->extents[1]>>4)+1)*3; @@ -1052,12 +1042,9 @@ static void RSurfShader_Wall_Pass_BaseFullbright(entity_render_t *ent, msurface_ } else { - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; } - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); ca = ent->alpha; for (mesh = surf->mesh;mesh;mesh = mesh->chain) @@ -1176,11 +1163,8 @@ static void RSurfShader_OpaqueWall_Pass_TripleTexCombine(entity_render_t *ent, m surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); m.texrgbscale[0] = 1.0f; m.tex[1] = R_GetTexture(surf->lightmaptexture); @@ -1222,11 +1206,8 @@ static void RSurfShader_OpaqueWall_Pass_BaseMTex(entity_render_t *ent, msurface_ surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); m.tex[1] = R_GetTexture(surf->lightmaptexture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) @@ -1262,11 +1243,8 @@ static void RSurfShader_OpaqueWall_Pass_BaseTexture(entity_render_t *ent, msurfa surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -1299,11 +1277,8 @@ static void RSurfShader_OpaqueWall_Pass_BaseLightmap(entity_render_t *ent, msurf surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ZERO; m.blendfunc2 = GL_SRC_COLOR; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->lightmaptexture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -1342,11 +1317,8 @@ static void RSurfShader_OpaqueWall_Pass_Light(entity_render_t *ent, msurface_t * return; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->texture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -1386,7 +1358,6 @@ static void RSurfShader_OpaqueWall_Pass_Fog(entity_render_t *ent, msurface_t *su surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; for (mesh = surf->mesh;mesh;mesh = mesh->chain) @@ -1420,11 +1391,8 @@ static void RSurfShader_OpaqueWall_Pass_BaseDetail(entity_render_t *ent, msurfac surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_DST_COLOR; m.blendfunc2 = GL_SRC_COLOR; - m.depthwrite = false; - m.depthdisable = false; m.tex[0] = R_GetTexture(surf->currenttexture->detailtexture); for (mesh = surf->mesh;mesh;mesh = mesh->chain) { @@ -1455,7 +1423,6 @@ static void RSurfShader_OpaqueWall_Pass_Glow(entity_render_t *ent, msurface_t *s surfmesh_t *mesh; rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.tex[0] = R_GetTexture(surf->currenttexture->glowtexture); diff --git a/r_crosshairs.c b/r_crosshairs.c index a4466ce3..4a765927 100644 --- a/r_crosshairs.c +++ b/r_crosshairs.c @@ -166,7 +166,6 @@ void R_DrawCrosshairSprite(rtexture_t *texture, vec3_t origin, vec_t scale, floa } memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.depthdisable = true; diff --git a/r_explosion.c b/r_explosion.c index da305b98..5cd7fb9a 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -182,7 +182,6 @@ void R_DrawExplosionCallback(void *calldata1, int calldata2) e = calldata1; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE; m.numtriangles = EXPLOSIONTRIS; diff --git a/r_light.c b/r_light.c index f801562f..13895c3e 100644 --- a/r_light.c +++ b/r_light.c @@ -138,7 +138,6 @@ void R_DrawCoronas(void) float scale, viewdist, diff[3], dist; rdlight_t *rd; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ONE; m.depthdisable = true; // magic diff --git a/r_sky.c b/r_sky.c index 7e211355..d7f95cff 100644 --- a/r_sky.c +++ b/r_sky.c @@ -164,7 +164,6 @@ static void R_SkyBox(void) m.texcoords[0][i * 2 + 1] = (t) * (254.0f/256.0f) + (1.0f/256.0f); memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; m.depthdisable = true; // don't modify or read zbuffer @@ -340,7 +339,6 @@ static void R_SkySphere(void) speedscale2 -= (int)speedscale2; memset(&m, 0, sizeof(m)); - m.transparent = false; m.blendfunc1 = GL_ONE; m.blendfunc2 = GL_ZERO; m.depthdisable = true; // don't modify or read zbuffer diff --git a/r_sprites.c b/r_sprites.c index 40abceff..8277f211 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -82,8 +82,6 @@ static void R_DrawSpriteImage (int wantoverbright, int additive, mspriteframe_t { rmeshbufferinfo_t m; memset(&m, 0, sizeof(m)); - // the mesh was sorted already, so don't transparent sort - m.transparent = false; m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; if (additive) -- 2.39.2