summaryrefslogtreecommitdiff
path: root/src/drv
diff options
context:
space:
mode:
Diffstat (limited to 'src/drv')
-rw-r--r--src/drv/cdgl.c7
-rw-r--r--src/drv/cdirgb.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/drv/cdgl.c b/src/drv/cdgl.c
index 4357e5a..fb1739d 100644
--- a/src/drv/cdgl.c
+++ b/src/drv/cdgl.c
@@ -638,10 +638,11 @@ static long int cdforeground(cdCtxCanvas *ctxcanvas, long int color)
static void cdclear(cdCtxCanvas* ctxcanvas)
{
- unsigned char r, g, b;
+ unsigned char r, g, b, a;
cdDecodeColor(ctxcanvas->canvas->background, &r, &g, &b);
- glClearColor((GLclampf)((double)r/255.0), (GLclampf)((double)g/255.0), (GLclampf)((double)b/255.0), 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ a = cdDecodeAlpha(ctxcanvas->canvas->background);
+ glClearColor((GLclampf)r/255.0f, (GLclampf)g/255.0f, (GLclampf)b/255.0f, (GLclampf)a/255.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
}
static void cdfline(cdCtxCanvas *ctxcanvas, double x1, double y1, double x2, double y2)
diff --git a/src/drv/cdirgb.c b/src/drv/cdirgb.c
index 68a5766..d9dd6a8 100644
--- a/src/drv/cdirgb.c
+++ b/src/drv/cdirgb.c
@@ -430,7 +430,8 @@ static void cdclear(cdCtxCanvas* ctxcanvas)
memset(ctxcanvas->red, cdRed(ctxcanvas->canvas->background), size);
memset(ctxcanvas->green, cdGreen(ctxcanvas->canvas->background), size);
memset(ctxcanvas->blue, cdBlue(ctxcanvas->canvas->background), size);
- if (ctxcanvas->alpha) memset(ctxcanvas->alpha, cdAlpha(ctxcanvas->canvas->background), size); /* here is the normal alpha coding */
+ if (ctxcanvas->alpha)
+ memset(ctxcanvas->alpha, cdAlpha(ctxcanvas->canvas->background), size); /* here is the normal alpha coding */
}
static void irgPostProcessIntersect(unsigned char* clip, int size)