Skip to content

Commit

Permalink
Improvements to ID24 intermissions
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Nov 13, 2024
1 parent 1bb196f commit daa2cc2
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions src/wi_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,13 @@ static bool UpdateAnimation(bool enteringcondition)
animation->states = NULL;
animation->backgroundlump = NULL;

if (!enteringcondition && animation->interlevelexiting)
if (!enteringcondition)
{
animation->states = animation->exitingstates;
animation->backgroundlump = animation->interlevelexiting->backgroundlump;
if (animation->interlevelexiting)
{
animation->states = animation->exitingstates;
animation->backgroundlump = animation->interlevelexiting->backgroundlump;
}
}
else if (animation->interlevelentering)
{
Expand Down Expand Up @@ -500,6 +503,30 @@ static bool NextLocAnimation(void)
return (animation && animation->enteringstates);
}

static bool UpdateMusic(bool enteringcondition)
{
int musicnum = -1;

if (!animation)
return false;

if (enteringcondition)
{
if (animation->interlevelentering)
musicnum = W_GetNumForName(animation->interlevelentering->musiclump);
}
else if (animation->interlevelexiting)
musicnum = W_GetNumForName(animation->interlevelexiting->musiclump);

if (musicnum > 0)
{
S_ChangeMusInfoMusic(musicnum, true);
return true;
}

return false;
}

// slam background
static void WI_SlamBackground(void)
{
Expand Down Expand Up @@ -919,13 +946,18 @@ static void WI_UpdateNoState(void)
WI_UpdateAnimatedBack();

if (!--cnt)
{
WI_End();
G_WorldDone();
}
}

static bool snl_pointeron;

static void WI_InitShowNextLoc(void)
{
UpdateMusic(true);

if (gamemode != commercial && gamemap == 8)
{
G_WorldDone();
Expand Down Expand Up @@ -1285,7 +1317,7 @@ static void WI_LoadData(void);
void WI_Ticker(void)
{
// counter for general background animation
if (++bcnt == 1)
if (++bcnt == 1 && !UpdateMusic(false))
{
// intermission music
S_ChangeMusic((gamemode == commercial ? mus_dm2int : mus_inter), true, false, false);
Expand Down

0 comments on commit daa2cc2

Please sign in to comment.