mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Attempt 2 at special stage fades.
More basic in execution.
This commit is contained in:
parent
2dc9a4b34a
commit
58e685353a
4 changed files with 51 additions and 16 deletions
|
@ -3187,6 +3187,12 @@ static void readwipes(MYFILE *f)
|
||||||
else if (fastcmp(pword, "FINAL"))
|
else if (fastcmp(pword, "FINAL"))
|
||||||
wipeoffset = wipe_gameend_final;
|
wipeoffset = wipe_gameend_final;
|
||||||
}
|
}
|
||||||
|
else if (fastncmp(word, "SPECLEVEL_", 10))
|
||||||
|
{
|
||||||
|
pword = word + 10;
|
||||||
|
if (fastcmp(pword, "TOWHITE"))
|
||||||
|
wipeoffset = wipe_speclevel_towhite;
|
||||||
|
}
|
||||||
|
|
||||||
if (wipeoffset < 0)
|
if (wipeoffset < 0)
|
||||||
{
|
{
|
||||||
|
@ -3194,9 +3200,11 @@ static void readwipes(MYFILE *f)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == UINT8_MAX // Cannot disable non-toblack wipes (or the level toblack wipe)
|
if (value == UINT8_MAX
|
||||||
&& (wipeoffset <= wipe_level_toblack || wipeoffset >= wipe_level_final))
|
&& (wipeoffset <= wipe_level_toblack || wipeoffset >= wipe_speclevel_towhite))
|
||||||
{
|
{
|
||||||
|
// Cannot disable non-toblack wipes
|
||||||
|
// (or the level toblack wipe, or the special towhite wipe)
|
||||||
deh_warning("Wipes: can't disable wipe of type '%s'", word);
|
deh_warning("Wipes: can't disable wipe of type '%s'", word);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ enum
|
||||||
// custom intermissions
|
// custom intermissions
|
||||||
wipe_specinter_toblack,
|
wipe_specinter_toblack,
|
||||||
wipe_multinter_toblack,
|
wipe_multinter_toblack,
|
||||||
|
wipe_speclevel_towhite,
|
||||||
|
|
||||||
wipe_level_final,
|
wipe_level_final,
|
||||||
wipe_intermission_final,
|
wipe_intermission_final,
|
||||||
|
@ -108,7 +109,7 @@ enum
|
||||||
|
|
||||||
NUMWIPEDEFS
|
NUMWIPEDEFS
|
||||||
};
|
};
|
||||||
#define WIPEFINALSHIFT 12
|
#define WIPEFINALSHIFT 13
|
||||||
extern UINT8 wipedefs[NUMWIPEDEFS];
|
extern UINT8 wipedefs[NUMWIPEDEFS];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,6 +58,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
|
||||||
|
|
||||||
0, // wipe_specinter_toblack
|
0, // wipe_specinter_toblack
|
||||||
0, // wipe_multinter_toblack
|
0, // wipe_multinter_toblack
|
||||||
|
0, // wipe_speclevel_towhite
|
||||||
|
|
||||||
0, // wipe_level_final
|
0, // wipe_level_final
|
||||||
0, // wipe_intermission_final
|
0, // wipe_intermission_final
|
||||||
|
|
|
@ -2369,7 +2369,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
// use gamemap to get map number.
|
// use gamemap to get map number.
|
||||||
// 99% of the things already did, so.
|
// 99% of the things already did, so.
|
||||||
// Map header should always be in place at this point
|
// Map header should always be in place at this point
|
||||||
INT32 i, loadprecip = 1;
|
INT32 i, loadprecip = 1, ranspecialwipe = 0;
|
||||||
INT32 loademblems = 1;
|
INT32 loademblems = 1;
|
||||||
INT32 fromnetsave = 0;
|
INT32 fromnetsave = 0;
|
||||||
boolean loadedbm = false;
|
boolean loadedbm = false;
|
||||||
|
@ -2442,6 +2442,28 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
// will be set by player think.
|
// will be set by player think.
|
||||||
players[consoleplayer].viewz = 1;
|
players[consoleplayer].viewz = 1;
|
||||||
|
|
||||||
|
// Special stage fade to white
|
||||||
|
// This is handled BEFORE sounds are stopped.
|
||||||
|
if (rendermode != render_none && G_IsSpecialStage(gamemap))
|
||||||
|
{
|
||||||
|
tic_t starttime = I_GetTime();
|
||||||
|
tic_t endtime = starttime + (3*TICRATE)/2;
|
||||||
|
|
||||||
|
S_StartSound(NULL, sfx_s3kaf);
|
||||||
|
|
||||||
|
F_WipeStartScreen();
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
|
||||||
|
|
||||||
|
F_WipeEndScreen();
|
||||||
|
F_RunWipe(wipedefs[wipe_speclevel_towhite], false);
|
||||||
|
|
||||||
|
// Hold on white for extra effect.
|
||||||
|
while (I_GetTime() < endtime)
|
||||||
|
I_Sleep();
|
||||||
|
|
||||||
|
ranspecialwipe = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure all sounds are stopped before Z_FreeTags.
|
// Make sure all sounds are stopped before Z_FreeTags.
|
||||||
S_StopSounds();
|
S_StopSounds();
|
||||||
S_ClearSfx();
|
S_ClearSfx();
|
||||||
|
@ -2451,16 +2473,20 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
S_Start();
|
S_Start();
|
||||||
|
|
||||||
// Let's fade to black here
|
// Let's fade to black here
|
||||||
if (rendermode != render_none)
|
// But only if we didn't do the special stage wipe
|
||||||
|
if (rendermode != render_none && !ranspecialwipe)
|
||||||
{
|
{
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
|
|
||||||
F_WipeEndScreen();
|
F_WipeEndScreen();
|
||||||
F_RunWipe(wipedefs[wipe_level_toblack], false);
|
F_RunWipe(wipedefs[wipe_level_toblack], false);
|
||||||
|
}
|
||||||
|
|
||||||
// Don't include these in the fade!
|
// Print "SPEEDING OFF TO [ZONE] [ACT 1]..."
|
||||||
|
if (rendermode != render_none)
|
||||||
{
|
{
|
||||||
|
// Don't include these in the fade!
|
||||||
char tx[64];
|
char tx[64];
|
||||||
V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to..."));
|
V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to..."));
|
||||||
snprintf(tx, 63, "%s%s%s",
|
snprintf(tx, 63, "%s%s%s",
|
||||||
|
@ -2470,7 +2496,6 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx);
|
V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx);
|
||||||
I_UpdateNoVsync();
|
I_UpdateNoVsync();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
LUA_InvalidateLevel();
|
LUA_InvalidateLevel();
|
||||||
|
@ -2767,7 +2792,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
|
|
||||||
// Remove the loading shit from the screen
|
// Remove the loading shit from the screen
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (ranspecialwipe) ? 0 : 31);
|
||||||
|
|
||||||
if (precache || dedicated)
|
if (precache || dedicated)
|
||||||
R_PrecacheLevel();
|
R_PrecacheLevel();
|
||||||
|
|
Loading…
Reference in a new issue