#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
#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
#define BUTTON_1 4
#define BUTTON_2 5
+#define NUM_PLAYER_ACTIONS 6
+
/* values for special "focus player" bitmasks */
#define BIT_SET_FOCUS 6
#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)
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)
#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
/* 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"
#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 : \
Key focus_player_all;
Key tape_eject;
+ Key tape_extra;
Key tape_stop;
Key tape_pause;
Key tape_record;
Key sound_simple;
Key sound_loops;
Key sound_music;
+
+ Key snap_left;
+ Key snap_right;
+ Key snap_up;
+ Key snap_down;
};
struct SetupSystemInfo
boolean prefer_aga_graphics;
int game_frame_delay;
boolean sp_show_border_elements;
+ boolean small_game_graphics;
char *graphics_set;
char *sounds_set;
int id;
};
+struct LevelStats
+{
+ int played;
+ int solved;
+};
+
/* ========================================================================= */
/* exported variables */
extern LevelDirTree *leveldir_current;
extern int level_nr;
+extern struct LevelStats level_stats[];
+
extern Display *display;
extern Visual *visual;
extern int screen;
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);