diff --git a/src/xrGame/xrGame.cpp b/src/xrGame/xrGame.cpp index 0749bde2866..e6ea87dd1a2 100644 --- a/src/xrGame/xrGame.cpp +++ b/src/xrGame/xrGame.cpp @@ -22,59 +22,59 @@ extern float g_fTimeFactor; extern "C" { - XR_EXPORT IFactoryObject* __cdecl xrFactory_Create(CLASS_ID clsid) - { - IFactoryObject* object = object_factory().client_object(clsid); +XR_EXPORT IFactoryObject* __cdecl xrFactory_Create(CLASS_ID clsid) +{ + IFactoryObject* object = object_factory().client_object(clsid); #ifdef DEBUG - if (!object) - return (0); + if (!object) + return (0); #endif - // XXX nitrocaster XRFACTORY: set clsid during factory initialization - object->GetClassId() = clsid; - return (object); - } + // XXX nitrocaster XRFACTORY: set clsid during factory initialization + object->GetClassId() = clsid; + return (object); +} - XR_EXPORT void __cdecl xrFactory_Destroy(IFactoryObject* O) { xr_delete(O); } +XR_EXPORT void __cdecl xrFactory_Destroy(IFactoryObject* O) { xr_delete(O); } - XR_EXPORT void initialize_library() - { - ZoneScoped; +XR_EXPORT void initialize_library() +{ + ZoneScoped; - g_fTimeFactor = pSettings->r_float("alife", "time_factor"); // XXX: find a better place + g_fTimeFactor = pSettings->r_float("alife", "time_factor"); // XXX: find a better place - // Fill ui style token - UIStyles = xr_new(); - // register console commands - CCC_RegisterCommands(); - // register localization - StringTable().Init(); - // keyboard binding - CCC_RegisterInput(); // XXX: Move to xrEngine + // Fill ui style token + UIStyles = xr_new(); + // register console commands + CCC_RegisterCommands(); + // register localization + StringTable().Init(); + // keyboard binding + CCC_RegisterInput(); // XXX: Move to xrEngine #ifdef DEBUG - g_profiler = xr_new(); + g_profiler = xr_new(); #endif - ImGui::SetAllocatorFunctions( - [](size_t size, void* /*user_data*/) + ImGui::SetAllocatorFunctions( + [](size_t size, void* /*user_data*/) { return xr_malloc(size); }, - [](void* ptr, void* /*user_data*/) + [](void* ptr, void* /*user_data*/) { xr_free(ptr); } - ); - ImGui::SetCurrentContext(Device.GetImGuiContext()); - } + ); + ImGui::SetCurrentContext(Device.GetImGuiContext()); +} - XR_EXPORT void finalize_library() - { - xr_delete(UIStyles); - StringTable().Destroy(); - CCC_DeregisterInput(); // XXX: Remove if possible +XR_EXPORT void finalize_library() +{ + xr_delete(UIStyles); + StringTable().Destroy(); + CCC_DeregisterInput(); // XXX: Remove if possible #ifdef DEBUG - xr_delete(g_profiler); + xr_delete(g_profiler); #endif - } +} }