#define SETUP_TOKEN_SOUND_LOOPS 2
#define SETUP_TOKEN_SOUND_MUSIC 3
#define SETUP_TOKEN_SOUND_SIMPLE 4
-#define SETUP_TOKEN_SCROLL_DELAY 5
-#define SETUP_TOKEN_SOFT_SCROLLING 6
-#define SETUP_TOKEN_FADING 7
-#define SETUP_TOKEN_AUTORECORD 8
-#define SETUP_TOKEN_QUICK_DOORS 9
-#define SETUP_TOKEN_TEAM_MODE 10
-#define SETUP_TOKEN_HANDICAP 11
-#define SETUP_TOKEN_TIME_LIMIT 12
-#define SETUP_TOKEN_FULLSCREEN 13
-
-#define NUM_GLOBAL_SETUP_TOKENS 14
+#define SETUP_TOKEN_TOONS 5
+#define SETUP_TOKEN_SCROLL_DELAY 6
+#define SETUP_TOKEN_SOFT_SCROLLING 7
+#define SETUP_TOKEN_FADING 8
+#define SETUP_TOKEN_AUTORECORD 9
+#define SETUP_TOKEN_QUICK_DOORS 10
+#define SETUP_TOKEN_TEAM_MODE 11
+#define SETUP_TOKEN_HANDICAP 12
+#define SETUP_TOKEN_TIME_LIMIT 13
+#define SETUP_TOKEN_FULLSCREEN 14
+
+#define NUM_GLOBAL_SETUP_TOKENS 15
/* player setup */
#define SETUP_TOKEN_USE_JOYSTICK 0
{ TYPE_SWITCH, &si.sound_loops, "repeating_sound_loops" },
{ TYPE_SWITCH, &si.sound_music, "background_music" },
{ TYPE_SWITCH, &si.sound_simple, "simple_sound_effects" },
+ { TYPE_SWITCH, &si.toons, "toons" },
{ TYPE_SWITCH, &si.scroll_delay, "scroll_delay" },
{ TYPE_SWITCH, &si.soft_scrolling, "soft_scrolling" },
{ TYPE_SWITCH, &si.fading, "screen_fading" },
/* screens in the setup menu */
#define SETUP_MODE_MAIN 0
#define SETUP_MODE_INPUT 1
+#define SETUP_MODE_GRAPHICS 2
+#define SETUP_MODE_SOUND 3
-/* for DrawSetupScreen(), HandleSetupScreen() */
-#define SETUP_SCREEN_POS_START 0
-#define SETUP_SCREEN_POS_END (SCR_FIELDY - 3)
-#define SETUP_SCREEN_POS_EMPTY1 (SETUP_SCREEN_POS_END - 2)
-#define SETUP_SCREEN_POS_EMPTY2 (SETUP_SCREEN_POS_END - 2)
+#define MAX_SETUP_MODES 4
/* for HandleSetupInputScreen() */
#define SETUPINPUT_SCREEN_POS_START 0
static int num_setup_info;
static int setup_mode = SETUP_MODE_MAIN;
+static void execSetupMain()
+{
+ setup_mode = SETUP_MODE_MAIN;
+ DrawSetupScreen();
+}
+
+static void execSetupSound()
+{
+ setup_mode = SETUP_MODE_SOUND;
+ DrawSetupScreen();
+}
+
static void execSetupInput()
{
setup_mode = SETUP_MODE_INPUT;
- DrawSetupInputScreen();
+ DrawSetupScreen();
}
static void execExitSetup()
execExitSetup();
}
-static struct TokenInfo setup_main_info[] =
+static struct TokenInfo setup_info_main[] =
{
+ { TYPE_ENTER_MENU, execSetupSound, "Sound Setup" },
+ { TYPE_ENTER_MENU, execSetupInput, "Input Devices" },
+ { TYPE_EMPTY, NULL, "" },
+#if 0
{ TYPE_SWITCH, &setup.sound, "Sound:", },
{ TYPE_SWITCH, &setup.sound_loops, " Sound Loops:" },
{ TYPE_SWITCH, &setup.sound_music, " Game Music:" },
-#if 0
+#endif
{ TYPE_SWITCH, &setup.toons, "Toons:" },
+#if 0
{ TYPE_SWITCH, &setup.double_buffering,"Buffered gfx:" },
#endif
{ TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" },
{ TYPE_SWITCH, &setup.team_mode, "Team-Mode:" },
{ TYPE_SWITCH, &setup.handicap, "Handicap:" },
{ TYPE_SWITCH, &setup.time_limit, "Timelimit:" },
- { TYPE_ENTER_MENU, execSetupInput, "Input Devices" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execExitSetup, "Exit" },
{ TYPE_LEAVE_MENU, execSaveAndExitSetup, "Save and exit" },
{ 0, NULL, NULL }
};
+static struct TokenInfo setup_info_sound[] =
+{
+ { TYPE_SWITCH, &setup.sound, "Sound:", },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_SWITCH, &setup.sound_simple, "Simple Sound:" },
+ { TYPE_SWITCH, &setup.sound_loops, "Sound Loops:" },
+ { TYPE_SWITCH, &setup.sound_music, "Game Music:" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
+ { 0, NULL, NULL }
+};
+
static void drawSetupValue(int pos)
{
int xpos = MENU_SCREEN_VALUE_XPOS;
DrawText(SX + xpos * 32, SY + ypos * 32, value_string, FS_BIG, value_color);
}
-static void DrawSetupMainScreen()
+static void DrawGenericSetupScreen()
{
+ char *title_string = NULL;
int i;
UnmapAllGadgets();
CloseDoor(DOOR_CLOSE_2);
ClearWindow();
- DrawText(SX + 16, SY + 16, "SETUP",FS_BIG,FC_YELLOW);
- setup_info = setup_main_info;
+ if (setup_mode == SETUP_MODE_MAIN)
+ {
+ setup_info = setup_info_main;
+ title_string = "Setup";
+ }
+ else if (setup_mode == SETUP_MODE_SOUND)
+ {
+ setup_info = setup_info_sound;
+ title_string = "Sound Setup";
+ }
+
+ DrawText(SX + 16, SY + 16, title_string, FS_BIG, FC_YELLOW);
num_setup_info = 0;
for(i=0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++)
HandleSetupScreen(0,0,0,0,MB_MENU_INITIALIZE);
}
-void HandleSetupMainScreen(int mx, int my, int dx, int dy, int button)
+void HandleGenericSetupScreen(int mx, int my, int dx, int dy, int button)
{
- static int choice = 0;
+ static int choice_store[MAX_SETUP_MODES];
+ int choice = choice_store[setup_mode];
int x = 0;
int y = choice;
{
drawCursor(y, FC_RED);
drawCursor(choice, FC_BLUE);
- choice = y;
+ choice = choice_store[setup_mode] = y;
}
}
else if (!(setup_info[y].type & TYPE_GHOSTED))
void DrawSetupScreen()
{
- if (setup_mode == SETUP_MODE_MAIN)
- DrawSetupMainScreen();
- else if (setup_mode == SETUP_MODE_INPUT)
+ if (setup_mode == SETUP_MODE_INPUT)
DrawSetupInputScreen();
+ else
+ DrawGenericSetupScreen();
}
void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
{
- if (setup_mode == SETUP_MODE_MAIN)
- HandleSetupMainScreen(mx, my, dx, dy, button);
- else if (setup_mode == SETUP_MODE_INPUT)
+ if (setup_mode == SETUP_MODE_INPUT)
HandleSetupInputScreen(mx, my, dx, dy, button);
+ else
+ HandleGenericSetupScreen(mx, my, dx, dy, button);
}
void CustomizeKeyboard(int player_nr)