X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=406a6f364672ec6d241d0259328999d78eccd0a6;hp=48e06ae1d3394aabac4916e46af371210df2b848;hb=5bdc30d016416d04eec826a28321325d4ddc66c2;hpb=cb586ba720ddae3c6d05ba1723b5bd4d58bc98bd diff --git a/src/libgame/system.h b/src/libgame/system.h index 48e06ae1..406a6f36 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -85,6 +85,7 @@ /* values for touch control */ #define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons" #define TOUCH_CONTROL_WIPE_GESTURES "wipe_gestures" +#define TOUCH_CONTROL_FOLLOW_FINGER "follow_finger" #define TOUCH_CONTROL_DEFAULT TOUCH_CONTROL_VIRTUAL_BUTTONS @@ -92,6 +93,15 @@ #define TOUCH_DROP_DISTANCE_DEFAULT 5 +/* values for special settings for mobile devices */ +#if defined(PLATFORM_ANDROID) +#define USE_TOUCH_INPUT_OVERLAY +#define USE_COMPLETE_DISPLAY +#define HAS_SCREEN_KEYBOARD +#define SCREEN_KEYBOARD_POS(h) ((h) / 2) +#endif + + /* default input keys */ #define DEFAULT_KEY_LEFT KSYM_Left #define DEFAULT_KEY_RIGHT KSYM_Right @@ -314,6 +324,45 @@ #define STYLE_DEFAULT STYLE_NONE +#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_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_DEFAULT ANIM_EVENT_NONE + /* values for fade mode */ #define FADE_TYPE_NONE 0 #define FADE_TYPE_FADE_IN (1 << 0) @@ -498,6 +547,7 @@ #define SOUNDSINFO_FILENAME "soundsinfo.conf" #define MUSICINFO_FILENAME "musicinfo.conf" #define ARTWORKINFO_CACHE_FILE "artworkinfo.cache" +#define LEVELTEMPLATE_FILENAME "template.level" #define LEVELFILE_EXTENSION "level" #define TAPEFILE_EXTENSION "tape" #define SCOREFILE_EXTENSION "score" @@ -715,14 +765,6 @@ } -/* type definitions */ -#if defined(TARGET_SDL2) -typedef int (*EventFilter)(void *, Event *); -#else -typedef int (*EventFilter)(const Event *); -#endif - - /* structure definitions */ struct ProgramInfo @@ -758,6 +800,11 @@ struct ProgramInfo char *(*window_title_function)(void); void (*exit_message_function)(char *, va_list); void (*exit_function)(int); + + boolean global_scores; + boolean many_scores_per_name; + + boolean headless; }; struct OptionInfo @@ -777,6 +824,7 @@ struct OptionInfo char *special_flags; + boolean mytapes; boolean serveronly; boolean network; boolean verbose; @@ -788,6 +836,9 @@ struct VideoSystemInfo int default_depth; int width, height, depth; int window_width, window_height; + int display_width, display_height; + int screen_width, screen_height; + int screen_xoffset, screen_yoffset; boolean fullscreen_available; boolean fullscreen_enabled; @@ -801,6 +852,12 @@ struct VideoSystemInfo unsigned int frame_delay; unsigned int frame_delay_value; + boolean shifted_up; + int shifted_up_pos; + int shifted_up_pos_last; + unsigned int shifted_up_delay; + unsigned int shifted_up_delay_value; + boolean initialized; }; @@ -901,6 +958,11 @@ struct GfxInfo int cursor_mode; }; +struct OverlayInfo +{ + boolean active; +}; + struct JoystickInfo { int status; @@ -948,6 +1010,8 @@ struct SetupEditorInfo boolean el_dx_boulderdash; boolean el_chars; boolean el_steel_chars; + + boolean el_classic; boolean el_custom; boolean el_user_defined; boolean el_dynamic; @@ -958,6 +1022,8 @@ struct SetupEditorInfo boolean el_by_type; boolean show_element_token; + + boolean use_template_for_new_levels; }; struct SetupEditorCascadeInfo @@ -1067,6 +1133,7 @@ struct SetupInfo boolean team_mode; boolean handicap; boolean skip_levels; + boolean increment_levels; boolean time_limit; boolean fullscreen; int window_scaling_percent; @@ -1364,6 +1431,7 @@ extern struct OptionInfo options; extern struct VideoSystemInfo video; extern struct AudioSystemInfo audio; extern struct GfxInfo gfx; +extern struct OverlayInfo overlay; extern struct AnimInfo anim; extern struct ArtworkInfo artwork; extern struct JoystickInfo joystick; @@ -1397,6 +1465,7 @@ extern int FrameCounter; void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *, int); +void InitScoresInfo(); void SetWindowTitle(); void InitWindowTitleFunction(char *(*window_title_function)(void)); @@ -1418,6 +1487,9 @@ void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int)); void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int)); void InitGfxCustomArtworkInfo(); void InitGfxOtherSettings(); +void InitOverlayInfo(); +void SetOverlayActive(boolean); +boolean GetOverlayActive(); void SetDrawDeactivationMask(int); void SetDrawBackgroundMask(int); void SetWindowBackgroundBitmap(Bitmap *); @@ -1480,7 +1552,6 @@ void OpenAudio(void); void CloseAudio(void); void SetAudioMode(boolean); -void InitEventFilter(EventFilter); boolean PendingEvent(void); void NextEvent(Event *event); void PeekEvent(Event *event); @@ -1488,6 +1559,8 @@ Key GetEventKey(KeyEvent *, boolean); KeyMod HandleKeyModState(Key, int); KeyMod GetKeyModState(); KeyMod GetKeyModStateFromEvents(); +void StartTextInput(int, int, int, int); +void StopTextInput(); boolean CheckCloseWindowEvent(ClientMessageEvent *); void InitJoysticks();