|
From: Kevin G. <kev...@us...> - 2005-07-10 20:17:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30019/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix native code to work with RGBA rather than RBGR. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- org_lwjgl_opengl_Display.c 5 Jul 2005 22:08:55 -0000 1.25 +++ org_lwjgl_opengl_Display.c 10 Jul 2005 20:16:53 -0000 1.26 @@ -446,9 +446,9 @@ for (y = 0; y < height; y++ ) { dstPtr = ptrCursorImage + wordAlignedWidth*y;; for (x = 0; x < width; x++ ) { - dstPtr[2] = (pixels[y*width+x] >> 0x10) & 0xFF; + dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; - dstPtr[0] = pixels[y*width+x] & 0xFF; + dstPtr[2] = pixels[y*width+x] & 0xFF; dstPtr += 3; } } @@ -477,22 +477,22 @@ maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize); memset(maskPixels, 0, imageSize); for (y = 0; y < height; y++) { - leftShift = 17; + leftShift = 7; mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (pixels[width*y+x] & 0x01000000) >> leftShift; + col = (pixels[width*y+x] & 0x00000001) << leftShift; mask = mask | col; - leftShift++; - if (leftShift == 25) { + leftShift--; + if (leftShift == -1) { maskPixels[maskPixelsOff++] = ~mask; - leftShift = 17; + leftShift = 7; mask = 0; } } // write what is left over - if (leftShift != 17) { + if (leftShift != 7) { maskPixels[maskPixelsOff++] = ~mask; } } |