Skip to content

Commit

Permalink
Fixed HUD sprite texcoords
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 27, 2003
1 parent 2604326 commit 225db86
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions doomsday/Src/gl_tex.c
Expand Up @@ -2350,7 +2350,8 @@ unsigned int GL_PrepareSpriteBuffer
gl.TexParameter(DGL_WRAP_T, DGL_CLAMP);

// Determine coordinates for the texture.
GL_SetTexCoords(spritelumps[pnum].tc, image->width, image->height);
GL_SetTexCoords(spritelumps[pnum].tc[isPsprite], image->width,
image->height);

return texture;
}
Expand Down Expand Up @@ -2418,7 +2419,6 @@ unsigned int GL_PrepareSprite(int pnum, int spriteMode)
{
DGLuint *texture;
int lumpNum;
short *width, *height;
spritelump_t *slump;

if(pnum < 0) return 0;
Expand All @@ -2430,9 +2430,7 @@ unsigned int GL_PrepareSprite(int pnum, int spriteMode)
// This way a sprite can be used both in the game and the HUD, and
// the textures can be different. (Very few sprites are used both
// in the game and the HUD.)
texture = (spriteMode == 0? &slump->tex : &slump->hudtex);
width = (spriteMode == 0? &slump->width : &slump->hudwidth);
height = (spriteMode == 0? &slump->height : &slump->hudheight);
texture = (spriteMode == 0? &slump->tex : &slump->hudtex);

if(!*texture)
{
Expand Down Expand Up @@ -2469,17 +2467,8 @@ unsigned int GL_PrepareSprite(int pnum, int spriteMode)
}

*texture = GL_PrepareSpriteBuffer(pnum, &image, spriteMode == 1);
*width = image.width;
*height = image.height;

GL_DestroyImage(&image);
}

// HACK: Since we are dealing with both normal sprites and HUD
// sprites, let's update the texture coords to match the dimensions
// in use.
slump->tex = *texture;
GL_SetTexCoords(slump->tc, *width, *height);

return *texture;
}
Expand Down

0 comments on commit 225db86

Please sign in to comment.