Skip to content

Commit 235f697

Browse files
committed
Export engine startup functions
1 parent 43445e5 commit 235f697

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

src/xrEngine/main.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Entry point is in xr_3da/entry_point.cpp
22
#include "stdafx.h"
3+
#include "main.h"
34
#include "xr_3da/resource.h"
45

56
#include <process.h>
@@ -38,7 +39,7 @@ HWND logoWindow = nullptr;
3839
void RunBenchmark(pcstr name);
3940
}
4041

41-
void InitEngine()
42+
ENGINE_API void InitEngine()
4243
{
4344
Engine.Initialize();
4445
Device.Initialize();
@@ -62,7 +63,7 @@ struct PathIncludePred
6263
};
6364
}
6465

65-
void InitSettings()
66+
ENGINE_API void InitSettings()
6667
{
6768
string_path fname;
6869
FS.update_path(fname, "$game_config$", "system.ltx");
@@ -84,7 +85,7 @@ void InitSettings()
8485
make_string("Cannot find file %s.\nReinstalling application may fix this problem.", fname));
8586
}
8687

87-
void InitConsole()
88+
ENGINE_API void InitConsole()
8889
{
8990
if (GEnv.isDedicatedServer)
9091
Console = new CTextConsole();
@@ -101,16 +102,16 @@ void InitConsole()
101102
}
102103
}
103104

104-
void InitInput()
105+
ENGINE_API void InitInput()
105106
{
106107
bool captureInput = !strstr(Core.Params, "-i");
107108
pInput = new CInput(captureInput);
108109
}
109110

110-
void destroyInput() { xr_delete(pInput); }
111-
void InitSound() { ISoundManager::_create(); }
112-
void destroySound() { ISoundManager::_destroy(); }
113-
void destroySettings()
111+
ENGINE_API void destroyInput() { xr_delete(pInput); }
112+
ENGINE_API void InitSound() { ISoundManager::_create(); }
113+
ENGINE_API void destroySound() { ISoundManager::_destroy(); }
114+
ENGINE_API void destroySettings()
114115
{
115116
auto s = const_cast<CInifile**>(&pSettings);
116117
xr_delete(*s);
@@ -119,14 +120,14 @@ void destroySettings()
119120
xr_delete(pGameIni);
120121
}
121122

122-
void destroyConsole()
123+
ENGINE_API void destroyConsole()
123124
{
124125
Console->Execute("cfg_save");
125126
Console->Destroy();
126127
xr_delete(Console);
127128
}
128129

129-
void destroyEngine()
130+
ENGINE_API void destroyEngine()
130131
{
131132
Device.Destroy();
132133
Engine.Destroy();
@@ -161,7 +162,7 @@ void CheckPrivilegySlowdown()
161162
#endif
162163
}
163164

164-
void Startup()
165+
ENGINE_API void Startup()
165166
{
166167
execUserScript();
167168
InitSound();
@@ -226,7 +227,7 @@ static INT_PTR CALLBACK LogoWndProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
226227
return true;
227228
}
228229

229-
XR_EXPORT int RunApplication(pcstr commandLine)
230+
ENGINE_API int RunApplication(pcstr commandLine)
230231
{
231232
if (strstr(commandLine, "-nosplash") == 0)
232233
{

src/xrEngine/main.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
ENGINE_API void InitEngine();
4+
ENGINE_API void destroyEngine();
5+
6+
ENGINE_API void InitSettings();
7+
ENGINE_API void destroySettings();
8+
9+
ENGINE_API void InitConsole();
10+
ENGINE_API void destroyConsole();
11+
12+
ENGINE_API void InitInput();
13+
ENGINE_API void destroyInput();
14+
15+
ENGINE_API void InitSound();
16+
ENGINE_API void destroySound();
17+
18+
ENGINE_API void Startup();
19+
ENGINE_API int RunApplication(pcstr commandLine);

src/xrEngine/xrEngine.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
<ClInclude Include="LightAnimLibrary.h" />
252252
<ClInclude Include="line_editor.h" />
253253
<ClInclude Include="line_edit_control.h" />
254+
<ClInclude Include="main.h" />
254255
<ClInclude Include="mp_logging.h" />
255256
<ClInclude Include="ObjectAnimator.h" />
256257
<ClInclude Include="ObjectDump.h" />

src/xrEngine/xrEngine.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@
555555
<ClInclude Include="profiler_inline.h">
556556
<Filter>General\Profiler</Filter>
557557
</ClInclude>
558+
<ClInclude Include="main.h" />
558559
</ItemGroup>
559560
<ItemGroup>
560561
<ClCompile Include="defines.cpp">

src/xr_3da/entry_point.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#include "stdafx.h"
22
#include "resource.h"
3-
43
#include "StickyKeyFilter.hpp"
5-
#include "xrCore/xrCore.h"
6-
#include "xrCore/xrDebug_macros.h"
74

8-
extern ENGINE_API int RunApplication(pcstr);
5+
#include "xrEngine/main.h"
96

107
int entry_point(pcstr commandLine)
118
{

src/xr_3da/stdafx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#pragma once
22

33
#include "Common/Common.hpp"
4+
#include "xrCore/xrCore.h"

0 commit comments

Comments
 (0)