fix RA fade

This commit is contained in:
Jaime Passos 2019-11-23 18:15:09 -03:00
parent aabddd69f1
commit e850d42bc2
5 changed files with 34 additions and 2 deletions

View File

@ -172,6 +172,7 @@ mapheader_t* mapheaderinfo[NUMMAPS] = {NULL};
static boolean exitgame = false;
static boolean retrying = false;
static boolean retryingmodeattack = false;
UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage.
@ -2015,7 +2016,7 @@ boolean G_Responder(event_t *ev)
pausedelay = 1+(NEWTICRATE/2);
else if (++pausedelay > 1+(NEWTICRATE/2)+(NEWTICRATE/3))
{
G_SetRetryFlag();
G_SetModeAttackRetryFlag();
return true;
}
pausedelay++; // counteract subsequent subtraction this frame
@ -6925,6 +6926,22 @@ boolean G_GetRetryFlag(void)
return retrying;
}
void G_SetModeAttackRetryFlag(void)
{
retryingmodeattack = true;
G_SetRetryFlag();
}
void G_ClearModeAttackRetryFlag(void)
{
retryingmodeattack = false;
}
boolean G_GetModeAttackRetryFlag(void)
{
return retryingmodeattack;
}
// Time utility functions
INT32 G_TicsToHours(tic_t tics)
{

View File

@ -225,10 +225,14 @@ void G_AddPlayer(INT32 playernum);
void G_SetExitGameFlag(void);
void G_ClearExitGameFlag(void);
boolean G_GetExitGameFlag(void);
void G_SetRetryFlag(void);
void G_ClearRetryFlag(void);
boolean G_GetRetryFlag(void);
void G_SetModeAttackRetryFlag(void);
void G_ClearModeAttackRetryFlag(void);
boolean G_GetModeAttackRetryFlag(void);
void G_LoadGameData(void);
void G_LoadGameSettings(void);

View File

@ -3535,6 +3535,7 @@ void M_StartControlPanel(void)
void M_EndModeAttackRun(void)
{
G_ClearModeAttackRetryFlag();
M_ModeAttackEndGame(0);
}

View File

@ -2757,6 +2757,13 @@ boolean P_SetupLevel(boolean skipprecip)
ranspecialwipe = 1;
}
if (G_GetModeAttackRetryFlag())
{
if (modeattacking)
wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE);
G_ClearModeAttackRetryFlag();
}
// Make sure all sounds are stopped before Z_FreeTags.
S_StopSounds();
S_ClearSfx();

View File

@ -20,6 +20,7 @@
#include "v_video.h"
#include "st_stuff.h"
#include "hu_stuff.h"
#include "f_finale.h"
#include "r_draw.h"
#include "console.h"
@ -1861,7 +1862,9 @@ void V_DrawFadeScreen(UINT16 color, UINT8 strength)
{
const UINT8 *fadetable = ((color & 0xFF00) // Color is not palette index?
? ((UINT8 *)colormaps + strength*256) // Do COLORMAP fade.
? ((UINT8 *)(((color & 0x0F00) == 0x0A00) ? fadecolormap // Do fadecolormap fade.
: (((color & 0x0F00) == 0x0B00) ? fadecolormap + (256 * FADECOLORMAPROWS) // Do white fadecolormap fade.
: colormaps)) + strength*256) // Do COLORMAP fade.
: ((UINT8 *)transtables + ((9-strength)<<FF_TRANSSHIFT) + color*256)); // Else, do TRANSMAP** fade.
const UINT8 *deststop = screens[0] + vid.rowbytes * vid.height;
UINT8 *buf = screens[0];