projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support for separate animations for single title screens
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index 3bcb01c4b532ac3ee7ebb89491e15e21ad0501f1..c01a99d711a640b175858a7e03dce7e8de5eb9cd 100644
(file)
--- 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);
}
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)
{
@@
-1247,11
+1254,7
@@
static void drawCursorXY(int xpos, int ypos, int graphic)
static void drawChooseTreeCursor(int ypos, boolean active)
{
static void drawChooseTreeCursor(int ypos, boolean active)
{
- int last_game_status = game_status; /* save current game status */
-
drawCursorExt(0, ypos, active, -1);
drawCursorExt(0, ypos, active, -1);
-
- SetGameStatus(last_game_status); /* restore current game status */
}
void DrawHeadline()
}
void DrawHeadline()
@@
-1309,13
+1312,12
@@
void DrawTitleScreenMessage(int nr, boolean initial)
{
char *filename = getLevelSetTitleMessageFilename(nr, initial);
struct TitleMessageInfo *tmi = getTitleMessageInfo(nr, initial);
{
char *filename = getLevelSetTitleMessageFilename(nr, initial);
struct TitleMessageInfo *tmi = getTitleMessageInfo(nr, initial);
- int last_game_status = game_status; /* save current game status */
if (filename == NULL)
return;
/* force TITLE font on title message screen */
if (filename == NULL)
return;
/* force TITLE font on title message screen */
- Set
Game
Status(getTitleMessageGameMode(initial));
+ Set
Font
Status(getTitleMessageGameMode(initial));
/* if chars *and* width set to "-1", automatically determine width */
if (tmi->chars == -1 && tmi->width == -1)
/* if chars *and* width set to "-1", automatically determine width */
if (tmi->chars == -1 && tmi->width == -1)
@@
-1354,7
+1356,7
@@
void DrawTitleScreenMessage(int nr, boolean initial)
filename, tmi->font, tmi->chars, -1, tmi->lines, 0, -1,
tmi->autowrap, tmi->centered, tmi->parse_comments);
filename, tmi->font, tmi->chars, -1, tmi->lines, 0, -1,
tmi->autowrap, tmi->centered, tmi->parse_comments);
- SetGameStatus(last_game_status); /* restore current game status */
+ ResetFontStatus();
}
void DrawTitleScreen()
}
void DrawTitleScreen()
@@
-1570,6
+1572,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;
@@
-1590,7
+1594,6
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
-
return;
}
return;
}
@@
-1651,10
+1654,13
@@
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);
@@
-3696,7
+3702,6
@@
static void drawChooseTreeList(int first_entry, int num_page_entries,
int yoffset_setup = 16;
int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ||
ti->type == TREE_TYPE_LEVEL_NR ? yoffset_sets : yoffset_setup);
int yoffset_setup = 16;
int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ||
ti->type == TREE_TYPE_LEVEL_NR ? yoffset_sets : yoffset_setup);
- int last_game_status = game_status; /* save current game status */
title_string = ti->infotext;
title_string = ti->infotext;
@@
-3736,8
+3741,6
@@
static void drawChooseTreeList(int first_entry, int num_page_entries,
initCursor(i, IMG_MENU_BUTTON);
}
initCursor(i, IMG_MENU_BUTTON);
}
- SetGameStatus(last_game_status); /* restore current game status */
-
redraw_mask |= REDRAW_FIELD;
}
redraw_mask |= REDRAW_FIELD;
}
@@
-3785,7
+3788,6
@@
static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
- int last_game_status = game_status; /* save current game status */
boolean position_set_by_scrollbar = (dx == 999);
if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
boolean position_set_by_scrollbar = (dx == 999);
if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
@@
-3793,8
+3795,6
@@
static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
else
num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
else
num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
- SetGameStatus(last_game_status); /* restore current game status */
-
if (button == MB_MENU_INITIALIZE)
{
int num_entries = numTreeInfoInGroup(ti);
if (button == MB_MENU_INITIALIZE)
{
int num_entries = numTreeInfoInGroup(ti);
@@
-3878,12
+3878,8
@@
static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
if (mx || my) /* mouse input */
{
if (mx || my) /* mouse input */
{
- int last_game_status = game_status; /* save current game status */
-
x = (mx - mSX) / 32;
y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
x = (mx - mSX) / 32;
y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
-
- SetGameStatus(last_game_status); /* restore current game status */
}
else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
}
else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
@@
-6935,14
+6931,10
@@
static void CreateScreenScrollbars()
void CreateScreenGadgets()
{
void CreateScreenGadgets()
{
- int last_game_status = game_status; /* save current game status */
-
CreateScreenMenubuttons();
CreateScreenScrollbuttons();
CreateScreenScrollbars();
CreateScreenMenubuttons();
CreateScreenScrollbuttons();
CreateScreenScrollbars();
-
- SetGameStatus(last_game_status); /* restore current game status */
}
void FreeScreenGadgets()
}
void FreeScreenGadgets()