#define SETUP_MODE_SHORTCUT_2 6
#define SETUP_MODE_GRAPHICS 7
#define SETUP_MODE_CHOOSE_SCREEN_MODE 8
-#define SETUP_MODE_SOUND 9
-#define SETUP_MODE_ARTWORK 10
-#define SETUP_MODE_CHOOSE_GRAPHICS 11
-#define SETUP_MODE_CHOOSE_SOUNDS 12
-#define SETUP_MODE_CHOOSE_MUSIC 13
+#define SETUP_MODE_CHOOSE_SCROLL_DELAY 9
+#define SETUP_MODE_SOUND 10
+#define SETUP_MODE_ARTWORK 11
+#define SETUP_MODE_CHOOSE_GRAPHICS 12
+#define SETUP_MODE_CHOOSE_SOUNDS 13
+#define SETUP_MODE_CHOOSE_MUSIC 14
-#define MAX_SETUP_MODES 14
+#define MAX_SETUP_MODES 15
/* for input setup functions */
#define SETUPINPUT_SCREEN_POS_START 0
static TreeInfo *screen_modes = NULL;
static TreeInfo *screen_mode_current = NULL;
+static TreeInfo *scroll_delays = NULL;
+static TreeInfo *scroll_delay_current = NULL;
+
static TreeInfo *game_speeds = NULL;
static TreeInfo *game_speed_current = NULL;
{ -1, NULL },
};
+static struct
+{
+ int value;
+ char *text;
+} scroll_delays_list[] =
+{
+ { 0, "0 Tiles (No Scroll Delay)" },
+ { 1, "1 Tile" },
+ { 2, "2 Tiles" },
+ { 3, "3 Tiles (Default)" },
+ { 4, "4 Tiles" },
+ { 5, "5 Tiles" },
+ { 6, "6 Tiles" },
+ { 7, "7 Tiles" },
+ { 8, "8 Tiles (Maximum Scroll Delay)"},
+
+ { -1, NULL },
+};
+
#define DRAW_MODE(s) ((s) >= GAME_MODE_MAIN && \
(s) <= GAME_MODE_SETUP ? (s) : \
(s) == GAME_MODE_PSEUDO_TYPENAME ? \
{
if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
execSetupGame();
- else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
+ setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
execSetupGraphics();
else
execSetupArtwork();
{
if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)
execSetupGame();
- else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE ||
+ setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
execSetupGraphics();
else
execSetupArtwork();
static int num_setup_info;
static char *screen_mode_text;
+static char *scroll_delay_text;
static char *game_speed_text;
static char *graphics_set_name;
static char *sounds_set_name;
screen_mode_text = screen_mode_current->name;
}
+#if 1
+ if (scroll_delays == NULL)
+ {
+ int i;
+
+ for (i = 0; scroll_delays_list[i].value != -1; i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED);
+ char identifier[32], name[32];
+ int value = scroll_delays_list[i].value;
+ char *text = scroll_delays_list[i].text;
+
+ ti->node_top = &scroll_delays;
+ ti->sort_priority = value;
+
+ sprintf(identifier, "%d", value);
+ sprintf(name, "%s", text);
+
+ setString(&ti->identifier, identifier);
+ setString(&ti->name, name);
+ setString(&ti->name_sorting, name);
+ setString(&ti->infotext, "Scroll Delay");
+
+ pushTreeInfo(&scroll_delays, ti);
+ }
+
+ /* sort scroll delay values to start with lowest scroll delay value */
+ sortTreeInfo(&scroll_delays);
+
+ /* set current scroll delay value to configured scroll delay value */
+ scroll_delay_current =
+ getTreeInfoFromIdentifier(scroll_delays,i_to_a(setup.scroll_delay_value));
+
+ /* if that fails, set current scroll delay to reliable default value */
+ if (scroll_delay_current == NULL)
+ scroll_delay_current =
+ getTreeInfoFromIdentifier(scroll_delays, i_to_a(STD_SCROLL_DELAY));
+
+ /* if that also fails, set current scroll delay to first available value */
+ if (scroll_delay_current == NULL)
+ scroll_delay_current = scroll_delays;
+ }
+
+ setup.scroll_delay_value = atoi(scroll_delay_current->identifier);
+
+ /* needed for displaying scroll delay text instead of identifier */
+ scroll_delay_text = scroll_delay_current->name;
+#endif
+
setup_mode = SETUP_MODE_GRAPHICS;
DrawSetupScreen();
}
DrawSetupScreen();
}
+static void execSetupChooseScrollDelay()
+{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
+ setup_mode = SETUP_MODE_CHOOSE_SCROLL_DELAY;
+ DrawSetupScreen();
+}
+
static void execSetupSound()
{
#if 0
{ TYPE_SWITCH, &setup.fullscreen, "Fullscreen:" },
{ TYPE_ENTER_LIST, execSetupChooseScreenMode, "Fullscreen Mode:" },
{ TYPE_STRING, &screen_mode_text, "" },
- { TYPE_SWITCH, &setup.scroll_delay, "Delayed Scrolling:" },
+#if 0
+ { TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" },
+#endif
+ { TYPE_ENTER_LIST, execSetupChooseScrollDelay, "Scroll Delay Value:" },
+ { TYPE_STRING, &scroll_delay_text, "" },
#if 0
{ TYPE_SWITCH, &setup.soft_scrolling, "Soft Scrolling:" },
{ TYPE_SWITCH, &setup.double_buffering,"Double-Buffering:" },
DrawChooseTree(&game_speed_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
DrawChooseTree(&screen_mode_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ DrawChooseTree(&scroll_delay_current);
else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
DrawChooseTree(&artwork.gfx_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS)
HandleChooseTree(mx, my, dx, dy, button, &game_speed_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE)
HandleChooseTree(mx, my, dx, dy, button, &screen_mode_current);
+ else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY)
+ HandleChooseTree(mx, my, dx, dy, button, &scroll_delay_current);
else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
HandleChooseTree(mx, my, dx, dy, button, &artwork.gfx_current);
else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS)