summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorKarl Schultz <kschultz@freedesktop.org>2002-01-16 15:42:17 +0000
committerKarl Schultz <kschultz@freedesktop.org>2002-01-16 15:42:17 +0000
commit4197c0ea9b6784d293b26d68c4c62e5edb87cda6 (patch)
treee963a1766ddf85f49f3ec9697b218c7d2ca6c4d3 /src/mesa
parent43df32e4387d978bf07f3aa3edd9f6d2b9c67306 (diff)
Fixes for 24-bit Windows devices. The old code was trying to do 3-byte
stores with a full DWORD store (yuk). (Jeff Lewis)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/windows/wmesa.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c
index 692bf62939..47edef993e 100644
--- a/src/mesa/drivers/windows/wmesa.c
+++ b/src/mesa/drivers/windows/wmesa.c
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.24 2002/01/15 18:14:34 kschultz Exp $ */
+/* $Id: wmesa.c,v 1.25 2002/01/16 15:42:17 kschultz Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
@@ -474,9 +474,9 @@ static clear(GLcontext* ctx, GLbitfield mask,
b = GetBValue(Current->clearpixel);
iSize = Current->width;
while (i < iSize) {
- *lpb++ = r;
- *lpb++ = g;
*lpb++ = b;
+ *lpb++ = g;
+ *lpb++ = r;
i++;
}
lpb = Current->pbPixels + Current->ScanWidth;
@@ -1616,7 +1616,11 @@ wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
else if(nBypp == 2)
*((LPWORD)lpb) = BGR16(r,g,b);
else if (nBypp == 3)
- *((LPDWORD)lpb) = BGR24(r,g,b);
+ {
+ *lpb++ = b;
+ *lpb++ = g;
+ *lpb = r;
+ }
else if (nBypp == 4)
*((LPDWORD)lpb) = BGR32(r,g,b);
}
@@ -1638,7 +1642,9 @@ void wmSetPixel4(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
void wmSetPixel3(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)
{
LPBYTE lpb = pwc->pbPixels + pwc->ScanWidth * iScanLine + iPixel + iPixel + iPixel;
- *((LPDWORD)lpb) = BGR24(r,g,b);
+ *lpb++ = b;
+ *lpb++ = g;
+ *lpb = r;
}
void wmSetPixel2(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b)