rnd-20111007-1-src
[rocksndiamonds.git] / src / libgame / msdos.h
index f2bfabef2bb0db198e703babbfd441fe811f6198..9d6a21552f6141f79dc40a140362f4f64313fe72 100644 (file)
@@ -1,28 +1,28 @@
 /***********************************************************
-*  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-2006 Artsoft Entertainment                      *
+*               Holger Schemel                             *
+*               Detmolder Strasse 189                      *
+*               33604 Bielefeld                            *
+*               Germany                                    *
+*               e-mail: info@artsoft.org                   *
 *----------------------------------------------------------*
-*  msdos.h                                                 *
+* msdos.h                                                  *
 ***********************************************************/
 
 #ifndef MSDOS_H
 #define MSDOS_H
 
-#include <allegro.h>
 #include <time.h>
+#include "allegro.h"
+
 
 /* symbol 'window' is defined in DJGPP cross-compiler in libc.a(conio.o) */
-#define window window_djgpp
+#define window window_internal
 
 /* symbol 'font' is defined in "allegro.h" */
-#define font font_allegro
+#define font font_internal
 
 /* system dependent definitions */
 
 #define XRES   800
 #define YRES   600
 
+/* allegro defines some macros that bother the rest of the program */
+#ifdef joy_x
+#undef joy_x
+#undef joy_y
+#undef joy_left
+#undef joy_right
+#undef joy_up
+#undef joy_down
+#undef joy_b1
+#undef joy_b2
+#endif
+
 /* additional Allegro keyboard mapping */
 
 /* The following are all undefined in Allegro */
 
 /* end of X11 keyboard mapping */
 
-#define JOYSTICK_FILENAME      "joystick.cnf"
 
 #define screen myscreen
 
 #define MapNotify              19
 #define ClientMessage          33
 
+#define LineSolid               0
+#define LineOnOffDash           1
+#define LineDoubleDash          2
+
+#define CapNotLast              0
+#define CapButt                 1
+#define CapRound                2
+#define CapProjecting           3
+
+#define JoinMiter               0
+#define JoinRound               1
+#define JoinBevel               2
+
 #define GCForeground            (1L << 2)
 #define GCBackground            (1L << 3)
+#define GCLineWidth             (1L << 4)
+#define GCLineStyle             (1L << 5)
+#define GCCapStyle              (1L << 6)
+#define GCJoinStyle             (1L << 7)
 #define GCGraphicsExposures     (1L << 16)
 #define GCClipMask             (1L << 19)
 
 #define BlackPixel(dpy, scr)     (ScreenOfDisplay(dpy,scr)->black_pixel)
 #define WhitePixel(dpy, scr)     (ScreenOfDisplay(dpy,scr)->white_pixel)
 #define RootWindow(dpy, scr)     (ScreenOfDisplay(dpy,scr)->root)
-#define AllPlanes                ((unsigned long)~0L)
+#define AllPlanes                ((unsigned int)~0L)
 
 #define DefaultVisual(dpy, scr)          (NULL)
 #define DefaultDepth(dpy, scr)   (NULL)
 #define XGetPixel(ximage, x, y) \
         ((*((ximage)->f.get_pixel))((ximage), (x), (y)))
 
-typedef unsigned long Pixel;   /* Index into colormap */
-typedef unsigned long XID;
+typedef unsigned int Pixel;    /* Index into colormap */
+typedef unsigned int XID;
 typedef XID Window;
 typedef XID Drawable;
 typedef XID Pixmap;
@@ -546,9 +574,9 @@ typedef XID Colormap;
 typedef XID KeySym;
 typedef XID GContext;
 typedef struct _XDisplay Display;
-typedef long Visual;
-typedef long XVisualInfo;
-typedef long Atom;
+typedef int Visual;
+typedef int XVisualInfo;
+typedef int Atom;
 typedef int Status;
 typedef int Bool;
 typedef int XComposeStatus;    /* we don't need the real type */
@@ -562,8 +590,8 @@ typedef struct
 {
   Colormap cmap;               /* default color map */
   Window root;                 /* root window id */
-  unsigned long white_pixel;   /* white pixel value */
-  unsigned long black_pixel;   /* black pixel value */
+  unsigned int white_pixel;    /* white pixel value */
+  unsigned int black_pixel;    /* black pixel value */
   int x;
   int y;
   unsigned int width;
@@ -582,13 +610,13 @@ typedef struct _XImage
 {
   struct funcs
   {
-    unsigned long (*get_pixel) (struct _XImage *, int, int);
+    unsigned int (*get_pixel) (struct _XImage *, int, int);
   } f;
 } XImage;
 
 typedef struct
 {
-  long flags;          /* marks which fields in this structure are defined */
+  int flags;           /* marks which fields in this structure are defined */
   int width, height;   /* should set so old wm's don't mess up */
   int min_width, min_height;
   int max_width, max_height;
@@ -596,7 +624,7 @@ typedef struct
 
 typedef struct
 {
-  long flags;          /* marks which fields in this structure are defined */
+  int flags;           /* marks which fields in this structure are defined */
   Bool input;          /* does this application rely on the window manager to
                           get keyboard input? */
   int initial_state;   /* see below */
@@ -617,13 +645,19 @@ typedef struct
 
 typedef struct
 {
-  unsigned long foreground;    /* foreground pixel */
-  unsigned long background;    /* background pixel */
+  unsigned int foreground;     /* foreground pixel */
+  unsigned int background;     /* background pixel */
   Bool graphics_exposures;     /* boolean, should exposures be generated */
   Pixmap clip_mask;            /* bitmap clipping; other calls for rects */
   int clip_x_origin;           /* x origin for clipping */
   int clip_y_origin;           /* y origin for clipping */
-  unsigned long value_mask;
+  unsigned int value_mask;
+  int line_width;              /* line width */
+  int line_style;              /* LineSolid, LineOnOffDash, LineDoubleDash */
+  int cap_style;               /* CapNotLast, CapButt, 
+                                  CapRound, CapProjecting */
+  int join_style;              /* JoinMiter, JoinRound, JoinBevel */
+
 } XGCValues;
 
 typedef struct
@@ -671,14 +705,16 @@ typedef union _XEvent
   XKeyEvent xkey;
 } XEvent;
 
+Pixel AllegroAllocColorCell(int, int, int);
+
 void XMapWindow(Display *, Window);
 Display *XOpenDisplay(char *);
 Window XCreateSimpleWindow(Display *, Window, int, int,
                           unsigned int, unsigned int, unsigned int,
-                          unsigned long, unsigned long);
+                          unsigned int, unsigned int);
 Status XStringListToTextProperty(char **, int, XTextProperty *);
 void XFree(void *);
-GC XCreateGC(Display *, Drawable, unsigned long, XGCValues *);
+GC XCreateGC(Display *, Drawable, unsigned int, XGCValues *);
 void XSetClipMask(Display *, GC, Pixmap);
 void XSetClipOrigin(Display *, GC, int, int);
 void XFillRectangle(Display *, Drawable, GC, int, int,
@@ -686,8 +722,8 @@ void XFillRectangle(Display *, Drawable, GC, int, int,
 Pixmap XCreatePixmap(Display *, Drawable, unsigned int, unsigned int,
                     unsigned int);
 void XSync(Display *, Bool);
-inline void XCopyArea(Display *, Drawable, Drawable, GC, int, int,
-                     unsigned int, unsigned int, int, int);
+void XCopyArea(Display *, Drawable, Drawable, GC, int, int,
+              unsigned int, unsigned int, int, int);
 int Read_PCX_to_Pixmap(Display *, Window, GC, char *, Pixmap *, Pixmap *);
 int XReadBitmapFile(Display *, Drawable, char *,
                    unsigned int *, unsigned int *, Pixmap *, int *, int *);
@@ -699,7 +735,7 @@ void XNextEvent(Display *, XEvent *);
 int XPending(Display *);
 KeySym XLookupKeysym(XKeyEvent *, int);
 int XLookupString(XKeyEvent *, char *, int, KeySym *, XComposeStatus *);
-void XSetForeground(Display *, GC, unsigned long);
+void XSetForeground(Display *, GC, unsigned int);
 void XDrawLine(Display *, Drawable, GC, int, int, int, int);
 void XDestroyImage(XImage *);
 void XDestroyWindow(Display *, Window);
@@ -708,9 +744,17 @@ Bool XQueryPointer(Display *, Window, Window *, Window *, int *, int *,
 void XAutoRepeatOn(Display *);
 void XAutoRepeatOff(Display *);
 
-boolean MSDOSOpenAudio(void);
+void AllegroDrawLine(Drawable, int, int, int, int, Pixel);
+Pixel AllegroGetPixel(Drawable, int, int);
+
+void AllegroZoomBitmap(Drawable, Drawable, int, int, int, int);
+
+void MSDOSOpenAudio(void);
 void MSDOSCloseAudio(void);
 
 void NetworkServer(int, int);
 
+void MSDOSInitJoysticks();
+boolean MSDOSReadJoystick(int, int *, int *, boolean *, boolean *);
+
 #endif /* MSDOS_H */