X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmain.h;h=87db2010f30b8ea93c488a25e79e38398f368b78;hp=4bdf70f1f85a64c4134e9d6f3817e80ce0e7b427;hb=3367ba5eaec57086e3c1013708967e8a995ef2e3;hpb=33df7a5ca87e883c2b718171fd7d05c22fc0353f diff --git a/src/main.h b/src/main.h index 4bdf70f1..87db2010 100644 --- a/src/main.h +++ b/src/main.h @@ -15,11 +15,13 @@ #ifndef MAIN_H #define MAIN_H +#ifndef MSDOS #define XK_MISCELLANY #define XK_LATIN1 #include #include +#include #include #include #include @@ -27,6 +29,9 @@ #ifdef XPM_INCLUDE_FILE #include XPM_INCLUDE_FILE #endif +#else +#include "msdos.h" +#endif // von #ifndef MSDOS #include #include @@ -37,13 +42,20 @@ typedef int BOOL; -#define TRUE 1 -#define FALSE 0 +#ifndef FALSE +#define FALSE 0 +#define TRUE (!FALSE) +#endif -#define WIN_XPOS 0 -#define WIN_YPOS 0 #define WIN_XSIZE 672 #define WIN_YSIZE 560 +#ifndef MSDOS +#define WIN_XPOS 0 +#define WIN_YPOS 0 +#else +#define WIN_XPOS (XRES-WIN_XSIZE)/2 +#define WIN_YPOS (YRES-WIN_YSIZE)/2 +#endif #define SCR_FIELDX 17 #define SCR_FIELDY 17 #define MAX_BUF_XSIZE (SCR_FIELDX + 2) @@ -56,10 +68,18 @@ typedef int BOOL; #define MAX_LEV_FIELDX 128 #define MAX_LEV_FIELDY 128 +#ifndef MIN #define MIN(a,b) ((a)<(b) ? (a) : (b)) +#endif +#ifndef MAX #define MAX(a,b) ((a)>(b) ? (a) : (b)) +#endif +#ifndef ABS #define ABS(a) ((a)<0 ? -(a) : (a)) +#endif +#ifndef SIGN #define SIGN(a) ((a)<0 ? -1 : ((a)>0 ? 1 : 0)) +#endif #define SCROLLX(a) ((a)-scroll_x) #define SCROLLY(a) ((a)-scroll_y) #define UNSCROLLX(a) ((a)+scroll_x) @@ -67,11 +87,12 @@ typedef int BOOL; #define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)