More refactoring and fixes

This commit is contained in:
Lactozilla 2023-12-27 14:42:50 -03:00
parent 3816115e4e
commit 39f412bfd6
12 changed files with 85 additions and 115 deletions

View file

@ -830,16 +830,6 @@ void F_IntroDrawer(void)
V_DrawString(cx, cy, V_ALLOWLOWERCASE, cutscene_disptext); V_DrawString(cx, cy, V_ALLOWLOWERCASE, cutscene_disptext);
} }
static void F_IntroDoCrossfade(void)
{
wipe_t wipe = {0};
wipe.flags = WSF_CROSSFADE;
wipe.style = WIPESTYLE_NORMAL;
wipe.type = 99;
wipe.drawmenuontop = false;
F_StartWipeParametrized(&wipe);
}
static void F_IntroCheckMidSceneWipe(void) static void F_IntroCheckMidSceneWipe(void)
{ {
boolean do_crossfade = false; boolean do_crossfade = false;
@ -858,10 +848,7 @@ static void F_IntroCheckMidSceneWipe(void)
do_crossfade = true; do_crossfade = true;
if (do_crossfade) if (do_crossfade)
{ F_WipeDoCrossfade(99);
F_IntroDoCrossfade();
timetonext--;
}
} }
static void F_PlayIntroMusic(void) static void F_PlayIntroMusic(void)
@ -872,7 +859,6 @@ static void F_PlayIntroMusic(void)
static void F_IntroDoSpecialWipe(INT32 scene) static void F_IntroDoSpecialWipe(INT32 scene)
{ {
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.style = WIPESTYLE_NORMAL;
wipe.type = 99; wipe.type = 99;
wipe.drawmenuontop = true; wipe.drawmenuontop = true;
@ -883,18 +869,15 @@ static void F_IntroDoSpecialWipe(INT32 scene)
case INTRO_STJR: case INTRO_STJR:
// The intro music is timed with the fade out and fade in // The intro music is timed with the fade out and fade in
wipe.callback = F_PlayIntroMusic; wipe.callback = F_PlayIntroMusic;
wipe.style = WIPESTYLE_COLORMAP;
do_fade_in = true; do_fade_in = true;
break; break;
case INTRO_SKYRUNNER: case INTRO_SKYRUNNER:
wipe.flags = WSF_TOWHITE; wipe.flags = WSF_TOWHITE;
wipe.style = WIPESTYLE_COLORMAP;
wipe.type = 0; wipe.type = 0;
wipe.holdframes = 17; wipe.holdframes = 17;
do_fade_in = true; do_fade_in = true;
break; break;
case INTRO_LAST: case INTRO_LAST:
wipe.style = WIPESTYLE_COLORMAP;
wipe.holdframes = NEWTICRATE*2; wipe.holdframes = NEWTICRATE*2;
wipe.callback = D_StartTitle; wipe.callback = D_StartTitle;
break; break;
@ -903,6 +886,8 @@ static void F_IntroDoSpecialWipe(INT32 scene)
break; break;
} }
wipe.style = F_WipeGetStyle(wipe.flags);
F_StartWipeParametrized(&wipe); F_StartWipeParametrized(&wipe);
if (do_fade_in) if (do_fade_in)
@ -954,7 +939,7 @@ void F_IntroTicker(void)
{ {
if (F_IntroSceneCrossfades(intro_scenenum)) if (F_IntroSceneCrossfades(intro_scenenum))
{ {
F_IntroDoCrossfade(); F_WipeDoCrossfade(99);
next = false; next = false;
} }
@ -3842,8 +3827,8 @@ static void F_AdvanceToNextScene(void)
if (cutscenes[cutnum]->scene[scenenum].fadecolor) if (cutscenes[cutnum]->scene[scenenum].fadecolor)
{ {
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.flags = 0; wipe.flags = WSF_CROSSFADE;
wipe.style = WIPESTYLE_NORMAL; wipe.style = F_WipeGetStyle(wipe.flags);
wipe.type = cutscenes[cutnum]->scene[scenenum].fadeinid; wipe.type = cutscenes[cutnum]->scene[scenenum].fadeinid;
wipe.drawmenuontop = true; wipe.drawmenuontop = true;
wipe.callback = F_PlayCutsceneMusic; wipe.callback = F_PlayCutsceneMusic;
@ -3853,7 +3838,7 @@ static void F_AdvanceToNextScene(void)
} }
else else
{ {
F_WipeDoCrossfade(); F_WipeDoCrossfade(DEFAULTWIPE);
} }
// Don't increment until after endcutscene check // Don't increment until after endcutscene check

View file

@ -170,11 +170,9 @@ extern boolean wipe_drawmenuontop;
typedef enum typedef enum
{ {
WIPESTYLE_UNDEFINED,
WIPESTYLE_NORMAL, WIPESTYLE_NORMAL,
WIPESTYLE_COLORMAP WIPESTYLE_COLORMAP
} wipestyle_t; } wipestyle_t;
extern wipestyle_t wipe_style;
typedef enum typedef enum
{ {
@ -182,7 +180,6 @@ typedef enum
WSF_TOWHITE = 1<<1, WSF_TOWHITE = 1<<1,
WSF_CROSSFADE = 1<<2 WSF_CROSSFADE = 1<<2
} wipeflags_t; } wipeflags_t;
extern wipeflags_t wipe_flags;
typedef void (*wipe_callback_t)(void); typedef void (*wipe_callback_t)(void);
@ -214,11 +211,13 @@ void F_DisplayWipe(void);
void F_StopWipe(void); void F_StopWipe(void);
void F_StopAllWipes(void); void F_StopAllWipes(void);
void F_SetupFadeOut(wipeflags_t flags); void F_SetupFadeOut(wipeflags_t flags);
void F_QueuePreWipe(INT16 wipetypepre, wipeflags_t flags, wipe_callback_t callback); void F_DoGenericTransition(void);
void F_QueuePostWipe(INT16 wipetypepost, wipeflags_t flags, wipe_callback_t callback); void F_QueuePreWipe(INT16 type, wipeflags_t flags, wipe_callback_t callback);
void F_WipeDoCrossfade(void); void F_QueuePostWipe(INT16 type, wipeflags_t flags, wipe_callback_t callback);
void F_WipeDoCrossfade(INT16 type);
void F_StartPendingWipe(void); void F_StartPendingWipe(void);
wipe_t *F_GetQueuedWipe(void); wipe_t *F_GetQueuedWipe(void);
wipestyle_t F_WipeGetStyle(wipeflags_t flags);
#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, c) #define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, c)

View file

@ -53,7 +53,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
99, // wipe_credits_intermediate (0) 99, // wipe_credits_intermediate (0)
0, // wipe_level_toblack 0, // wipe_level_toblack
UINT8_MAX, // wipe_intermission_toblack 0, // wipe_intermission_toblack
0, // wipe_continuing_toblack 0, // wipe_continuing_toblack
0, // wipe_titlescreen_toblack 0, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack 0, // wipe_timeattack_toblack
@ -98,8 +98,9 @@ static UINT8 wipe_frame;
static boolean wipe_stopped = false; static boolean wipe_stopped = false;
static tic_t wipe_holdframes = 0; static tic_t wipe_holdframes = 0;
wipestyle_t wipe_style = WIPESTYLE_UNDEFINED; static wipestyle_t wipe_style = WIPESTYLE_NORMAL;
wipeflags_t wipe_flags = WSF_CROSSFADE; static wipeflags_t wipe_flags = WSF_CROSSFADE;
specialwipe_t ranspecialwipe = SPECIALWIPE_NONE; specialwipe_t ranspecialwipe = SPECIALWIPE_NONE;
boolean wipe_running = false; boolean wipe_running = false;
@ -422,7 +423,7 @@ void F_WipeEndScreen(void)
#ifdef HWRENDER #ifdef HWRENDER
if (rendermode == render_opengl) if (rendermode == render_opengl)
{ {
HWR_EndScreenWipe(false); HWR_EndScreenWipe();
return; return;
} }
#endif #endif
@ -442,7 +443,7 @@ static boolean F_WipeCanTint(wipeflags_t flags)
/** Decides what wipe style to use. /** Decides what wipe style to use.
*/ */
static wipestyle_t F_WipeGetStyle(wipeflags_t flags) wipestyle_t F_WipeGetStyle(wipeflags_t flags)
{ {
if (F_WipeCanTint(flags)) if (F_WipeCanTint(flags))
return WIPESTYLE_COLORMAP; return WIPESTYLE_COLORMAP;
@ -495,7 +496,7 @@ void F_StartWipeParametrized(wipe_t *wipe)
paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS); paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS);
#endif #endif
if (wipe_numqueued >= WIPEQUEUESIZE) if (wipe_numqueued >= WIPEQUEUESIZE || wipe->type == UINT8_MAX)
{ {
// Can't queue it, but its callback has to run. // Can't queue it, but its callback has to run.
if (wipe->callback) if (wipe->callback)
@ -672,11 +673,11 @@ wipe_t *F_GetQueuedWipe(void)
void F_SetupFadeOut(wipeflags_t flags) void F_SetupFadeOut(wipeflags_t flags)
{ {
#ifndef NOWIPE
F_WipeStartScreen(); F_WipeStartScreen();
UINT8 wipecolor = (flags & WSF_TOWHITE) ? 0 : 31; UINT8 wipecolor = (flags & WSF_TOWHITE) ? 0 : 31;
#ifndef NOWIPE
if (F_WipeCanTint(flags)) if (F_WipeCanTint(flags))
{ {
#ifdef HWRENDER #ifdef HWRENDER
@ -685,46 +686,47 @@ void F_SetupFadeOut(wipeflags_t flags)
#endif #endif
} }
else else
#endif
{ {
F_WipeColorFill(wipecolor); F_WipeColorFill(wipecolor);
} }
F_WipeEndScreen(); F_WipeEndScreen();
#endif
}
void F_DoGenericTransition(void)
{
F_QueuePreWipe(DEFAULTWIPE, 0, NULL);
F_QueuePostWipe(DEFAULTWIPE, WSF_FADEIN, NULL);
} }
/** Starts the "pre" type of a wipe. /** Starts the "pre" type of a wipe.
*/ */
void F_QueuePreWipe(INT16 wipetypepre, wipeflags_t flags, wipe_callback_t callback) void F_QueuePreWipe(INT16 type, wipeflags_t flags, wipe_callback_t callback)
{ {
if (wipetypepre == DEFAULTWIPE || !F_WipeExists(wipetypepre)) if (type == DEFAULTWIPE || !F_WipeExists(type))
wipetypepre = wipedefs[F_GetWipedefIndex()]; type = wipedefs[F_GetWipedefIndex()];
// Fade to black first
if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)) // fades to black on its own timing, always
&& wipetypepre != UINT8_MAX)
{
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.flags = flags; wipe.flags = flags;
wipe.style = F_WipeGetStyle(wipe.flags); wipe.style = F_WipeGetStyle(flags);
wipe.type = wipetypepre; wipe.type = type;
wipe.drawmenuontop = gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN; wipe.drawmenuontop = gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN;
wipe.callback = callback; wipe.callback = callback;
F_StartWipeParametrized(&wipe); F_StartWipeParametrized(&wipe);
}
} }
/** Starts the "post" type of a wipe. /** Starts the "post" type of a wipe.
*/ */
void F_QueuePostWipe(INT16 wipetypepost, wipeflags_t flags, wipe_callback_t callback) void F_QueuePostWipe(INT16 type, wipeflags_t flags, wipe_callback_t callback)
{ {
if (wipetypepost == DEFAULTWIPE || !F_WipeExists(wipetypepost)) if (type == DEFAULTWIPE || !F_WipeExists(type))
wipetypepost = wipedefs[F_GetWipedefIndex() + WIPEFINALSHIFT]; type = wipedefs[F_GetWipedefIndex() + WIPEFINALSHIFT];
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.flags = flags; wipe.flags = flags;
wipe.style = F_WipeGetStyle(wipe.flags); wipe.style = F_WipeGetStyle(flags);
wipe.type = wipetypepost; wipe.type = type;
wipe.drawmenuontop = gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN; wipe.drawmenuontop = gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN;
wipe.callback = callback; wipe.callback = callback;
F_StartWipeParametrized(&wipe); F_StartWipeParametrized(&wipe);
@ -732,12 +734,12 @@ void F_QueuePostWipe(INT16 wipetypepost, wipeflags_t flags, wipe_callback_t call
/** Does a crossfade. /** Does a crossfade.
*/ */
void F_WipeDoCrossfade(void) void F_WipeDoCrossfade(INT16 type)
{ {
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.flags = WSF_CROSSFADE | WSF_FADEIN; wipe.flags = WSF_CROSSFADE;
wipe.style = WIPESTYLE_NORMAL; wipe.style = F_WipeGetStyle(wipe.flags);
wipe.type = wipedefs[F_GetWipedefIndex()]; wipe.type = type == DEFAULTWIPE ? wipedefs[F_GetWipedefIndex()] : type;
wipe.drawmenuontop = false; wipe.drawmenuontop = false;
F_StartWipeParametrized(&wipe); F_StartWipeParametrized(&wipe);
} }

View file

@ -79,7 +79,7 @@ static void G_DoContinued(void);
static void G_DoWorldDone(void); static void G_DoWorldDone(void);
static void G_CheckPlayerReborn(void); static void G_CheckPlayerReborn(void);
static inline void G_TickerEnd(void); static void G_TickerEnd(void);
char mapmusname[7]; // Music name char mapmusname[7]; // Music name
UINT16 mapmusflags; // Track and reset bit UINT16 mapmusflags; // Track and reset bit
@ -2087,7 +2087,7 @@ static void G_DoLevelFadeIn(void)
if (ranspecialwipe == SPECIALWIPE_SSTAGE) if (ranspecialwipe == SPECIALWIPE_SSTAGE)
flags |= WSF_TOWHITE; flags |= WSF_TOWHITE;
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.style = WIPESTYLE_COLORMAP; wipe.style = F_WipeGetStyle(wipe.flags);
wipe.flags = flags; wipe.flags = flags;
wipe.type = wipedefs[wipe_level_final]; wipe.type = wipedefs[wipe_level_final];
wipe.drawmenuontop = true; wipe.drawmenuontop = true;
@ -2180,7 +2180,7 @@ void TitleCard_Run(void)
{ {
if (!cv_showhud.value) if (!cv_showhud.value)
{ {
F_WipeDoCrossfade(); F_WipeDoCrossfade(DEFAULTWIPE);
} }
else else
{ {
@ -2563,7 +2563,6 @@ static void G_MarathonTicker(void)
void G_Ticker(boolean run) void G_Ticker(boolean run)
{ {
UINT32 i; UINT32 i;
INT32 buf;
// Bot players queued for removal // Bot players queued for removal
for (i = MAXPLAYERS-1; i != UINT32_MAX; i--) for (i = MAXPLAYERS-1; i != UINT32_MAX; i--)
@ -2601,8 +2600,12 @@ void G_Ticker(boolean run)
} }
// Run the title card // Run the title card
if (titlecard.running && (wipe_flags & WSF_FADEIN)) if (titlecard.running)
{
wipe_t *wipe = F_GetQueuedWipe();
if (wipe && wipe->flags & WSF_FADEIN)
TitleCard_Run(); TitleCard_Run();
}
// Run Marathon Mode in-game timer // Run Marathon Mode in-game timer
G_MarathonTicker(); G_MarathonTicker();
@ -2638,16 +2641,15 @@ void G_Ticker(boolean run)
default: I_Error("gameaction = %d\n", gameaction); default: I_Error("gameaction = %d\n", gameaction);
} }
buf = gametic % BACKUPTICS;
// Generate ticcmds for bots FIRST, then copy received ticcmds for players. // Generate ticcmds for bots FIRST, then copy received ticcmds for players.
// This emulates pre-2.2.10 behaviour where the bot referenced their leader's last copied ticcmd, // This emulates pre-2.2.10 behaviour where the bot referenced their leader's last copied ticcmd,
// which is desirable because P_PlayerThink can override inputs (e.g. while PF_STASIS is applied or in a waterslide), // which is desirable because P_PlayerThink can override inputs (e.g. while PF_STASIS is applied or in a waterslide),
// and the bot AI needs to respect that. // and the bot AI needs to respect that.
#define ISHUMAN (players[i].bot == BOT_NONE || players[i].bot == BOT_2PHUMAN) INT32 buf = gametic % BACKUPTICS;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (playeringame[i] && !ISHUMAN) // Less work is required if we're building a bot ticcmd. if (playeringame[i] && !P_IsHuman(&players[i])) // Less work is required if we're building a bot ticcmd.
{ {
players[i].lastbuttons = players[i].cmd.buttons; // Save last frame's button readings players[i].lastbuttons = players[i].cmd.buttons; // Save last frame's button readings
B_BuildTiccmd(&players[i], &players[i].cmd); B_BuildTiccmd(&players[i], &players[i].cmd);
@ -2660,7 +2662,7 @@ void G_Ticker(boolean run)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (playeringame[i] && ISHUMAN) if (playeringame[i] && P_IsHuman(&players[i]))
{ {
players[i].lastbuttons = players[i].cmd.buttons; // Save last frame's button readings players[i].lastbuttons = players[i].cmd.buttons; // Save last frame's button readings
G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1); G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1);
@ -2677,7 +2679,6 @@ void G_Ticker(boolean run)
players[i].cmd.angleturn = (players[i].angleturn & ~TICCMD_RECEIVED) | (players[i].cmd.angleturn & TICCMD_RECEIVED); players[i].cmd.angleturn = (players[i].angleturn & ~TICCMD_RECEIVED) | (players[i].cmd.angleturn & TICCMD_RECEIVED);
} }
} }
#undef ISHUMAN
// do main actions // do main actions
switch (gamestate) switch (gamestate)
@ -2776,7 +2777,7 @@ void G_Ticker(boolean run)
G_TickerEnd(); G_TickerEnd();
} }
static inline void G_TickerEnd(void) static void G_TickerEnd(void)
{ {
if (pausedelay && pausedelay != INT32_MIN) if (pausedelay && pausedelay != INT32_MIN)
{ {
@ -3562,9 +3563,7 @@ void G_DoReborn(INT32 playernum)
P_ClearStarPost(players[i].starpostnum); P_ClearStarPost(players[i].starpostnum);
} }
// Do a wipe F_WipeDoCrossfade(DEFAULTWIPE);
// TODO should be done after rendering
F_WipeDoCrossfade();
if (camera.chase) if (camera.chase)
P_ResetCamera(&players[displayplayer], &camera); P_ResetCamera(&players[displayplayer], &camera);

View file

@ -58,7 +58,7 @@ EXPORT INT32 HWRAPI(GetTextureUsed) (void);
EXPORT void HWRAPI(FlushScreenTextures) (void); EXPORT void HWRAPI(FlushScreenTextures) (void);
EXPORT void HWRAPI(StartScreenWipe) (void); EXPORT void HWRAPI(StartScreenWipe) (void);
EXPORT void HWRAPI(EndScreenWipe) (boolean restore); EXPORT void HWRAPI(EndScreenWipe) (void);
EXPORT void HWRAPI(DoScreenWipe) (void); EXPORT void HWRAPI(DoScreenWipe) (void);
EXPORT void HWRAPI(DrawIntermissionBG) (void); EXPORT void HWRAPI(DrawIntermissionBG) (void);
EXPORT void HWRAPI(MakeScreenTexture) (void); EXPORT void HWRAPI(MakeScreenTexture) (void);

View file

@ -6924,10 +6924,10 @@ void HWR_StartScreenWipe(void)
HWD.pfnStartScreenWipe(); HWD.pfnStartScreenWipe();
} }
void HWR_EndScreenWipe(boolean restore) void HWR_EndScreenWipe(void)
{ {
//CONS_Debug(DBG_RENDER, "In HWR_EndScreenWipe()\n"); //CONS_Debug(DBG_RENDER, "In HWR_EndScreenWipe()\n");
HWD.pfnEndScreenWipe(restore); HWD.pfnEndScreenWipe();
} }
void HWR_DrawIntermissionBG(void) void HWR_DrawIntermissionBG(void)

View file

@ -58,7 +58,7 @@ void transform(float *cx, float *cy, float *cz);
INT32 HWR_GetTextureUsed(void); INT32 HWR_GetTextureUsed(void);
void HWR_DoPostProcessor(player_t *player); void HWR_DoPostProcessor(player_t *player);
void HWR_StartScreenWipe(void); void HWR_StartScreenWipe(void);
void HWR_EndScreenWipe(boolean restore); void HWR_EndScreenWipe(void);
void HWR_DrawIntermissionBG(void); void HWR_DrawIntermissionBG(void);
void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum); void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum);
void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum); void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum);

View file

@ -3242,7 +3242,7 @@ EXPORT void HWRAPI(StartScreenWipe) (void)
} }
// Create Screen to fade to // Create Screen to fade to
EXPORT void HWRAPI(EndScreenWipe)(boolean restore) EXPORT void HWRAPI(EndScreenWipe)(void)
{ {
INT32 texsize = 2048; INT32 texsize = 2048;
boolean firstTime = (endScreenWipe == 0); boolean firstTime = (endScreenWipe == 0);
@ -3270,10 +3270,6 @@ EXPORT void HWRAPI(EndScreenWipe)(boolean restore)
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texsize, texsize); pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texsize, texsize);
tex_downloaded = endScreenWipe; tex_downloaded = endScreenWipe;
// Draw the start screen wipe texture
if (restore)
DrawScreenTexture(startScreenWipe);
} }
// Draw the last scene under the intermission // Draw the last scene under the intermission

View file

@ -147,6 +147,7 @@ void P_ForceLocalAngle(player_t *player, angle_t angle);
boolean P_PlayerFullbright(player_t *player); boolean P_PlayerFullbright(player_t *player);
boolean P_PlayerCanEnterSpinGaps(player_t *player); boolean P_PlayerCanEnterSpinGaps(player_t *player);
boolean P_PlayerShouldUseSpinHeight(player_t *player); boolean P_PlayerShouldUseSpinHeight(player_t *player);
boolean P_IsHuman(player_t *player);
UINT16 P_GetPlayerColor(player_t *player); UINT16 P_GetPlayerColor(player_t *player);
boolean P_IsObjectInGoop(mobj_t *mo); boolean P_IsObjectInGoop(mobj_t *mo);

View file

@ -7541,14 +7541,14 @@ void P_RunSpecialStageWipe(void)
if (RESETMUSIC || if (RESETMUSIC ||
strnicmp(S_MusicName(), strnicmp(S_MusicName(),
(mapmusflags & MUSIC_RELOADRESET) ? mapheaderinfo[gamemap - 1]->musname : mapmusname, 7)) (mapmusflags & MUSIC_RELOADRESET) ? mapheaderinfo[gamemap - 1]->musname : mapmusname, 7))
S_FadeOutStopMusic(MUSICRATE/4); //FixedMul(FixedDiv(F_GetWipeLength(wipedefs[wipe_speclevel_towhite])*NEWTICRATERATIO, NEWTICRATE), MUSICRATE) S_FadeOutStopMusic(MUSICRATE/4);
if (titlemapinaction || F_GetQueuedWipe()) if (titlemapinaction || F_GetQueuedWipe())
return; return;
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.style = WIPESTYLE_COLORMAP;
wipe.flags = WSF_TOWHITE; wipe.flags = WSF_TOWHITE;
wipe.style = F_WipeGetStyle(wipe.flags);
wipe.callback = G_DoLoadLevel; wipe.callback = G_DoLoadLevel;
wipe.type = wipedefs[wipe_speclevel_towhite]; wipe.type = wipedefs[wipe_speclevel_towhite];
wipe.drawmenuontop = false; wipe.drawmenuontop = false;
@ -7562,8 +7562,8 @@ void P_RunLevelWipe(void)
return; return;
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.style = WIPESTYLE_COLORMAP;
wipe.flags = 0; wipe.flags = 0;
wipe.style = F_WipeGetStyle(wipe.flags);
wipe.callback = G_DoLoadLevel; wipe.callback = G_DoLoadLevel;
wipe.type = wipedefs[wipe_level_toblack]; wipe.type = wipedefs[wipe_level_toblack];
wipe.drawmenuontop = false; wipe.drawmenuontop = false;
@ -7945,8 +7945,8 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (ranspecialwipe == SPECIALWIPE_RETRY) if (ranspecialwipe == SPECIALWIPE_RETRY)
{ {
wipe_t wipe = {0}; wipe_t wipe = {0};
wipe.style = WIPESTYLE_COLORMAP;
wipe.flags = WSF_TOWHITE | WSF_FADEIN; wipe.flags = WSF_TOWHITE | WSF_FADEIN;
wipe.style = F_WipeGetStyle(wipe.flags);
wipe.type = wipedefs[wipe_level_final]; wipe.type = wipedefs[wipe_level_final];
wipe.drawmenuontop = true; wipe.drawmenuontop = true;
F_StartWipeParametrized(&wipe); F_StartWipeParametrized(&wipe);

View file

@ -13235,6 +13235,14 @@ boolean P_PlayerShouldUseSpinHeight(player_t *player)
|| JUMPCURLED(player)); || JUMPCURLED(player));
} }
boolean P_IsHuman(player_t *player)
{
if (!player)
return true;
return player->bot == BOT_NONE || player->bot == BOT_2PHUMAN;
}
UINT16 P_GetPlayerColor(player_t *player) UINT16 P_GetPlayerColor(player_t *player)
{ {
if (G_GametypeHasTeams() && player->ctfteam) if (G_GametypeHasTeams() && player->ctfteam)

View file

@ -1363,7 +1363,7 @@ void Y_StartIntermission(void)
} }
usetile = false; usetile = false;
F_WipeDoCrossfade(); F_WipeDoCrossfade(DEFAULTWIPE);
// set up the "got through act" message according to skin name // set up the "got through act" message according to skin name
if (stagefailed) if (stagefailed)
@ -1440,23 +1440,7 @@ void Y_StartIntermission(void)
// tile if using the default background // tile if using the default background
usetile = !useinterpic; usetile = !useinterpic;
F_QueuePreWipe(DEFAULTWIPE, 0, NULL); F_DoGenericTransition();
F_QueuePostWipe(DEFAULTWIPE, WSF_FADEIN, NULL);
// get special stage specific patches
/* if (!stagefailed && ALL7EMERALDS(emeralds))
{
data.spec.cemerald = W_CachePatchName("GOTEMALL", PU_PATCH);
data.spec.headx = 70;
data.spec.nowsuper = players[consoleplayer].skin
? NULL : W_CachePatchName("NOWSUPER", PU_PATCH);
}
else
{
data.spec.cemerald = W_CachePatchName("CEMERALD", PU_PATCH);
data.spec.headx = 48;
data.spec.nowsuper = NULL;
} */
// Super form stuff (normally blank) // Super form stuff (normally blank)
data.spec.passed3[0] = '\0'; data.spec.passed3[0] = '\0';
@ -1532,8 +1516,7 @@ void Y_StartIntermission(void)
usetile = true; usetile = true;
useinterpic = false; useinterpic = false;
F_QueuePreWipe(DEFAULTWIPE, 0, NULL); F_DoGenericTransition();
F_QueuePostWipe(DEFAULTWIPE, WSF_FADEIN, NULL);
break; break;
} }
@ -1559,8 +1542,7 @@ void Y_StartIntermission(void)
usetile = true; usetile = true;
useinterpic = false; useinterpic = false;
F_QueuePreWipe(DEFAULTWIPE, 0, NULL); F_DoGenericTransition();
F_QueuePostWipe(DEFAULTWIPE, WSF_FADEIN, NULL);
break; break;
} }
@ -1587,8 +1569,7 @@ void Y_StartIntermission(void)
usetile = true; usetile = true;
useinterpic = false; useinterpic = false;
F_QueuePreWipe(DEFAULTWIPE, 0, NULL); F_DoGenericTransition();
F_QueuePostWipe(DEFAULTWIPE, WSF_FADEIN, NULL);
break; break;
} }
@ -1614,8 +1595,7 @@ void Y_StartIntermission(void)
usetile = true; usetile = true;
useinterpic = false; useinterpic = false;
F_QueuePreWipe(-1, 0, NULL); F_DoGenericTransition();
F_QueuePostWipe(-1, WSF_FADEIN, NULL);
break; break;
} }