Skip to content

Commit 5d4b21a

Browse files
committed
Use one LevelCompilerLogger for all modules.
1 parent f92f37b commit 5d4b21a

11 files changed

+15
-82
lines changed

src/utils/xrAI/xrAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Factory_Create* create_entity = 0;
1818
Factory_Destroy* destroy_entity = 0;
1919

20-
LevelCompilerLoggerWindow& Logger = LevelCompilerLoggerWindow();
20+
LevelCompilerLoggerWindow& Logger = LevelCompilerLoggerWindow::instance();
2121

2222
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
2323
va_list args;

src/utils/xrDO_Light/xrDO_Light.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#pragma comment(lib, "comctl32.lib")
1111
#pragma comment(lib, "winmm.LIB")
1212

13-
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow();
13+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
1414

1515
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
1616
va_list args;

src/utils/xrLC/xrLC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
CBuild* pBuild = NULL;
1515
u32 version = 0;
16-
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow();
16+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
1717

1818
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
1919
va_list args;

src/utils/xrLCUtil/LevelCompilerLoggerConsole.cpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/utils/xrLCUtil/LevelCompilerLoggerConsole.hpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/utils/xrLCUtil/LevelCompilerLoggerWindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,9 @@ void LevelCompilerLoggerWindow::Success(const char* msg)
252252

253253
void LevelCompilerLoggerWindow::Failure(const char* msg) { MessageBox(logWindow, msg, "Error!", MB_OK | MB_ICONERROR); }
254254
HWND LevelCompilerLoggerWindow::GetWindow() const { return logWindow; }
255+
256+
LevelCompilerLoggerWindow & LevelCompilerLoggerWindow::instance()
257+
{
258+
static LevelCompilerLoggerWindow instance;
259+
return instance;
260+
}

src/utils/xrLCUtil/LevelCompilerLoggerWindow.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class XRLCUTIL_API LevelCompilerLoggerWindow : public ILevelCompilerLogger
2929
bool bPhaseChange = false;
3030
u32 phase_total_time = 0;
3131

32-
public:
32+
protected:
3333
LevelCompilerLoggerWindow();
34+
public:
3435
virtual void Initialize(const char* name) override;
3536
virtual void Destroy() override;
3637
virtual void clMsg(const char* format, ...) override;
@@ -43,6 +44,7 @@ class XRLCUTIL_API LevelCompilerLoggerWindow : public ILevelCompilerLogger
4344
virtual void Success(const char* msg) override;
4445
virtual void Failure(const char* msg) override;
4546
HWND GetWindow() const;
47+
static LevelCompilerLoggerWindow& instance();
4648

4749
private:
4850
static void LogThreadProc(void* context);

src/utils/xrLCUtil/xrLCUtil.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
158158
</Link>
159159
</ItemDefinitionGroup>
160160
<ItemGroup>
161-
<ClCompile Include="LevelCompilerLoggerConsole.cpp" />
162161
<ClCompile Include="LevelCompilerLoggerWindow.cpp" />
163162
<ClCompile Include="pch.cpp">
164163
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
@@ -181,7 +180,6 @@
181180
</ItemGroup>
182181
<ItemGroup>
183182
<ClInclude Include="ILevelCompilerLogger.hpp" />
184-
<ClInclude Include="LevelCompilerLoggerConsole.hpp" />
185183
<ClInclude Include="LevelCompilerLoggerWindow.hpp" />
186184
<ClInclude Include="pch.hpp" />
187185
<ClInclude Include="xrThread.hpp" />

src/utils/xrLCUtil/xrLCUtil.vcxproj.filters

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
<ClCompile Include="LevelCompilerLoggerWindow.cpp">
2525
<Filter>Log</Filter>
2626
</ClCompile>
27-
<ClCompile Include="LevelCompilerLoggerConsole.cpp">
28-
<Filter>Log</Filter>
29-
</ClCompile>
3027
<ClCompile Include="xrLCUtil.cpp" />
3128
</ItemGroup>
3229
<ItemGroup>
@@ -45,9 +42,6 @@
4542
<ClInclude Include="LevelCompilerLoggerWindow.hpp">
4643
<Filter>Log</Filter>
4744
</ClInclude>
48-
<ClInclude Include="LevelCompilerLoggerConsole.hpp">
49-
<Filter>Log</Filter>
50-
</ClInclude>
5145
<ClInclude Include="xrLCUtil.hpp" />
5246
</ItemGroup>
5347
<ItemGroup>

src/utils/xrLC_Light/compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void xrLight()
1515
// Start threads, wait, continue --- perform all the work
1616
CThreadManager Threads(ProxyStatus, ProxyProgress);
1717
CTimer start_time;
18+
start_time.Start();
1819
u32 stride = range / NUM_THREADS;
1920
u32 last = range - stride * (NUM_THREADS - 1);
2021
for (u32 thID = 0; thID < NUM_THREADS; thID++)

src/utils/xrLC_Light/stdafx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// stdafx.obj will contain the pre-compiled type information
44

55
#include "stdafx.h"
6-
#include "utils/xrLCUtil/LevelCompilerLoggerConsole.hpp"
6+
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
77

8-
ILevelCompilerLogger& Logger = LevelCompilerLoggerConsole();
8+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
99

1010
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
1111
va_list args;

0 commit comments

Comments
 (0)