rnd-20001125-3-src
[rocksndiamonds.git] / src / image.c
index c2785a2443512a6374b6058b44ff981196b4d5bb..5331a8865c956ebdee5229c3326e2316bed4c2f1 100644 (file)
 *  image.c                                                 *
 ***********************************************************/
 
+#ifndef TARGET_SDL
+
 #include "image.h"
+#include "pcx.h"
 #include "misc.h"
 
 /* exclude all except newImage() and freeImage() */
@@ -75,7 +78,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);
 
@@ -374,7 +377,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)
   {
@@ -513,7 +516,7 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename,
 
   /* read the graphic file in PCX format to image structure */
   if ((image = Read_PCX_to_Image(filename)) == NULL)
-    return PCX_FileInvalid;
+    return errno_pcx;
 
 #if DEBUG_TIMING
   printf("%s:\n", filename);
@@ -547,7 +550,8 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename,
   *pixmap = ximageinfo->pixmap;
   *pixmap_mask = ximageinfo->pixmap_mask;
 
-  return(PCX_Success);
+  return PCX_Success;
 }
 
 #endif /* !MSDOS */
+#endif /* !TARGET_SDL */