X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=b6c2ad3b465f74274944449c2886183a3b737731;hb=3c53030b9e20c59004046274e94eff2ee90d0ab5;hp=756682817a5c1ce99275cb769ee027eff2c15843;hpb=dc856cea3f61d1fecaf875fa519ac72c1c129713;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index 75668281..b6c2ad3b 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -73,6 +73,7 @@ #define DEFAULT_KEY_FOCUS_PLAYER_4 KSYM_F8 #define DEFAULT_KEY_FOCUS_PLAYER_ALL KSYM_F9 #define DEFAULT_KEY_TAPE_EJECT KSYM_UNDEFINED +#define DEFAULT_KEY_TAPE_EXTRA KSYM_UNDEFINED #define DEFAULT_KEY_TAPE_STOP KSYM_UNDEFINED #define DEFAULT_KEY_TAPE_PAUSE KSYM_UNDEFINED #define DEFAULT_KEY_TAPE_RECORD KSYM_UNDEFINED @@ -80,6 +81,10 @@ #define DEFAULT_KEY_SOUND_SIMPLE KSYM_UNDEFINED #define DEFAULT_KEY_SOUND_LOOPS KSYM_UNDEFINED #define DEFAULT_KEY_SOUND_MUSIC KSYM_UNDEFINED +#define DEFAULT_KEY_SNAP_LEFT KSYM_UNDEFINED +#define DEFAULT_KEY_SNAP_RIGHT KSYM_UNDEFINED +#define DEFAULT_KEY_SNAP_UP KSYM_UNDEFINED +#define DEFAULT_KEY_SNAP_DOWN KSYM_UNDEFINED /* values for key_status */ #define KEY_NOT_PRESSED FALSE @@ -130,6 +135,8 @@ #define BUTTON_1 4 #define BUTTON_2 5 +#define NUM_PLAYER_ACTIONS 6 + /* values for special "focus player" bitmasks */ #define BIT_SET_FOCUS 6 @@ -153,6 +160,8 @@ #define KEY_BUTTON_1 (1 << BUTTON_1) #define KEY_BUTTON_2 (1 << BUTTON_2) +#define KEY_BUTTON_SNAP KEY_BUTTON_1 +#define KEY_BUTTON_DROP KEY_BUTTON_2 #define KEY_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN) #define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2) #define KEY_ACTION (KEY_MOTION | KEY_BUTTON) @@ -276,7 +285,18 @@ REDRAW_TILES | \ REDRAW_MICROLEVEL) #define REDRAW_FPS (1 << 11) + +#if defined(TARGET_X11) +/* on old-style, classic and potentially slow graphics systems, redraw single + tiles instead of the whole playfield unless a certain threshold is reached; + when using the X11 target, this method should still be fast on all systems */ #define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2) +#else +/* on modern graphics systems and when using the SDL target, this tile redraw + optimization can slow things down a lot due to many small blits compared to + one single playfield-sized blit (especially observed on Mac OS X with SDL) */ +#define REDRAWTILES_THRESHOLD 0 +#endif #define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \ y >= gfx.sy && y < gfx.sy + gfx.sysize) @@ -295,6 +315,7 @@ #define GAME_FRAME_DELAY 20 /* frame delay in milliseconds */ #define FFWD_FRAME_DELAY 10 /* 200% speed for fast forward */ #define FRAMES_PER_SECOND (ONE_SECOND_DELAY / GAME_FRAME_DELAY) +#define FRAMES_PER_SECOND_SP 35 /* maximum playfield size supported by libgame functions */ #define MAX_PLAYFIELD_WIDTH 128 @@ -306,6 +327,9 @@ /* maximum allowed length of player name */ #define MAX_PLAYER_NAME_LEN 10 +/* maximum number of levels in a level set */ +#define MAX_LEVELS 1000 + /* default name for empty highscore entry */ #define EMPTY_PLAYER_NAME "no name" @@ -494,16 +518,20 @@ #define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS #define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC #define TREE_TYPE_LEVEL_DIR 3 +#define TREE_TYPE_LEVEL_NR 4 -#define NUM_TREE_TYPES 4 +#define NUM_TREE_TYPES 5 #define INFOTEXT_UNDEFINED "" #define INFOTEXT_GRAPHICS_DIR "Custom Graphics" #define INFOTEXT_SOUNDS_DIR "Custom Sounds" #define INFOTEXT_MUSIC_DIR "Custom Music" #define INFOTEXT_LEVEL_DIR "Level Sets" +#define INFOTEXT_LEVEL_NR "Levels" -#define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_DIR ? \ +#define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_NR ? \ + INFOTEXT_LEVEL_NR : \ + (t) == TREE_TYPE_LEVEL_DIR ? \ INFOTEXT_LEVEL_DIR : \ (t) == TREE_TYPE_GRAPHICS_DIR ? \ INFOTEXT_GRAPHICS_DIR : \ @@ -623,9 +651,11 @@ typedef int (*EventFilter)(const Event *); struct ProgramInfo { - char *command_basepath; /* directory that contains the program */ + char *command_basepath; /* path to the program binary */ char *command_basename; /* base filename of the program binary */ + char *maindata_path; /* main game data (installation) directory */ + char *userdata_subdir; /* personal user game data directory */ char *userdata_subdir_unix; /* personal user game data directory (Unix) */ char *userdata_path; /* resulting full path to game data directory */ @@ -754,6 +784,10 @@ struct GfxInfo Bitmap *background_bitmap; int background_bitmap_mask; + boolean clipping_enabled; + int clip_x, clip_y; + int clip_width, clip_height; + boolean override_level_graphics; boolean override_level_sounds; boolean override_level_music; @@ -851,6 +885,7 @@ struct SetupShortcutInfo Key focus_player_all; Key tape_eject; + Key tape_extra; Key tape_stop; Key tape_pause; Key tape_record; @@ -859,6 +894,11 @@ struct SetupShortcutInfo Key sound_simple; Key sound_loops; Key sound_music; + + Key snap_left; + Key snap_right; + Key snap_up; + Key snap_down; }; struct SetupSystemInfo @@ -897,6 +937,7 @@ struct SetupInfo boolean prefer_aga_graphics; int game_frame_delay; boolean sp_show_border_elements; + boolean small_game_graphics; char *graphics_set; char *sounds_set; @@ -905,6 +946,10 @@ struct SetupInfo int override_level_sounds; /* not boolean -- can also be "AUTO" */ int override_level_music; /* not boolean -- can also be "AUTO" */ + int volume_simple; + int volume_loops; + int volume_music; + struct SetupEditorInfo editor; struct SetupEditorCascadeInfo editor_cascade; struct SetupShortcutInfo shortcut; @@ -1108,6 +1153,13 @@ struct Rect int width, height; }; +struct RectWithBorder +{ + int x, y; + int width, height; + int border_size; +}; + struct MenuPosInfo { int x, y; @@ -1127,6 +1179,12 @@ struct TextPosInfo int id; }; +struct LevelStats +{ + int played; + int solved; +}; + /* ========================================================================= */ /* exported variables */ @@ -1147,6 +1205,8 @@ extern LevelDirTree *leveldir_first; extern LevelDirTree *leveldir_current; extern int level_nr; +extern struct LevelStats level_stats[]; + extern Display *display; extern Visual *visual; extern int screen; @@ -1179,6 +1239,7 @@ void InitGfxDoor1Info(int, int, int, int); void InitGfxDoor2Info(int, int, int, int); void InitGfxWindowInfo(int, int); void InitGfxScrollbufferInfo(int, int); +void InitGfxClipRegion(boolean, int, int, int, int); void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)); void InitGfxCustomArtworkInfo(); void SetDrawDeactivationMask(int); @@ -1192,8 +1253,10 @@ void CloseVideoDisplay(void); void InitVideoBuffer(int, int, int, boolean); Bitmap *CreateBitmapStruct(void); Bitmap *CreateBitmap(int, int, int); +void ReCreateBitmap(Bitmap **, int, int, int); void FreeBitmap(Bitmap *); void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int); +void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int); void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int, void (*draw_border_function)(void)); void FillRectangle(Bitmap *, int, int, int, int, Pixel);