2021-08-01 02:25:29 -07:00
|
|
|
#pragma once
|
2022-05-26 22:04:50 +02:00
|
|
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
class CLauncher
|
|
|
|
{
|
|
|
|
public:
|
2024-04-17 20:49:22 +02:00
|
|
|
CLauncher()
|
2022-05-23 19:14:12 +02:00
|
|
|
{
|
2024-04-17 20:49:22 +02:00
|
|
|
m_pSurface = nullptr;
|
2023-07-13 00:14:47 +02:00
|
|
|
m_ProcessorAffinity = NULL;
|
2023-03-19 11:20:04 +01:00
|
|
|
m_svCurrentDir = fs::current_path().u8string();
|
2022-05-24 02:23:37 +02:00
|
|
|
}
|
|
|
|
~CLauncher()
|
|
|
|
{
|
2022-05-23 19:14:12 +02:00
|
|
|
}
|
2023-03-22 00:28:41 +01:00
|
|
|
|
2023-03-20 10:26:43 +01:00
|
|
|
void RunSurface();
|
2024-04-17 20:49:22 +02:00
|
|
|
|
|
|
|
void Init();
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
void AddLog(const LogType_t level, const char* szText);
|
2023-03-20 10:26:43 +01:00
|
|
|
|
|
|
|
int HandleCommandLine(int argc, char* argv[]);
|
2022-05-26 22:04:50 +02:00
|
|
|
int HandleInput();
|
2022-05-23 19:14:12 +02:00
|
|
|
|
2023-07-13 00:14:47 +02:00
|
|
|
bool CreateLaunchContext(eLaunchMode lMode, uint64_t nProcessorAffinity = NULL, const char* szCommandLine = nullptr, const char* szConfig = nullptr);
|
2023-07-01 23:27:29 +02:00
|
|
|
void SetupLaunchContext(const char* szConfig, const char* szGameDll, const char* szCommandLine);
|
2023-03-20 10:26:43 +01:00
|
|
|
bool LaunchProcess() const;
|
2022-05-24 02:23:37 +02:00
|
|
|
|
2024-04-17 20:49:22 +02:00
|
|
|
eLaunchMode BuildParameter(string& parameterList) { return m_pSurface->BuildParameter(parameterList); }
|
2022-05-23 19:14:12 +02:00
|
|
|
|
|
|
|
private:
|
2024-04-17 20:49:22 +02:00
|
|
|
CSurface* m_pSurface;
|
2022-05-24 02:23:37 +02:00
|
|
|
|
2023-07-13 00:14:47 +02:00
|
|
|
uint64_t m_ProcessorAffinity;
|
|
|
|
|
2023-07-01 23:27:29 +02:00
|
|
|
string m_svGameDll;
|
2022-05-23 19:14:12 +02:00
|
|
|
string m_svCmdLine;
|
|
|
|
string m_svCurrentDir;
|
|
|
|
};
|
2023-03-19 11:20:04 +01:00
|
|
|
|
2023-03-21 00:14:54 +01:00
|
|
|
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
|
|
|
|
|
2024-04-17 20:49:22 +02:00
|
|
|
extern CLauncher* SDKLauncher();
|