X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=039f328e1a3fbdafca496c64585c377b4dc270e6;hb=951e6d0a5b07999e3c919b1c689c71c108e45411;hp=480ef0d426820e4719effd45d914d909fa171c49;hpb=164e6c72eba4eac8002bd6b334579e78e5010d0f;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index 480ef0d4..039f328e 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -96,7 +96,10 @@ #define TOUCH_MOVE_DISTANCE_DEFAULT 2 #define TOUCH_DROP_DISTANCE_DEFAULT 5 +#define TOUCH_TRANSPARENCY_DEFAULT 50 +#define ALPHA_FROM_TRANSPARENCY(x) ((100 - x) * SDL_ALPHA_OPAQUE / 100) +#define ALPHA_FADING_STEPSIZE(x) ((x) / 25) /* values for special settings for mobile devices */ #if defined(PLATFORM_ANDROID) @@ -327,6 +330,10 @@ #define STYLE_INNER_CORNERS (1 << 1) #define STYLE_REVERSE (1 << 2) +/* values for special event handling style (used for global animation) */ +#define STYLE_PASSTHROUGH (1 << 3) +#define STYLE_MULTIPLE_ACTIONS (1 << 4) + #define STYLE_DEFAULT STYLE_NONE /* values for special global animation events */ @@ -342,6 +349,9 @@ #define ANIM_EVENT_DEFAULT ANIM_EVENT_NONE +/* values for special global animation event actions */ +#define ANIM_EVENT_ACTION_NONE -1 + /* values for fade mode */ #define FADE_TYPE_NONE 0 #define FADE_TYPE_FADE_IN (1 << 0) @@ -456,10 +466,10 @@ #define MIN_GRID_YSIZE 3 #define MAX_GRID_XSIZE 32 #define MAX_GRID_YSIZE 32 -#define GRID_REAL_WIDTH MAX(video.screen_width, \ - video.screen_height) -#define GRID_REAL_HEIGHT MIN(video.screen_width, \ - video.screen_height) +#define GRID_REAL_WIDTH MAX(1, MAX(video.screen_width, \ + video.screen_height)) +#define GRID_REAL_HEIGHT MAX(1, MIN(video.screen_width, \ + video.screen_height)) #define DEFAULT_GRID_XSIZE_0 18 #define DEFAULT_GRID_YSIZE_0 MIN(MAX(MIN_GRID_YSIZE, \ DEFAULT_GRID_XSIZE_0 * \ @@ -473,9 +483,9 @@ GRID_REAL_HEIGHT), \ MAX_GRID_YSIZE) -#define DEFAULT_GRID_XSIZE(n) (n == 0 ? DEFAULT_GRID_XSIZE_0 : \ +#define DEFAULT_GRID_XSIZE(n) ((n) == 0 ? DEFAULT_GRID_XSIZE_0 : \ DEFAULT_GRID_XSIZE_1) -#define DEFAULT_GRID_YSIZE(n) (n == 0 ? DEFAULT_GRID_YSIZE_0 : \ +#define DEFAULT_GRID_YSIZE(n) ((n) == 0 ? DEFAULT_GRID_YSIZE_0 : \ DEFAULT_GRID_YSIZE_1) #define GRID_ACTIVE_NR() (video.screen_width > \ @@ -490,6 +500,20 @@ #define CHAR_GRID_BUTTON_SNAP '1' #define CHAR_GRID_BUTTON_DROP '2' +#define GET_ACTION_FROM_GRID_BUTTON(c) ((c) == CHAR_GRID_BUTTON_LEFT ? \ + JOY_LEFT : \ + (c) == CHAR_GRID_BUTTON_RIGHT ? \ + JOY_RIGHT : \ + (c) == CHAR_GRID_BUTTON_UP ? \ + JOY_UP : \ + (c) == CHAR_GRID_BUTTON_DOWN ? \ + JOY_DOWN : \ + (c) == CHAR_GRID_BUTTON_SNAP ? \ + JOY_BUTTON_1 : \ + (c) == CHAR_GRID_BUTTON_DROP ? \ + JOY_BUTTON_2 : \ + JOY_NO_ACTION) + /* default name for empty highscore entry */ #define EMPTY_PLAYER_NAME "no name" @@ -841,6 +865,17 @@ struct ProgramInfo boolean headless; }; +struct NetworkInfo +{ + boolean enabled; + boolean connected; + boolean serveronly; + + char *server_host; + int server_port; + +}; + struct OptionInfo { char *server_host; @@ -1017,14 +1052,13 @@ struct OverlayInfo boolean show_grid; - int grid_xsize_all[2]; - int grid_ysize_all[2]; int grid_xsize; int grid_ysize; - char grid_button_all[2][MAX_GRID_XSIZE][MAX_GRID_YSIZE]; char grid_button[MAX_GRID_XSIZE][MAX_GRID_YSIZE]; char grid_button_highlight; + + int grid_button_action; }; struct JoystickInfo @@ -1053,6 +1087,17 @@ struct SetupTouchInfo char *control_type; int move_distance; int drop_distance; + + int grid_xsize[2]; + int grid_ysize[2]; + + char grid_button[2][MAX_GRID_XSIZE][MAX_GRID_YSIZE]; + + int transparency; /* in percent (0 == opaque, 100 == invisible) */ + boolean draw_outlined; + boolean draw_pressed; + + boolean grid_initialized; }; struct SetupInputInfo @@ -1212,6 +1257,8 @@ struct SetupInfo boolean handicap; boolean skip_levels; boolean increment_levels; + boolean auto_play_next_level; + boolean skip_scores_after_game; boolean time_limit; boolean fullscreen; int window_scaling_percent; @@ -1238,6 +1285,9 @@ struct SetupInfo int volume_loops; int volume_music; + boolean network_mode; + int network_player_nr; + struct SetupAutoSetupInfo auto_setup; struct SetupEditorInfo editor; struct SetupEditorCascadeInfo editor_cascade; @@ -1522,6 +1572,7 @@ struct LevelStats /* ========================================================================= */ extern struct ProgramInfo program; +extern struct NetworkInfo network; extern struct OptionInfo options; extern struct VideoSystemInfo video; extern struct AudioSystemInfo audio; @@ -1560,6 +1611,7 @@ extern int FrameCounter; void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *, char *, int); +void InitNetworkInfo(boolean, boolean, boolean, char *, int); void InitScoresInfo(); void SetWindowTitle();