added support for loading and saving number of currently active user
[rocksndiamonds.git] / src / libgame / system.h
index 6e0296ef182a0a7c4dc2600e95d248705c474c00..2011aaacf3e6932985f32011b946555c7199b8e2 100644 (file)
 #define STR_SPECIAL_RENDERING_TARGET   "target_texture_only"
 #define STR_SPECIAL_RENDERING_DOUBLE   "stream_and_target_texture"
 
+#if defined(PLATFORM_EMSCRIPTEN)
+#define STR_SPECIAL_RENDERING_DEFAULT  STR_SPECIAL_RENDERING_BITMAP
+#else
 #define STR_SPECIAL_RENDERING_DEFAULT  STR_SPECIAL_RENDERING_DOUBLE
+#endif
 
 #define SPECIAL_RENDERING_OFF          0
 #define SPECIAL_RENDERING_BITMAP       1
 #define SPECIAL_RENDERING_TARGET       2
 #define SPECIAL_RENDERING_DOUBLE       3
 
-#define SPECIAL_RENDERING_DEFAULT      SPECIAL_RENDERING_DOUBLE
-
 // values for vertical screen retrace synchronization (vsync)
 #define STR_VSYNC_MODE_OFF             "off"
 #define STR_VSYNC_MODE_NORMAL          "normal"
 // maximum number of parallel players supported by libgame functions
 #define MAX_PLAYERS            4
 
+// maximum number of player names
+#define MAX_PLAYER_NAMES       10
+
 // maximum allowed length of player name
 #define MAX_PLAYER_NAME_LEN    10
 
 #define CACHE_DIRECTORY                "cache"
 #define CONF_DIRECTORY         "conf"
 #define NETWORK_DIRECTORY      "network"
+#define USERS_DIRECTORY                "users"
 
 #define GFX_CLASSIC_SUBDIR     "gfx_classic"
 #define SND_CLASSIC_SUBDIR     "snd_classic"
 // file names and filename extensions
 #define LEVELSETUP_DIRECTORY   "levelsetup"
 #define SETUP_FILENAME         "setup.conf"
+#define USERSETUP_FILENAME     "usersetup.conf"
 #define AUTOSETUP_FILENAME     "autosetup.conf"
 #define LEVELSETUP_FILENAME    "levelsetup.conf"
 #define EDITORSETUP_FILENAME   "editorsetup.conf"
                                 (artwork).snd_first :                  \
                                 (artwork).mus_first)
 
+#define ARTWORK_CURRENT_PTR(artwork, type)                             \
+                               ((type) == ARTWORK_TYPE_GRAPHICS ?      \
+                                &(artwork).gfx_current :               \
+                                (type) == ARTWORK_TYPE_SOUNDS ?        \
+                                &(artwork).snd_current :               \
+                                &(artwork).mus_current)
+
+#define ARTWORK_CURRENT(artwork, type)                                 \
+                               ((type) == ARTWORK_TYPE_GRAPHICS ?      \
+                                (artwork).gfx_current :                \
+                                (type) == ARTWORK_TYPE_SOUNDS ?        \
+                                (artwork).snd_current :                \
+                                (artwork).mus_current)
+
 #define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type)                  \
                                ((type) == ARTWORK_TYPE_GRAPHICS ?      \
                                 &(artwork).gfx_current_identifier :    \
@@ -977,6 +998,8 @@ struct NetworkInfo
   char *server_host;
   int server_port;
 
+  SDL_Thread *server_thread;
+  boolean is_server_thread;
 };
 
 struct RuntimeInfo
@@ -1001,6 +1024,7 @@ struct OptionInfo
   char *execute_command;
 
   char *special_flags;
+  char *debug_mode;
 
   boolean mytapes;
   boolean serveronly;
@@ -1156,6 +1180,8 @@ struct TileCursorInfo
   int target_x, target_y;      // tile cursor target screen position
 
   int sx, sy;                  // tile cursor screen start position
+
+  boolean xsn_debug;           // enable or disable XSN debugging
 };
 
 struct OverlayInfo
@@ -1361,12 +1387,16 @@ struct SetupDebugInfo
   boolean frame_delay_use_mod_key;
   boolean frame_delay_game_only;
   boolean show_frames_per_second;
+  int xsn_mode;
+  int xsn_percent;
 };
 
 struct SetupInfo
 {
   char *player_name;
 
+  boolean multiple_users;
+
   boolean sound;
   boolean sound_loops;
   boolean sound_music;
@@ -1434,6 +1464,11 @@ struct SetupInfo
   struct OptionInfo options;
 };
 
+struct UserInfo
+{
+  int nr;
+};
+
 struct TreeInfo
 {
   struct TreeInfo **node_top;          // topmost node in tree
@@ -1754,6 +1789,7 @@ extern struct AnimInfo            anim;
 extern struct ArtworkInfo      artwork;
 extern struct JoystickInfo     joystick;
 extern struct SetupInfo                setup;
+extern struct UserInfo         user;
 
 extern LevelDirTree           *leveldir_first_all;
 extern LevelDirTree           *leveldir_first;
@@ -1810,6 +1846,7 @@ void InitGfxCustomArtworkInfo(void);
 void InitGfxOtherSettings(void);
 void InitTileCursorInfo(void);
 void InitOverlayInfo(void);
+void SetOverlayGridSizeAndButtons(void);
 void SetTileCursorEnabled(boolean);
 void SetTileCursorActive(boolean);
 void SetTileCursorTargetXY(int, int);