summaryrefslogtreecommitdiffstats
path: root/minuitwrp/graphics.c
diff options
context:
space:
mode:
Diffstat (limited to 'minuitwrp/graphics.c')
-rw-r--r--minuitwrp/graphics.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c
index fc34b6b19..99f584183 100644
--- a/minuitwrp/graphics.c
+++ b/minuitwrp/graphics.c
@@ -69,6 +69,7 @@ static GGLSurface gr_framebuffer[NUM_BUFFERS];
static GGLSurface gr_mem_surface;
static unsigned gr_active_fb = 0;
static unsigned double_buffering = 0;
+static int gr_is_curr_clr_opaque = 0;
static int gr_fb_fd = -1;
static int gr_vt_fd = -1;
@@ -288,6 +289,8 @@ void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a
color[2] = ((b << 8) | b) + 1;
color[3] = ((a << 8) | a) + 1;
gl->color4xv(gl, color);
+
+ gr_is_curr_clr_opaque = (a == 255);
}
int gr_measureEx(const char *s, void* font)
@@ -463,8 +466,15 @@ int twgr_text(int x, int y, const char *s)
void gr_fill(int x, int y, int w, int h)
{
GGLContext *gl = gr_context;
+
+ if(gr_is_curr_clr_opaque)
+ gl->disable(gl, GGL_BLEND);
+
gl->disable(gl, GGL_TEXTURE_2D);
gl->recti(gl, x, y, x + w, y + h);
+
+ if(gr_is_curr_clr_opaque)
+ gl->enable(gl, GGL_BLEND);
}
void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) {