projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20131120-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
system.h
diff --git
a/src/libgame/system.h
b/src/libgame/system.h
index d9b42bac13136b145d027aafd0897146420648ba..5c1976917b04dd8c44d6790ec709fbddd1884645 100644
(file)
--- a/
src/libgame/system.h
+++ b/
src/libgame/system.h
@@
-285,7
+285,18
@@
REDRAW_TILES | \
REDRAW_MICROLEVEL)
#define REDRAW_FPS (1 << 11)
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)
#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 IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
y >= gfx.sy && y < gfx.sy + gfx.sysize)
@@
-316,6
+327,9
@@
/* maximum allowed length of player name */
#define MAX_PLAYER_NAME_LEN 10
/* 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"
/* default name for empty highscore entry */
#define EMPTY_PLAYER_NAME "no name"
@@
-504,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_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_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 : \
INFOTEXT_LEVEL_DIR : \
(t) == TREE_TYPE_GRAPHICS_DIR ? \
INFOTEXT_GRAPHICS_DIR : \
@@
-633,9
+651,11
@@
typedef int (*EventFilter)(const Event *);
struct ProgramInfo
{
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 *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 */
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 */
@@
-659,6
+679,7
@@
struct ProgramInfo
int version_minor;
int version_patch;
int version_minor;
int version_patch;
+ void (*exit_message_function)(char *, va_list);
void (*exit_function)(int);
};
void (*exit_function)(int);
};
@@
-926,6
+947,10
@@
struct SetupInfo
int override_level_sounds; /* not boolean -- can also be "AUTO" */
int override_level_music; /* not boolean -- can also be "AUTO" */
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;
struct SetupEditorInfo editor;
struct SetupEditorCascadeInfo editor_cascade;
struct SetupShortcutInfo shortcut;
@@
-1155,6
+1180,12
@@
struct TextPosInfo
int id;
};
int id;
};
+struct LevelStats
+{
+ int played;
+ int solved;
+};
+
/* ========================================================================= */
/* exported variables */
/* ========================================================================= */
/* exported variables */
@@
-1175,6
+1206,8
@@
extern LevelDirTree *leveldir_first;
extern LevelDirTree *leveldir_current;
extern int level_nr;
extern LevelDirTree *leveldir_current;
extern int level_nr;
+extern struct LevelStats level_stats[];
+
extern Display *display;
extern Visual *visual;
extern int screen;
extern Display *display;
extern Visual *visual;
extern int screen;
@@
-1198,6
+1231,7
@@
extern int FrameCounter;
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *, int);
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
char *, char *, char *, char *, char *, int);
+void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
void InitExitFunction(void (*exit_function)(int));
void InitPlatformDependentStuff(void);
void ClosePlatformDependentStuff(void);
void InitExitFunction(void (*exit_function)(int));
void InitPlatformDependentStuff(void);
void ClosePlatformDependentStuff(void);