From: Holger Schemel Date: Tue, 17 Oct 2006 18:36:28 +0000 (+0200) Subject: rnd-20061017-2-src X-Git-Tag: 3.2.3^2~30 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9eff630555d9f481889fa2f807af76daaa2e70cb;p=rocksndiamonds.git rnd-20061017-2-src * added additional configuration directives for info screen draw offset: menu.draw_{x,y}offset.INFO[{ELEMENTS,MUSIC,CREDITS,PROGRAM,LEVELSET}] --- diff --git a/ChangeLog b/ChangeLog index 6f3e66d8..2708c47b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-17 + * added additional configuration directives for info screen draw offset: + menu.draw_{x,y}offset.INFO[{ELEMENTS,MUSIC,CREDITS,PROGRAM,LEVELSET}] + 2006-10-16 * added highlighted menu text entries to menu navigation when selected diff --git a/src/conf_gfx.c b/src/conf_gfx.c index ef3231fb..019af377 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -4545,6 +4545,16 @@ struct ConfigInfo image_config[] = { "menu.draw_yoffset.EDITOR", "0" }, { "menu.draw_xoffset.INFO", "0" }, { "menu.draw_yoffset.INFO", "0" }, + { "menu.draw_xoffset.INFO[ELEMENTS]", "0" }, + { "menu.draw_yoffset.INFO[ELEMENTS]", "0" }, + { "menu.draw_xoffset.INFO[MUSIC]", "0" }, + { "menu.draw_yoffset.INFO[MUSIC]", "0" }, + { "menu.draw_xoffset.INFO[CREDITS]", "0" }, + { "menu.draw_yoffset.INFO[CREDITS]", "0" }, + { "menu.draw_xoffset.INFO[PROGRAM]", "0" }, + { "menu.draw_yoffset.INFO[PROGRAM]", "0" }, + { "menu.draw_xoffset.INFO[LEVELSET]", "0" }, + { "menu.draw_yoffset.INFO[LEVELSET]", "0" }, { "menu.draw_xoffset.SETUP", "0" }, { "menu.draw_yoffset.SETUP", "0" }, @@ -4630,6 +4640,8 @@ struct ConfigInfo image_config[] = { "preview.y", "388" }, { "preview.xsize", "66" }, { "preview.ysize", "34" }, + { "preview.xoffset", "0" }, + { "preview.yoffset", "0" }, { "preview.tile_size", "4" }, { "preview.step_offset", "1" }, { "preview.step_delay", "50" }, diff --git a/src/conftime.h b/src/conftime.h index c33f5311..6d93226e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-10-17 02:38]" +#define COMPILE_DATE_STRING "[2006-10-17 20:23]" diff --git a/src/events.c b/src/events.c index 9bd81237..dbaa4373 100644 --- a/src/events.c +++ b/src/events.c @@ -711,6 +711,9 @@ void HandleKey(Key key, int key_status) ToggleFullscreenIfNeeded(); + if (game_status == GAME_MODE_SETUP) + RedrawSetupScreenAfterFullscreenToggle(); + return; } diff --git a/src/files.c b/src/files.c index 1287d1ec..3d6af17c 100644 --- a/src/files.c +++ b/src/files.c @@ -6619,6 +6619,18 @@ static void LoadSpecialMenuDesignSettingsFromFilename(char *filename) menu.list_size[i] = get_integer_from_string(list_size); } + /* special case: initialize with default values that may be overwritten */ + for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++) + { + char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO"); + char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO"); + + if (value_x != NULL) + menu.draw_xoffset_info[i] = get_integer_from_string(value_x); + if (value_y != NULL) + menu.draw_yoffset_info[i] = get_integer_from_string(value_y); + } + /* read (and overwrite with) values that may be specified in config file */ for (i = 0; image_config_vars[i].token != NULL; i++) { diff --git a/src/main.c b/src/main.c index bb45da54..f7925c45 100644 --- a/src/main.c +++ b/src/main.c @@ -4661,6 +4661,26 @@ struct TokenIntPtrInfo image_config_vars[] = { "menu.draw_yoffset.EDITOR", &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] }, { "menu.draw_xoffset.INFO", &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO] }, { "menu.draw_yoffset.INFO", &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO] }, + { "menu.draw_xoffset.INFO[ELEMENTS]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] }, + { "menu.draw_yoffset.INFO[ELEMENTS]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] }, + { "menu.draw_xoffset.INFO[MUSIC]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] }, + { "menu.draw_yoffset.INFO[MUSIC]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] }, + { "menu.draw_xoffset.INFO[CREDITS]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] }, + { "menu.draw_yoffset.INFO[CREDITS]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] }, + { "menu.draw_xoffset.INFO[PROGRAM]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] }, + { "menu.draw_yoffset.INFO[PROGRAM]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] }, + { "menu.draw_xoffset.INFO[LEVELSET]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] }, + { "menu.draw_yoffset.INFO[LEVELSET]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] }, { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] }, { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] }, @@ -4746,6 +4766,8 @@ struct TokenIntPtrInfo image_config_vars[] = { "preview.y", &preview.y }, { "preview.xsize", &preview.xsize }, { "preview.ysize", &preview.ysize }, + { "preview.xoffset", &preview.xoffset }, + { "preview.yoffset", &preview.yoffset }, { "preview.tile_size", &preview.tile_size }, { "preview.step_offset", &preview.step_offset }, { "preview.step_delay", &preview.step_delay }, diff --git a/src/main.h b/src/main.h index 3c3a40fb..36fb3b16 100644 --- a/src/main.h +++ b/src/main.h @@ -1599,6 +1599,17 @@ #define NUM_SPECIAL_GFX_ARGS 12 +/* these additional definitions are currently only used for draw offsets */ +#define GFX_SPECIAL_ARG_INFO_MAIN 0 +#define GFX_SPECIAL_ARG_INFO_TITLE 1 +#define GFX_SPECIAL_ARG_INFO_ELEMENTS 2 +#define GFX_SPECIAL_ARG_INFO_MUSIC 3 +#define GFX_SPECIAL_ARG_INFO_CREDITS 4 +#define GFX_SPECIAL_ARG_INFO_PROGRAM 5 +#define GFX_SPECIAL_ARG_INFO_LEVELSET 6 + +#define NUM_SPECIAL_GFX_INFO_ARGS 7 + /* values for image configuration suffixes */ #define GFX_ARG_X 0 @@ -1884,6 +1895,8 @@ struct MenuInfo { int draw_xoffset[NUM_SPECIAL_GFX_ARGS]; int draw_yoffset[NUM_SPECIAL_GFX_ARGS]; + int draw_xoffset_info[NUM_SPECIAL_GFX_INFO_ARGS]; + int draw_yoffset_info[NUM_SPECIAL_GFX_INFO_ARGS]; int scrollbar_xoffset; @@ -1911,6 +1924,7 @@ struct PreviewInfo { int x, y; int xsize, ysize; + int xoffset, yoffset; int tile_size; int step_offset; int step_delay; diff --git a/src/screens.c b/src/screens.c index be4f8a48..cae3c5f2 100644 --- a/src/screens.c +++ b/src/screens.c @@ -164,13 +164,31 @@ static int info_mode = INFO_MODE_MAIN; static TreeInfo *screen_modes = NULL; static TreeInfo *screen_mode_current = NULL; -#define DRAW_OFFSET_MODE(x) (x >= GAME_MODE_MAIN && \ - x <= GAME_MODE_SETUP ? x : \ - x == GAME_MODE_PSEUDO_TYPENAME ? \ +#define DRAW_MODE(s) ((s) >= GAME_MODE_MAIN && \ + (s) <= GAME_MODE_SETUP ? (s) : \ + (s) == GAME_MODE_PSEUDO_TYPENAME ? \ GAME_MODE_MAIN : GAME_MODE_DEFAULT) -#define mSX (SX + menu.draw_xoffset[DRAW_OFFSET_MODE(game_status)]) -#define mSY (SY + menu.draw_yoffset[DRAW_OFFSET_MODE(game_status)]) +#define DRAW_MODE_INFO(i) ((i) >= INFO_MODE_ELEMENTS && \ + (i) <= INFO_MODE_LEVELSET ? (i) : \ + INFO_MODE_MAIN) + +#define DRAW_XOFFSET_INFO(i) (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ? \ + menu.draw_xoffset[GAME_MODE_INFO] : \ + menu.draw_xoffset_info[DRAW_MODE_INFO(i)]) +#define DRAW_YOFFSET_INFO(i) (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ? \ + menu.draw_yoffset[GAME_MODE_INFO] : \ + menu.draw_yoffset_info[DRAW_MODE_INFO(i)]) + +#define DRAW_XOFFSET(s) ((s) == GAME_MODE_INFO ? \ + DRAW_XOFFSET_INFO(info_mode) : \ + menu.draw_xoffset[DRAW_MODE(s)]) +#define DRAW_YOFFSET(s) ((s) == GAME_MODE_INFO ? \ + DRAW_YOFFSET_INFO(info_mode) : \ + menu.draw_yoffset[DRAW_MODE(s)]) + +#define mSX (SX + DRAW_XOFFSET(game_status)) +#define mSY (SY + DRAW_YOFFSET(game_status)) #define NUM_MENU_ENTRIES_ON_SCREEN (menu.list_size[game_status] > 2 ? \ menu.list_size[game_status] : \ @@ -4264,6 +4282,12 @@ void DrawSetupScreen() PlayMenuMusic(); } +void RedrawSetupScreenAfterFullscreenToggle() +{ + if (setup_mode == SETUP_MODE_GRAPHICS) + DrawSetupScreen(); +} + void HandleSetupScreen(int mx, int my, int dx, int dy, int button) { if (setup_mode == SETUP_MODE_INPUT) diff --git a/src/screens.h b/src/screens.h index 6f8cb1fb..d649a76d 100644 --- a/src/screens.h +++ b/src/screens.h @@ -26,6 +26,8 @@ void DrawAndFadeInMainMenu(int); void DrawMainMenu(void); void DrawHallOfFame(int); +void RedrawSetupScreenAfterFullscreenToggle(); + void HandleTitleScreen(int, int, int, int, int); void HandleMainMenu(int, int, int, int, int); void HandleChooseLevel(int, int, int, int, int); diff --git a/src/tools.c b/src/tools.c index 32f7b638..17864c32 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1777,7 +1777,8 @@ void DrawPreviewLevel(boolean restart) if (restart) { - from_x = from_y = 0; + from_x = preview.xoffset; + from_y = preview.yoffset; scroll_direction = MV_RIGHT; label_state = 1; label_counter = 0;