rnd-20001128-1-src
[rocksndiamonds.git] / src / msdos.c
index df72b8eb677c7176d2246ed3deea337c96e5173d..181a9f1ada1712bd03ff9bf7ab8172a55dcef1b3 100644 (file)
@@ -12,7 +12,9 @@
 *  msdos.c                                                 *
 ***********************************************************/
 
-#ifdef MSDOS
+#include "platform.h"
+
+#if defined(PLATFORM_MSDOS)
 
 #include "main.h"
 #include "misc.h"
@@ -88,10 +90,11 @@ static void allegro_drivers()
   last_joystick_state = 0;
   joystick_event = FALSE;
 
+  sysinfo.audio_available = TRUE;
   reserve_voices(MAX_SOUNDS_PLAYING, 0);
   if (install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL) == -1)
     if (install_sound(DIGI_SB, MIDI_NONE, NULL) == -1)
-      sound_status = SOUND_OFF;
+      sysinfo.audio_available = FALSE;
 }
 
 static boolean hide_mouse(Display *display, int x, int y,
@@ -516,7 +519,10 @@ static BITMAP *Image_to_AllegroBitmap(Image *image)
 
   /* allocate new allegro bitmap structure */
   if ((bitmap = create_bitmap_ex(depth, image->width, image->height)) == NULL)
+  {
+    errno_pcx = PCX_NoMemory;
     return NULL;
+  }
 
   clear(bitmap);
 
@@ -582,17 +588,11 @@ static BITMAP *Read_PCX_to_AllegroBitmap(char *filename)
 
   /* read the graphic file in PCX format to internal image structure */
   if ((image = Read_PCX_to_Image(filename)) == NULL)
-  {
-    Error(ERR_RETURN, "Read_PCX_to_Image failed");
     return NULL;
-  }
 
   /* convert internal image structure to allegro bitmap structure */
   if ((bitmap = Image_to_AllegroBitmap(image)) == NULL)
-  {
-    Error(ERR_RETURN, "Image_to_AllegroBitmap failed");
     return NULL;
-  }
 
   set_palette(global_colormap);
 
@@ -605,7 +605,7 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename,
   BITMAP *bitmap;
 
   if ((bitmap = Read_PCX_to_AllegroBitmap(filename)) == NULL)
-    return PCX_FileInvalid;
+    return errno_pcx;
 
   *pixmap = (Pixmap)bitmap;
   *pixmap_mask = (Pixmap)bitmap;
@@ -613,20 +613,6 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename,
   return PCX_Success;
 }
 
-int XpmReadFileToPixmap(Display *display, Drawable d, char *filename,
-                       Pixmap *pixmap_return, Pixmap *shapemask_return,
-                       XpmAttributes *attributes)
-{
-  BITMAP *bitmap;
-
-  if ((bitmap = Read_PCX_to_AllegroBitmap(filename)) == NULL)
-    return XpmOpenFailed;
-
-  *pixmap_return = (Pixmap)bitmap;
-
-  return XpmSuccess;
-}
-
 int XReadBitmapFile(Display *display, Drawable d, char *filename,
                    unsigned int *width_return, unsigned int *height_return,
                    Pixmap *bitmap_return,
@@ -934,4 +920,4 @@ void NetworkServer(int port, int serveronly)
   Error(ERR_WARN, "networking not supported in DOS version");
 }
 
-#endif /* MSDOS */
+#endif /* PLATFORM_MSDOS */