diff --git a/src/k_menu.h b/src/k_menu.h index 228f6d928..e750146cd 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -207,6 +207,7 @@ extern menu_t MAIN_GonerDef; void M_GonerTick(void); void M_GonerBGTick(void); +void M_GonerBGImplyPassageOfTime(void); void M_DrawGonerBack(void); void M_GonerProfile(INT32 choice); void M_GonerTutorial(INT32 choice); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index b4ac55246..8e73ad320 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -3930,10 +3930,13 @@ void M_DrawMPServerBrowser(void) // Draws the cogs and also the options background! void M_DrawOptionsCogs(void) { + boolean trulystarted = M_GameTrulyStarted(); + UINT32 tick = ((optionsmenu.ticker/10) % 3) + 1; + // the background isn't drawn outside of being in the main menu state. - if (gamestate == GS_MENU && M_GameTrulyStarted()) + if (gamestate == GS_MENU && trulystarted) { - patch_t *back[3] = {W_CachePatchName("OPT_BG1", PU_CACHE), W_CachePatchName("OPT_BG2", PU_CACHE), W_CachePatchName("OPT_BG3", PU_CACHE)}; + patch_t *back = W_CachePatchName(va("OPT_BG%u", tick), PU_CACHE); INT32 tflag = 0; UINT8 *c; UINT8 *c2; // colormap for the one we're changing @@ -3941,19 +3944,24 @@ void M_DrawOptionsCogs(void) if (optionsmenu.fade) { c2 = R_GetTranslationColormap(TC_DEFAULT, optionsmenu.lastcolour, GTC_CACHE); - V_DrawFixedPatch(0, 0, FRACUNIT, 0, back[(optionsmenu.ticker/10) %3], c2); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, back, c2); // prepare fade flag: tflag = min(V_90TRANS, (optionsmenu.fade)<gonerlevel = GDGONER_OUTRO; + M_GonerBGImplyPassageOfTime(); } } diff --git a/src/menus/main-goner.cpp b/src/menus/main-goner.cpp index cb7efb5bf..48b663e2c 100644 --- a/src/menus/main-goner.cpp +++ b/src/menus/main-goner.cpp @@ -203,7 +203,7 @@ public: GonerBGData() { x = focusx = 0; - y = focusy = 0; + y = focusy = 20*FRACUNIT; darkframes = 0; @@ -228,39 +228,46 @@ public: void Tick() { - gonerspeakers_t focuscurrent = MAXGONERSPEAKERS; - if (currentMenu == &MAIN_GonerDef && !LinesOutput.empty()) - { - focuscurrent = LinesOutput.front().speaker; - } - - if (focuslast != focuscurrent) - { - focusdelta = FRACUNIT; - x = focusx; - y = focusy; - - switch (focuscurrent) - { - case GONERSPEAKER_TAILS: - focusx = -10*FRACUNIT; - focusy = 0; - break; - case GONERSPEAKER_EGGMAN: - focusx = 10*FRACUNIT; - focusy = 0; - break; - default: - focusx = 0; - focusy = 20*FRACUNIT; - break; - } - - focuslast = focuscurrent; - } - + // This is the visual feed sputtering in and out. if (darkframes) darkframes--; + else if (gamedata->gonerlevel > GDGONER_VIDEO) + { + // Everything in here is Metal Sonic's response to stimulus. + + gonerspeakers_t focuscurrent = MAXGONERSPEAKERS; + if (currentMenu == &MAIN_GonerDef && !LinesOutput.empty()) + { + focuscurrent = LinesOutput.front().speaker; + } + + if (focuslast != focuscurrent) + { + focusdelta = FRACUNIT; + x = focusx; + y = focusy; + + switch (focuscurrent) + { + case GONERSPEAKER_TAILS: + focusx = -10*FRACUNIT; + focusy = 0; + break; + case GONERSPEAKER_EGGMAN: + focusx = 10*FRACUNIT; + focusy = 0; + break; + default: + focusx = 0; + focusy = 20*FRACUNIT; + break; + } + + focuslast = focuscurrent; + } + } + + // Everything below this is the real world. if (miles_timetoblink == 0) { @@ -630,6 +637,7 @@ void M_AddGonerLines(void) LinesToDigest.emplace_front(GONERSPEAKER_TAILS, 0, "Remember, MS-1. Even when you move on from this setup, you "\ "can always change your ""\x87""Options""\x80"" at any time from the menu."); + LinesToDigest.emplace_front(0, Miles_Look_Electric); break; } @@ -637,7 +645,6 @@ void M_AddGonerLines(void) { if (!leftoff) { - LinesToDigest.emplace_front(0, Miles_Look_Electric); LinesToDigest.emplace_front(GONERSPEAKER_EGGMAN, TICRATE/3, "And... the training data is completed."); } @@ -764,6 +771,11 @@ void M_GonerBGTick(void) goner_background.Tick(); } +void M_GonerBGImplyPassageOfTime(void) +{ + goner_background = GonerBGData(); +} + void M_GonerTick(void) { static bool first = true; @@ -1010,17 +1022,19 @@ void M_DrawGonerBack(void) ))); } - if (goner_background.miles_electric_delta < FRACUNIT) + bool drawarms = false; + + if (goner_background.miles_electric_delta == FRACUNIT) + { + drawarms = (milesfocus && goner_background.miles_electric); + } + else { goner_background.miles_electric_delta += renderdeltatics/(TICRATE/3); if (goner_background.miles_electric_delta > FRACUNIT) goner_background.miles_electric_delta = FRACUNIT; } - bool drawarms = ( - goner_background.miles_electric - && milesfocus - ); if (drawarms) { miles.patch("GON_TA1");