[ZoneBuilder] Use the custom entry point again

This commit is contained in:
momo5502 2017-05-27 17:17:12 +02:00
parent 908343a381
commit b166af9f1b
3 changed files with 12 additions and 4 deletions

View File

@ -495,6 +495,11 @@ namespace Components
return *reinterpret_cast<HWND*>(0x64A3288); return *reinterpret_cast<HWND*>(0x64A3288);
} }
void Console::ShowAsyncConsole()
{
Console::ConsoleThread = std::thread(Console::ConsoleRunner);
}
Game::dvar_t* Console::RegisterConColor(const char* name, float r, float g, float b, float a, float min, float max, int flags, const char* description) Game::dvar_t* Console::RegisterConColor(const char* name, float r, float g, float b, float a, float min, float max, int flags, const char* description)
{ {
static struct static struct
@ -593,7 +598,7 @@ namespace Components
Utils::Hook(0x60BB68, [] () Utils::Hook(0x60BB68, [] ()
{ {
Console::ConsoleThread = std::thread(Console::ConsoleRunner); Console::ShowAsyncConsole();
}, HOOK_CALL).install()->quick(); }, HOOK_CALL).install()->quick();
Utils::Hook(0x4D69A2, []() Utils::Hook(0x4D69A2, []()

View File

@ -21,6 +21,8 @@ namespace Components
static HWND GetWindow(); static HWND GetWindow();
static void ShowAsyncConsole();
private: private:
// Text-based console stuff // Text-based console stuff
static WINDOW* OutputWindow; static WINDOW* OutputWindow;

View File

@ -811,7 +811,7 @@ namespace Components
Utils::Hook::Call<void()>(0x64A020)(); // PMem_Init Utils::Hook::Call<void()>(0x64A020)(); // PMem_Init
if (!Flags::HasFlag("stdout")) if (!Flags::HasFlag("stdout"))
{ {
Game::Sys_ShowConsole(); Console::ShowAsyncConsole();
Utils::Hook::Call<void()>(0x43D140)(); // Com_EventLoop Utils::Hook::Call<void()>(0x43D140)(); // Com_EventLoop
} }
Utils::Hook::Call<void(unsigned int)>(0x502580)(static_cast<unsigned int>(__rdtsc())); // Netchan_Init Utils::Hook::Call<void(unsigned int)>(0x502580)(static_cast<unsigned int>(__rdtsc())); // Netchan_Init
@ -1088,7 +1088,6 @@ namespace Components
return result; return result;
}); });
#ifdef ENABLE_EXPERIMENTAL_ENTRYPOINT
// set new entry point // set new entry point
Utils::Hook(0x4513DA, ZoneBuilder::EntryPoint, HOOK_JUMP).install()->quick(); Utils::Hook(0x4513DA, ZoneBuilder::EntryPoint, HOOK_JUMP).install()->quick();
@ -1100,7 +1099,9 @@ namespace Components
// thread fuckery hooks // thread fuckery hooks
Utils::Hook(0x4C37D0, ZoneBuilder::IsThreadMainThreadHook, HOOK_JUMP).install()->quick(); Utils::Hook(0x4C37D0, ZoneBuilder::IsThreadMainThreadHook, HOOK_JUMP).install()->quick();
#endif
// Don't exec startup config in fs_restart
Utils::Hook::Set<BYTE>(0x461B48, 0xEB);
// remove overriding asset messages // remove overriding asset messages
Utils::Hook::Nop(0x5BC74E, 5); Utils::Hook::Nop(0x5BC74E, 5);