Skip to content

Commit

Permalink
More alt. intermission background tweaks
Browse files Browse the repository at this point in the history
For the most part, this meant making it deal with big level-title graphics.
  • Loading branch information
MrAlaux committed Dec 27, 2023
1 parent 9e0f3d3 commit 0ae200a
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ static void G_DoLoadLevel(void)
}

// Alt. intermission background
if (STRICTMODE(alt_interpic)) {
if (WI_UsingAltInterpic()) {
fovchange = true;
R_SetViewSize(screenblocks);
R_ExecuteSetViewSize();
Expand Down
2 changes: 1 addition & 1 deletion src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ void I_ResetScreen(void)
ST_Start(); // Reset palette

if (gamestate == GS_INTERMISSION
&& !STRICTMODE(alt_interpic)) // [Nugget] Alt. intermission background
&& !WI_UsingAltInterpic()) // [Nugget] Alt. intermission background
{
WI_DrawBackground();
}
Expand Down
14 changes: 1 addition & 13 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4930,18 +4930,6 @@ setup_menu_t gen_settings6[] = {
{0,S_SKIP|S_END,m_null}
};

void M_ToggleAltInterpic(void)
{
if (gamestate == GS_INTERMISSION)
{
if (!STRICTMODE(alt_interpic))
{ R_SetViewSize(screenblocks); }

fovchange = true;
R_ExecuteSetViewSize();
}
}

static const char *fake_contrast_styles[] = {
"Off", "Smooth", "Vanilla", NULL
};
Expand All @@ -4958,7 +4946,7 @@ setup_menu_t gen_settings7[] = {
{"Bonus Tint Cap", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_boncountcap * M_SPC, {"bonuscount_cap"}},
{"Fake Contrast", S_CHOICE|S_STRICT, m_null, M_X, M_Y + gen7_fakecontrast * M_SPC, {"fake_contrast"}, 0, NULL, fake_contrast_styles},
{"Screen Wipe Speed Percentage", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_wipespeed * M_SPC, {"wipe_speed_percentage"}},
{"Alt. Intermission Background", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen7_altinterpic * M_SPC, {"alt_interpic"}, 0, M_ToggleAltInterpic},
{"Alt. Intermission Background", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen7_altinterpic * M_SPC, {"alt_interpic"}},

{"<- PREV", S_SKIP|S_PREV, m_null, M_X_PREV, M_Y_PREVNEXT, {gen_settings6}},
{"NEXT ->", S_SKIP|S_NEXT, m_null, M_X_NEXT, M_Y_PREVNEXT, {gen_settings8}},
Expand Down
11 changes: 6 additions & 5 deletions src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "m_random.h"
#include "p_map.h"
#include "p_mobj.h"
#include "wi_stuff.h"

// [Nugget]
#ifndef M_PI
Expand Down Expand Up @@ -592,7 +593,7 @@ void R_ExecuteSetViewSize (void)
setsizeneeded = false;

// [Nugget] Alt. intermission background
if (STRICTMODE(alt_interpic) && (gamestate == GS_INTERMISSION))
if (WI_UsingAltInterpic() && (gamestate == GS_INTERMISSION))
{ setblocks = 11; }

if (setblocks >= 11) // [Nugget] Crispy minimalistic HUD
Expand Down Expand Up @@ -716,7 +717,7 @@ void R_ExecuteSetViewSize (void)
for (i = 0; i < NUMFOVFX; i++)
{ fx += fovfx[i].current; }

rfov = (STRICTMODE(alt_interpic) && (gamestate == GS_INTERMISSION))
rfov = (WI_UsingAltInterpic() && (gamestate == GS_INTERMISSION))
? 150 : bfov + fx;

fovdiff = (float) ORIGFOV / rfov;
Expand Down Expand Up @@ -921,7 +922,7 @@ void R_SetupFrame (player_t *player)

// [Nugget]
// Alt. intermission background
if (STRICTMODE(alt_interpic) && (gamestate == GS_INTERMISSION))
if (WI_UsingAltInterpic() && (gamestate == GS_INTERMISSION))
{
static int oldtic = -1;

Expand Down Expand Up @@ -973,8 +974,8 @@ void R_SetupFrame (player_t *player)
// [Nugget] Chasecam /------------------------------------------------------

chasecam_on = STRICTMODE(chasecam_mode || (death_camera && player->mo->health <= 0 && player->playerstate == PST_DEAD))
&& !(alt_interpic && (gamestate == GS_INTERMISSION));
&& !(WI_UsingAltInterpic() && (gamestate == GS_INTERMISSION));

if (chasecam_on)
{
static fixed_t oldextradist = 0, extradist = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// [Nugget]
#include "m_nughud.h"
#include "st_stuff.h"
#include "wi_stuff.h"

#define MINZ (FRACUNIT*4)
#define BASEYCENTER 100
Expand Down Expand Up @@ -853,7 +854,7 @@ void R_DrawPSprite (pspdef_t *psp, boolean translucent) // [Nugget] Translucent
if (STRICTMODE(hide_weapon)
// [Nugget]
|| chasecam_on // Chasecam
|| (STRICTMODE(alt_interpic) && (gamestate == GS_INTERMISSION))) // Alt. intermission background
|| (WI_UsingAltInterpic() && (gamestate == GS_INTERMISSION))) // Alt. intermission background
return;

R_DrawVisSprite(vis, vis->x1, vis->x2);
Expand Down
64 changes: 53 additions & 11 deletions src/wi_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,17 @@ static int num_lnames;

static const char *exitpic, *enterpic;

// [Nugget] Alt. intermission background /------------------------------------

static boolean alt_interpic_on, old_alt_interpic_on = 0;

boolean WI_UsingAltInterpic(void)
{
return alt_interpic_on;
}

// [Nugget] -----------------------------------------------------------------/

//
// CODE
//
Expand All @@ -396,7 +407,7 @@ static const char *exitpic, *enterpic;
static void WI_slamBackground(void)
{
// [Nugget] Alt. intermission background
if (STRICTMODE(alt_interpic))
if (alt_interpic_on)
{
const size_t size = (SCREENWIDTH * hires) * (SCREENHEIGHT * hires);

Expand Down Expand Up @@ -717,7 +728,7 @@ static void WI_drawAnimatedBack(void)
if (wbs->epsd > 2)
return;

if (STRICTMODE(alt_interpic)) { return; } // [Nugget] Alt. intermission background
if (alt_interpic_on) { return; } // [Nugget] Alt. intermission background

for (i=0 ; i<NUMANIMS[wbs->epsd] ; i++)
{
Expand Down Expand Up @@ -1073,7 +1084,7 @@ static void WI_drawShowNextLoc(void)
if ( gamemode != commercial)
{
if (wbs->epsd > 2
|| STRICTMODE(alt_interpic)) // [Nugget] Alt. intermission background
|| alt_interpic_on) // [Nugget] Alt. intermission background
{
WI_drawEL(); // "Entering..." if not E1 or E2
return;
Expand Down Expand Up @@ -1949,6 +1960,43 @@ void WI_Ticker(void)
WI_updateNoState();
break;
}

{ // [Nugget] Alt. intermission background
static boolean big_last = false;
boolean big;

{
int level = (state == StatCount) ? wbs->last : wbs->next;
patch_t *patch = (0 <= level && level < num_lnames) ? lnames[level] : NULL;

if (patch) {
big = ((ORIGWIDTH / 2) < SHORT(patch->width))
&& ((ORIGHEIGHT / 2) < SHORT(patch->height));
}
else { big = false; }
}

// Don't use the alt. interpic if the last-level title is big,
// regardless of the next-level title's size
if (state == StatCount) { big_last = big; }

if (STRICTMODE(alt_interpic) && !big_last && !big)
{
alt_interpic_on = true;
}
else { alt_interpic_on = false; }

if (old_alt_interpic_on != alt_interpic_on)
{
old_alt_interpic_on = alt_interpic_on;

if (!alt_interpic_on)
{ R_SetViewSize(screenblocks); }

fovchange = true;
R_ExecuteSetViewSize();
}
}
}

// killough 11/98:
Expand Down Expand Up @@ -2149,14 +2197,6 @@ void WI_loadData(void)
sprintf(name, "WIBP%d", i+1);
bp[i] = W_CacheLumpName(name, PU_STATIC);
}

// [Nugget] Alt. intermission background ---------------------------------

if (STRICTMODE(alt_interpic)) {
fovchange = true;
R_ClearFOVFX();
R_ExecuteSetViewSize();
}
}

// ====================================================================
Expand Down Expand Up @@ -2270,6 +2310,8 @@ void WI_Start(wbstartstruct_t* wbstartstruct)
WI_initNetgameStats();
else
WI_initStats();

old_alt_interpic_on = false; // [Nugget] Alt. intermission background
}


Expand Down
2 changes: 2 additions & 0 deletions src/wi_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void WI_checkForAccelerate(void); // killough 11/98

void WI_DrawBackground(void); // killough 11/98

extern boolean WI_UsingAltInterpic(void); // [Nugget] Alt. intermission background

#endif

//----------------------------------------------------------------------------
Expand Down

0 comments on commit 0ae200a

Please sign in to comment.