Skip to content

Commit

Permalink
Fixed|InFine: None-opaque backgrounds not drawn
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jun 28, 2012
1 parent ecc4247 commit 381871b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/gl_draw.c
Expand Up @@ -171,7 +171,7 @@ void GL_DrawRectf2TextureColor(double x, double y, double width, double height,
int texW, int texH, const float topColor[3], float topAlpha,
const float bottomColor[3], float bottomAlpha)
{
if(!(topAlpha > 0 || bottomAlpha > 0)) return;
if(topAlpha <= 0 && bottomAlpha <= 0) return;

LIBDENG_ASSERT_IN_MAIN_THREAD();
LIBDENG_ASSERT_GL_CONTEXT_ACTIVE();
Expand Down
14 changes: 8 additions & 6 deletions doomsday/engine/portable/src/ui2_main.c
Expand Up @@ -542,6 +542,14 @@ static void drawPageBackground(fi_page_t* p, float x, float y, float width, floa
vec3f_t topColor, bottomColor;
float topAlpha, bottomAlpha;

V3f_Set(topColor, p->_bg.topColor [0].value * light, p->_bg.topColor [1].value * light, p->_bg.topColor [2].value * light);
topAlpha = p->_bg.topColor[3].value * alpha;

V3f_Set(bottomColor, p->_bg.bottomColor[0].value * light, p->_bg.bottomColor[1].value * light, p->_bg.bottomColor[2].value * light);
bottomAlpha = p->_bg.bottomColor[3].value * alpha;

if(topAlpha <= 0 && bottomAlpha <= 0) return;

if(p->_bg.material)
{
const materialvariantspecification_t* spec = Materials_VariantSpecificationForContext(
Expand All @@ -552,12 +560,6 @@ static void drawPageBackground(fi_page_t* p, float x, float y, float width, floa
glEnable(GL_TEXTURE_2D);
}

V3f_Set(topColor, p->_bg.topColor [0].value * light, p->_bg.topColor [1].value * light, p->_bg.topColor [2].value * light);
topAlpha = p->_bg.topColor[3].value * alpha;

V3f_Set(bottomColor, p->_bg.bottomColor[0].value * light, p->_bg.bottomColor[1].value * light, p->_bg.bottomColor[2].value * light);
bottomAlpha = p->_bg.bottomColor[3].value * alpha;

if(p->_bg.material || topAlpha < 1.0 || bottomAlpha < 1.0)
{
GL_BlendMode(BM_NORMAL);
Expand Down

0 comments on commit 381871b

Please sign in to comment.