X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=c69b78fb4fcd4e22bd1f2e12a742ba23b4756479;hb=f3df9df1084ac74e3f7c0be0560bea46517316fd;hp=c6e3c645c87796d4690ea98663725436cdbfbd8d;hpb=2176d1de29652bc9e8db1baa283fdc1c4e99e674;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index c6e3c645..c69b78fb 100644 --- a/src/screens.c +++ b/src/screens.c @@ -235,9 +235,6 @@ static TreeInfo *drop_distance_current = NULL; static TreeInfo *level_number = NULL; static TreeInfo *level_number_current = NULL; -static unsigned int sync_frame_delay = 0; -static unsigned int sync_frame_delay_value = GAME_FRAME_DELAY; - static struct { int value; @@ -1666,9 +1663,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) sound = getTitleSound(tci); music = getTitleMusic(tci); - if (sound == SND_UNDEFINED || sound != last_sound) - FadeSounds(); - if (music == MUS_UNDEFINED || music != last_music) + if (last_sound != SND_UNDEFINED && sound != last_sound) + FadeSound(last_sound); + if (last_music != MUS_UNDEFINED && music != last_music) FadeMusic(); fading = getTitleFading(tci); @@ -5595,8 +5592,6 @@ static Key getSetupKey() DoAnimation(); BackToFront(); - - WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value); } return key; @@ -5641,7 +5636,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); @@ -5673,8 +5668,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) @@ -5692,7 +5689,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); } } @@ -5735,7 +5731,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); @@ -6310,8 +6306,6 @@ void CustomizeKeyboard(int player_nr) DoAnimation(); BackToFront(); - - WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value); } /* write new key bindings back to player setup */ @@ -6465,8 +6459,6 @@ static boolean CalibrateJoystickMain(int player_nr) DoAnimation(); BackToFront(); - - WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value); } /* calibrated center position (joystick should now be centered) */ @@ -6488,7 +6480,7 @@ static boolean CalibrateJoystickMain(int player_nr) NextEvent(&event); HandleOtherEvents(&event); - WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value); + BackToFront(); } }