X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmain.h;h=d34fbb96085bbae64644fcad02f29afde17b0bd2;hp=36c0978dbe05f90f23345f68af3de173a49e007e;hb=c4baa69cc8d5e8398425e67498b49f4b77f8e477;hpb=b7d31643c9c84104fb3ebef778e545928610ff65 diff --git a/src/main.h b/src/main.h index 36c0978d..d34fbb96 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,15 +42,24 @@ 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) +#define MAX_BUF_YSIZE (SCR_FIELDY + 2) #define MIN_LEV_FIELDX (SCR_FIELDX-2) #define MIN_LEV_FIELDY (SCR_FIELDY-2) @@ -54,18 +68,32 @@ 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) #define UNSCROLLY(a) ((a)+scroll_y) -#define IN_SCR_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)