projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20140108-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
system.h
diff --git
a/src/libgame/system.h
b/src/libgame/system.h
index df95c9d336ff7ed064fb095c09572b5149b947b0..dfa7a4f73cd1af11b0cffa925416f02e14ba9b19 100644
(file)
--- a/
src/libgame/system.h
+++ b/
src/libgame/system.h
@@
-24,6
+24,8
@@
#include "windows.h"
#elif defined(PLATFORM_MSDOS)
#include "msdos.h"
#include "windows.h"
#elif defined(PLATFORM_MSDOS)
#include "msdos.h"
+#elif defined(PLATFORM_ANDROID)
+#include "android.h"
#endif
#if defined(TARGET_SDL)
#endif
#if defined(TARGET_SDL)
@@
-45,9
+47,19
@@
#define BLIT_INVERSE 2
#define BLIT_ON_BACKGROUND 3
#define BLIT_INVERSE 2
#define BLIT_ON_BACKGROUND 3
+/* values for fullscreen status */
#define FULLSCREEN_NOT_AVAILABLE FALSE
#define FULLSCREEN_AVAILABLE TRUE
#define FULLSCREEN_NOT_AVAILABLE FALSE
#define FULLSCREEN_AVAILABLE TRUE
+/* values for window scaling */
+#define WINDOW_SCALING_NOT_AVAILABLE FALSE
+#define WINDOW_SCALING_AVAILABLE TRUE
+
+#define MIN_WINDOW_SCALING_PERCENT 50
+#define STD_WINDOW_SCALING_PERCENT 100
+#define MAX_WINDOW_SCALING_PERCENT 300
+#define STEP_WINDOW_SCALING_PERCENT 10
+
/* default input keys */
#define DEFAULT_KEY_LEFT KSYM_Left
#define DEFAULT_KEY_RIGHT KSYM_Right
/* default input keys */
#define DEFAULT_KEY_LEFT KSYM_Left
#define DEFAULT_KEY_RIGHT KSYM_Right
@@
-285,7
+297,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)
@@
-633,16
+656,22
@@
/* type definitions */
/* type definitions */
+#if defined(TARGET_SDL2)
+typedef int (*EventFilter)(void *, Event *);
+#else
typedef int (*EventFilter)(const Event *);
typedef int (*EventFilter)(const Event *);
+#endif
/* structure definitions */
struct ProgramInfo
{
/* structure definitions */
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 */
@@
-666,6
+695,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);
};
@@
-703,11
+733,16
@@
struct VideoSystemInfo
{
int default_depth;
int width, height, depth;
{
int default_depth;
int width, height, depth;
+ int window_width, window_height;
boolean fullscreen_available;
boolean fullscreen_enabled;
boolean fullscreen_available;
boolean fullscreen_enabled;
+ boolean fullscreen_initial;
struct ScreenModeInfo *fullscreen_modes;
char *fullscreen_mode_current;
struct ScreenModeInfo *fullscreen_modes;
char *fullscreen_mode_current;
+
+ boolean window_scaling_available;
+ int window_scaling_percent;
};
struct AudioSystemInfo
};
struct AudioSystemInfo
@@
-917,6
+952,7
@@
struct SetupInfo
boolean time_limit;
boolean fullscreen;
char *fullscreen_mode;
boolean time_limit;
boolean fullscreen;
char *fullscreen_mode;
+ int window_scaling_percent;
boolean ask_on_escape;
boolean ask_on_escape_editor;
boolean quick_switch;
boolean ask_on_escape;
boolean ask_on_escape_editor;
boolean quick_switch;
@@
-933,6
+969,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;
@@
-1201,6
+1241,9
@@
extern DrawBuffer *drawto;
extern int button_status;
extern boolean motion_status;
extern int button_status;
extern boolean motion_status;
+#if defined(TARGET_SDL2)
+extern boolean keyrepeat_status;
+#endif
extern int redraw_mask;
extern int redraw_tiles;
extern int redraw_mask;
extern int redraw_tiles;
@@
-1213,6
+1256,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);