aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorJason Rumney <[email protected]>2002-11-15 23:29:20 +0000
committerJason Rumney <[email protected]>2002-11-15 23:29:20 +0000
commit35624c0374f83c9a68d33e42e889a4b99a621819 (patch)
treeb6b03ee4297ea87f5952a0e5819605c1c279fc24 /src/w32fns.c
parentaab83f9115b4fe83257b3f78eedd41554511ffcb (diff)
(x_create_x_image_and_pixmap): Fill in palette for
depth of 1. (xbm_read_bitmap_data): Invert bits as xbm is read in. (XPutPixel): Don't invert bits here.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 19b4d90a79..6be0521dc2 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -9352,6 +9352,17 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
header->biClrUsed = palette_colors;
/* TODO: fill in palette. */
+ if (depth == 1)
+ {
+ (*ximg)->info.bmiColors[0].rgbBlue = 0;
+ (*ximg)->info.bmiColors[0].rgbGreen = 0;
+ (*ximg)->info.bmiColors[0].rgbRed = 0;
+ (*ximg)->info.bmiColors[0].rgbReserved = 0;
+ (*ximg)->info.bmiColors[1].rgbBlue = 255;
+ (*ximg)->info.bmiColors[1].rgbGreen = 255;
+ (*ximg)->info.bmiColors[1].rgbRed = 255;
+ (*ximg)->info.bmiColors[1].rgbReserved = 0;
+ }
hdc = get_frame_dc (f);
@@ -9918,9 +9929,9 @@ xbm_read_bitmap_data (contents, end, width, height, data)
int val = value;
expect (XBM_TK_NUMBER);
- *p++ = val;
+ *p++ = ~ val;
if (!padding_p || ((i + 2) % bytes_per_line))
- *p++ = value >> 8;
+ *p++ = ~ (value >> 8);
if (LA1 == ',' || LA1 == '}')
match ();
@@ -9935,7 +9946,7 @@ xbm_read_bitmap_data (contents, end, width, height, data)
int val = value;
expect (XBM_TK_NUMBER);
- *p++ = val;
+ *p++ = ~ val;
if (LA1 == ',' || LA1 == '}')
match ();
@@ -10711,9 +10722,9 @@ static void XPutPixel (ximg, x, y, color)
rowbytes += 4 - (rowbytes % 4);
pixel = ximg->data + y * rowbytes + x * 3;
- *pixel = 255 - GetRValue (color);
- *(pixel + 1) = 255 - GetGValue (color);
- *(pixel + 2) = 255 - GetBValue (color);
+ *pixel = GetRValue (color);
+ *(pixel + 1) = GetGValue (color);
+ *(pixel + 2) = GetBValue (color);
}