added setup option to ask to play again after game is over but not solved
[rocksndiamonds.git] / src / libgame / system.h
index 039f328e1a3fbdafca496c64585c377b4dc270e6..711b227355959cd6e7a28a1523c78c1ab9d34be9 100644 (file)
 #define SPECIAL_RENDERING_DEFAULT      SPECIAL_RENDERING_BITMAP
 #endif
 
+/* values for vertical screen retrace synchronization (vsync) */
+#define STR_VSYNC_MODE_OFF             "off"
+#define STR_VSYNC_MODE_NORMAL          "normal"
+#define STR_VSYNC_MODE_ADAPTIVE                "adaptive"
+
+#define STR_VSYNC_MODE_DEFAULT         STR_VSYNC_MODE_OFF
+
+#define VSYNC_MODE_OFF                 0
+#define VSYNC_MODE_NORMAL              1
+#define VSYNC_MODE_ADAPTIVE            -1
+
+#define VSYNC_MODE_DEFAULT             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 touch control */
 #define TOUCH_CONTROL_OFF              "off"
 #define TOUCH_CONTROL_VIRTUAL_BUTTONS  "virtual_buttons"
 #define MENU_FRAME_DELAY       20      /* frame delay in milliseconds */
 #define GAME_FRAME_DELAY       20      /* frame delay in milliseconds */
 #define FFWD_FRAME_DELAY       10      /* 200% speed for fast forward */
+#define MIN_VSYNC_FRAME_DELAY  15      /* minimum value for vsync to keep */
+#define MAX_VSYNC_FRAME_DELAY  16      /* maximum value for vsync to work */
 #define FRAMES_PER_SECOND      (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
 #define FRAMES_PER_SECOND_SP   35
 
 #define DOCS_DIRECTORY         "docs"
 #define CACHE_DIRECTORY                "cache"
 #define CONF_DIRECTORY         "conf"
+#define NETWORK_DIRECTORY      "network"
 
 #define GFX_CLASSIC_SUBDIR     "gfx_classic"
 #define SND_CLASSIC_SUBDIR     "snd_classic"
@@ -918,6 +938,7 @@ struct VideoSystemInfo
   int window_scaling_percent;
   char *window_scaling_quality;
   int screen_rendering_mode;
+  int vsync_mode;
 
   unsigned int frame_delay;
   unsigned int frame_delay_value;
@@ -1264,11 +1285,14 @@ struct SetupInfo
   int window_scaling_percent;
   char *window_scaling_quality;
   char *screen_rendering_mode;
+  char *vsync_mode;
   boolean ask_on_escape;
   boolean ask_on_escape_editor;
+  boolean ask_on_game_over;
   boolean quick_switch;
   boolean input_on_focus;
   boolean prefer_aga_graphics;
+  boolean game_speed_extended;
   int game_frame_delay;
   boolean sp_show_border_elements;
   boolean small_game_graphics;
@@ -1287,6 +1311,7 @@ struct SetupInfo
 
   boolean network_mode;
   int network_player_nr;
+  char *network_server_hostname;
 
   struct SetupAutoSetupInfo auto_setup;
   struct SetupEditorInfo editor;
@@ -1395,6 +1420,12 @@ struct ValueTextInfo
   char *text;
 };
 
+struct StringValueTextInfo
+{
+  char *value;
+  char *text;
+};
+
 struct ConfigInfo
 {
   char *token;
@@ -1539,6 +1570,7 @@ struct TextPosInfo
   int x, y;
   int xoffset;                 /* special case for tape date and time */
   int xoffset2;                        /* special case for tape date */
+  int yoffset;                 /* special case for list of preview players */
   int width, height;
   int align, valign;
   int size;                    /* also used for suffix ".digits" */
@@ -1551,6 +1583,10 @@ struct TextPosInfo
   int direction;               /* needed for panel time/health graphics */
   int class;                   /* needed for panel time/health graphics */
   int style;                   /* needed for panel time/health graphics */
+
+  int tile_size;               /* special case for list of network players */
+  int border_size;             /* special case for list of preview players */
+  int vertical;                        /* special case for list of preview players */
 };
 
 struct MouseActionInfo
@@ -1560,6 +1596,14 @@ struct MouseActionInfo
   int button_hint;
 };
 
+struct LevelSetInfo
+{
+  int music[MAX_LEVELS];
+
+  char *identifier;
+  int level_nr;
+};
+
 struct LevelStats
 {
   int played;
@@ -1589,6 +1633,7 @@ extern LevelDirTree              *leveldir_first;
 extern LevelDirTree           *leveldir_current;
 extern int                     level_nr;
 
+extern struct LevelSetInfo     levelset;
 extern struct LevelStats       level_stats[];
 
 extern DrawWindow             *window;
@@ -1613,8 +1658,8 @@ void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
                     char *, int);
 void InitNetworkInfo(boolean, boolean, boolean, char *, int);
 
-void InitScoresInfo();
-void SetWindowTitle();
+void InitScoresInfo(void);
+void SetWindowTitle(void);
 
 void InitWindowTitleFunction(char *(*window_title_function)(void));
 void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
@@ -1634,10 +1679,10 @@ void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
 void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int));
 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
 void InitGfxDrawTileCursorFunction(void (*draw_tile_cursor_function)(int));
-void InitGfxCustomArtworkInfo();
-void InitGfxOtherSettings();
-void InitTileCursorInfo();
-void InitOverlayInfo();
+void InitGfxCustomArtworkInfo(void);
+void InitGfxOtherSettings(void);
+void InitTileCursorInfo(void);
+void InitOverlayInfo(void);
 void SetTileCursorEnabled(boolean);
 void SetTileCursorActive(boolean);
 void SetTileCursorTargetXY(int, int);
@@ -1646,7 +1691,7 @@ void SetTileCursorSXSY(int, int);
 void SetOverlayEnabled(boolean);
 void SetOverlayActive(boolean);
 void SetOverlayShowGrid(boolean);
-boolean GetOverlayActive();
+boolean GetOverlayActive(void);
 void SetDrawDeactivationMask(int);
 int GetDrawDeactivationMask(void);
 void SetDrawBackgroundMask(int);
@@ -1676,7 +1721,7 @@ void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
 boolean DrawingDeactivatedField(void);
 boolean DrawingDeactivated(int, int, int, int);
 boolean DrawingOnBackground(int, int);
-boolean DrawingAreaChanged();
+boolean DrawingAreaChanged(void);
 void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
 void BlitTexture(Bitmap *, int, int, int, int, int, int);
 void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
@@ -1693,7 +1738,7 @@ void KeyboardAutoRepeatOn(void);
 void KeyboardAutoRepeatOff(void);
 boolean SetVideoMode(boolean);
 void SetVideoFrameDelay(unsigned int);
-unsigned int GetVideoFrameDelay();
+unsigned int GetVideoFrameDelay(void);
 boolean ChangeVideoModeIfNeeded(boolean);
 
 Bitmap *LoadImage(char *);
@@ -1718,15 +1763,15 @@ void PeekEvent(Event *event);
 void CheckQuitEvent(void);
 Key GetEventKey(KeyEvent *, boolean);
 KeyMod HandleKeyModState(Key, int);
-KeyMod GetKeyModState();
-KeyMod GetKeyModStateFromEvents();
+KeyMod GetKeyModState(void);
+KeyMod GetKeyModStateFromEvents(void);
 void StartTextInput(int, int, int, int);
-void StopTextInput();
+void StopTextInput(void);
 boolean CheckCloseWindowEvent(ClientMessageEvent *);
 
-void InitJoysticks();
+void InitJoysticks(void);
 boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
 boolean CheckJoystickOpened(int);
-void ClearJoystickState();
+void ClearJoystickState(void);
 
 #endif /* SYSTEM_H */