diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 3683bce3..25a24f86 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -859,7 +859,8 @@ void gmenu::renderbg(int x1, int y1, int x2, int y2, bool border) { static Texture *tex = NULL; if(!tex) tex = textureload("packages/textures/makke/menu.jpg"); - blendbox(x1, y1, x2, y2, border, tex->id); + static color transparent(1, 1, 1, 0.75f); + blendbox(x1, y1, x2, y2, border, tex->id, allowinput ? NULL : &transparent); } // apply changes menu diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index d1292dfa..bb7bd2da 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -265,13 +265,19 @@ void dot(int x, int y, float z) void blendbox(int x1, int y1, int x2, int y2, bool border, int tex, color *c) { glDepthMask(GL_FALSE); - glDisable(GL_TEXTURE_2D); if(tex>=0) { glBindTexture(GL_TEXTURE_2D, tex); - glEnable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - glColor3f(1, 1, 1); + if(c) + { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(c->r, c->g, c->b, c->alpha); + } + else + { + glDisable(GL_BLEND); + glColor3f(1, 1, 1); + } int texw = 512; int texh = texw; @@ -307,9 +313,13 @@ void blendbox(int x1, int y1, int x2, int y2, bool border, int tex, color *c) glEnd(); } } + + if(!c) glEnable(GL_BLEND); } else { + glDisable(GL_TEXTURE_2D); + if(c) { glBlendFunc(GL_SRC_ALPHA, GL_ONE); @@ -346,7 +356,7 @@ void blendbox(int x1, int y1, int x2, int y2, bool border, int tex, color *c) glEnable(GL_BLEND); } - glEnable(GL_TEXTURE_2D); + if(tex<0 || border) glEnable(GL_TEXTURE_2D); glDepthMask(GL_TRUE); }