2021-12-25 22:36:38 +01:00
|
|
|
#include "core/stdafx.h"
|
|
|
|
#include "core/r5dev.h"
|
|
|
|
#include "core/init.h"
|
|
|
|
/*****************************************************************************/
|
|
|
|
#ifndef DEDICATED
|
|
|
|
#include "windows/id3dx.h"
|
|
|
|
#include "windows/input.h"
|
|
|
|
#endif // !DEDICATED
|
|
|
|
#include "windows/console.h"
|
2021-04-13 04:45:22 -07:00
|
|
|
|
2021-06-28 15:51:32 -07:00
|
|
|
//#############################################################################
|
|
|
|
// INITIALIZATION
|
|
|
|
//#############################################################################
|
2021-04-13 04:45:22 -07:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
void R5Dev_Init()
|
2021-04-13 04:45:22 -07:00
|
|
|
{
|
2021-12-25 22:36:38 +01:00
|
|
|
Console_Init();
|
|
|
|
Systems_Init();
|
|
|
|
|
|
|
|
#ifndef DEDICATED
|
|
|
|
Input_Init();
|
|
|
|
DirectX_Init();
|
|
|
|
#endif // !DEDICATED
|
2021-10-05 00:25:58 +02:00
|
|
|
|
|
|
|
spdlog::get("console")->set_pattern("%v");
|
|
|
|
spdlog::info("+-----------------------------------------------------------------------------+\n");
|
2021-12-25 22:36:38 +01:00
|
|
|
spdlog::info("| R5 DEVELOPER CONSOLE -- INITIALIZED ----------------------------------- |\n");
|
2021-10-05 00:25:58 +02:00
|
|
|
spdlog::info("+-----------------------------------------------------------------------------+\n");
|
2021-12-25 22:36:38 +01:00
|
|
|
spdlog::get("console")->set_pattern("[%S.%e] %v");
|
2021-04-13 04:45:22 -07:00
|
|
|
}
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
void R5Dev_Shutdown()
|
2021-04-13 04:45:22 -07:00
|
|
|
{
|
2021-12-25 22:36:38 +01:00
|
|
|
Systems_Shutdown();
|
|
|
|
|
|
|
|
#ifndef DEDICATED
|
|
|
|
Input_Shutdown();
|
|
|
|
DirectX_Shutdown();
|
|
|
|
#endif // !DEDICATED
|
|
|
|
|
2021-06-19 11:21:31 -07:00
|
|
|
FreeConsole();
|
2021-04-13 04:45:22 -07:00
|
|
|
}
|
|
|
|
|
2021-06-28 15:51:32 -07:00
|
|
|
//#############################################################################
|
|
|
|
// ENTRYPOINT
|
|
|
|
//#############################################################################
|
2021-06-08 10:54:49 -07:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
|
2021-04-13 04:45:22 -07:00
|
|
|
{
|
|
|
|
switch (dwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2021-04-17 04:51:04 -07:00
|
|
|
{
|
2021-12-25 22:36:38 +01:00
|
|
|
R5Dev_Init();
|
2021-04-13 04:45:22 -07:00
|
|
|
break;
|
2021-04-17 04:51:04 -07:00
|
|
|
}
|
2021-04-13 04:45:22 -07:00
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
2021-04-17 04:51:04 -07:00
|
|
|
{
|
2021-12-25 22:36:38 +01:00
|
|
|
R5Dev_Shutdown();
|
2021-04-13 04:45:22 -07:00
|
|
|
break;
|
2021-04-17 04:51:04 -07:00
|
|
|
}
|
2021-04-13 04:45:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2021-06-08 10:54:49 -07:00
|
|
|
}
|