From 667b51097f3c8af98d5eb2d04ba3614b31405a96 Mon Sep 17 00:00:00 2001 From: Amos <48657826+Mauler125@users.noreply.github.com> Date: Tue, 22 Feb 2022 02:45:40 +0100 Subject: [PATCH] Add launcher enums --- r5dev/appframework/engine_launcher_api.h | 34 ++++++++++++++++++++++++ r5dev/appframework/iappsystem.h | 33 +++++++++++++++++++++++ r5dev/dedicated.vcxproj | 2 ++ r5dev/dedicated.vcxproj.filters | 9 +++++++ r5dev/gamesdk.vcxproj | 2 ++ r5dev/gamesdk.vcxproj.filters | 9 +++++++ r5dev/launcher/IApplication.cpp | 4 +-- r5dev/launcher/IApplication.h | 19 +++++++++++++ 8 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 r5dev/appframework/engine_launcher_api.h create mode 100644 r5dev/appframework/iappsystem.h diff --git a/r5dev/appframework/engine_launcher_api.h b/r5dev/appframework/engine_launcher_api.h new file mode 100644 index 00000000..b38ddd04 --- /dev/null +++ b/r5dev/appframework/engine_launcher_api.h @@ -0,0 +1,34 @@ +// +// Purpose: engine/launcher interface +// +// $NoKeywords: $ +//=============================================================================// + +#include "appframework/iappsystem.h" + +//----------------------------------------------------------------------------- +// Return values from the initialization stage of the application framework +//----------------------------------------------------------------------------- +enum +{ + INIT_RESTART = INIT_LAST_VAL, + RUN_FIRST_VAL, +}; + + +//----------------------------------------------------------------------------- +// Return values from IEngineAPI::Run. +//----------------------------------------------------------------------------- +enum +{ + RUN_OK = RUN_FIRST_VAL, + RUN_RESTART, +}; + + +//----------------------------------------------------------------------------- +// Main engine interface to launcher + tools +//----------------------------------------------------------------------------- +#define VENGINE_LAUNCHER_API_VERSION "VENGINE_LAUNCHER_API_VERSION004" + +// NOTE: _purecall IEngineAPI vtable diff --git a/r5dev/appframework/iappsystem.h b/r5dev/appframework/iappsystem.h new file mode 100644 index 00000000..ef2723bd --- /dev/null +++ b/r5dev/appframework/iappsystem.h @@ -0,0 +1,33 @@ +//----------------------------------------------------------------------------- +// Specifies a module + interface name for initialization +//----------------------------------------------------------------------------- +struct AppSystemInfo_t +{ + const char* m_pModuleName; + const char* m_pInterfaceName; +}; + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +enum InitReturnVal_t +{ + INIT_FAILED = 0, + INIT_OK, + + INIT_LAST_VAL, +}; + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +enum AppSystemTier_t +{ + APP_SYSTEM_TIER0 = 0, + APP_SYSTEM_TIER1, + APP_SYSTEM_TIER2, + APP_SYSTEM_TIER3, + + APP_SYSTEM_TIER_OTHER, +}; +// NOTE: _purecall IAppSystem vtable diff --git a/r5dev/dedicated.vcxproj b/r5dev/dedicated.vcxproj index d957618a..6931f2b5 100644 --- a/r5dev/dedicated.vcxproj +++ b/r5dev/dedicated.vcxproj @@ -181,6 +181,8 @@ + + diff --git a/r5dev/dedicated.vcxproj.filters b/r5dev/dedicated.vcxproj.filters index 63d00021..acedf350 100644 --- a/r5dev/dedicated.vcxproj.filters +++ b/r5dev/dedicated.vcxproj.filters @@ -127,6 +127,9 @@ {3097f306-20ab-4601-a184-ce56c5265746} + + {888e265d-d431-4c9c-8d1a-e8a3639c9fbd} + @@ -756,6 +759,12 @@ sdk\common + + sdk\appframework + + + sdk\appframework + diff --git a/r5dev/gamesdk.vcxproj b/r5dev/gamesdk.vcxproj index a705b397..1398bb8b 100644 --- a/r5dev/gamesdk.vcxproj +++ b/r5dev/gamesdk.vcxproj @@ -232,6 +232,8 @@ + + diff --git a/r5dev/gamesdk.vcxproj.filters b/r5dev/gamesdk.vcxproj.filters index b82e805d..403c603c 100644 --- a/r5dev/gamesdk.vcxproj.filters +++ b/r5dev/gamesdk.vcxproj.filters @@ -157,6 +157,9 @@ {9b8dfdef-ff4d-49c4-89ac-d6ad59a1f58a} + + {cd141b6d-58a2-4b7d-afc9-32195cd9aa3c} + @@ -1178,6 +1181,12 @@ sdk\common + + sdk\appframework + + + sdk\appframework + diff --git a/r5dev/launcher/IApplication.cpp b/r5dev/launcher/IApplication.cpp index 67813234..15cdf2ad 100644 --- a/r5dev/launcher/IApplication.cpp +++ b/r5dev/launcher/IApplication.cpp @@ -19,7 +19,7 @@ //----------------------------------------------------------------------------- int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup) { - int nRunResult = 3; // RUN_OK + int nRunResult = RUN_OK; HEbisuSDK_Init(); // Not here in retail. We init EbisuSDK here though. if (modAppSystemGroup->m_bIsServerOnly()) // This will never be true anyway but we implement it for the sake of it. @@ -38,7 +38,7 @@ int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup) { if (CEngineAPI_MainLoop()) { - nRunResult = 4; // RUN_RESTART + nRunResult = RUN_RESTART; } g_pEngine->Unload(); SV_ShutdownGameDLL(); diff --git a/r5dev/launcher/IApplication.h b/r5dev/launcher/IApplication.h index c2e83c19..a4e5fa48 100644 --- a/r5dev/launcher/IApplication.h +++ b/r5dev/launcher/IApplication.h @@ -1,4 +1,23 @@ #pragma once +#include "appframework/iappsystem.h" +//----------------------------------------------------------------------------- +// Return values from the initialization stage of the application framework +//----------------------------------------------------------------------------- +enum +{ + INIT_RESTART = INIT_LAST_VAL, + RUN_FIRST_VAL, +}; + + +//----------------------------------------------------------------------------- +// Return values from IEngineAPI::Run. +//----------------------------------------------------------------------------- +enum +{ + RUN_OK = RUN_FIRST_VAL, + RUN_RESTART, +}; class CModAppSystemGroup {