# HG changeset patch # User Jason Rumney # Date 1037402960 0 # Node ID 6420af8e1ad8a0a334b3f7fd4b5dce853ee15efb # Parent 465ba090e0a5b77c7031e9bed7bed4832efebd15 (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. diff -r 465ba090e0a5 -r 6420af8e1ad8 src/w32fns.c --- a/src/w32fns.c Fri Nov 15 23:22:20 2002 +0000 +++ b/src/w32fns.c Fri Nov 15 23:29:20 2002 +0000 @@ -9352,6 +9352,17 @@ 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 @@ 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 @@ int val = value; expect (XBM_TK_NUMBER); - *p++ = val; + *p++ = ~ val; if (LA1 == ',' || LA1 == '}') match (); @@ -10711,9 +10722,9 @@ 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); }