Skip to content

Commit

Permalink
xrGame/xrGame.cpp: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed May 4, 2024
1 parent a914f65 commit 655e7ab
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/xrGame/xrGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<UIStyleManager>();
// register console commands
CCC_RegisterCommands();
// register localization
StringTable().Init();
// keyboard binding
CCC_RegisterInput(); // XXX: Move to xrEngine
// Fill ui style token
UIStyles = xr_new<UIStyleManager>();
// register console commands
CCC_RegisterCommands();
// register localization
StringTable().Init();
// keyboard binding
CCC_RegisterInput(); // XXX: Move to xrEngine
#ifdef DEBUG
g_profiler = xr_new<CProfiler>();
g_profiler = xr_new<CProfiler>();
#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
}
}
}

0 comments on commit 655e7ab

Please sign in to comment.