X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=abed03f0096cd0e639b365e8896e0293ff7a7655;hb=bf1e4db1ffa9a313b8d1b68e55633ace682fef96;hp=a48ccf05551863bd0c278f9abf88d81286793f74;hpb=5e616edfe5f101927d2ff3f7a14d2c65897de3cc;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index a48ccf05..abed03f0 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -55,10 +55,10 @@ #define DEFAULT_KEY_DOWN KSYM_Down #if defined(PLATFORM_MACOSX) #define DEFAULT_KEY_SNAP KSYM_Control_L -#define DEFAULT_KEY_BOMB KSYM_KP_Enter +#define DEFAULT_KEY_DROP KSYM_KP_Enter #else -#define DEFAULT_KEY_SNAP KSYM_Shift_L -#define DEFAULT_KEY_BOMB KSYM_Shift_R +#define DEFAULT_KEY_SNAP KSYM_Control_L +#define DEFAULT_KEY_DROP KSYM_Control_R #endif #define DEFAULT_KEY_OKAY KSYM_Return #define DEFAULT_KEY_CANCEL KSYM_Escape @@ -126,12 +126,11 @@ #define ANIM_RANDOM (1 << 4) #define ANIM_REVERSE (1 << 5) -#if 0 -/* values for special animation modes */ -#define ANIM_DEFAULT (1 << 6) -#define ANIM_QUICK (1 << 7) -#define ANIM_SPECIAL1 (1 << 8) -#endif +/* values for special (non game element) animation modes */ +#define ANIM_HORIZONTAL (1 << 6) +#define ANIM_VERTICAL (1 << 7) + +#define ANIM_DEFAULT ANIM_LOOP /* values for redraw_mask */ #define REDRAW_NONE (0) @@ -158,6 +157,12 @@ #define REDRAW_FPS (1 << 11) #define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2) +#define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \ + y >= gfx.sy && y < gfx.sy + gfx.sysize) +#define IN_GFX_DOOR(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \ + y >= gfx.dy && y < gfx.dy + gfx.dysize) +#define IN_GFX_VIDEO(x, y) (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \ + y >= gfx.vy && y < gfx.vy + gfx.vysize) /* values for mouse cursor */ #define CURSOR_DEFAULT 0 @@ -176,6 +181,9 @@ /* default name for unknown player names */ #define ANONYMOUS_NAME "anonymous" +/* default for other unknown names */ +#define UNKNOWN_NAME "unknown" + /* default name for new levels */ #define NAMELESS_LEVEL_NAME "nameless level" @@ -204,6 +212,7 @@ #define RO_BASE_PATH RO_GAME_DIR #define RW_BASE_PATH RW_GAME_DIR +/* directory names */ #define GRAPHICS_DIRECTORY "graphics" #define SOUNDS_DIRECTORY "sounds" #define MUSIC_DIRECTORY "music" @@ -222,6 +231,37 @@ #define MUS_CLASSIC_SUBDIR "mus_orig" #endif +/* file names and filename extensions */ +#if !defined(PLATFORM_MSDOS) +#define LEVELSETUP_DIRECTORY "levelsetup" +#define SETUP_FILENAME "setup.conf" +#define LEVELSETUP_FILENAME "levelsetup.conf" +#define EDITORSETUP_FILENAME "editorsetup.conf" +#define HELPANIM_FILENAME "helpanim.conf" +#define HELPTEXT_FILENAME "helptext.conf" +#define LEVELINFO_FILENAME "levelinfo.conf" +#define GRAPHICSINFO_FILENAME "graphicsinfo.conf" +#define SOUNDSINFO_FILENAME "soundsinfo.conf" +#define MUSICINFO_FILENAME "musicinfo.conf" +#define LEVELFILE_EXTENSION "level" +#define TAPEFILE_EXTENSION "tape" +#define SCOREFILE_EXTENSION "score" +#else +#define LEVELSETUP_DIRECTORY "lvlsetup" +#define SETUP_FILENAME "setup.cnf" +#define LEVELSETUP_FILENAME "lvlsetup.cnf" +#define EDITORSETUP_FILENAME "edsetup.cnf" +#define HELPANIM_FILENAME "helpanim.conf" +#define HELPTEXT_FILENAME "helptext.conf" +#define LEVELINFO_FILENAME "lvlinfo.cnf" +#define GRAPHICSINFO_FILENAME "gfxinfo.cnf" +#define SOUNDSINFO_FILENAME "sndinfo.cnf" +#define MUSICINFO_FILENAME "musinfo.cnf" +#define LEVELFILE_EXTENSION "lvl" +#define TAPEFILE_EXTENSION "tap" +#define SCOREFILE_EXTENSION "sco" +#endif + /* areas in bitmap PIX_DOOR */ /* meaning in PIX_DB_DOOR: (3 PAGEs) @@ -244,12 +284,11 @@ /* macros for version handling */ -#define VERSION_IDENT(x,y,z) ((x) * 1000000 + (y) * 10000 + (z) * 100) -#define RELEASE_IDENT(x,y,z,r) (VERSION_IDENT(x,y,z) + (r)) #define VERSION_MAJOR(x) ((x) / 1000000) #define VERSION_MINOR(x) (((x) % 1000000) / 10000) #define VERSION_PATCH(x) (((x) % 10000) / 100) -#define VERSION_RELEASE(x) ((x) % 100) +#define VERSION_BUILD(x) ((x) % 100) +#define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d)) /* macros for parent/child process identification */ @@ -325,6 +364,30 @@ (artwork).snd_current_identifier : \ (artwork).mus_current_identifier) +#define ARTWORKINFO_FILENAME(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + GRAPHICSINFO_FILENAME : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + SOUNDSINFO_FILENAME : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + MUSICINFO_FILENAME : "") + +#define ARTWORK_DIRECTORY(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + GRAPHICS_DIRECTORY : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + SOUNDS_DIRECTORY : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + MUSIC_DIRECTORY : "") + +#define OPTIONS_ARTWORK_DIRECTORY(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + options.graphics_directory : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + options.sounds_directory : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + options.music_directory : "") + /* type definitions */ typedef int (*EventFilter)(const Event *); @@ -458,18 +521,13 @@ struct SetupJoystickInfo int xleft, xmiddle, xright; int yupper, ymiddle, ylower; - int snap; - int bomb; + int snap, drop; }; struct SetupKeyboardInfo { - Key left; - Key right; - Key up; - Key down; - Key snap; - Key bomb; + Key left, right, up, down; + Key snap, drop; }; struct SetupInputInfo @@ -491,6 +549,7 @@ struct SetupEditorInfo boolean el_chars; boolean el_custom; boolean el_custom_more; + boolean el_user_defined; boolean el_headlines; }; @@ -579,6 +638,8 @@ struct TreeInfo int last_level; /* last level number (automatically calculated) */ int sort_priority; /* sort levels by 'sort_priority' and then by name */ + boolean latest_engine;/* force level set to use the latest game engine */ + boolean level_group; /* directory contains more level series directories */ boolean parent_link; /* entry links back to parent directory */ boolean user_defined; /* user defined levels are stored in home directory */