rnd-20001204-3-src
[rocksndiamonds.git] / src / libgame / msdos.c
index 782369c1560a7291f5e4df8b48cce25ce0ff6a88..5b037e0287befbf489d097cbdbbeba580d10434e 100644 (file)
@@ -1,21 +1,25 @@
 /***********************************************************
-*  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
+* Artsoft Retro-Game Library                               *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+* (c) 1994-2000 Artsoft Entertainment                      *
+*               Holger Schemel                             *
+*               Detmolder Strasse 189                      *
+*               33604 Bielefeld                            *
+*               Germany                                    *
+*               e-mail: info@artsoft.org                   *
 *----------------------------------------------------------*
-*  msdos.c                                                 *
+* msdos.c                                                  *
 ***********************************************************/
 
-#include "libgame.h"
+#include "system.h"
+
 
 #if defined(PLATFORM_MSDOS)
 
+#include "sound.h"
+#include "misc.h"
+#include "pcx.h"
+
 #define AllegroDefaultScreen() (display->screens[display->default_screen])
 
 /* allegro driver declarations */
@@ -442,7 +446,7 @@ Pixmap XCreatePixmap(Display *display, Drawable d, unsigned int width,
   BITMAP *bitmap = NULL;
 
   if (gfx_capabilities & GFX_HW_VRAM_BLIT &&
-      width == video.scrollbuffer_width && height == video.scrollbuffer_height)
+      width  == gfx.scrollbuffer_width && height == gfx.scrollbuffer_height)
     bitmap = create_video_bitmap(width, height);
 
   if (bitmap == NULL)
@@ -641,6 +645,10 @@ void XFreeGC(Display *display, GC gc)
     free(gcv);
 }
 
+void XUnmapWindow(Display *display, Window window)
+{
+}
+
 void XCloseDisplay(Display *display)
 {
   BITMAP *bitmap = video_bitmap;
@@ -886,6 +894,10 @@ void XDestroyImage(XImage *ximage)
 {
 }
 
+void XDestroyWindow(Display *display, Window window)
+{
+}
+
 Bool XQueryPointer(Display *display, Window window,
                   Window *root, Window *child, int *root_x, int *root_y,
                   int *win_x, int *win_y, unsigned int *mask)
@@ -907,7 +919,40 @@ void XAutoRepeatOff(Display *display)
   keyboard_auto_repeat = FALSE;
 }
 
-boolean MSDOSOpenAudio(void)
+void AllegroDrawLine(Drawable d, int from_x, int from_y, int to_x, int to_y,
+                    Pixel color)
+{
+  boolean mouse_off = FALSE;
+
+  if ((BITMAP *)d == video_bitmap)
+  {
+    int dx = AllegroDefaultScreen().x;
+    int dy = AllegroDefaultScreen().y;
+    int x1, y1, x2, y2;
+
+    from_x += dx;
+    from_y += dy;
+    to_x += dx;
+    to_y += dy;
+
+    x1 = (from_x < to_x ? from_x : to_x);
+    y1 = (from_y < to_y ? from_y : to_y);
+    x2 = (from_x < to_x ? to_x : from_x);
+    y2 = (from_y < to_y ? to_y : from_y);
+
+    freeze_mouse_flag = TRUE;
+    mouse_off = hide_mouse(display, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
+  }
+
+  line((BITMAP *)d, from_x, from_y, to_x, to_y, color);
+
+  if (mouse_off)
+    unhide_mouse(display);
+
+  freeze_mouse_flag = FALSE;
+}
+
+Bool MSDOSOpenAudio(void)
 {
   return allegro_init_audio();
 }