X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fscreens.c;h=1743be63f92aee4c0f88e9d00a55d25790149364;hp=b86aa1c92c535d7e762efa4b44baeffd187e0ac3;hb=ecc1df8f5863b1cba6ba4d71bd5053e9a376e702;hpb=bc6e19a34de8c4c290dc3c6bee70ac805525070b diff --git a/src/screens.c b/src/screens.c index b86aa1c9..1743be63 100644 --- a/src/screens.c +++ b/src/screens.c @@ -725,6 +725,13 @@ static int getTitleMessageGameMode(boolean initial) return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); } +static int getTitleAnimMode(struct TitleControlInfo *tci) +{ + int base = (tci->initial ? GAME_MODE_TITLE_INITIAL_1 : GAME_MODE_TITLE_1); + + return base + tci->local_nr; +} + #if 0 static int getTitleScreenBackground(boolean initial) { @@ -1393,6 +1400,8 @@ void DrawMainMenu() UnmapAllGadgets(); FadeSoundsAndMusic(); + ExpireSoundLoops(FALSE); + KeyboardAutoRepeatOn(); ActivateJoystick(); @@ -1565,6 +1574,8 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) title_screen_nr = 0; tci = &title_controls[title_screen_nr]; + SetAnimStatus(getTitleAnimMode(tci)); + last_sound = SND_UNDEFINED; last_music = MUS_UNDEFINED; @@ -1645,10 +1656,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } title_screen_nr++; - tci = &title_controls[title_screen_nr]; if (title_screen_nr < num_title_screens) { + tci = &title_controls[title_screen_nr]; + + SetAnimStatus(getTitleAnimMode(tci)); + sound = getTitleSound(tci); music = getTitleMusic(tci); @@ -2156,6 +2170,7 @@ static void DrawInfoScreen_Main() fade_mask = REDRAW_ALL; UnmapAllGadgets(); + FadeSoundsAndMusic(); FreeScreenGadgets(); CreateScreenGadgets(); @@ -4061,6 +4076,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, void DrawChooseLevelSet() { + FadeSoundsAndMusic(); + SetMainBackgroundImage(IMG_BACKGROUND_LEVELS); DrawChooseTree(&leveldir_current); @@ -4078,6 +4095,8 @@ void DrawChooseLevelNr() { int i; + FadeSoundsAndMusic(); + if (level_number != NULL) { freeTreeInfo(level_number); @@ -5622,7 +5641,7 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) int ypos = MENU_SCREEN_START_YPOS + screen_pos; int startx = mSX + xpos * 32; int starty = mSY + ypos * 32; - int font_nr, font_width; + int font_nr, font_nr_default, font_width_default; int type = si->type; void *value = si->value; char *value_string = getSetupValue(type, value); @@ -5654,8 +5673,10 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) startx = mSX + xpos * 32; starty = mSY + ypos * 32; - font_nr = getSetupValueFont(type, value); - font_width = getFontWidth(font_nr); + font_nr_default = getSetupValueFont(type, value); + font_width_default = getFontWidth(font_nr_default); + + font_nr = font_nr_default; // special check if right-side setup values moved left due to scrollbar if (scrollbar_needed && xpos > MENU_SCREEN_START_XPOS) @@ -5673,7 +5694,6 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) startx = mSX + xpos * 32; font_nr = getSetupValueFontNarrow(type, font_nr); - font_width = getFontWidth(font_nr); } } @@ -5716,7 +5736,7 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw) } for (i = 0; i <= menu_screen_max_xpos - xpos; i++) - DrawText(startx + i * font_width, starty, " ", font_nr); + DrawText(startx + i * font_width_default, starty, " ", font_nr_default); DrawText(startx, starty, value_string, font_nr); @@ -5773,6 +5793,7 @@ static void DrawSetupScreen_Generic() fade_mask = REDRAW_ALL; UnmapAllGadgets(); + FadeSoundsAndMusic(); FreeScreenGadgets(); CreateScreenGadgets();