From c679f83f75b85c08cef18905d83e54e5c638adfc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 4 May 2021 11:32:09 +0200 Subject: [PATCH] - make all games return to the main menu when the game is ended with F10. Duke still went to the intro movies which was a bit problematic. --- source/core/gamestruct.h | 1 - source/core/menu/razemenu.cpp | 4 +++- source/games/blood/src/blood.h | 1 - source/games/blood/src/d_menu.cpp | 6 ------ source/games/duke/src/d_menu.cpp | 6 ------ source/games/duke/src/duke3d.h | 1 - source/games/exhumed/src/d_menu.cpp | 5 ----- source/games/exhumed/src/exhumed.h | 1 - source/games/sw/src/d_menu.cpp | 7 ------- source/games/sw/src/game.h | 3 +-- 10 files changed, 4 insertions(+), 31 deletions(-) diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index e98e975c4..97b0a857b 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -84,7 +84,6 @@ struct GameInterface virtual double SmallFontScale() { return 1; } virtual void SerializeGameState(FSerializer& arc) {} virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {} - virtual void QuitToTitle() {} virtual void SetAmbience(bool on) {} virtual FString GetCoordString() { return "'stat coord' not implemented"; } virtual void ExitFromMenu() { throw CExitEvent(0); } diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index b55887f65..764f2f096 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -64,6 +64,7 @@ #include "i_net.h" #include "savegamehelp.h" #include "gi.h" +#include "raze_music.h" EXTERN_CVAR(Int, cl_gfxlocalization) EXTERN_CVAR(Bool, m_quickexit) @@ -272,7 +273,8 @@ CCMD(menu_endgame) { STAT_Cancel(); M_ClearMenus(); - gi->QuitToTitle(); + Mus_Stop(); + gameaction = ga_mainmenu; }); M_ActivateMenu(newmenu); diff --git a/source/games/blood/src/blood.h b/source/games/blood/src/blood.h index be2fb4ff0..6202eca69 100644 --- a/source/games/blood/src/blood.h +++ b/source/games/blood/src/blood.h @@ -121,7 +121,6 @@ struct GameInterface : ::GameInterface void MenuOpened() override; void MenuClosed() override; bool CanSave() override; - void QuitToTitle() override; FString GetCoordString() override; ReservedSpace GetReservedScreenSpace(int viewsize) override; void UpdateSounds() override; diff --git a/source/games/blood/src/d_menu.cpp b/source/games/blood/src/d_menu.cpp index 0cacadeb7..ec3818489 100644 --- a/source/games/blood/src/d_menu.cpp +++ b/source/games/blood/src/d_menu.cpp @@ -163,12 +163,6 @@ FSavegameInfo GameInterface::GetSaveSig() return { SAVESIG_BLD, MINSAVEVER_BLD, SAVEVER_BLD }; } -void GameInterface::QuitToTitle() -{ - Mus_Stop(); - gameaction = ga_mainmenu; -} - END_BLD_NS using namespace Blood; diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 343483ee3..ea3ea9a23 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -136,10 +136,4 @@ void GameInterface::DrawPlayerSprite(const DVector2& origin, bool onteam) DrawTexture(twod, tex, x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, color, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); } -void GameInterface::QuitToTitle() -{ - gameaction = ga_startup; -} - - END_DUKE_NS diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 96c9ce5b9..da153613a 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -40,7 +40,6 @@ struct GameInterface : public ::GameInterface FSavegameInfo GetSaveSig() override; double SmallFontScale() override { return isRR() ? 0.5 : 1.; } void SerializeGameState(FSerializer& arc) override; - void QuitToTitle() override; FString GetCoordString() override; void ExitFromMenu() override; ReservedSpace GetReservedScreenSpace(int viewsize) override; diff --git a/source/games/exhumed/src/d_menu.cpp b/source/games/exhumed/src/d_menu.cpp index 50d7282ef..176770f23 100644 --- a/source/games/exhumed/src/d_menu.cpp +++ b/source/games/exhumed/src/d_menu.cpp @@ -67,11 +67,6 @@ void GameInterface::MenuSound(EMenuSounds snd) } } -void GameInterface::QuitToTitle() -{ - gameaction = ga_mainmenu; -} - FSavegameInfo GameInterface::GetSaveSig() { return { SAVESIG_PS, MINSAVEVER_PS, SAVEVER_PS }; diff --git a/source/games/exhumed/src/exhumed.h b/source/games/exhumed/src/exhumed.h index 005ff042f..32ac8f035 100644 --- a/source/games/exhumed/src/exhumed.h +++ b/source/games/exhumed/src/exhumed.h @@ -225,7 +225,6 @@ struct GameInterface : ::GameInterface void SerializeGameState(FSerializer& arc); bool CanSave() override; ReservedSpace GetReservedScreenSpace(int viewsize) override { return { 0, 24 }; } - void QuitToTitle() override; void UpdateSounds() override; void ErrorCleanup() override; void Ticker() override; diff --git a/source/games/sw/src/d_menu.cpp b/source/games/sw/src/d_menu.cpp index e1425e8ec..f9cb0b8e5 100644 --- a/source/games/sw/src/d_menu.cpp +++ b/source/games/sw/src/d_menu.cpp @@ -61,13 +61,6 @@ BEGIN_SW_NS // //---------------------------------------------------------------------------- -void GameInterface::QuitToTitle() -{ - Mus_Stop(); - gameaction = ga_mainmenu; -} - - void GameInterface::MenuSound(EMenuSounds snd) { switch (snd) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index c574f6116..da6f93897 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2250,8 +2250,7 @@ struct GameInterface : ::GameInterface void SetAmbience(bool on) override { if (on) StartAmbientSound(); else StopAmbientSound(); } FString GetCoordString() override; ReservedSpace GetReservedScreenSpace(int viewsize) override; - void QuitToTitle() override; - void UpdateSounds() override; + void UpdateSounds() override; void ErrorCleanup() override; void GetInput(InputPacket* input, ControlInfo* const hidInput) override; void DrawBackground(void) override;