X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=4769e69bb958e48854b6090cb4c5003611d969cb;hb=1101077a226b09854650662759bf12caf7c84f8d;hp=fdad7a4e858a621557c8b886125788d912a0dabe;hpb=998be01ad92a672b69b11e24d472f6c0c076817f;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index fdad7a4e..4769e69b 100644 --- a/src/main.h +++ b/src/main.h @@ -1,14 +1,14 @@ /*********************************************************** -* Rocks'n'Diamonds -- McDuffin Strikes Back! * +* Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-98 Artsoft Entertainment * -* Holger Schemel * -* Oststrasse 11a * -* 33604 Bielefeld * -* phone: ++49 +521 290471 * -* email: aeglos@valinor.owl.de * +* (c) 1995-2001 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * *----------------------------------------------------------* -* main.h * +* main.h * ***********************************************************/ #ifndef MAIN_H @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -24,15 +25,10 @@ #include #include -#ifdef DEBUG -#define DEBUG_TIMING 0 -#endif - #include "libgame/libgame.h" #define WIN_XSIZE 672 #define WIN_YSIZE 560 -#define WIN_SDL_DEPTH 16 /* !!! change this !!! */ #if !defined(PLATFORM_MSDOS) #define WIN_XPOS 0 @@ -53,8 +49,6 @@ #define MAX_LEV_FIELDX 128 #define MAX_LEV_FIELDY 128 -#define MAX_PLAYERS 4 - #define SCREENX(a) ((a) - scroll_x) #define SCREENY(a) ((a) - scroll_y) #define LEVELX(a) ((a) + scroll_x) @@ -101,6 +95,7 @@ #define EP_BIT_BELT (1 << 0) #define EP_BIT_BELT_SWITCH (1 << 1) #define EP_BIT_TUBE (1 << 2) +#define EP_BIT_EM_SLIPPERY_WALL (1 << 3) #define IS_AMOEBALIVE(e) (Elementeigenschaften1[e] & EP_BIT_AMOEBALIVE) #define IS_AMOEBOID(e) (Elementeigenschaften1[e] & EP_BIT_AMOEBOID) @@ -137,6 +132,7 @@ #define IS_BELT(e) (Elementeigenschaften2[e] & EP_BIT_BELT) #define IS_BELT_SWITCH(e) (Elementeigenschaften2[e] & EP_BIT_BELT_SWITCH) #define IS_TUBE(e) (Elementeigenschaften2[e] & EP_BIT_TUBE) +#define IS_EM_SLIPPERY_WALL(e) (Elementeigenschaften2[e] & EP_BIT_EM_SLIPPERY_WALL) #define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y])) @@ -160,7 +156,7 @@ #define IS_DRAWABLE(e) ((e) < EL_BLOCKED) #define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) #define TAPE_IS_EMPTY(x) ((x).length == 0) -#define TAPE_IS_STOPPED(x) (!(x).recording && !(x).playing &&!(x).pausing) +#define TAPE_IS_STOPPED(x) (!(x).recording && !(x).playing) #define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_SPIELER1]) #define SHIELD_ON(p) ((p)->shield_passive_time_left > 0) @@ -187,7 +183,6 @@ #define NUM_BITMAPS 12 /* boundaries of arrays etc. */ -#define MAX_PLAYER_NAME_LEN 10 #define MAX_LEVEL_NAME_LEN 32 #define MAX_LEVEL_AUTHOR_LEN 32 #define MAX_TAPELEN (1000 * 50) /* max. time * framerate */ @@ -215,63 +210,6 @@ struct HiScore int Score; }; -struct SetupJoystickInfo -{ - char *device_name; - int xleft, xmiddle, xright; - int yupper, ymiddle, ylower; - int snap; - int bomb; -}; - -struct SetupKeyboardInfo -{ - Key left; - Key right; - Key up; - Key down; - Key snap; - Key bomb; -}; - -struct SetupInputInfo -{ - boolean use_joystick; - struct SetupJoystickInfo joy; - struct SetupKeyboardInfo key; -}; - -struct SetupInfo -{ - char *player_name; - - boolean sound; - boolean sound_loops; - boolean sound_music; - boolean sound_simple; - boolean toons; - boolean double_buffering; - boolean direct_draw; /* !double_buffering (redundant!) */ - boolean scroll_delay; - boolean soft_scrolling; - boolean fading; - boolean autorecord; - boolean quick_doors; - boolean team_mode; - boolean handicap; - boolean time_limit; - boolean fullscreen; - - struct SetupInputInfo input[MAX_PLAYERS]; -}; - -struct SetupFileList -{ - char *token; - char *value; - struct SetupFileList *next; -}; - struct PlayerInfo { boolean present; /* player present in level playfield */ @@ -281,14 +219,12 @@ struct PlayerInfo int index_nr, client_nr, element_nr; byte action; /* action from local input device */ - byte effective_action; /* action aknowledged from network server + byte effective_action; /* action acknowledged from network server or summarized over all configured input devices when in single player mode */ byte programmed_action; /* action forced by game itself (like moving through doors); overrides other actions */ - int joystick_fd; /* file descriptor of player's joystick */ - int jx,jy, last_jx,last_jy; int MovDir, MovPos, GfxPos; int Frame; @@ -298,11 +234,12 @@ struct PlayerInfo boolean LevelSolved, GameOver; boolean snapped; + int last_move_dir; + int is_moving; + unsigned long move_delay; int move_delay_value; - int last_move_dir; - unsigned long push_delay; unsigned long push_delay_value; @@ -324,6 +261,12 @@ struct PlayerInfo struct LevelInfo { + int file_version; /* file format version the level is stored with */ + int game_version; /* game engine version the level was created with */ + boolean encoding_16bit_field; /* level contains 16-bit elements */ + boolean encoding_16bit_yamyam; /* yamyam contains 16-bit elements */ + boolean encoding_16bit_amoeba; /* amoeba contains 16-bit elements */ + int fieldx; int fieldy; int time; @@ -341,10 +284,14 @@ struct LevelInfo int time_timegate; boolean double_speed; boolean gravity; + boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */ }; struct TapeInfo { + int file_version; /* file format version the tape is stored with */ + int game_version; /* game engine version the tape was created with */ + int version; int level_nr; unsigned long random_seed; unsigned long date; @@ -355,8 +302,13 @@ struct TapeInfo boolean pause_before_death; boolean recording, playing, pausing; boolean fast_forward; + boolean index_search; + boolean quick_resume; + boolean single_step; boolean changed; boolean player_participates[MAX_PLAYERS]; + int num_participating_players; + struct { byte action[MAX_PLAYERS]; @@ -366,6 +318,7 @@ struct TapeInfo struct GameInfo { + int version; int emulation; int yam_content_nr; boolean magic_wall_active; @@ -376,6 +329,7 @@ struct GameInfo int belt_dir_nr[4]; int switchgate_pos; int balloon_dir; + boolean explosions_delayed; }; struct GlobalInfo @@ -386,19 +340,16 @@ struct GlobalInfo }; extern GC tile_clip_gc; -extern Bitmap pix[]; +extern Bitmap *pix[]; extern Pixmap tile_clipmask[]; -extern DrawBuffer drawto_field, fieldbuffer; - -extern int joystick_device; -extern char *joystick_device_name[]; +extern DrawBuffer *fieldbuffer; +extern DrawBuffer *drawto_field; extern int game_status; extern boolean level_editor_test_game; extern boolean network_playing; extern int key_joystick_mapping; -extern int global_joystick_status, joystick_status; extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; extern int redraw_x1, redraw_y1; @@ -416,10 +367,10 @@ extern boolean Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA]; +extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern unsigned long Elementeigenschaften1[MAX_ELEMENTS]; extern unsigned long Elementeigenschaften2[MAX_ELEMENTS]; -extern int level_nr; extern int lev_fieldx,lev_fieldy, scroll_x,scroll_y; extern int FX,FY, ScrollStepSize; @@ -443,14 +394,10 @@ extern struct LevelInfo level; extern struct PlayerInfo stored_player[], *local_player; extern struct HiScore highscore[]; extern struct TapeInfo tape; -extern struct JoystickInfo joystick[]; -extern struct SetupInfo setup; extern struct GameInfo game; extern struct GlobalInfo global; extern char *sound_name[]; -extern int background_loop[]; -extern int num_bg_loops; extern char *element_info[]; extern int num_element_info; @@ -905,6 +852,10 @@ extern int num_element_info; #define EL_TRAP_ACTIVE 522 #define EL_SPRING_MOVING 523 #define EL_SP_MURPHY_CLONE 524 +#define EL_QUICKSAND_EMPTYING 525 +#define EL_MAGIC_WALL_EMPTYING 526 +#define EL_MAGIC_WALL_BD_EMPTYING 527 +#define EL_AMOEBA_DRIPPING 528 /* "unreal" (and therefore not drawable) runtime elements */ #define EL_BLOCKED 600 @@ -917,6 +868,9 @@ extern int num_element_info; #define EL_MAUERND 607 #define EL_BURNING 608 #define EL_PLAYER_IS_LEAVING 609 +#define EL_QUICKSAND_FILLING 610 +#define EL_MAGIC_WALL_FILLING 611 +#define EL_MAGIC_WALL_BD_FILLING 612 /* game graphics: ** 0 - 255: graphics from "RocksScreen" @@ -1426,87 +1380,63 @@ extern int num_element_info; /* the names of the sounds */ -#define SND_ALCHEMY 0 -#define SND_AMOEBE 1 -#define SND_ANTIGRAV 2 -#define SND_AUTSCH 3 -#define SND_BLURB 4 -#define SND_BONG 5 -#define SND_BUING 6 -#define SND_CHASE 7 -#define SND_CZARDASZ 8 -#define SND_DENG 9 -#define SND_FUEL 10 -#define SND_GONG 11 -#define SND_HALLOFFAME 12 -#define SND_HOLZ 13 -#define SND_HUI 14 -#define SND_KABUMM 15 -#define SND_KINK 16 -#define SND_KLAPPER 17 -#define SND_KLING 18 -#define SND_KLOPF 19 -#define SND_KLUMPF 20 -#define SND_KNACK 21 -#define SND_KNURK 22 -#define SND_KRACH 23 -#define SND_LACHEN 24 -#define SND_LASER 25 -#define SND_MIEP 26 -#define SND_NETWORK 27 -#define SND_NJAM 28 -#define SND_OEFFNEN 29 -#define SND_PLING 30 -#define SND_PONG 31 -#define SND_PUSCH 32 -#define SND_QUIEK 33 -#define SND_QUIRK 34 -#define SND_RHYTHMLOOP 35 -#define SND_ROAAAR 36 -#define SND_ROEHR 37 -#define SND_RUMMS 38 -#define SND_SCHLOPP 39 -#define SND_SCHLURF 40 -#define SND_SCHRFF 41 -#define SND_SCHWIRR 42 -#define SND_SIRR 43 -#define SND_SLURP 44 -#define SND_SPROING 45 -#define SND_TWILIGHT 46 -#define SND_TYGER 47 -#define SND_VOYAGER 48 -#define SND_WARNTON 49 -#define SND_WHOOSH 50 -#define SND_ZISCH 51 -#define SND_SP_BASE 52 -#define SND_SP_INFOTRON 53 -#define SND_SP_ZONKDOWN 54 -#define SND_SP_ZONKPUSH 55 -#define SND_SP_BUG 56 -#define SND_SP_BOOM 57 -#define SND_SP_BOOOM 58 -#define SND_SP_EXIT 59 -#define SND_EMPTY 60 -#define SND_GATE 61 - -#define NUM_SOUNDS 62 - -/* default input keys */ -#define DEFAULT_KEY_LEFT KSYM_Left -#define DEFAULT_KEY_RIGHT KSYM_Right -#define DEFAULT_KEY_UP KSYM_Up -#define DEFAULT_KEY_DOWN KSYM_Down -#define DEFAULT_KEY_SNAP KSYM_Shift_L -#define DEFAULT_KEY_BOMB KSYM_Shift_R -#define DEFAULT_KEY_OKAY KSYM_Return -#define DEFAULT_KEY_CANCEL KSYM_Escape - -/* directions for moving */ -#define MV_NO_MOVING 0 -#define MV_LEFT (1 << 0) -#define MV_RIGHT (1 << 1) -#define MV_UP (1 << 2) -#define MV_DOWN (1 << 3) +#define SND_AMOEBE 0 +#define SND_ANTIGRAV 1 +#define SND_AUTSCH 2 +#define SND_BLURB 3 +#define SND_BONG 4 +#define SND_BUING 5 +#define SND_DENG 6 +#define SND_FUEL 7 +#define SND_GONG 8 +#define SND_HALLOFFAME 9 +#define SND_HOLZ 10 +#define SND_HUI 11 +#define SND_KABUMM 12 +#define SND_KINK 13 +#define SND_KLAPPER 14 +#define SND_KLING 15 +#define SND_KLOPF 16 +#define SND_KLUMPF 17 +#define SND_KNACK 18 +#define SND_KNURK 19 +#define SND_KRACH 20 +#define SND_LACHEN 21 +#define SND_LASER 22 +#define SND_MIEP 23 +#define SND_NJAM 24 +#define SND_OEFFNEN 25 +#define SND_PLING 26 +#define SND_PONG 27 +#define SND_PUSCH 28 +#define SND_QUIEK 29 +#define SND_QUIRK 30 +#define SND_RHYTHMLOOP 31 +#define SND_ROAAAR 32 +#define SND_ROEHR 33 +#define SND_RUMMS 34 +#define SND_SCHLOPP 35 +#define SND_SCHLURF 36 +#define SND_SCHRFF 37 +#define SND_SCHWIRR 38 +#define SND_SIRR 39 +#define SND_SLURP 40 +#define SND_SPROING 41 +#define SND_WARNTON 42 +#define SND_WHOOSH 43 +#define SND_ZISCH 44 +#define SND_SP_BASE 45 +#define SND_SP_INFOTRON 46 +#define SND_SP_ZONKDOWN 47 +#define SND_SP_ZONKPUSH 48 +#define SND_SP_BUG 49 +#define SND_SP_BOOM 50 +#define SND_SP_BOOOM 51 +#define SND_SP_EXIT 52 +#define SND_EMPTY 53 +#define SND_GATE 54 + +#define NUM_SOUNDS 55 /* values for game_status */ #define EXITGAME 0 @@ -1518,24 +1448,54 @@ extern int num_element_info; #define TYPENAME 6 #define HALLOFFAME 7 #define SETUP 8 -#define SETUPINPUT 9 -#define CALIBRATION 10 -#define PROGRAM_VERSION_STRING "1.5.0" +#define PROGRAM_VERSION_MAJOR 2 +#define PROGRAM_VERSION_MINOR 0 +#define PROGRAM_VERSION_PATCH 2 +#define PROGRAM_VERSION_STRING "2.0.2" + #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_RIGHTS_STRING "Copyright ^1995-2000 by" +#define PROGRAM_RIGHTS_STRING "Copyright ^1995-2002 by" #define PROGRAM_DOS_PORT_STRING "DOS port done by Guido Schulz" #define PROGRAM_IDENT_STRING PROGRAM_VERSION_STRING " " TARGET_STRING #define WINDOW_TITLE_STRING PROGRAM_TITLE_STRING " " PROGRAM_IDENT_STRING #define WINDOW_SUBTITLE_STRING PROGRAM_RIGHTS_STRING " " PROGRAM_AUTHOR_STRING #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define UNIX_USERDATA_DIRECTORY ".rocksndiamonds" +#define COOKIE_PREFIX "ROCKSNDIAMONDS" +#define FILENAME_PREFIX "Rocks" #define X11_ICON_FILENAME "rocks_icon.xbm" #define X11_ICONMASK_FILENAME "rocks_iconmask.xbm" #define MSDOS_POINTER_FILENAME "mouse.pcx" +/* file version numbers for resource files (levels, tapes, score, setup, etc.) +** currently supported/known file version numbers: +** 1.0 (old) +** 1.2 (still in use) +** 1.4 (still in use) +** 2.0 (actual) +*/ +#define FILE_VERSION_1_0 VERSION_IDENT(1,0,0) +#define FILE_VERSION_1_2 VERSION_IDENT(1,2,0) +#define FILE_VERSION_1_4 VERSION_IDENT(1,4,0) +#define FILE_VERSION_2_0 VERSION_IDENT(2,0,0) + +/* file version does not change for every program version, but is changed + when new features are introduced that are incompatible with older file + versions, so that they can be treated accordingly */ +#define FILE_VERSION_ACTUAL FILE_VERSION_2_0 + +#define GAME_VERSION_1_0 FILE_VERSION_1_0 +#define GAME_VERSION_1_2 FILE_VERSION_1_2 +#define GAME_VERSION_1_4 FILE_VERSION_1_4 +#define GAME_VERSION_2_0 FILE_VERSION_2_0 + +#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \ + PROGRAM_VERSION_MINOR, \ + PROGRAM_VERSION_PATCH) + /* for DrawGraphicAnimation() [tools.c] and AnimateToon() [cartoons.c] */ #define ANIM_NORMAL 0 #define ANIM_OSCILLATE 1