rnd-20140311-1-src
[rocksndiamonds.git] / src / libgame / system.h
index b9f65d149e19f77bffcc2b2aefc5ccc982ec461d..b9c74003365e64ead0319b70879c65caeabc8e4c 100644 (file)
 #define WINDOW_SCALING_NOT_AVAILABLE   FALSE
 #define WINDOW_SCALING_AVAILABLE       TRUE
 
-#define MIN_WINDOW_SCALING_PERCENT     10
+#define MIN_WINDOW_SCALING_PERCENT     50
 #define STD_WINDOW_SCALING_PERCENT     100
 #define MAX_WINDOW_SCALING_PERCENT     300
+#define STEP_WINDOW_SCALING_PERCENT    10
+
+/* values for window scaling quality */
+#define SCALING_QUALITY_NEAREST                "nearest"
+#define SCALING_QUALITY_LINEAR         "linear"
+#define SCALING_QUALITY_BEST           "best"
+
+#define SCALING_QUALITY_DEFAULT                SCALING_QUALITY_LINEAR
 
 /* default input keys */
 #define DEFAULT_KEY_LEFT               KSYM_Left
 #define REDRAWTILES_THRESHOLD  0
 #endif
 
-#define IN_GFX_SCREEN(x, y)    (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
+#define IN_GFX_FIELD_PLAY(x, y)        (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
                                 y >= gfx.sy && y < gfx.sy + gfx.sysize)
-#define IN_GFX_DOOR(x, y)      (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
+#define IN_GFX_FIELD_FULL(x, y)        (x >= gfx.real_sx && \
+                                x <  gfx.real_sx + gfx.full_sxsize && \
+                                y >= gfx.real_sy && \
+                                y <  gfx.real_sy + gfx.full_sysize)
+#define IN_GFX_DOOR_1(x, y)    (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
                                 y >= gfx.dy && y < gfx.dy + gfx.dysize)
-#define IN_GFX_VIDEO(x, y)     (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
+#define IN_GFX_DOOR_2(x, y)    (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
                                 y >= gfx.vy && y < gfx.vy + gfx.vysize)
+#define IN_GFX_DOOR_3(x, y)    (x >= gfx.ex && x < gfx.ex + gfx.exsize && \
+                                y >= gfx.ey && y < gfx.ey + gfx.eysize)
 
 /* values for mouse cursor */
 #define CURSOR_DEFAULT         0
 
 /* default values for undefined configuration file parameters */
 #define ARG_UNDEFINED          "-1000000"
-#define ARG_UNDEFINED_VALUE    (atoi(ARG_UNDEFINED))
+#define ARG_UNDEFINED_VALUE    (-1000000)
+
+/* default value for off-screen positions */
+#define POS_OFFSCREEN          (-1000000)
 
 /* definitions for game sub-directories */
 #ifndef RO_GAME_DIR
@@ -694,6 +711,7 @@ struct ProgramInfo
   int version_minor;
   int version_patch;
 
+  char *(*window_title_function)(void);
   void (*exit_message_function)(char *, va_list);
   void (*exit_function)(int);
 };
@@ -732,14 +750,17 @@ struct VideoSystemInfo
 {
   int default_depth;
   int width, height, depth;
+  int window_width, window_height;
 
   boolean fullscreen_available;
   boolean fullscreen_enabled;
+  boolean fullscreen_initial;
   struct ScreenModeInfo *fullscreen_modes;
   char *fullscreen_mode_current;
 
   boolean window_scaling_available;
   int window_scaling_percent;
+  char *window_scaling_quality;
 };
 
 struct AudioSystemInfo
@@ -793,6 +814,9 @@ struct GfxInfo
   int vx, vy;
   int vxsize, vysize;
 
+  int ex, ey;
+  int exsize, eysize;
+
   int win_xsize, win_ysize;
 
   int draw_deactivation_mask;
@@ -950,6 +974,7 @@ struct SetupInfo
   boolean fullscreen;
   char *fullscreen_mode;
   int window_scaling_percent;
+  char *window_scaling_quality;
   boolean ask_on_escape;
   boolean ask_on_escape_editor;
   boolean quick_switch;
@@ -1187,6 +1212,19 @@ struct MenuPosInfo
   int align, valign;
 };
 
+struct DoorPartPosInfo
+{
+  int x, y;
+  int step_xoffset;
+  int step_yoffset;
+  int step_delay;
+  int start_step;
+  int start_step_opening;
+  int start_step_closing;
+  boolean draw_masked;
+  int sort_priority;
+};
+
 struct TextPosInfo
 {
   int x, y;
@@ -1195,6 +1233,7 @@ struct TextPosInfo
   int size;
   int font, font_alt;
   boolean draw_masked;
+  boolean draw_player;         /* special case for network player buttons */
   int sort_priority;
   int id;
 };
@@ -1250,9 +1289,17 @@ extern int                       FrameCounter;
 
 /* function definitions */
 
+#if 1
+void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
+                    char *, char *, char *, char *, int);
+#else
 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
                     char *, char *, char *, char *, char *, int);
+#endif
+
+void SetWindowTitle();
 
+void InitWindowTitleFunction(char *(*window_title_function)(void));
 void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
 void InitExitFunction(void (*exit_function)(int));
 void InitPlatformDependentStuff(void);
@@ -1261,6 +1308,7 @@ void ClosePlatformDependentStuff(void);
 void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *);
 void InitGfxDoor1Info(int, int, int, int);
 void InitGfxDoor2Info(int, int, int, int);
+void InitGfxDoor3Info(int, int, int, int);
 void InitGfxWindowInfo(int, int);
 void InitGfxScrollbufferInfo(int, int);
 void InitGfxClipRegion(boolean, int, int, int, int);
@@ -1272,6 +1320,8 @@ void SetWindowBackgroundBitmap(Bitmap *);
 void SetMainBackgroundBitmap(Bitmap *);
 void SetDoorBackgroundBitmap(Bitmap *);
 
+void LimitScreenUpdates(boolean);
+
 void InitVideoDisplay(void);
 void CloseVideoDisplay(void);
 void InitVideoBuffer(int, int, int, boolean);