moved game controller base mappings file to new 'conf' sub-directory
[rocksndiamonds.git] / src / libgame / system.h
index 40a1a5d18ad4375bf397d596a4450078b4f08323..2f6c2809fff688814c214e9030b4975d5e5e3f16 100644 (file)
 
 #define STYLE_DEFAULT          STYLE_NONE
 
+/* values for special global animation events */
 #define ANIM_EVENT_NONE                0
-#define ANIM_EVENT_CLICK_ANIM_1        (1 << 0)
-#define ANIM_EVENT_CLICK_ANIM_2        (1 << 1)
-#define ANIM_EVENT_CLICK_ANIM_3        (1 << 2)
-#define ANIM_EVENT_CLICK_ANIM_4        (1 << 3)
-#define ANIM_EVENT_CLICK_ANIM_5        (1 << 4)
-#define ANIM_EVENT_CLICK_ANIM_6        (1 << 5)
-#define ANIM_EVENT_CLICK_ANIM_7        (1 << 6)
-#define ANIM_EVENT_CLICK_ANIM_8        (1 << 7)
-#define ANIM_EVENT_CLICK_PART_1        (1 << 8)
-#define ANIM_EVENT_CLICK_PART_2        (1 << 9)
-#define ANIM_EVENT_CLICK_PART_3        (1 << 10)
-#define ANIM_EVENT_CLICK_PART_4        (1 << 11)
-#define ANIM_EVENT_CLICK_PART_5        (1 << 12)
-#define ANIM_EVENT_CLICK_PART_6        (1 << 13)
-#define ANIM_EVENT_CLICK_PART_7        (1 << 14)
-#define ANIM_EVENT_CLICK_PART_8        (1 << 15)
-#define ANIM_EVENT_CLICK_SELF  (1 << 16)
-#define ANIM_EVENT_CLICK_ANY   (1 << 17)
-
-#define ANIM_EVENT_CLICK_ANIM_ALL      (ANIM_EVENT_CLICK_ANIM_1 |      \
-                                         ANIM_EVENT_CLICK_ANIM_2 |     \
-                                         ANIM_EVENT_CLICK_ANIM_3 |     \
-                                         ANIM_EVENT_CLICK_ANIM_4 |     \
-                                         ANIM_EVENT_CLICK_ANIM_5 |     \
-                                         ANIM_EVENT_CLICK_ANIM_6 |     \
-                                         ANIM_EVENT_CLICK_ANIM_7 |     \
-                                         ANIM_EVENT_CLICK_ANIM_8)
-
-#define ANIM_EVENT_CLICK_PART_ALL      (ANIM_EVENT_CLICK_PART_1 |      \
-                                         ANIM_EVENT_CLICK_PART_2 |     \
-                                         ANIM_EVENT_CLICK_PART_3 |     \
-                                         ANIM_EVENT_CLICK_PART_4 |     \
-                                         ANIM_EVENT_CLICK_PART_5 |     \
-                                         ANIM_EVENT_CLICK_PART_6 |     \
-                                         ANIM_EVENT_CLICK_PART_7 |     \
-                                         ANIM_EVENT_CLICK_PART_8)
+#define ANIM_EVENT_SELF                (1 << 16)
+#define ANIM_EVENT_ANY         (1 << 17)
+
+#define ANIM_EVENT_ANIM_BIT    0
+#define ANIM_EVENT_PART_BIT    8
+
+#define ANIM_EVENT_ANIM_MASK   (0xff << ANIM_EVENT_ANIM_BIT)
+#define ANIM_EVENT_PART_MASK   (0xff << ANIM_EVENT_PART_BIT)
 
 #define ANIM_EVENT_DEFAULT     ANIM_EVENT_NONE
 
 /* maximum number of levels in a level set */
 #define MAX_LEVELS             1000
 
+/* maximum number of global animation and parts */
+#define MAX_GLOBAL_ANIMS               32
+#define MAX_GLOBAL_ANIM_PARTS          32
+
 /* default name for empty highscore entry */
 #define EMPTY_PLAYER_NAME      "no name"
 
 #define SCORES_DIRECTORY       "scores"
 #define DOCS_DIRECTORY         "docs"
 #define CACHE_DIRECTORY                "cache"
+#define CONF_DIRECTORY         "conf"
 
 #define GFX_CLASSIC_SUBDIR     "gfx_classic"
 #define SND_CLASSIC_SUBDIR     "snd_classic"
 #define TAPEFILE_EXTENSION     "tape"
 #define SCOREFILE_EXTENSION    "score"
 
+#define GAMECONTROLLER_BASENAME        "gamecontrollerdb.txt"
+
 #define LOG_OUT_BASENAME       "stdout.txt"
 #define LOG_ERR_BASENAME       "stderr.txt"
 
@@ -821,6 +801,7 @@ struct OptionInfo
   char *sounds_directory;
   char *music_directory;
   char *docs_directory;
+  char *conf_directory;
 
   char *execute_command;
 
@@ -962,13 +943,14 @@ struct GfxInfo
 
 struct OverlayInfo
 {
-  boolean active;
+  boolean enabled;             /* overlay generally enabled or disabled */
+  boolean active;              /* overlay activated (depending on game mode) */
 };
 
 struct JoystickInfo
 {
   int status;
-  int fd[MAX_PLAYERS];         /* file descriptor of player's joystick */
+  int nr[MAX_PLAYERS];         /* joystick number for each player */
 };
 
 struct SetupJoystickInfo
@@ -1490,6 +1472,7 @@ void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
 void InitGfxCustomArtworkInfo();
 void InitGfxOtherSettings();
 void InitOverlayInfo();
+void SetOverlayEnabled(boolean);
 void SetOverlayActive(boolean);
 boolean GetOverlayActive();
 void SetDrawDeactivationMask(int);
@@ -1567,5 +1550,7 @@ boolean CheckCloseWindowEvent(ClientMessageEvent *);
 
 void InitJoysticks();
 boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
+boolean CheckJoystickOpened(int);
+void ClearJoystickState();
 
 #endif /* SYSTEM_H */