f_finale.h 5.48 KB
Newer Older
Alam Ed Arias committed
1 2 3 4
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
James R. committed
5
// Copyright (C) 1999-2020 by Sonic Team Junior.
Alam Ed Arias committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file  f_finale.h
/// \brief Title screen, intro, game evaluation, and credits.
///        Also includes protos for screen wipe functions.

#ifndef __F_FINALE__
#define __F_FINALE__

#include "doomtype.h"
#include "d_event.h"
20
#include "p_mobj.h"
Alam Ed Arias committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

//
// FINALE
//

// Called by main loop.
boolean F_IntroResponder(event_t *ev);
boolean F_CutsceneResponder(event_t *ev);
boolean F_CreditResponder(event_t *ev);

// Called by main loop.
void F_GameEndTicker(void);
void F_IntroTicker(void);
void F_TitleScreenTicker(boolean run);
void F_CutsceneTicker(void);
void F_TitleDemoTicker(void);
37
void F_TextPromptTicker(void);
Alam Ed Arias committed
38 39

// Called by main loop.
40
void F_GameEndDrawer(void);
Alam Ed Arias committed
41 42
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);
43
void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
Alam Ed Arias committed
44 45 46 47 48

void F_GameEvaluationDrawer(void);
void F_StartGameEvaluation(void);
void F_GameEvaluationTicker(void);

49 50 51
void F_EndingTicker(void);
void F_EndingDrawer(void);

Alam Ed Arias committed
52 53 54 55 56 57 58
void F_CreditTicker(void);
void F_CreditDrawer(void);

void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
void F_CutsceneDrawer(void);
void F_EndCutScene(void);

59
void F_StartTextPrompt(INT32 promptnum, INT32 pagenum, mobj_t *mo, UINT16 postexectag, boolean blockcontrols, boolean freezerealtime);
Marco Z committed
60
void F_GetPromptPageByNamedTag(const char *tag, INT32 *promptnum, INT32 *pagenum);
61
void F_TextPromptDrawer(void);
62
void F_EndTextPrompt(boolean forceexec, boolean noexec);
63 64
boolean F_GetPromptHideHudAll(void);
boolean F_GetPromptHideHud(fixed_t y);
65

Alam Ed Arias committed
66 67 68
void F_StartGameEnd(void);
void F_StartIntro(void);
void F_StartTitleScreen(void);
69
void F_StartEnding(void);
Alam Ed Arias committed
70 71 72 73 74 75 76
void F_StartCredits(void);

boolean F_ContinueResponder(event_t *event);
void F_StartContinue(void);
void F_ContinueTicker(void);
void F_ContinueDrawer(void);

77
extern INT32 finalecount;
Marco Z committed
78 79
extern INT32 titlescrollxspeed;
extern INT32 titlescrollyspeed;
80

81 82
typedef enum
{
James R. committed
83
	TTMODE_NONE = 0,
84 85 86 87 88
	TTMODE_OLD,
	TTMODE_ALACROIX,
	TTMODE_USER
} ttmode_enum;

89
#define TTMAX_ALACROIX 30 // max frames for SONIC typeface, plus one for NULL terminating entry
90 91 92 93 94 95 96 97 98 99
#define TTMAX_USER 100

extern ttmode_enum ttmode;
extern UINT8 ttscale;
// ttmode user vars
extern char ttname[9];
extern INT16 ttx;
extern INT16 tty;
extern INT16 ttloop;
extern UINT16 tttics;
100 101
extern boolean ttavailable[6];

102

103 104 105 106 107 108 109
typedef enum
{
	TITLEMAP_OFF = 0,
	TITLEMAP_LOADING,
	TITLEMAP_RUNNING
} titlemap_enum;

110 111
// Current menu parameters

112
extern mobj_t *titlemapcameraref;
113
extern char curbgname[9];
114 115 116 117 118
extern SINT8 curfadevalue;
extern INT32 curbgcolor;
extern INT32 curbgxspeed;
extern INT32 curbgyspeed;
extern boolean curbghide;
Jaime Ita Passos committed
119
extern boolean hidetitlemap;
120

121 122 123 124 125 126 127 128 129 130
extern boolean curhidepics;
extern ttmode_enum curttmode;
extern UINT8 curttscale;
// ttmode user vars
extern char curttname[9];
extern INT16 curttx;
extern INT16 curtty;
extern INT16 curttloop;
extern UINT16 curtttics;

131 132 133 134
#define TITLEBACKGROUNDACTIVE (curfadevalue >= 0 || curbgname[0])

void F_InitMenuPresValues(void);
void F_MenuPresTicker(boolean run);
Alam Ed Arias committed
135 136 137 138

//
// WIPE
//
139
// HACK for menu fading while titlemapinaction; skips the level check
140
#define FORCEWIPE -3
141
#define FORCEWIPEOFF -2
142

Alam Ed Arias committed
143
extern boolean WipeInAction;
Jaime Ita Passos committed
144
extern boolean WipeStageTitle;
Alam Ed Arias committed
145

Jaime Ita Passos committed
146 147 148
typedef enum
{
	WIPESTYLE_NORMAL,
149
	WIPESTYLE_COLORMAP
Jaime Ita Passos committed
150 151 152 153 154
} wipestyle_t;
extern wipestyle_t wipestyle;

typedef enum
{
Jaime Ita Passos committed
155 156 157 158
	WSF_FADEOUT   = 1,
	WSF_FADEIN    = 1<<1,
	WSF_TOWHITE   = 1<<2,
	WSF_CROSSFADE = 1<<3,
Jaime Ita Passos committed
159 160 161
} wipestyleflags_t;
extern wipestyleflags_t wipestyleflags;

162 163 164
// Even my function names are borderline
boolean F_ShouldColormapFade(void);
boolean F_TryColormapFade(UINT8 wipecolor);
165
#ifndef NOWIPE
166
void F_DecideWipeStyle(void);
167
#endif
168

Jaime Ita Passos committed
169 170 171
#define FADECOLORMAPDIV 8
#define FADECOLORMAPROWS (256/FADECOLORMAPDIV)

172 173
#define FADEREDFACTOR   15
#define FADEGREENFACTOR 15
Jaime Ita Passos committed
174 175
#define FADEBLUEFACTOR  10

Alam Ed Arias committed
176 177
extern INT32 lastwipetic;

Jaime Ita Passos committed
178 179 180
// Don't know where else to place this constant
// But this file seems appropriate
#define PRELEVELTIME 24 // frames in tics
Jaime Ita Passos committed
181

Alam Ed Arias committed
182 183 184
void F_WipeStartScreen(void);
void F_WipeEndScreen(void);
void F_RunWipe(UINT8 wipetype, boolean drawMenu);
Jaime Ita Passos committed
185
void F_WipeStageTitle(void);
186
#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, c)
187 188
tic_t F_GetWipeLength(UINT8 wipetype);
boolean F_WipeExists(UINT8 wipetype);
Alam Ed Arias committed
189 190 191 192 193 194 195 196 197 198 199 200 201 202

enum
{
	wipe_credits_intermediate, // makes a good 0 I guess.

	wipe_level_toblack,
	wipe_intermission_toblack,
	wipe_continuing_toblack,
	wipe_titlescreen_toblack,
	wipe_timeattack_toblack,
	wipe_credits_toblack,
	wipe_evaluation_toblack,
	wipe_gameend_toblack,
	wipe_intro_toblack,
203
	wipe_ending_toblack,
Alam Ed Arias committed
204 205 206 207 208
	wipe_cutscene_toblack,

	// custom intermissions
	wipe_specinter_toblack,
	wipe_multinter_toblack,
209
	wipe_speclevel_towhite,
Alam Ed Arias committed
210 211 212 213 214 215 216 217 218 219

	wipe_level_final,
	wipe_intermission_final,
	wipe_continuing_final,
	wipe_titlescreen_final,
	wipe_timeattack_final,
	wipe_credits_final,
	wipe_evaluation_final,
	wipe_gameend_final,
	wipe_intro_final,
220
	wipe_ending_final,
Alam Ed Arias committed
221 222 223 224 225 226
	wipe_cutscene_final,

	// custom intermissions
	wipe_specinter_final,
	wipe_multinter_final,

227 228
	NUMWIPEDEFS,
	WIPEFINALSHIFT = (wipe_level_final-wipe_level_toblack)
Alam Ed Arias committed
229 230 231 232
};
extern UINT8 wipedefs[NUMWIPEDEFS];

#endif