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,54 +1445,19 @@ int32_t g_logoFlags = 255;
int inExtraScreens = 0; int inExtraScreens = 0;
#endif #endif
void G_DisplayExtraScreens(void) void gameDisplayTENScreen()
{ {
int32_t flags = G_GetLogoFlags();
S_StopMusic();
FX_StopAllSounds();
if (!DUKEBETA && (!VOLUMEALL || flags & LOGO_SHAREWARESCREENS))
{
#ifdef __ANDROID__ #ifdef __ANDROID__
inExtraScreens = 1; inExtraScreens = 1;
#endif #endif
videoSetViewableArea(0, 0, xdim-1, ydim-1); videoSetViewableArea(0, 0, xdim - 1, ydim - 1);
renderFlushPerms(); renderFlushPerms();
//g_player[myconnectindex].ps->palette = palette; // 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();
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3291, 0, 0, 2+8+64+BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, 3291);
while (!I_CheckAllInput())
G_HandleAsync();
fadepaltile(0, 0, 0, 0, 252, 28, 3291);
I_ClearAllInput();
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3290, 0, 0, 2+8+64+BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, 3290);
while (!I_CheckAllInput())
G_HandleAsync();
#ifdef __ANDROID__
inExtraScreens = 0;
#endif
}
if (flags & LOGO_TENSCREEN)
{
#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 P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
fadepal(0, 0, 0, 0, 252, 28); fadepal(0, 0, 0, 0, 252, 28);
I_ClearAllInput(); I_ClearAllInput();
totalclock = 0; totalclock = 0;
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, TENSCREEN, 0, 0, 2+8+64+BGSTRETCH); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, TENSCREEN, 0, 0, 2 + 8 + 64 + BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, TENSCREEN); fadepaltile(0, 0, 0, 252, 0, -28, TENSCREEN);
while (!I_CheckAllInput() && totalclock < 2400) while (!I_CheckAllInput() && totalclock < 2400)
G_HandleAsync(); G_HandleAsync();
@ -1502,68 +1467,50 @@ void G_DisplayExtraScreens(void)
#ifdef __ANDROID__ #ifdef __ANDROID__
inExtraScreens = 0; inExtraScreens = 0;
#endif #endif
}
} }
void G_DisplayLogo(void) void gameDisplaySharewareScreens()
{ {
int32_t soundanm = 0; #ifdef __ANDROID__
int32_t logoflags = G_GetLogoFlags(); inExtraScreens = 1;
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 #endif
(logoflags & LOGO_PLAYANIM)) videoSetViewableArea(0, 0, xdim - 1, ydim - 1);
{ renderFlushPerms();
if (!I_CheckAllInput() && g_noLogoAnim == 0) // g_player[myconnectindex].ps->palette = palette;
{ P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
Net_GetPackets(); fadepal(0, 0, 0, 0, 252, 28);
Anim_Play("logo.anm");
G_FadePalette(0, 0, 0, 252);
I_ClearAllInput(); I_ClearAllInput();
} rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 3291, 0, 0, 2 + 8 + 64 + BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, 3291);
while (!I_CheckAllInput())
G_HandleAsync();
videoClearScreen(0L); fadepaltile(0, 0, 0, 0, 252, 28, 3291);
videoNextPage(); I_ClearAllInput();
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 3290, 0, 0, 2 + 8 + 64 + BGSTRETCH);
fadepaltile(0, 0, 0, 252, 0, -28, 3290);
while (!I_CheckAllInput())
G_HandleAsync();
if (logoflags & LOGO_STOPANIMSOUNDS) #ifdef __ANDROID__
{ inExtraScreens = 0;
#endif
}
void G_DisplayExtraScreens(void)
{
S_StopMusic();
FX_StopAllSounds(); FX_StopAllSounds();
S_ClearSoundLocks();
}
}
if (logoflags & LOGO_PLAYMUSIC) if (!DUKEBETA && (!VOLUMEALL || G_GetLogoFlags() & LOGO_SHAREWARESCREENS))
S_PlaySpecialMusicOrNothing(MUS_INTRO); gameDisplaySharewareScreens();
if (!NAM) if (G_GetLogoFlags() & LOGO_TENSCREEN)
{ gameDisplayTENScreen();
//g_player[myconnectindex].ps->palette = drealms; }
//G_FadePalette(0,0,0,252);
if (logoflags & LOGO_3DRSCREEN) void gameDisplay3DRScreen()
{ {
if (!I_CheckAllInput() && g_noLogoAnim == 0) if (!I_CheckAllInput() && g_noLogoAnim == 0)
{ {
int32_t i; int32_t i;
@ -1612,93 +1559,91 @@ void G_DisplayLogo(void)
fadepaltile(0, 0, 0, 0, 252, 28, DREALMS); fadepaltile(0, 0, 0, 0, 252, 28, DREALMS);
} }
} }
}
videoClearScreen(0L); void gameDisplayTitleScreen(void)
videoNextPage(); {
} int titlesound = 0;
int32_t const logoflags = G_GetLogoFlags();
I_ClearAllInput();
}
videoClearScreen(0L);
videoNextPage();
if (logoflags & LOGO_TITLESCREEN)
{
videoClearScreen(0); videoClearScreen(0);
//g_player[myconnectindex].ps->palette = titlepal; // g_player[myconnectindex].ps->palette = titlepal;
P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8+2+1); // JBF 20040308 P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8 + 2 + 1); // JBF 20040308
renderFlushPerms(); renderFlushPerms();
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, BETASCREEN, 0, 0, 2+8+64+BGSTRETCH); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, BETASCREEN, 0, 0, 2 + 8 + 64 + BGSTRETCH);
KB_FlushKeyboardQueue(); KB_FlushKeyboardQueue();
fadepaltile(0, 0, 0, 252, 0, -28, BETASCREEN); fadepaltile(0, 0, 0, 252, 0, -28, BETASCREEN);
totalclock = 0; totalclock = 0;
while ( while (
#ifndef EDUKE32_SIMPLE_MENU #ifndef EDUKE32_SIMPLE_MENU
totalclock < (860+120) && totalclock < (860 + 120) &&
#endif #endif
!I_CheckAllInput()) !I_CheckAllInput())
{ {
if (G_FPSLimit()) if (G_FPSLimit())
{ {
videoClearScreen(0); videoClearScreen(0);
rotatesprite_fs(160<<16, 100<<16, 65536L, 0, BETASCREEN, 0, 0, 2+8+64+BGSTRETCH); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, BETASCREEN, 0, 0, 2 + 8 + 64 + BGSTRETCH);
if (logoflags & LOGO_DUKENUKEM) if (logoflags & LOGO_DUKENUKEM)
{ {
if (totalclock > 120 && totalclock < (120+60)) if (totalclock > 120 && totalclock < (120 + 60))
{ {
if (soundanm == 0) if (titlesound == 0)
{ {
soundanm++; titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE); S_PlaySound(PIPEBOMB_EXPLODE);
} }
rotatesprite_fs(160<<16, 104<<16, (totalclock-120)<<10, 0, DUKENUKEM, 0, 0, 2+8); rotatesprite_fs(160 << 16, 104 << 16, (totalclock - 120) << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
} }
else if (totalclock >= (120+60)) else if (totalclock >= (120 + 60))
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8); rotatesprite_fs(160 << 16, (104) << 16, 60 << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
} }
else soundanm++; else
titlesound++;
if (logoflags & LOGO_THREEDEE) if (logoflags & LOGO_THREEDEE)
{ {
if (totalclock > 220 && totalclock < (220+30)) if (totalclock > 220 && totalclock < (220 + 30))
{ {
if (soundanm == 1) if (titlesound == 1)
{ {
soundanm++; titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE); S_PlaySound(PIPEBOMB_EXPLODE);
} }
rotatesprite_fs(160<<16, (104)<<16, 60<<10, 0, DUKENUKEM, 0, 0, 2+8); rotatesprite_fs(160 << 16, (104) << 16, 60 << 10, 0, DUKENUKEM, 0, 0, 2 + 8);
rotatesprite_fs(160<<16, (129)<<16, (totalclock - 220)<<11, 0, THREEDEE, 0, 0, 2+8); rotatesprite_fs(160 << 16, (129) << 16, (totalclock - 220) << 11, 0, THREEDEE, 0, 0, 2 + 8);
} }
else if (totalclock >= (220+30)) else if (totalclock >= (220 + 30))
rotatesprite_fs(160<<16, (129)<<16, 30<<11, 0, THREEDEE, 0, 0, 2+8); rotatesprite_fs(160 << 16, (129) << 16, 30 << 11, 0, THREEDEE, 0, 0, 2 + 8);
} }
else soundanm++; else
titlesound++;
if (PLUTOPAK && (logoflags & LOGO_PLUTOPAKSPRITE)) if (PLUTOPAK && (logoflags & LOGO_PLUTOPAKSPRITE))
{ {
// JBF 20030804 // JBF 20030804
if (totalclock >= 280 && totalclock < 395) 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); rotatesprite_fs(160 << 16, (151) << 16, (410 - totalclock) << 12, 0, PLUTOPAKSPRITE + 1,
if (soundanm == 2) (sintable[(totalclock << 4) & 2047] >> 11), 0, 2 + 8);
if (titlesound == 2)
{ {
soundanm++; titlesound++;
S_PlaySound(FLY_BY); S_PlaySound(FLY_BY);
} }
} }
else if (totalclock >= 395) else if (totalclock >= 395)
{ {
if (soundanm == 3) if (titlesound == 3)
{ {
soundanm++; titlesound++;
S_PlaySound(PIPEBOMB_EXPLODE); 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);
} }
} }
@ -1720,8 +1665,82 @@ void G_DisplayLogo(void)
G_HandleAsync(); G_HandleAsync();
} }
}
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(); I_ClearAllInput();
} }
@ -1729,8 +1748,8 @@ void G_DisplayLogo(void)
videoClearScreen(0L); videoClearScreen(0L);
videoNextPage(); videoNextPage();
//g_player[myconnectindex].ps->palette = palette; P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0);
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
if ((G_GetLogoFlags() & LOGO_STOPMISCSOUNDS) == 0) if ((G_GetLogoFlags() & LOGO_STOPMISCSOUNDS) == 0)
S_PlaySound(NITEVISION_ONOFF); S_PlaySound(NITEVISION_ONOFF);
@ -1741,13 +1760,10 @@ void G_DisplayLogo(void)
#ifndef EDUKE32_STANDALONE #ifndef EDUKE32_STANDALONE
void G_DoOrderScreen(void) void G_DoOrderScreen(void)
{ {
int32_t i;
videoSetViewableArea(0, 0, xdim-1, ydim-1); videoSetViewableArea(0, 0, xdim-1, ydim-1);
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 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); fadepal(0, 0, 0, 0, 252, 28);
I_ClearAllInput(); I_ClearAllInput();
@ -1774,8 +1790,8 @@ static void G_BonusCutscenes(void)
if (ud.lockout == 0 && !(G_GetLogoFlags() & LOGO_NOE1BONUSSCENE)) if (ud.lockout == 0 && !(G_GetLogoFlags() & LOGO_NOE1BONUSSCENE))
{ {
int32_t bonuscnt=0; int bonuscnt=0;
int32_t const bossmove [] = int const bossmove [] =
{ {
0, 120, VICTORY1+3, 86, 59, 0, 120, VICTORY1+3, 86, 59,
220, 260, VICTORY1+4, 86, 59, 220, 260, VICTORY1+4, 86, 59,
@ -1795,7 +1811,7 @@ static void G_BonusCutscenes(void)
I_ClearAllInput(); I_ClearAllInput();
totalclock = 0; totalclock = 0;
while (1) do
{ {
if (G_FPSLimit()) if (G_FPSLimit())
{ {
@ -1852,7 +1868,7 @@ static void G_BonusCutscenes(void)
G_HandleAsync(); G_HandleAsync();
if (I_CheckAllInput()) break; if (I_CheckAllInput()) break;
} } while (1);
fadepal(0, 0, 0, 0, 252, 4); fadepal(0, 0, 0, 0, 252, 4);
} }