X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmain.h;h=d34fbb96085bbae64644fcad02f29afde17b0bd2;hp=6cf2bb23891b4c939dbb1b3ba4c6240afad33b8e;hb=c4baa69cc8d5e8398425e67498b49f4b77f8e477;hpb=a5a03e15b395ba1942c180d1cd0d3a4f43b87f56 diff --git a/src/main.h b/src/main.h index 6cf2bb23..d34fbb96 100644 --- a/src/main.h +++ b/src/main.h @@ -15,20 +15,23 @@ #ifndef MAIN_H #define MAIN_H +#ifndef MSDOS #define XK_MISCELLANY #define XK_LATIN1 #include #include +#include #include #include #include #ifdef XPM_INCLUDE_FILE #include XPM_INCLUDE_FILE -#else -#include "YOU HAVE TO SET 'XPM_INCLUDE_FILE' IN THE 'Makefile'!!!" #endif +#else +#include "msdos.h" +#endif // von #ifndef MSDOS #include #include @@ -39,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) @@ -56,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) -#define DEV_JOYSTICK_0 "/dev/joy0" -#define DEV_JOYSTICK_1 "/dev/joy1" -#else -#define DEV_JOYSTICK_0 "/dev/js0" -#define DEV_JOYSTICK_1 "/dev/js1" -#endif - -/* get these values from the program 'js' from the joystick package, */ -/* set JOYSTICK_PERCENT to a threshold appropriate for your joystick */ -#define JOYSTICK_XLEFT 30 -#define JOYSTICK_XRIGHT 1250 -#define JOYSTICK_XMIDDLE 530 -#define JOYSTICK_YUPPER 40 -#define JOYSTICK_YLOWER 1440 -#define JOYSTICK_YMIDDLE 680 -#define JOYSTICK_PERCENT 25 -#define JOY_LEFT MV_LEFT -#define JOY_RIGHT MV_RIGHT -#define JOY_UP MV_UP -#define JOY_DOWN MV_DOWN -#define JOY_BUTTON_1 16 -#define JOY_BUTTON_2 32 -#define JOY_BUTTON (JOY_BUTTON_1 | JOY_BUTTON_2) -#define JOY_BUTTON_NOT_PRESSED 0 -#define JOY_BUTTON_PRESSED 1 -#define JOY_BUTTON_NEW_PRESSED 2 -#define JOY_BUTTON_NEW_RELEASED 3 - -#ifdef NO_JOYSTICK -#define JOYSTICK_STATUS JOYSTICK_OFF -#else -#define JOYSTICK_STATUS JOYSTICK_AVAILABLE -#endif #ifndef GAME_DIR #define GAME_DIR "." @@ -887,10 +962,17 @@ extern struct SoundInfo Sound[NUM_SOUNDS]; #define JOYDAT_PATH GAME_DIR #endif +#ifndef MSDOS #define SCORE_FILENAME "ROCKS.score" #define NAMES_FILENAME "ROCKS.names" #define LEVDIR_FILENAME "ROCKS.levelinfo" #define JOYDAT_FILENAME "ROCKS.joystick" +#else +#define SCORE_FILENAME "ROCKS.sco" +#define NAMES_FILENAME "ROCKS.nam" +#define LEVDIR_FILENAME "ROCKS.lev" +#define JOYDAT_FILENAME "ROCKS.joy" +#endif #define JOYDAT_FILE JOYDAT_PATH "/" JOYDAT_FILENAME @@ -917,10 +999,10 @@ extern struct SoundInfo Sound[NUM_SOUNDS]; #define LEVELREC_COOKIE_LEN (strlen(LEVELREC_COOKIE)+1) #define JOYSTICK_COOKIE_LEN (strlen(JOYSTICK_COOKIE)+1) -#define VERSION_STRING "1.1" +#define VERSION_STRING "1.2" #define GAMETITLE_STRING "Rocks'n'Diamonds" #define WINDOWTITLE_STRING GAMETITLE_STRING " " VERSION_STRING -#define COPYRIGHT_STRING "Copyright ^1995-97 by Holger Schemel" +#define COPYRIGHT_STRING "Copyright ^1995-98 by Holger Schemel" /* Leerer Login- und Alias-Name */ #define EMPTY_LOGIN "NO_LOGIN" @@ -932,19 +1014,21 @@ extern struct SoundInfo Sound[NUM_SOUNDS]; #define MB_PRESSED TRUE #define MB_MENU_CHOICE FALSE #define MB_MENU_MARK TRUE +#define MB_MENU_INITIALIZE (-1) #define MB_LEFT 1 +#ifdef MSDOS +#define MB_MIDDLE 4 +#define MB_RIGHT 2 +#else #define MB_MIDDLE 2 #define MB_RIGHT 3 +#endif /* values for key_status */ #define KEY_NOT_PRESSED FALSE #define KEY_RELEASED FALSE #define KEY_PRESSED TRUE -/* values for focus_status */ -#define FOCUS_OUT FALSE -#define FOCUS_IN TRUE - /* values for redraw_mask */ #define REDRAW_ALL (1L<<0) #define REDRAW_FIELD (1L<<1) @@ -954,10 +1038,11 @@ extern struct SoundInfo Sound[NUM_SOUNDS]; #define REDRAW_VIDEO_2 (1L<<5) #define REDRAW_VIDEO_3 (1L<<6) #define REDRAW_MICROLEV (1L<<7) +#define REDRAW_FROM_BACKBUFFER (1L<<8) #define REDRAW_DOOR_2 (REDRAW_VIDEO_1 | REDRAW_VIDEO_2 | REDRAW_VIDEO_3) #define REDRAW_DOORS (REDRAW_DOOR_1 | REDRAW_DOOR_2) #define REDRAW_MAIN (REDRAW_FIELD | REDRAW_TILES | REDRAW_MICROLEV) -#define REDRAWTILES_TH SCR_FIELDX*SCR_FIELDY/2 +#define REDRAWTILES_THRESHOLD SCR_FIELDX*SCR_FIELDY/2 /* positions in the game control window */ #define XX_LEVEL 37 @@ -1003,4 +1088,9 @@ extern struct SoundInfo Sound[NUM_SOUNDS]; #define DOOR_GFX_PAGEY1 0 #define DOOR_GFX_PAGEY2 DYSIZE +/* für DrawGraphicAnimation (tools.c) und AnimateToon (cartoons.c) */ +#define ANIM_NORMAL 0 +#define ANIM_OSCILLATE 1 +#define ANIM_REVERSE 2 + #endif