Skip to content

Commit 4b0e518

Browse files
committed
xrEngine: move renderers initialization into separate function
1 parent 61369f8 commit 4b0e518

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/xrEngine/EngineAPI.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ void CEngineAPI::InitializeNotDedicated()
9898
}
9999
#endif // DEDICATED_SERVER
100100

101-
void CEngineAPI::Initialize(void)
101+
void CEngineAPI::InitializeRenderers()
102102
{
103-
//////////////////////////////////////////////////////////////////////////
104-
// render
105103
constexpr pcstr r1_name = "xrRender_R1";
106104

107105
#ifndef DEDICATED_SERVER
@@ -122,11 +120,18 @@ void CEngineAPI::Initialize(void)
122120
R_ASSERT(hRender);
123121
g_current_renderer = 1;
124122
}
123+
125124
// ask current renderer to setup GlobalEnv
126-
using SetupEnvFunc = void (*)();
125+
using SetupEnvFunc = void(*)();
127126
auto setupEnv = (SetupEnvFunc)hRender->getProcAddress("SetupEnv");
128127
R_ASSERT(setupEnv);
129128
setupEnv();
129+
}
130+
131+
void CEngineAPI::Initialize(void)
132+
{
133+
InitializeRenderers();
134+
130135
// game
131136
{
132137
constexpr pcstr g_name = "xrGame";

src/xrEngine/EngineAPI.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class ENGINE_API CEngineAPI
5959
VTResume* tune_resume;
6060
void Initialize();
6161

62+
void InitializeRenderers();
6263
#ifndef DEDICATED_SERVER
6364
void InitializeNotDedicated();
6465
#endif // DEDICATED_SERVER

0 commit comments

Comments
 (0)