New userdef structure "screenfade"

Set to zero to disable the hard-coded fade to black transition between screens, menu or when the level ends.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6556 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-12-12 05:13:53 +00:00
parent 63748e5381
commit 756fa2bbd8
6 changed files with 12 additions and 0 deletions

View file

@ -247,6 +247,7 @@ void CONFIG_SetDefaults(void)
ud.configversion = 0;
ud.weaponscale = 100;
ud.textscale = 200;
ud.screenfade = 1;
ud.config.CheckForUpdates = 1;

View file

@ -246,6 +246,7 @@ typedef struct {
char wchoice[MAX_WEAPONS];
uint8_t user_map;
uint8_t screenfade;
} user_defs;
extern user_defs ud;

View file

@ -1227,6 +1227,7 @@ const memberlabel_t UserdefsLabels[]=
{ "screenarea_y1", USERDEFS_SCREENAREA_Y1, 0, 0 },
{ "screenarea_x2", USERDEFS_SCREENAREA_X2, 0, 0 },
{ "screenarea_y2", USERDEFS_SCREENAREA_Y2, 0, 0 },
{ "screenfade", USERDEFS_SCREENFADE, 0, 0 },
{ NULL, -1, 0, 0 } // END OF LIST
};

View file

@ -530,6 +530,7 @@ enum UserdefsLabel_t
USERDEFS_SCREENAREA_Y1,
USERDEFS_SCREENAREA_X2,
USERDEFS_SCREENAREA_Y2,
USERDEFS_SCREENFADE,
USERDEFS_END
};

View file

@ -177,6 +177,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum)
case USERDEFS_SCREENAREA_Y1: labelNum = ud.screenarea_y1; break;
case USERDEFS_SCREENAREA_X2: labelNum = ud.screenarea_x2; break;
case USERDEFS_SCREENAREA_Y2: labelNum = ud.screenarea_y2; break;
case USERDEFS_SCREENFADE: labelNum = ud.screenfade; break;
default: labelNum = -1; break;
}
@ -304,6 +305,7 @@ void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const iSet)
case USERDEFS_SCREENAREA_Y1: ud.screenarea_y1 = iSet; break;
case USERDEFS_SCREENAREA_X2: ud.screenarea_x2 = iSet; break;
case USERDEFS_SCREENAREA_Y2: ud.screenarea_y2 = iSet; break;
case USERDEFS_SCREENFADE: ud.screenfade = iSet; break;
default: break;
}
}

View file

@ -1299,6 +1299,8 @@ void G_DisplayRest(int32_t smoothratio)
void G_FadePalette(int32_t r, int32_t g, int32_t b, int32_t e)
{
if (ud.screenfade == 0)
return;
setpalettefade(r, g, b, e);
nextpage();
@ -1311,6 +1313,8 @@ void G_FadePalette(int32_t r, int32_t g, int32_t b, int32_t e)
// STEP must evenly divide END-START, i.e. abs(end-start)%step == 0
void fadepal(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_t step)
{
if (ud.screenfade == 0)
return;
if (getrendermode() >= REND_POLYMOST)
{
G_FadePalette(r, g, b, end);
@ -1336,6 +1340,8 @@ void fadepal(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_
// START and END limits are always inclusive!
static void fadepaltile(int32_t r, int32_t g, int32_t b, int32_t start, int32_t end, int32_t step, int32_t tile)
{
if (ud.screenfade == 0)
return;
// STEP must evenly divide END-START
Bassert(klabs(end-start)%step == 0);