Skip to content

Commit

Permalink
Added gltexture_t->texmasked, use that when setting the rendpoly text…
Browse files Browse the repository at this point in the history
…ure's mask status instead of relying on the global var texmask to be in sync with curtex.
  • Loading branch information
danij committed Mar 2, 2007
1 parent be3dfed commit af64a04
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions doomsday/engine/portable/include/r_data.h
Expand Up @@ -103,6 +103,7 @@ typedef struct detailinfo_s {
typedef struct gltexture_s {
DGLuint id;
float width, height;
boolean masked;
detailinfo_t *detail;
} gltexture_t;

Expand Down
5 changes: 5 additions & 0 deletions doomsday/engine/portable/src/r_data.c
Expand Up @@ -246,6 +246,11 @@ rendpoly_t *R_AllocRendPoly(rendpolytype_t type, boolean isWall,
poly->decorlightmap = 0;
poly->sector = 0;
poly->blendmode = BM_NORMAL;
poly->tex.id = curtex = GL_PrepareDDTexture(DDT_UNKNOWN);
poly->tex.detail = texdetail;
poly->tex.height = texh;
poly->tex.width = texw;
poly->tex.masked = texmask;

return poly;
}
Expand Down
1 change: 1 addition & 0 deletions doomsday/engine/portable/src/rend_fakeradio.c
Expand Up @@ -751,6 +751,7 @@ void Rend_RadioWallSection(const seg_t *seg, rendpoly_t *origQuad)
quad->tex.detail = NULL;
quad->tex.width = seg->linedef->length;
quad->tex.height = shadowSize;
quad->tex.masked = false;
quad->lights = NULL;
quad->intertex.id = 0;
quad->intertex.detail = NULL;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/rend_list.c
Expand Up @@ -281,7 +281,7 @@ static void RL_AddMaskedPoly(rendpoly_t *poly)
vis->type = VSPR_MASKED_WALL;
vis->distance = (poly->vertices[0].dist + poly->vertices[1].dist) / 2;
vis->data.wall.texture = poly->tex.id;
vis->data.wall.masked = texmask; // Store texmask status in flip.
vis->data.wall.masked = poly->tex.masked; // Store texmask status in flip.
for(i = 0; i < 4; ++i)
{
vis->data.wall.vertices[i].pos[VX] = poly->vertices[i].pos[VX];
Expand Down
4 changes: 4 additions & 0 deletions doomsday/engine/portable/src/rend_main.c
Expand Up @@ -447,7 +447,9 @@ static void Rend_AddShinyPoly(rendpoly_t *poly, ded_reflection_t *ref,
poly->blendmode = ref->blend_mode;
poly->tex.id = ref->use_shiny->shiny_tex;
poly->tex.detail = NULL;
poly->tex.masked = false;
poly->intertex.detail = NULL;
poly->intertex.masked = false;
poly->interpos = 0;

// Strength of the shine.
Expand Down Expand Up @@ -500,6 +502,7 @@ static void Rend_PolyTexBlend(surface_t *surface, rendpoly_t *poly,
poly->intertex.width = texw;
poly->intertex.height = texh;
poly->intertex.detail = texdetail;
poly->intertex.masked = texmask;
poly->interpos = xlat->inter;
}

Expand Down Expand Up @@ -669,6 +672,7 @@ static int Rend_PrepareTextureForPoly(rendpoly_t *poly, surface_t *surface)
poly->tex.width = texw;
poly->tex.height = texh;
poly->tex.detail = texdetail;
poly->tex.masked = texmask;

// Return the parameters for this surface.
return flags;
Expand Down

0 comments on commit af64a04

Please sign in to comment.