Skip to content

Commit 549d1bc

Browse files
committed
xrCore refactoring
1 parent be5c51c commit 549d1bc

File tree

13 files changed

+36
-30
lines changed

13 files changed

+36
-30
lines changed

src/utils/ETools/ETools.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
1010
{
1111
case DLL_PROCESS_ATTACH:
1212
xrDebug::Initialize(false);
13-
Core._initialize("XRayEditorTools", 0, FALSE);
13+
Core.Initialize("XRayEditorTools", 0, FALSE);
1414
// FPU::m64r ();
1515
break;
1616
case DLL_THREAD_ATTACH: break;

src/utils/mp_configs_verifyer/entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void run_configs_verifyer_server()
148148

149149
void initialize_core()
150150
{
151-
Core._initialize("mp_configs_info", LogCallback(xrcore_log_cb, nullptr), TRUE, "fsgame4mpu.ltx");
151+
Core.Initialize("mp_configs_info", LogCallback(xrcore_log_cb, nullptr), TRUE, "fsgame4mpu.ltx");
152152

153153
string_path fname;
154154
FS.update_path(fname, "$game_config$", "system.ltx");

src/utils/mp_screenshots_info/entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main(int argc, char** argv)
6969
return EXIT_FAILURE;
7070
}
7171
printf("Initializing core...\n");
72-
Core._initialize("mp_screenshots_info", LogCallback(xrcore_log_cb, nullptr), TRUE, "fsgame4mpu.ltx");
72+
Core.Initialize("mp_screenshots_info", LogCallback(xrcore_log_cb, nullptr), TRUE, "fsgame4mpu.ltx");
7373

7474
#ifdef DEBUG
7575
if (strstr(argv[1], "--gen_params"))

src/utils/xrAI/xrAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Factory_Destroy* destroy_entity = 0;
197197
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
198198
{
199199
xrDebug::Initialize(false);
200-
Core._initialize("xrai", 0);
200+
Core.Initialize("xrai", 0);
201201
HMODULE hFactory;
202202
LPCSTR g_name = "xrSE_Factory";
203203
Log("Loading DLL:", g_name);

src/utils/xrCompress/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern int ProcessDifference();
88
int __cdecl main(int argc, char* argv[])
99
{
1010
xrDebug::Initialize(false);
11-
Core._initialize("xrCompress", 0, FALSE);
11+
Core.Initialize("xrCompress", 0, FALSE);
1212
printf("\n\n");
1313

1414
LPCSTR params = GetCommandLine();

src/utils/xrDO_Light/xrDO_Light.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
9090
{
9191
// Initialize debugging
9292
xrDebug::Initialize(false);
93-
Core._initialize("xrDO");
93+
Core.Initialize("xrDO");
9494
Startup(lpCmdLine);
9595

9696
return 0;

src/utils/xrLC/xrLC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
155155
{
156156
// Initialize debugging
157157
xrDebug::Initialize(false);
158-
Core._initialize("xrLC");
158+
Core.Initialize("xrLC");
159159

160160
if (strstr(Core.Params, "-nosmg"))
161161
g_using_smooth_groups = false;

src/utils/xrLC_Light/xrLC_Light.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
2424
{
2525
xrDebug::Initialize(false);
2626
bool init_log = (0 != xr_strcmp(Core.ApplicationName, "XRayEditorTools"));
27-
Core._initialize("xrLC_Light", 0, FALSE);
27+
Core.Initialize("xrLC_Light", 0, FALSE);
2828
if (init_log)
2929
CreateLog();
3030

src/utils/xrSE_Factory/xrSE_Factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ BOOL APIENTRY DllMain(HANDLE module_handle, DWORD call_reason, LPVOID reserved)
5454
// g_temporary_stuff = &trivial_encryptor::decode;
5555

5656
Debug._initialize(false);
57-
Core._initialize("xrSE_Factory", NULL, TRUE, "fsfactory.ltx");
57+
Core.Initialize("xrSE_Factory", NULL, TRUE, "fsfactory.ltx");
5858
string_path SYSTEM_LTX;
5959
FS.update_path(SYSTEM_LTX, "$game_config$", "system.ltx");
6060
pSettings = xr_new<CInifile>(SYSTEM_LTX);

src/xrCore/xrCore.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static u32 init_counter = 0;
2626

2727
//. extern xr_vector<shared_str>* LogFile;
2828

29-
void xrCore::_initialize(LPCSTR _ApplicationName, LogCallback cb, BOOL init_fs, LPCSTR fs_fname, bool plugin)
29+
void xrCore::Initialize(pcstr _ApplicationName, LogCallback cb, bool init_fs, pcstr fs_fname, bool plugin)
3030
{
3131
xr_strcpy(ApplicationName, _ApplicationName);
3232
if (0 == init_counter)
@@ -36,13 +36,13 @@ void xrCore::_initialize(LPCSTR _ApplicationName, LogCallback cb, BOOL init_fs,
3636
// HRESULT co_res =
3737
Params = xr_strdup(GetCommandLine());
3838
if (!strstr(Params, "-editor"))
39-
CoInitializeEx(NULL, COINIT_MULTITHREADED);
39+
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
4040

4141
string_path fn, dr, di;
4242

4343
// application path
4444
GetModuleFileName(GetModuleHandle("xrCore"), fn, sizeof(fn));
45-
_splitpath(fn, dr, di, 0, 0);
45+
_splitpath(fn, dr, di, nullptr, nullptr);
4646
strconcat(sizeof(ApplicationPath), ApplicationPath, dr, di);
4747

4848
#ifdef _EDITOR
@@ -87,10 +87,10 @@ void xrCore::_initialize(LPCSTR _ApplicationName, LogCallback cb, BOOL init_fs,
8787
}
8888
if (init_fs)
8989
{
90-
u32 flags = 0;
91-
if (0 != strstr(Params, "-build"))
90+
u32 flags = 0u;
91+
if (strstr(Params, "-build") != nullptr)
9292
flags |= CLocatorAPI::flBuildCopy;
93-
if (0 != strstr(Params, "-ebuild"))
93+
if (strstr(Params, "-ebuild") != nullptr)
9494
flags |= CLocatorAPI::flBuildCopy | CLocatorAPI::flEBuildCopy;
9595
#ifdef DEBUG
9696
if (strstr(Params, "-cache"))
@@ -105,11 +105,11 @@ void xrCore::_initialize(LPCSTR _ApplicationName, LogCallback cb, BOOL init_fs,
105105

106106
#ifndef _EDITOR
107107
#ifndef ELocatorAPIH
108-
if (0 != strstr(Params, "-file_activity"))
108+
if (strstr(Params, "-file_activity") != nullptr)
109109
flags |= CLocatorAPI::flDumpFileActivity;
110110
#endif
111111
#endif
112-
FS._initialize(flags, 0, fs_fname);
112+
FS._initialize(flags, nullptr, fs_fname);
113113
CalculateBuildId();
114114
Msg("'%s' build %d, %s\n", "xrCore", buildId, buildDate);
115115
EFS._initialize();
@@ -201,7 +201,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID lpvRese
201201
break;
202202
case DLL_THREAD_ATTACH:
203203
if (!strstr(GetCommandLine(), "-editor"))
204-
CoInitializeEx(NULL, COINIT_MULTITHREADED);
204+
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
205205
timeBeginPeriod(1);
206206
break;
207207
case DLL_THREAD_DETACH: break;

0 commit comments

Comments
 (0)