rnd-20020401-3-src
[rocksndiamonds.git] / src / libgame / system.h
index 0cf978df10d41cf7f983fa049d288338cbb6dd9a..801fb44bdbe31a55e9fce93a4cdd8fc10fcc9294 100644 (file)
@@ -28,8 +28,6 @@
 #endif
 
 
-/* contant definitions */
-
 /* the additional 'b' is needed for Win32 to open files in binary mode */
 #define MODE_READ              "rb"
 #define MODE_WRITE             "wb"
 #define DEFAULT_KEY_OKAY       KSYM_Return
 #define DEFAULT_KEY_CANCEL     KSYM_Escape
 
+/* default shortcut keys */
+#define DEFAULT_KEY_SAVE_GAME  KSYM_F1
+#define DEFAULT_KEY_LOAD_GAME  KSYM_F2
+
 /* values for move directions */
 #define MV_NO_MOVING           0
 #define MV_LEFT                        (1 << 0)
@@ -65,6 +67,7 @@
 #define MB_MENU_CHOICE         FALSE
 #define MB_MENU_MARK           TRUE
 #define MB_MENU_INITIALIZE     (-1)
+#define MB_MENU_LEAVE          (-2)
 #define MB_LEFTBUTTON          1
 #define MB_MIDDLEBUTTON                2
 #define MB_RIGHTBUTTON         3
 #define DOOR_GFX_PAGEY1                (0)
 #define DOOR_GFX_PAGEY2                (gfx.dysize)
 
+/* functions for version handling */
+#define VERSION_IDENT(x,y,z)   ((x) * 10000 + (y) * 100 + (z))
+#define VERSION_MAJOR(x)       ((x) / 10000)
+#define VERSION_MINOR(x)       (((x) % 10000) / 100)
+#define VERSION_PATCH(x)       ((x) % 100)
 
-/* type definitions */
 
+/* type definitions */
 typedef int (*EventFilter)(const Event *);
 
 
@@ -163,10 +171,18 @@ struct ProgramInfo
   char *program_title;
   char *window_title;
   char *icon_title;
+
   char *x11_icon_filename;
   char *x11_iconmask_filename;
   char *msdos_pointer_filename;
 
+  char *cookie_prefix;
+  char *filename_prefix;       /* prefix to cut off from DOS filenames */
+
+  int version_major;
+  int version_minor;
+  int version_patch;
+
   void (*exit_function)(int);
 };
 
@@ -226,6 +242,16 @@ struct GfxInfo
 
   int vx, vy;
   int vxsize, vysize;
+
+  boolean draw_deactivation_mask;
+};
+
+struct ArtworkInfo
+{
+  char *custom_artwork;
+  char *custom_graphics;
+  char *custom_sounds;
+  char *custom_music;
 };
 
 struct JoystickInfo
@@ -261,6 +287,12 @@ struct SetupInputInfo
   struct SetupKeyboardInfo key;
 };
 
+struct SetupShortcutInfo
+{
+  Key save_game;
+  Key load_game;
+};
+
 struct SetupInfo
 {
   char *player_name;
@@ -282,6 +314,7 @@ struct SetupInfo
   boolean time_limit;
   boolean fullscreen;
 
+  struct SetupShortcutInfo shortcut;
   struct SetupInputInfo input[MAX_PLAYERS];
 };
 
@@ -324,6 +357,7 @@ extern struct OptionInfo    options;
 extern struct VideoSystemInfo  video;
 extern struct AudioSystemInfo  audio;
 extern struct GfxInfo          gfx;
+extern struct ArtworkInfo      artwork;
 extern struct JoystickInfo     joystick;
 extern struct SetupInfo                setup;
 
@@ -356,12 +390,14 @@ void InitExitFunction(void (*exit_function)(int));
 void InitPlatformDependantStuff(void);
 void ClosePlatformDependantStuff(void);
 
-void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *);
+void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
+                    char *, char *, int);
 
 void InitGfxFieldInfo(int, int, int, int, int, int, int, int);
 void InitGfxDoor1Info(int, int, int, int);
 void InitGfxDoor2Info(int, int, int, int);
 void InitGfxScrollbufferInfo(int, int);
+void SetDrawDeactivationMask(int );
 
 inline void InitVideoDisplay(void);
 inline void CloseVideoDisplay(void);
@@ -389,6 +425,7 @@ inline boolean SetVideoMode(boolean);
 inline boolean ChangeVideoModeIfNeeded(boolean);
 
 Bitmap *LoadImage(char *);
+Bitmap *LoadCustomImage(char *);
 
 inline void OpenAudio(void);
 inline void CloseAudio(void);
@@ -400,4 +437,7 @@ inline void NextEvent(Event *event);
 inline Key GetEventKey(KeyEvent *, boolean);
 inline boolean CheckCloseWindowEvent(ClientMessageEvent *);
 
+inline void InitJoysticks();
+inline boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
+
 #endif /* SYSTEM_H */