Split some of the title screen display stuff into separate functions

git-svn-id: https://svn.eduke32.com/eduke32@7176 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-11-18 18:08:20 +00:00
parent e06962460b
commit 741d362228

View file

@ -1445,14 +1445,31 @@ int32_t g_logoFlags = 255;
int inExtraScreens = 0;
#endif
void G_DisplayExtraScreens(void)
void gameDisplayTENScreen()
{
int32_t flags = G_GetLogoFlags();
#ifdef __ANDROID__
inExtraScreens = 1;
#endif
videoSetViewableArea(0, 0, xdim - 1, ydim - 1);
renderFlushPerms();
// g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
fadepal(0, 0, 0, 0, 252, 28);
I_ClearAllInput();
totalclock = 0;
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, TENSCREEN, 0, 0, 2 + 8 + 64 + BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, TENSCREEN);
while (!I_CheckAllInput() && totalclock < 2400)
G_HandleAsync();
S_StopMusic();
FX_StopAllSounds();
fadepaltile(0, 0, 0, 0, 252, 28, TENSCREEN);
I_ClearAllInput();
#ifdef __ANDROID__
inExtraScreens = 0;
#endif
}
if (!DUKEBETA && (!VOLUMEALL || flags & LOGO_SHAREWARESCREENS))
void gameDisplaySharewareScreens()
{
#ifdef __ANDROID__
inExtraScreens = 1;
@ -1480,89 +1497,19 @@ void G_DisplayExtraScreens(void)
#endif
}
if (flags & LOGO_TENSCREEN)
void G_DisplayExtraScreens(void)
{
#ifdef __ANDROID__
inExtraScreens = 1;
#endif
videoSetViewableArea(0, 0, xdim-1, ydim-1);
renderFlushPerms();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
fadepal(0, 0, 0, 0, 252, 28);
I_ClearAllInput();
totalclock = 0;
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, TENSCREEN, 0, 0, 2+8+64+BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, TENSCREEN);
while (!I_CheckAllInput() && totalclock < 2400)
G_HandleAsync();
fadepaltile(0, 0, 0, 0, 252, 28, TENSCREEN);
I_ClearAllInput();
#ifdef __ANDROID__
inExtraScreens = 0;
#endif
}
}
void G_DisplayLogo(void)
{
int32_t soundanm = 0;
int32_t logoflags = G_GetLogoFlags();
ready2send = 0;
I_ClearAllInput();
videoSetViewableArea(0, 0, xdim-1, ydim-1);
videoClearScreen(0L);
G_FadePalette(0, 0, 0, 252);
renderFlushPerms();
videoNextPage();
G_UpdateAppTitle();
S_StopMusic();
FX_StopAllSounds(); // JBF 20031228
S_ClearSoundLocks(); // JBF 20031228
if (!g_noLogo /* && (!g_netServer && ud.multimode < 2) */ &&
VM_OnEventWithReturn(EVENT_MAINMENUSCREEN, g_player[myconnectindex].ps->i, myconnectindex, 0) == 0 &&
(logoflags & LOGO_ENABLED))
{
if (
#ifndef EDUKE32_TOUCH_DEVICES
VOLUMEALL &&
#endif
(logoflags & LOGO_PLAYANIM))
{
if (!I_CheckAllInput() && g_noLogoAnim == 0)
{
Net_GetPackets();
Anim_Play("logo.anm");
G_FadePalette(0, 0, 0, 252);
I_ClearAllInput();
}
videoClearScreen(0L);
videoNextPage();
if (logoflags & LOGO_STOPANIMSOUNDS)
{
FX_StopAllSounds();
S_ClearSoundLocks();
}
if (!DUKEBETA && (!VOLUMEALL || G_GetLogoFlags() & LOGO_SHAREWARESCREENS))
gameDisplaySharewareScreens();
if (G_GetLogoFlags() & LOGO_TENSCREEN)
gameDisplayTENScreen();
}
if (logoflags & LOGO_PLAYMUSIC)
S_PlaySpecialMusicOrNothing(MUS_INTRO);
if (!NAM)
{
//g_player[myconnectindex].ps->palette = drealms;
//G_FadePalette(0,0,0,252);
if (logoflags & LOGO_3DRSCREEN)
void gameDisplay3DRScreen()
{
if (!I_CheckAllInput() && g_noLogoAnim == 0)
{
@ -1612,19 +1559,13 @@ void G_DisplayLogo(void)
fadepaltile(0, 0, 0, 0, 252, 28, DREALMS);
}
}
videoClearScreen(0L);
videoNextPage();
}
I_ClearAllInput();
}
videoClearScreen(0L);
videoNextPage();
if (logoflags & LOGO_TITLESCREEN)
void gameDisplayTitleScreen(void)
{
int titlesound = 0;
int32_t const logoflags = G_GetLogoFlags();
videoClearScreen(0);
// g_player[myconnectindex].ps->palette = titlepal;
@ -1649,9 +1590,9 @@ void G_DisplayLogo(void)
{
if (totalclock > 120 && totalclock < (120 + 60))
{
if (soundanm == 0)
if (titlesound == 0)
{
soundanm++;
titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE);
}
rotatesprite_fs(160 << 16, 104 << 16, (totalclock - 120) << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
@ -1659,15 +1600,16 @@ void G_DisplayLogo(void)
else if (totalclock >= (120 + 60))
rotatesprite_fs(160 << 16, (104) << 16, 60 << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
}
else soundanm++;
else
titlesound++;
if (logoflags & LOGO_THREEDEE)
{
if (totalclock > 220 && totalclock < (220 + 30))
{
if (soundanm == 1)
if (titlesound == 1)
{
soundanm++;
titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE);
}
@ -1677,28 +1619,31 @@ void G_DisplayLogo(void)
else if (totalclock >= (220 + 30))
rotatesprite_fs(160 << 16, (129) << 16, 30 << 11, 0, THREEDEE, 0, 0, 2 + 8);
}
else soundanm++;
else
titlesound++;
if (PLUTOPAK && (logoflags & LOGO_PLUTOPAKSPRITE))
{
// JBF 20030804
if (totalclock >= 280 && totalclock < 395)
{
rotatesprite_fs(160<<16, (151)<<16, (410-totalclock)<<12, 0, PLUTOPAKSPRITE+1, (sintable[(totalclock<<4)&2047]>>11), 0, 2+8);
if (soundanm == 2)
rotatesprite_fs(160 << 16, (151) << 16, (410 - totalclock) << 12, 0, PLUTOPAKSPRITE + 1,
(sintable[(totalclock << 4) & 2047] >> 11), 0, 2 + 8);
if (titlesound == 2)
{
soundanm++;
titlesound++;
S_PlaySound(FLY_BY);
}
}
else if (totalclock >= 395)
{
if (soundanm == 3)
if (titlesound == 3)
{
soundanm++;
titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE);
}
rotatesprite_fs(160<<16, (151)<<16, 30<<11, 0, PLUTOPAKSPRITE+1, (sintable[(totalclock<<4)&2047]>>11), 0, 2+8);
rotatesprite_fs(160 << 16, (151) << 16, 30 << 11, 0, PLUTOPAKSPRITE + 1, (sintable[(totalclock << 4) & 2047] >> 11), 0,
2 + 8);
}
}
@ -1722,6 +1667,80 @@ void G_DisplayLogo(void)
}
}
void G_DisplayLogo(void)
{
int32_t const logoflags = G_GetLogoFlags();
ready2send = 0;
I_ClearAllInput();
videoSetViewableArea(0, 0, xdim-1, ydim-1);
videoClearScreen(0L);
G_FadePalette(0, 0, 0, 252);
renderFlushPerms();
videoNextPage();
G_UpdateAppTitle();
S_StopMusic();
FX_StopAllSounds(); // JBF 20031228
S_ClearSoundLocks(); // JBF 20031228
if (!g_noLogo /* && (!g_netServer && ud.multimode < 2) */ &&
VM_OnEventWithReturn(EVENT_MAINMENUSCREEN, g_player[myconnectindex].ps->i, myconnectindex, 0) == 0 &&
(logoflags & LOGO_ENABLED))
{
if (
#ifndef EDUKE32_TOUCH_DEVICES
VOLUMEALL &&
#endif
(logoflags & LOGO_PLAYANIM))
{
if (!I_CheckAllInput() && g_noLogoAnim == 0)
{
Net_GetPackets();
Anim_Play("logo.anm");
G_FadePalette(0, 0, 0, 252);
I_ClearAllInput();
}
videoClearScreen(0L);
videoNextPage();
if (logoflags & LOGO_STOPANIMSOUNDS)
{
FX_StopAllSounds();
S_ClearSoundLocks();
}
}
if (logoflags & LOGO_PLAYMUSIC)
S_PlaySpecialMusicOrNothing(MUS_INTRO);
if (!NAM)
{
//g_player[myconnectindex].ps->palette = drealms;
//G_FadePalette(0,0,0,252);
if (logoflags & LOGO_3DRSCREEN)
{
gameDisplay3DRScreen();
videoClearScreen(0L);
videoNextPage();
}
I_ClearAllInput();
}
videoClearScreen(0L);
videoNextPage();
if (logoflags & LOGO_TITLESCREEN)
gameDisplayTitleScreen();
I_ClearAllInput();
}
@ -1729,8 +1748,8 @@ void G_DisplayLogo(void)
videoClearScreen(0L);
videoNextPage();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0);
if ((G_GetLogoFlags() & LOGO_STOPMISCSOUNDS) == 0)
S_PlaySound(NITEVISION_ONOFF);
@ -1741,13 +1760,10 @@ void G_DisplayLogo(void)
#ifndef EDUKE32_STANDALONE
void G_DoOrderScreen(void)
{
int32_t i;
videoSetViewableArea(0, 0, xdim-1, ydim-1);
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
for (i=0; i<4; i++)
for (int i=0; i<4; i++)
{
fadepal(0, 0, 0, 0, 252, 28);
I_ClearAllInput();
@ -1774,8 +1790,8 @@ static void G_BonusCutscenes(void)
if (ud.lockout == 0 && !(G_GetLogoFlags() & LOGO_NOE1BONUSSCENE))
{
int32_t bonuscnt=0;
int32_t const bossmove [] =
int bonuscnt=0;
int const bossmove [] =
{
0, 120, VICTORY1+3, 86, 59,
220, 260, VICTORY1+4, 86, 59,
@ -1795,7 +1811,7 @@ static void G_BonusCutscenes(void)
I_ClearAllInput();
totalclock = 0;
while (1)
do
{
if (G_FPSLimit())
{
@ -1852,7 +1868,7 @@ static void G_BonusCutscenes(void)
G_HandleAsync();
if (I_CheckAllInput()) break;
}
} while (1);
fadepal(0, 0, 0, 0, 252, 4);
}