projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added option to write tape log file (for high score server)
[rocksndiamonds.git]
/
src
/
libgame
/
system.h
diff --git
a/src/libgame/system.h
b/src/libgame/system.h
index f5b2967e5ffc5345b042c15a29fe5ac7e713422c..bd3f4b8fd6f3bf30629574dc161275b157a0d1d7 100644
(file)
--- a/
src/libgame/system.h
+++ b/
src/libgame/system.h
@@
-22,6
+22,8
@@
#include "windows.h"
#elif defined(PLATFORM_ANDROID)
#include "android.h"
#include "windows.h"
#elif defined(PLATFORM_ANDROID)
#include "android.h"
+#elif defined(PLATFORM_EMSCRIPTEN)
+#include "emscripten.h"
#endif
#include "sdl.h"
#endif
#include "sdl.h"
@@
-103,6
+105,13
@@
#define STR_NETWORK_AUTO_DETECT "auto_detect_network_server"
#define STR_NETWORK_AUTO_DETECT_SETUP "(auto detect network server)"
#define STR_NETWORK_AUTO_DETECT "auto_detect_network_server"
#define STR_NETWORK_AUTO_DETECT_SETUP "(auto detect network server)"
+// values for API server settings
+#define API_SERVER_HOSTNAME "api.artsoft.org"
+#define API_SERVER_PORT 80
+#define API_SERVER_METHOD "POST"
+#define API_SERVER_URI_ADD "/api/scores/add"
+#define API_SERVER_URI_GET "/api/scores/get"
+
// values for touch control
#define TOUCH_CONTROL_OFF "off"
#define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons"
// values for touch control
#define TOUCH_CONTROL_OFF "off"
#define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons"
@@
-605,6
+614,9
@@
// default value for undefined levelset
#define UNDEFINED_LEVELSET "[NONE]"
// default value for undefined levelset
#define UNDEFINED_LEVELSET "[NONE]"
+// default value for undefined password
+#define UNDEFINED_PASSWORD "[undefined]"
+
// default value for undefined parameter
#define ARG_DEFAULT "[DEFAULT]"
// default value for undefined parameter
#define ARG_DEFAULT "[DEFAULT]"
@@
-615,18
+627,11
@@
// default value for off-screen positions
#define POS_OFFSCREEN (-1000000)
// default value for off-screen positions
#define POS_OFFSCREEN (-1000000)
-// definitions for game sub-directories
-#ifndef
RO_GAME_DIR
-#define
RO_GAME_DIR
"."
+// definitions for game
base path and
sub-directories
+#ifndef
BASE_PATH
+#define
BASE_PATH
"."
#endif
#endif
-#ifndef RW_GAME_DIR
-#define RW_GAME_DIR "."
-#endif
-
-#define RO_BASE_PATH RO_GAME_DIR
-#define RW_BASE_PATH RW_GAME_DIR
-
// directory names
#define GRAPHICS_DIRECTORY "graphics"
#define SOUNDS_DIRECTORY "sounds"
// directory names
#define GRAPHICS_DIRECTORY "graphics"
#define SOUNDS_DIRECTORY "sounds"
@@
-774,6
+779,11
@@
#define NUM_BASE_TREE_TYPES 4
#define NUM_TREE_TYPES 6
#define NUM_BASE_TREE_TYPES 4
#define NUM_TREE_TYPES 6
+#define TREE_TYPE_IS_DIR(type) ((type) == TREE_TYPE_GRAPHICS_DIR || \
+ (type) == TREE_TYPE_SOUNDS_DIR || \
+ (type) == TREE_TYPE_MUSIC_DIR || \
+ (type) == TREE_TYPE_LEVEL_DIR)
+
#define INFOTEXT_UNDEFINED ""
#define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
#define INFOTEXT_SOUNDS_DIR "Custom Sounds"
#define INFOTEXT_UNDEFINED ""
#define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
#define INFOTEXT_SOUNDS_DIR "Custom Sounds"
@@
-1003,9
+1013,6
@@
struct ProgramInfo
void (*exit_message_function)(char *, va_list);
void (*exit_function)(int);
void (*exit_message_function)(char *, va_list);
void (*exit_function)(int);
- boolean global_scores;
- boolean many_scores_per_name;
-
boolean headless;
};
boolean headless;
};
@@
-1025,6
+1032,8
@@
struct NetworkInfo
struct RuntimeInfo
{
boolean uses_touch_device;
struct RuntimeInfo
{
boolean uses_touch_device;
+
+ boolean api_server;
};
struct OptionInfo
};
struct OptionInfo
@@
-1032,8
+1041,7
@@
struct OptionInfo
char *server_host;
int server_port;
char *server_host;
int server_port;
- char *ro_base_directory;
- char *rw_base_directory;
+ char *base_directory;
char *level_directory;
char *graphics_directory;
char *sounds_directory;
char *level_directory;
char *graphics_directory;
char *sounds_directory;
@@
-1042,6
+1050,7
@@
struct OptionInfo
char *conf_directory;
char *execute_command;
char *conf_directory;
char *execute_command;
+ char *tape_log_filename;
char *special_flags;
char *debug_mode;
char *special_flags;
char *debug_mode;
@@
-1454,6
+1463,8
@@
struct SetupInfo
boolean ask_on_escape;
boolean ask_on_escape_editor;
boolean ask_on_game_over;
boolean ask_on_escape;
boolean ask_on_escape_editor;
boolean ask_on_game_over;
+ boolean ask_on_quit_game;
+ boolean ask_on_quit_program;
boolean quick_switch;
boolean input_on_focus;
boolean prefer_aga_graphics;
boolean quick_switch;
boolean input_on_focus;
boolean prefer_aga_graphics;
@@
-1464,6
+1475,7
@@
struct SetupInfo
boolean sp_show_border_elements;
boolean small_game_graphics;
boolean show_snapshot_buttons;
boolean sp_show_border_elements;
boolean small_game_graphics;
boolean show_snapshot_buttons;
+ boolean only_show_local_scores;
char *graphics_set;
char *sounds_set;
char *graphics_set;
char *sounds_set;
@@
-1480,6
+1492,10
@@
struct SetupInfo
int network_player_nr;
char *network_server_hostname;
int network_player_nr;
char *network_server_hostname;
+ boolean api_server;
+ char *api_server_hostname;
+ char *api_server_password;
+
struct SetupAutoSetupInfo auto_setup;
struct SetupLevelSetupInfo level_setup;
struct SetupAutoSetupInfo auto_setup;
struct SetupLevelSetupInfo level_setup;
@@
-1556,6
+1572,7
@@
struct TreeInfo
boolean level_group; // directory contains more level series directories
boolean parent_link; // entry links back to parent directory
boolean level_group; // directory contains more level series directories
boolean parent_link; // entry links back to parent directory
+ boolean is_copy; // this entry is a copy of another entry in the tree
boolean in_user_dir; // user defined levels are stored in home directory
boolean user_defined; // levels in user directory and marked as "private"
boolean readonly; // readonly levels can not be changed with editor
boolean in_user_dir; // user defined levels are stored in home directory
boolean user_defined; // levels in user directory and marked as "private"
boolean readonly; // readonly levels can not be changed with editor
@@
-1852,7
+1869,6
@@
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
void InitNetworkInfo(boolean, boolean, boolean, char *, int);
void InitRuntimeInfo(void);
void InitNetworkInfo(boolean, boolean, boolean, char *, int);
void InitRuntimeInfo(void);
-void InitScoresInfo(void);
void SetWindowTitle(void);
void InitWindowTitleFunction(char *(*window_title_function)(void));
void SetWindowTitle(void);
void InitWindowTitleFunction(char *(*window_title_function)(void));
@@
-1941,6
+1957,7
@@
Bitmap *LoadImage(char *);
Bitmap *LoadCustomImage(char *);
void ReloadCustomImage(Bitmap *, char *);
Bitmap *LoadCustomImage(char *);
void ReloadCustomImage(Bitmap *, char *);
+Bitmap *ZoomBitmap(Bitmap *, int, int);
void ReCreateGameTileSizeBitmap(Bitmap **);
void CreateBitmapWithSmallBitmaps(Bitmap **, int, int);
void CreateBitmapTextures(Bitmap **);
void ReCreateGameTileSizeBitmap(Bitmap **);
void CreateBitmapWithSmallBitmaps(Bitmap **, int, int);
void CreateBitmapTextures(Bitmap **);
@@
-1974,4
+1991,7
@@
boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
boolean CheckJoystickOpened(int);
void ClearJoystickState(void);
boolean CheckJoystickOpened(int);
void ClearJoystickState(void);
+void InitEmscriptenFilesystem(void);
+void SyncEmscriptenFilesystem(void);
+
#endif // SYSTEM_H
#endif // SYSTEM_H