X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16a12a3d27d3d3e2557bcde15365245ef2675bb4..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/xpm/simx.c?ds=sidebyside diff --git a/src/xpm/simx.c b/src/xpm/simx.c index b3e3fb1369..6b8ef57b91 100644 --- a/src/xpm/simx.c +++ b/src/xpm/simx.c @@ -119,7 +119,12 @@ XDefaultScreen(Display *d) } /* I get only 1 plane but 8 bits per pixel, - so I think BITSPIXEL should be depth */ + so I think BITSPIXEL should be depth + + TRS: I assume that all "displays" have the same number of + planes later in the code, which is based on the assumption + that the display variable is ignored below. :) + */ int XDefaultDepth(Display *display, Screen *screen) { @@ -261,8 +266,12 @@ XCreateImage(Display *d, Visual *v, if (img) { /* *img = CreateCompatibleBitmap(*d, width, height); */ + #if !defined(__VISAGECPP__) /* fixme for OS/2 */ - img->bitmap = CreateBitmap(width, height, 1 /* plane */ , + /* create the bitmap with the same number of planes as the default display + * (otherwise it wouldn't work for 16 color mode) */ + img->bitmap = CreateBitmap(width, height, + GetDeviceCaps(*d, PLANES), depth /* bits per pixel */ , NULL); #endif img->width = width;