X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=73fc371603eaf3d6afb3953e1f7b2908137ad545;hb=1be3e5c990b84f8548a80ccd6b7b209a88312141;hp=be48d88978b3e64fa0f1fc2662ebace904ce0d90;hpb=64e7c54dce6ea8c063f04198c64c5057d751c928;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index be48d889..73fc3716 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -65,22 +65,14 @@ #define STR_SPECIAL_RENDERING_TARGET "target_texture_only" #define STR_SPECIAL_RENDERING_DOUBLE "stream_and_target_texture" -#if defined(TARGET_SDL2) #define STR_SPECIAL_RENDERING_DEFAULT STR_SPECIAL_RENDERING_DOUBLE -#else -#define STR_SPECIAL_RENDERING_DEFAULT STR_SPECIAL_RENDERING_BITMAP -#endif #define SPECIAL_RENDERING_OFF 0 #define SPECIAL_RENDERING_BITMAP 1 #define SPECIAL_RENDERING_TARGET 2 #define SPECIAL_RENDERING_DOUBLE 3 -#if defined(TARGET_SDL2) #define SPECIAL_RENDERING_DEFAULT SPECIAL_RENDERING_DOUBLE -#else -#define SPECIAL_RENDERING_DEFAULT SPECIAL_RENDERING_BITMAP -#endif // values for vertical screen retrace synchronization (vsync) #define STR_VSYNC_MODE_OFF "off" @@ -126,6 +118,11 @@ #define SCREEN_KEYBOARD_POS(h) ((h) / 2) #endif +// values for drag-and-drop support (some parts not added before SDL 2.0.5) +#if SDL_VERSION_ATLEAST(2,0,5) +#define USE_DRAG_AND_DROP +#endif + // default input keys #define DEFAULT_KEY_LEFT KSYM_Left #define DEFAULT_KEY_RIGHT KSYM_Right @@ -421,6 +418,8 @@ (v) == VALIGN_BOTTOM ? (y) - (h) : (y)) #define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align) #define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign) +#define ALIGNED_VP_XPOS(p) ALIGNED_TEXT_XPOS(p) +#define ALIGNED_VP_YPOS(p) ALIGNED_TEXT_YPOS(p) // values for redraw_mask #define REDRAW_NONE (0) @@ -654,11 +653,10 @@ // areas in bitmap PIX_DOOR -/* meaning in PIX_DB_DOOR: (3 PAGEs) - PAGEX1: 1. buffer for DOOR_1 - PAGEX2: 2. buffer for DOOR_1 - PAGEX3: buffer for animations -*/ +// meaning in PIX_DB_DOOR: (3 PAGEs) +// PAGEX1: 1. buffer for DOOR_1 +// PAGEX2: 2. buffer for DOOR_1 +// PAGEX3: buffer for animations // these values are hard-coded to be able to use them in initialization #define DOOR_GFX_PAGE_WIDTH 100 // should be set to "gfx.dxsize" @@ -718,6 +716,7 @@ #define TREE_TYPE_LEVEL_DIR 3 #define TREE_TYPE_LEVEL_NR 4 +#define NUM_BASE_TREE_TYPES 4 #define NUM_TREE_TYPES 5 #define INFOTEXT_UNDEFINED "" @@ -739,6 +738,36 @@ INFOTEXT_MUSIC_DIR : \ INFOTEXT_UNDEFINED) +#define TREE_USERDIR(t) ((t) == TREE_TYPE_LEVEL_DIR ? \ + getUserLevelDir(NULL) : \ + (t) == TREE_TYPE_GRAPHICS_DIR ? \ + getUserGraphicsDir() : \ + (t) == TREE_TYPE_SOUNDS_DIR ? \ + getUserSoundsDir() : \ + (t) == TREE_TYPE_MUSIC_DIR ? \ + getUserMusicDir() : \ + NULL) + +#define TREE_FIRST_NODE_PTR(t) ((t) == TREE_TYPE_LEVEL_DIR ? \ + &leveldir_first : \ + (t) == TREE_TYPE_GRAPHICS_DIR ? \ + &artwork.gfx_first : \ + (t) == TREE_TYPE_SOUNDS_DIR ? \ + &artwork.snd_first : \ + (t) == TREE_TYPE_MUSIC_DIR ? \ + &artwork.mus_first : \ + NULL) + +#define TREE_FIRST_NODE(t) ((t) == TREE_TYPE_LEVEL_DIR ? \ + leveldir_first : \ + (t) == TREE_TYPE_GRAPHICS_DIR ? \ + artwork.gfx_first : \ + (t) == TREE_TYPE_SOUNDS_DIR ? \ + artwork.snd_first : \ + (t) == TREE_TYPE_MUSIC_DIR ? \ + artwork.mus_first : \ + NULL) + // values for artwork handling #define LEVELDIR_ARTWORK_SET_PTR(leveldir, type) \ ((type) == ARTWORK_TYPE_GRAPHICS ? \ @@ -834,6 +863,14 @@ (type) == ARTWORK_TYPE_MUSIC ? \ options.music_directory : "") +#define USER_ARTWORK_DIRECTORY(type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + getUserGraphicsDir() : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + getUserSoundsDir() : \ + (type) == ARTWORK_TYPE_MUSIC ? \ + getUserMusicDir() : "") + #define UPDATE_BUSY_STATE() \ { \ if (gfx.draw_busy_anim_function != NULL) \ @@ -1542,7 +1579,19 @@ struct RectWithBorder { int x, y; int width, height; + int min_width, min_height; + int max_width, max_height; + int margin_left; + int margin_right; + int margin_top; + int margin_bottom; + int border_left; + int border_right; + int border_top; + int border_bottom; int border_size; + int align_size; + int align, valign; }; struct MenuPosInfo @@ -1643,9 +1692,7 @@ extern DrawBuffer *drawto; extern int button_status; extern boolean motion_status; extern int wheel_steps; -#if defined(TARGET_SDL2) extern boolean keyrepeat_status; -#endif extern int redraw_mask; @@ -1691,6 +1738,7 @@ void SetTileCursorSXSY(int, int); void SetOverlayEnabled(boolean); void SetOverlayActive(boolean); void SetOverlayShowGrid(boolean); +boolean GetOverlayEnabled(void); boolean GetOverlayActive(void); void SetDrawDeactivationMask(int); int GetDrawDeactivationMask(void);