added user structure for upcoming multiple user support
[rocksndiamonds.git] / src / libgame / system.h
index f70b6b5fdfc950b198fd79911ed2d8ae3052331a..3962dbdba4107a6e5fae8890a49d73cb832dee3a 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // system.h
 // ============================================================================
 #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"
 
 #define VSYNC_MODE_DEFAULT             VSYNC_MODE_OFF
 
+#define VSYNC_MODE_STR_TO_INT(s)                                       \
+  (strEqual((s), STR_VSYNC_MODE_NORMAL)                ? VSYNC_MODE_NORMAL :   \
+   strEqual((s), STR_VSYNC_MODE_ADAPTIVE)      ? VSYNC_MODE_ADAPTIVE : \
+   VSYNC_MODE_OFF)
+
+#define VSYNC_MODE_INT_TO_STR(i)                                       \
+  ((i) == VSYNC_MODE_NORMAL            ? STR_VSYNC_MODE_NORMAL :       \
+   (i) == VSYNC_MODE_ADAPTIVE          ? STR_VSYNC_MODE_ADAPTIVE :     \
+   STR_VSYNC_MODE_OFF)
+
 // values for network server settings
 #define STR_NETWORK_AUTO_DETECT                "auto_detect_network_server"
 #define STR_NETWORK_AUTO_DETECT_SETUP  "(auto detect network server)"
 
 // values for special settings for mobile devices
 #if defined(PLATFORM_ANDROID)
+#define HAS_TOUCH_DEVICE
 #define USE_TOUCH_INPUT_OVERLAY
 #define USE_COMPLETE_DISPLAY
 #define HAS_SCREEN_KEYBOARD
                                 (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 :    \
@@ -966,6 +993,8 @@ struct NetworkInfo
   char *server_host;
   int server_port;
 
+  SDL_Thread *server_thread;
+  boolean is_server_thread;
 };
 
 struct RuntimeInfo
@@ -990,6 +1019,7 @@ struct OptionInfo
   char *execute_command;
 
   char *special_flags;
+  char *debug_mode;
 
   boolean mytapes;
   boolean serveronly;
@@ -1145,6 +1175,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
@@ -1295,6 +1327,7 @@ struct SetupShortcutInfo
 
 struct SetupSystemInfo
 {
+  char *sdl_renderdriver;
   char *sdl_videodriver;
   char *sdl_audiodriver;
   int audio_fragment_size;
@@ -1330,6 +1363,7 @@ struct SetupInternalInfo
   boolean create_user_levelset;
 
   boolean menu_game;
+  boolean menu_engines;
   boolean menu_editor;
   boolean menu_graphics;
   boolean menu_sound;
@@ -1348,12 +1382,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;
@@ -1386,6 +1424,7 @@ struct SetupInfo
   boolean quick_switch;
   boolean input_on_focus;
   boolean prefer_aga_graphics;
+  boolean prefer_lowpass_sounds;
   boolean game_speed_extended;
   int game_frame_delay;
   boolean sp_show_border_elements;
@@ -1420,6 +1459,11 @@ struct SetupInfo
   struct OptionInfo options;
 };
 
+struct UserInfo
+{
+  int nr;
+};
+
 struct TreeInfo
 {
   struct TreeInfo **node_top;          // topmost node in tree
@@ -1454,6 +1498,8 @@ struct TreeInfo
   char *graphics_set_ecs; // special EMC custom graphics set (ECS graphics)
   char *graphics_set_aga; // special EMC custom graphics set (AGA graphics)
   char *graphics_set;  // optional custom graphics set (level tree only)
+  char *sounds_set_default; // default EMC custom sounds set
+  char *sounds_set_lowpass; // special EMC custom sounds set (lowpass filter)
   char *sounds_set;    // optional custom sounds set (level tree only)
   char *music_set;     // optional custom music set (level tree only)
   char *graphics_path; // path to optional custom graphics set (level only)
@@ -1738,6 +1784,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;
@@ -1755,6 +1802,7 @@ extern int                        button_status;
 extern boolean                 motion_status;
 extern int                     wheel_steps;
 extern boolean                 keyrepeat_status;
+extern boolean                 textinput_status;
 
 extern int                     redraw_mask;
 
@@ -1793,6 +1841,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);