added (and set) identifier and level number to global levelset structure
[rocksndiamonds.git] / src / libgame / system.h
index 4ef22022c95a4e2d1dde0325742dce733695c09b..29a98017dd832c63435c16297498f3018ecd5868 100644 (file)
 
 #define TOUCH_MOVE_DISTANCE_DEFAULT    2
 #define TOUCH_DROP_DISTANCE_DEFAULT    5
+#define TOUCH_TRANSPARENCY_DEFAULT     50
 
+#define ALPHA_FROM_TRANSPARENCY(x)     ((100 - x) * SDL_ALPHA_OPAQUE / 100)
+#define ALPHA_FADING_STEPSIZE(x)       ((x) / 25)
 
 /* values for special settings for mobile devices */
 #if defined(PLATFORM_ANDROID)
 #define STYLE_INNER_CORNERS    (1 << 1)
 #define STYLE_REVERSE          (1 << 2)
 
+/* values for special event handling style (used for global animation) */
+#define STYLE_PASSTHROUGH      (1 << 3)
+#define STYLE_MULTIPLE_ACTIONS (1 << 4)
+
 #define STYLE_DEFAULT          STYLE_NONE
 
 /* values for special global animation events */
 
 #define ANIM_EVENT_DEFAULT     ANIM_EVENT_NONE
 
+/* values for special global animation event actions */
+#define ANIM_EVENT_ACTION_NONE -1
+
 /* values for fade mode */
 #define FADE_TYPE_NONE         0
 #define FADE_TYPE_FADE_IN      (1 << 0)
                                                GRID_REAL_HEIGHT),      \
                                            MAX_GRID_YSIZE)
 
-#define DEFAULT_GRID_XSIZE(n)          (n == 0 ? DEFAULT_GRID_XSIZE_0 : \
+#define DEFAULT_GRID_XSIZE(n)          ((n) == 0 ? DEFAULT_GRID_XSIZE_0 : \
                                         DEFAULT_GRID_XSIZE_1)
-#define DEFAULT_GRID_YSIZE(n)          (n == 0 ? DEFAULT_GRID_YSIZE_0 : \
+#define DEFAULT_GRID_YSIZE(n)          ((n) == 0 ? DEFAULT_GRID_YSIZE_0 : \
                                         DEFAULT_GRID_YSIZE_1)
 
 #define GRID_ACTIVE_NR()               (video.screen_width >   \
 #define CHAR_GRID_BUTTON_SNAP          '1'
 #define CHAR_GRID_BUTTON_DROP          '2'
 
+#define GET_ACTION_FROM_GRID_BUTTON(c) ((c) == CHAR_GRID_BUTTON_LEFT ?  \
+                                        JOY_LEFT :                      \
+                                        (c) == CHAR_GRID_BUTTON_RIGHT ? \
+                                        JOY_RIGHT :                     \
+                                        (c) == CHAR_GRID_BUTTON_UP ?    \
+                                        JOY_UP :                        \
+                                        (c) == CHAR_GRID_BUTTON_DOWN ?  \
+                                        JOY_DOWN :                      \
+                                        (c) == CHAR_GRID_BUTTON_SNAP ?  \
+                                        JOY_BUTTON_1 :                  \
+                                        (c) == CHAR_GRID_BUTTON_DROP ?  \
+                                        JOY_BUTTON_2 :                  \
+                                        JOY_NO_ACTION)
+
 /* default name for empty highscore entry */
 #define EMPTY_PLAYER_NAME      "no name"
 
 #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"
@@ -841,6 +866,17 @@ struct ProgramInfo
   boolean headless;
 };
 
+struct NetworkInfo
+{
+  boolean enabled;
+  boolean connected;
+  boolean serveronly;
+
+  char *server_host;
+  int server_port;
+
+};
+
 struct OptionInfo
 {
   char *server_host;
@@ -1022,6 +1058,8 @@ struct OverlayInfo
 
   char grid_button[MAX_GRID_XSIZE][MAX_GRID_YSIZE];
   char grid_button_highlight;
+
+  int grid_button_action;
 };
 
 struct JoystickInfo
@@ -1056,6 +1094,10 @@ struct SetupTouchInfo
 
   char grid_button[2][MAX_GRID_XSIZE][MAX_GRID_YSIZE];
 
+  int transparency;            /* in percent (0 == opaque, 100 == invisible) */
+  boolean draw_outlined;
+  boolean draw_pressed;
+
   boolean grid_initialized;
 };
 
@@ -1216,6 +1258,8 @@ struct SetupInfo
   boolean handicap;
   boolean skip_levels;
   boolean increment_levels;
+  boolean auto_play_next_level;
+  boolean skip_scores_after_game;
   boolean time_limit;
   boolean fullscreen;
   int window_scaling_percent;
@@ -1242,6 +1286,9 @@ struct SetupInfo
   int volume_loops;
   int volume_music;
 
+  boolean network_mode;
+  int network_player_nr;
+
   struct SetupAutoSetupInfo auto_setup;
   struct SetupEditorInfo editor;
   struct SetupEditorCascadeInfo editor_cascade;
@@ -1493,6 +1540,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" */
@@ -1505,6 +1553,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
@@ -1514,6 +1566,14 @@ struct MouseActionInfo
   int button_hint;
 };
 
+struct LevelSetInfo
+{
+  int music[MAX_LEVELS];
+
+  char *identifier;
+  int level_nr;
+};
+
 struct LevelStats
 {
   int played;
@@ -1526,6 +1586,7 @@ struct LevelStats
 /* ========================================================================= */
 
 extern struct ProgramInfo      program;
+extern struct NetworkInfo      network;
 extern struct OptionInfo       options;
 extern struct VideoSystemInfo  video;
 extern struct AudioSystemInfo  audio;
@@ -1542,6 +1603,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;
@@ -1564,6 +1626,7 @@ extern int                        FrameCounter;
 
 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
                     char *, int);
+void InitNetworkInfo(boolean, boolean, boolean, char *, int);
 
 void InitScoresInfo();
 void SetWindowTitle();