projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed screen update function name to be explicit regarding build-in delay
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index b86aa1c92c535d7e762efa4b44baeffd187e0ac3..c69b78fb4fcd4e22bd1f2e12a742ba23b4756479 100644
(file)
--- 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 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;
static struct
{
int value;
@@
-725,6
+722,13
@@
static int getTitleMessageGameMode(boolean initial)
return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE);
}
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)
{
#if 0
static int getTitleScreenBackground(boolean initial)
{
@@
-1393,6
+1397,8
@@
void DrawMainMenu()
UnmapAllGadgets();
FadeSoundsAndMusic();
UnmapAllGadgets();
FadeSoundsAndMusic();
+ ExpireSoundLoops(FALSE);
+
KeyboardAutoRepeatOn();
ActivateJoystick();
KeyboardAutoRepeatOn();
ActivateJoystick();
@@
-1565,6
+1571,8
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
title_screen_nr = 0;
tci = &title_controls[title_screen_nr];
title_screen_nr = 0;
tci = &title_controls[title_screen_nr];
+ SetAnimStatus(getTitleAnimMode(tci));
+
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
@@
-1645,16
+1653,19
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
}
title_screen_nr++;
}
title_screen_nr++;
- tci = &title_controls[title_screen_nr];
if (title_screen_nr < num_title_screens)
{
if (title_screen_nr < num_title_screens)
{
+ tci = &title_controls[title_screen_nr];
+
+ SetAnimStatus(getTitleAnimMode(tci));
+
sound = getTitleSound(tci);
music = getTitleMusic(tci);
sound = getTitleSound(tci);
music = getTitleMusic(tci);
- if (
sound == SND_UNDEFINED ||
sound != last_sound)
- FadeSound
s(
);
- 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);
FadeMusic();
fading = getTitleFading(tci);
@@
-2156,6
+2167,7
@@
static void DrawInfoScreen_Main()
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
+ FadeSoundsAndMusic();
FreeScreenGadgets();
CreateScreenGadgets();
FreeScreenGadgets();
CreateScreenGadgets();
@@
-4061,6
+4073,8
@@
static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
void DrawChooseLevelSet()
{
void DrawChooseLevelSet()
{
+ FadeSoundsAndMusic();
+
SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
DrawChooseTree(&leveldir_current);
SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
DrawChooseTree(&leveldir_current);
@@
-4078,6
+4092,8
@@
void DrawChooseLevelNr()
{
int i;
{
int i;
+ FadeSoundsAndMusic();
+
if (level_number != NULL)
{
freeTreeInfo(level_number);
if (level_number != NULL)
{
freeTreeInfo(level_number);
@@
-5576,8
+5592,6
@@
static Key getSetupKey()
DoAnimation();
BackToFront();
DoAnimation();
BackToFront();
-
- WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
return key;
}
return key;
@@
-5622,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 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);
int type = si->type;
void *value = si->value;
char *value_string = getSetupValue(type, value);
@@
-5654,8
+5668,10
@@
static void drawSetupValue(int screen_pos, int setup_info_pos_raw)
startx = mSX + xpos * 32;
starty = mSY + ypos * 32;
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)
// special check if right-side setup values moved left due to scrollbar
if (scrollbar_needed && xpos > MENU_SCREEN_START_XPOS)
@@
-5673,7
+5689,6
@@
static void drawSetupValue(int screen_pos, int setup_info_pos_raw)
startx = mSX + xpos * 32;
font_nr = getSetupValueFontNarrow(type, font_nr);
startx = mSX + xpos * 32;
font_nr = getSetupValueFontNarrow(type, font_nr);
- font_width = getFontWidth(font_nr);
}
}
}
}
@@
-5716,7
+5731,7
@@
static void drawSetupValue(int screen_pos, int setup_info_pos_raw)
}
for (i = 0; i <= menu_screen_max_xpos - xpos; i++)
}
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);
DrawText(startx, starty, value_string, font_nr);
@@
-5773,6
+5788,7
@@
static void DrawSetupScreen_Generic()
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
+ FadeSoundsAndMusic();
FreeScreenGadgets();
CreateScreenGadgets();
FreeScreenGadgets();
CreateScreenGadgets();
@@
-6290,8
+6306,6
@@
void CustomizeKeyboard(int player_nr)
DoAnimation();
BackToFront();
DoAnimation();
BackToFront();
-
- WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
/* write new key bindings back to player setup */
}
/* write new key bindings back to player setup */
@@
-6445,8
+6459,6
@@
static boolean CalibrateJoystickMain(int player_nr)
DoAnimation();
BackToFront();
DoAnimation();
BackToFront();
-
- WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
/* calibrated center position (joystick should now be centered) */
}
/* calibrated center position (joystick should now be centered) */
@@
-6468,7
+6480,7
@@
static boolean CalibrateJoystickMain(int player_nr)
NextEvent(&event);
HandleOtherEvents(&event);
NextEvent(&event);
HandleOtherEvents(&event);
-
WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value
);
+
BackToFront(
);
}
}
}
}