mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-07 08:52:01 +00:00
Merge branch 'titleflash' into 'master'
Improved title screen flashes See merge request STJr/SRB2Internal!462
This commit is contained in:
commit
031a352f72
4 changed files with 40 additions and 10 deletions
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
// Stage of animation:
|
// Stage of animation:
|
||||||
// 0 = text, 1 = art screen
|
// 0 = text, 1 = art screen
|
||||||
static INT32 finalecount;
|
INT32 finalecount;
|
||||||
INT32 titlescrollxspeed = 20;
|
INT32 titlescrollxspeed = 20;
|
||||||
INT32 titlescrollyspeed = 0;
|
INT32 titlescrollyspeed = 0;
|
||||||
UINT8 titlemapinaction = TITLEMAP_OFF;
|
UINT8 titlemapinaction = TITLEMAP_OFF;
|
||||||
|
@ -2573,6 +2573,8 @@ void F_TitleScreenDrawer(void)
|
||||||
{
|
{
|
||||||
boolean hidepics;
|
boolean hidepics;
|
||||||
fixed_t sc = FRACUNIT / max(1, curttscale);
|
fixed_t sc = FRACUNIT / max(1, curttscale);
|
||||||
|
INT32 whitefade = 0;
|
||||||
|
UINT8 *whitecol[2] = {NULL, NULL};
|
||||||
|
|
||||||
if (modeattacking)
|
if (modeattacking)
|
||||||
return; // We likely came here from retrying. Don't do a damn thing.
|
return; // We likely came here from retrying. Don't do a damn thing.
|
||||||
|
@ -2658,16 +2660,40 @@ void F_TitleScreenDrawer(void)
|
||||||
//
|
//
|
||||||
if (finalecount <= 29)
|
if (finalecount <= 29)
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
|
// Flash at tic 30, timed to O__TITLE percussion. Hold the flash until tic 34.
|
||||||
|
// After tic 34, fade the flash until tic 44.
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (finalecount > 29 && finalecount < 35)
|
||||||
|
V_DrawFadeScreen(0, (whitefade = 9));
|
||||||
|
else if (finalecount > 34 && 44-finalecount > 0 && 44-finalecount < 10)
|
||||||
|
V_DrawFadeScreen(0, 44-finalecount);
|
||||||
|
if (39-finalecount > 0)
|
||||||
|
{
|
||||||
|
whitefade = (9 - (39-finalecount))<<V_ALPHASHIFT;
|
||||||
|
whitecol[0] = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SUPERGOLD3, GTC_CACHE);
|
||||||
|
whitecol[1] = R_GetTranslationColormap(TC_ALLWHITE, 0, GTC_CACHE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Draw emblem
|
// Draw emblem
|
||||||
V_DrawSciencePatch(40<<FRACBITS, 20<<FRACBITS, 0, TTEMBL[0], sc);
|
V_DrawSciencePatch(40<<FRACBITS, 20<<FRACBITS, 0, TTEMBL[0], sc);
|
||||||
|
|
||||||
|
if (whitecol[0])
|
||||||
|
{
|
||||||
|
V_DrawFixedPatch(40<<FRACBITS, 20<<FRACBITS, sc, whitefade, TTEMBL[0], whitecol[0]);
|
||||||
|
V_DrawFixedPatch(40<<FRACBITS, 20<<FRACBITS, sc, V_TRANSLUCENT + ((whitefade/2) & V_ALPHAMASK), TTEMBL[0], whitecol[1]);
|
||||||
|
}
|
||||||
|
|
||||||
// Animate SONIC ROBO BLAST 2 before the white flash at tic 30.
|
// Animate SONIC ROBO BLAST 2 before the white flash at tic 30.
|
||||||
if (finalecount <= 29)
|
if (finalecount <= 29)
|
||||||
{
|
{
|
||||||
// Ribbon unfurls, revealing SONIC text, from tic 0 to tic 24. SONIC text is pre-baked into this ribbon graphic.
|
// Ribbon unfurls, revealing SONIC text, from tic 0 to tic 24. SONIC text is pre-baked into this ribbon graphic.
|
||||||
V_DrawSciencePatch(39<<FRACBITS, 88<<FRACBITS, 0, TTRIBB[min(max(0, finalecount), 24)], sc);
|
V_DrawSciencePatch(39<<FRACBITS, 88<<FRACBITS, 0, TTRIBB[min(max(0, finalecount), 24)], sc);
|
||||||
|
|
||||||
|
// Darken non-text things.
|
||||||
|
V_DrawFadeScreen(0xFF00, 12);
|
||||||
|
|
||||||
// Animate SONIC text while the ribbon unfurls, from tic 0 to tic 28.
|
// Animate SONIC text while the ribbon unfurls, from tic 0 to tic 28.
|
||||||
if(finalecount >= 0)
|
if(finalecount >= 0)
|
||||||
V_DrawSciencePatch(89<<FRACBITS, 92<<FRACBITS, 0, TTSONT[min(finalecount, 28)], sc);
|
V_DrawSciencePatch(89<<FRACBITS, 92<<FRACBITS, 0, TTSONT[min(finalecount, 28)], sc);
|
||||||
|
@ -2692,6 +2718,7 @@ void F_TitleScreenDrawer(void)
|
||||||
case 8: case 7: fadeval = V_30TRANS; break;
|
case 8: case 7: fadeval = V_30TRANS; break;
|
||||||
case 6: case 5: fadeval = V_20TRANS; break;
|
case 6: case 5: fadeval = V_20TRANS; break;
|
||||||
case 4: case 3: fadeval = V_10TRANS; break;
|
case 4: case 3: fadeval = V_10TRANS; break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
V_DrawSciencePatch(79<<FRACBITS, 132<<FRACBITS, fadeval, TTROBO[0], sc);
|
V_DrawSciencePatch(79<<FRACBITS, 132<<FRACBITS, fadeval, TTROBO[0], sc);
|
||||||
|
@ -3112,9 +3139,15 @@ void F_TitleScreenDrawer(void)
|
||||||
// After tic 34, starting when the flash fades,
|
// After tic 34, starting when the flash fades,
|
||||||
// draw the combined ribbon and SONIC ROBO BLAST 2 logo. Note the different Y value, because this
|
// draw the combined ribbon and SONIC ROBO BLAST 2 logo. Note the different Y value, because this
|
||||||
// graphic is cropped differently from the unfurling ribbon.
|
// graphic is cropped differently from the unfurling ribbon.
|
||||||
if (finalecount > 34)
|
if (finalecount > 29)
|
||||||
V_DrawSciencePatch(39<<FRACBITS, 93<<FRACBITS, 0, TTRBTX[0], sc);
|
V_DrawSciencePatch(39<<FRACBITS, 93<<FRACBITS, 0, TTRBTX[0], sc);
|
||||||
|
|
||||||
|
if (whitecol[0])
|
||||||
|
{
|
||||||
|
V_DrawFixedPatch(39<<FRACBITS, 93<<FRACBITS, sc, whitefade, TTRBTX[0], whitecol[0]);
|
||||||
|
V_DrawFixedPatch(39<<FRACBITS, 93<<FRACBITS, sc, V_TRANSLUCENT + ((whitefade/2) & V_ALPHAMASK), TTRBTX[0], whitecol[1]);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// FRONT LAYER CHARACTERS
|
// FRONT LAYER CHARACTERS
|
||||||
//
|
//
|
||||||
|
@ -3253,13 +3286,6 @@ void F_TitleScreenDrawer(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flash at tic 30, timed to O__TITLE percussion. Hold the flash until tic 34.
|
|
||||||
// After tic 34, fade the flash until tic 44.
|
|
||||||
if (finalecount > 29 && finalecount < 35)
|
|
||||||
V_DrawFadeScreen(0, 9);
|
|
||||||
else if (finalecount > 34 && 44-finalecount > 0 && 44-finalecount < 10)
|
|
||||||
V_DrawFadeScreen(0, 44-finalecount);
|
|
||||||
|
|
||||||
#undef CHARSTART
|
#undef CHARSTART
|
||||||
#undef SONICSTART
|
#undef SONICSTART
|
||||||
#undef SONICIDLE
|
#undef SONICIDLE
|
||||||
|
|
|
@ -74,6 +74,7 @@ void F_StartContinue(void);
|
||||||
void F_ContinueTicker(void);
|
void F_ContinueTicker(void);
|
||||||
void F_ContinueDrawer(void);
|
void F_ContinueDrawer(void);
|
||||||
|
|
||||||
|
extern INT32 finalecount;
|
||||||
extern INT32 titlescrollxspeed;
|
extern INT32 titlescrollxspeed;
|
||||||
extern INT32 titlescrollyspeed;
|
extern INT32 titlescrollyspeed;
|
||||||
|
|
||||||
|
|
|
@ -1717,7 +1717,7 @@ boolean G_Responder(event_t *ev)
|
||||||
if (gameaction == ga_nothing && !singledemo &&
|
if (gameaction == ga_nothing && !singledemo &&
|
||||||
((demoplayback && !modeattacking && !titledemo) || gamestate == GS_TITLESCREEN))
|
((demoplayback && !modeattacking && !titledemo) || gamestate == GS_TITLESCREEN))
|
||||||
{
|
{
|
||||||
if (ev->type == ev_keydown && ev->data1 != 301)
|
if (ev->type == ev_keydown && ev->data1 != 301 && !(gamestate == GS_TITLESCREEN && finalecount < TICRATE))
|
||||||
{
|
{
|
||||||
M_StartControlPanel();
|
M_StartControlPanel();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2985,6 +2985,9 @@ boolean M_Responder(event_t *ev)
|
||||||
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION || gamestate == GS_GAMEEND)
|
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION || gamestate == GS_GAMEEND)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (gamestate == GS_TITLESCREEN && finalecount < TICRATE)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (noFurtherInput)
|
if (noFurtherInput)
|
||||||
{
|
{
|
||||||
// Ignore input after enter/escape/other buttons
|
// Ignore input after enter/escape/other buttons
|
||||||
|
|
Loading…
Reference in a new issue