X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fimage.c;h=09a75fcee078a7eb6628042246a6acd67ecef6be;hp=3cc85e34fc057f1a3eed88490c7015e42ead41c5;hb=3ae3dff29ac1a6022b1e5af414ba2c99391148c8;hpb=c878cb2be6a0bffee850bf4f2dcb1939d5d2cd4f diff --git a/src/image.c b/src/image.c index 3cc85e34..09a75fce 100644 --- a/src/image.c +++ b/src/image.c @@ -12,8 +12,12 @@ ***********************************************************/ #include "image.h" +#include "pcx.h" #include "misc.h" +/* exclude all except newImage() and freeImage() */ +#ifndef MSDOS + /* extra colors to try allocating in private color maps to minimize flashing */ #define NOFLASH_COLORS 256 @@ -34,10 +38,10 @@ static Pixmap Image_to_Mask(Image *image, Display *display, Window window) { - unsigned char *src_ptr, *dst_ptr, *dst_ptr2; + byte *src_ptr, *dst_ptr, *dst_ptr2; unsigned int bytes_per_row; unsigned int x, y; - unsigned char bitmask; + byte bitmask; byte *mask_data; Pixmap mask_pixmap; @@ -72,7 +76,7 @@ static Pixmap Image_to_Mask(Image *image, Display *display, Window window) dst_ptr += bytes_per_row; /* continue with leftmost byte of next row */ } - mask_pixmap = XCreateBitmapFromData(display, window, mask_data, + mask_pixmap = XCreateBitmapFromData(display, window, (char *)mask_data, image->width, image->height); free(mask_data); @@ -371,7 +375,7 @@ XImageInfo *Image_to_Pixmap(Display *display, int screen, Visual *visual, ximage->byte_order = MSBFirst; src_ptr = image->data; - dst_ptr = ximage->data; + dst_ptr = (byte *)ximage->data; switch (visual->class) { @@ -463,6 +467,8 @@ void freeXImage(Image *image, XImageInfo *ximageinfo) free(ximageinfo); } +#endif /* !MSDOS */ + Image *newImage(unsigned int width, unsigned int height, unsigned int depth) { Image *image; @@ -491,8 +497,10 @@ void freeImage(Image *image) free(image); } -int Read_PCX_to_Pixmaps(Display *display, Window window, GC gc, char *filename, - Pixmap *pixmap, Pixmap *pixmap_mask) +#ifndef MSDOS + +int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename, + Pixmap *pixmap, Pixmap *pixmap_mask) { Image *image; XImageInfo *ximageinfo; @@ -542,3 +550,5 @@ int Read_PCX_to_Pixmaps(Display *display, Window window, GC gc, char *filename, return(PCX_Success); } + +#endif /* !MSDOS */