diff --git a/source/blood/src/d_menu.cpp b/source/blood/src/d_menu.cpp index 9096f2a5f..36e05073d 100644 --- a/source/blood/src/d_menu.cpp +++ b/source/blood/src/d_menu.cpp @@ -123,15 +123,6 @@ void CGameMenuItemQAV::Draw(void) static std::unique_ptr itemBloodQAV; // This must be global to ensure that the animation remains consistent across menus. -DEFINE_ACTION_FUNCTION(DListMenuItemBloodDripDrawer, Draw) -{ - // For narrow screens this would be mispositioned so skip drawing it there. - double ratio = screen->GetWidth() / double(screen->GetHeight()); - if (ratio > 1.32) itemBloodQAV->Draw(); - return 0; -} - - void UpdateNetworkMenus(void) { // For now disable the network menu item as it is not functional. @@ -201,12 +192,23 @@ void GameInterface::QuitToTitle() gameaction = ga_mainmenu; } +END_BLD_NS + +using namespace Blood; //---------------------------------------------------------------------------- // // // //---------------------------------------------------------------------------- +DEFINE_ACTION_FUNCTION(DListMenuItemBloodDripDrawer, Draw) +{ + // For narrow screens this would be mispositioned so skip drawing it there. + double ratio = screen->GetWidth() / double(screen->GetHeight()); + if (ratio > 1.32) itemBloodQAV->Draw(); + return 0; +} + DEFINE_ACTION_FUNCTION(_ImageScrollerPageQavDrawer, LoadQav) { PARAM_PROLOGUE; @@ -231,5 +233,4 @@ DEFINE_ACTION_FUNCTION(_ImageScrollerPageQavDrawer, DrawQav) return 0; } -END_BLD_NS diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index cc51f039f..5db175eb6 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -462,7 +462,7 @@ namespace ShadowWarrior { ::GameInterface* CreateInterface(); } -namespace Powerslave +namespace Exhumed { ::GameInterface* CreateInterface(); } @@ -479,7 +479,7 @@ void CheckFrontend(int flags) } else if (flags & GAMEFLAG_PSEXHUMED) { - gi = Powerslave::CreateInterface(); + gi = Exhumed::CreateInterface(); } else { diff --git a/source/core/ns.h b/source/core/ns.h index b97f6907a..82d397fd3 100644 --- a/source/core/ns.h +++ b/source/core/ns.h @@ -17,7 +17,7 @@ #define BEGIN_SW_NS namespace ShadowWarrior { #define END_SW_NS } -#define BEGIN_PS_NS namespace Powerslave { +#define BEGIN_PS_NS namespace Exhumed { #define END_PS_NS } #else diff --git a/source/exhumed/src/d_menu.cpp b/source/exhumed/src/d_menu.cpp index d8776bd38..8938f13a8 100644 --- a/source/exhumed/src/d_menu.cpp +++ b/source/exhumed/src/d_menu.cpp @@ -39,22 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS - -DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedPlasma, Draw) -{ - menu_DoPlasma(); - return 0; -} - -DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedLogo, Draw) -{ - auto nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; - DrawRel(nLogoTile, 160, 40); - return 0; -} - - - void GameInterface::MenuOpened() { GrabPalette(); @@ -105,3 +89,19 @@ FSavegameInfo GameInterface::GetSaveSig() END_PS_NS + +using namespace Exhumed; + +DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedPlasma, Draw) +{ + menu_DoPlasma(); + return 0; +} + +DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedLogo, Draw) +{ + auto nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; + DrawRel(nLogoTile, 160, 40); + return 0; +} + diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index bbbb41bf2..84ec2c6e6 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -64,23 +64,6 @@ BEGIN_SW_NS // //---------------------------------------------------------------------------- -static bool DidOrderSound; -static int zero = 0; - -DEFINE_ACTION_FUNCTION(_SWMenuDelegate, PlayOrderSound) -{ - if (SW_SHAREWARE && !DidOrderSound) - { - DidOrderSound = true; - int choose_snd = STD_RANDOM_RANGE(1000); - if (choose_snd > 500) - PlaySound(DIGI_WANGORDER1, v3df_dontpan, CHAN_BODY, CHANF_UI); - else - PlaySound(DIGI_WANGORDER2, v3df_dontpan, CHAN_BODY, CHANF_UI); - } - return 0; -} - void GameInterface::QuitToTitle() { Mus_Stop(); @@ -172,3 +155,4 @@ FSavegameInfo GameInterface::GetSaveSig() END_SW_NS + diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 552073e9f..e90e16148 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -573,6 +573,25 @@ void TerminateLevel(void) } +using namespace ShadowWarrior; +static bool DidOrderSound; +static int zero = 0; + +static void PlayOrderSound() +{ + if (!DidOrderSound) + { + DidOrderSound = true; + int choose_snd = STD_RANDOM_RANGE(1000); + if (choose_snd > 500) + PlaySound(DIGI_WANGORDER1, v3df_dontpan, CHAN_BODY, CHANF_UI); + else + PlaySound(DIGI_WANGORDER2, v3df_dontpan, CHAN_BODY, CHANF_UI); + } +} + + + void GameInterface::LevelCompleted(MapRecord *map, int skill) { //ResetPalette(mpp); @@ -587,7 +606,11 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill) STAT_Update(true); FinishAnim = false; PlaySong(nullptr, ThemeSongs[0], ThemeTrack[0]); - if (SW_SHAREWARE) gameaction = ga_creditsmenu; + if (SW_SHAREWARE) + { + PlayOrderSound(); + gameaction = ga_creditsmenu; + } else gameaction = ga_mainmenu; } else gameaction = ga_nextlevel; diff --git a/wadsrc/static/zscript/games/sw/ui/menu.zs b/wadsrc/static/zscript/games/sw/ui/menu.zs index 5bcb7e183..3b317e200 100644 --- a/wadsrc/static/zscript/games/sw/ui/menu.zs +++ b/wadsrc/static/zscript/games/sw/ui/menu.zs @@ -53,8 +53,6 @@ class SWMenuDelegate : RazeMenuDelegate DTA_CenterOffset, true, DTA_Color, 0xfff0f0f0, DTA_ScaleX, 0.5, DTA_ScaleY, 0.5); return true; } - - //native static void PlayOrderSound(); } //============================================================================= @@ -76,27 +74,6 @@ class ListMenuItemSWLogo : ListMenuItem } } -//============================================================================= -// -// SW order sound -// -//============================================================================= -/* -class ListMenuItemOrderSound : ListMenuItem -{ - void Init(ListMenuDescriptor desc) - { - Super.Init(0, 0); - } - - override void Drawer() - { - if (mEnabled) SWMenuDelegate.PlayOrderSound(); - mEnabled = 0; - } -} -*/ - //============================================================================= // // text item