Skip to content

Commit 168f1d4

Browse files
committed
xrGame: replace \\ to DELIMITER macro
1 parent 3721a94 commit 168f1d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+196
-187
lines changed

src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ void simplify_texture(string_path& fn)
1919
if (strstr(Core.Params, "-game_designer"))
2020
{
2121
if (strstr(fn, "$user")) return;
22-
if (strstr(fn, "ui\\")) return;
22+
if (strstr(fn, "ui" DELIMITER )) return;
2323
if (strstr(fn, "lmap#")) return;
24-
if (strstr(fn, "act\\")) return;
25-
if (strstr(fn, "fx\\")) return;
26-
if (strstr(fn, "glow\\")) return;
27-
if (strstr(fn, "map\\")) return;
28-
strcpy_s(fn, "ed\\ed_not_existing_texture");
24+
if (strstr(fn, "act" DELIMITER )) return;
25+
if (strstr(fn, "fx" DELIMITER )) return;
26+
if (strstr(fn, "glow" DELIMITER )) return;
27+
if (strstr(fn, "map" DELIMITER )) return;
28+
strcpy_s(fn, "ed" DELIMITER "ed_not_existing_texture");
2929
}
3030
}
3131

src/xrCore/XML/XMLDocument.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ void ParseFile(pcstr path, CMemoryWriter& W, IReader* F, XMLDocument* xml)
2323
if (_GetItem(str, 1, inc_name, '"'))
2424
{
2525
IReader* I = nullptr;
26-
if (inc_name == strstr(inc_name, "ui\\"))
26+
if (inc_name == strstr(inc_name, "ui" DELIMITER ))
2727
{
28-
shared_str fn = xml->correct_file_name("ui", strchr(inc_name, '\\') + 1);
28+
shared_str fn = xml->correct_file_name("ui", strchr(inc_name, _DELIMITER) + 1);
2929
string_path buff;
30-
strconcat(sizeof buff, buff, "ui\\", fn.c_str());
30+
strconcat(sizeof buff, buff, "ui" DELIMITER , fn.c_str());
3131
I = FS.r_open(path, buff);
3232
}
3333

@@ -50,7 +50,7 @@ void XMLDocument::Load(pcstr path_alias, pcstr path, pcstr _xml_filename)
5050
shared_str fn = correct_file_name(path, _xml_filename);
5151

5252
string_path str;
53-
xr_sprintf(str, "%s\\%s", path, *fn);
53+
xr_sprintf(str, "%s" DELIMITER "%s", path, *fn);
5454
return Load(path_alias, str);
5555
}
5656

src/xrEngine/GameFont.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ void CGameFont::Initialize(pcstr cShader, pcstr cTextureName)
5959
else
6060
xr_strcpy(cTexture, sizeof(cTexture), cTextureName);
6161

62+
#if defined(LINUX)
63+
char* ptr = strchr(cTexture, '\\');
64+
while (ptr)
65+
{
66+
*ptr = '/';
67+
ptr = strchr(ptr, '\\');
68+
}
69+
#endif
70+
6271
uFlags &= ~fsValid;
6372
vTS.set(1.f, 1.f); // обязательно !!!
6473

src/xrEngine/XR_IOConsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void CConsole::OnRender()
219219
if (!m_hShader_back)
220220
{
221221
m_hShader_back = new FactoryPtr<IUIShader>();
222-
(*m_hShader_back)->create("hud\\default", "ui\\ui_console"); // "ui\\ui_empty"
222+
(*m_hShader_back)->create("hud" DELIMITER "default", "ui" DELIMITER "ui_console"); // "ui/ui_empty"
223223
}
224224

225225
if (!pFont)

src/xrGame/Actor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ void CActor::Load(LPCSTR section)
387387
char buf[256];
388388

389389
GEnv.Sound->create(
390-
sndDie[0], strconcat(sizeof(buf), buf, *cName(), "\\die0"), st_Effect, SOUND_TYPE_MONSTER_DYING);
390+
sndDie[0], strconcat(sizeof(buf), buf, *cName(), DELIMITER "die0"), st_Effect, SOUND_TYPE_MONSTER_DYING);
391391
GEnv.Sound->create(
392-
sndDie[1], strconcat(sizeof(buf), buf, *cName(), "\\die1"), st_Effect, SOUND_TYPE_MONSTER_DYING);
392+
sndDie[1], strconcat(sizeof(buf), buf, *cName(), DELIMITER "die1"), st_Effect, SOUND_TYPE_MONSTER_DYING);
393393
GEnv.Sound->create(
394-
sndDie[2], strconcat(sizeof(buf), buf, *cName(), "\\die2"), st_Effect, SOUND_TYPE_MONSTER_DYING);
394+
sndDie[2], strconcat(sizeof(buf), buf, *cName(), DELIMITER "die2"), st_Effect, SOUND_TYPE_MONSTER_DYING);
395395
GEnv.Sound->create(
396-
sndDie[3], strconcat(sizeof(buf), buf, *cName(), "\\die3"), st_Effect, SOUND_TYPE_MONSTER_DYING);
396+
sndDie[3], strconcat(sizeof(buf), buf, *cName(), DELIMITER "die3"), st_Effect, SOUND_TYPE_MONSTER_DYING);
397397

398398
m_HeavyBreathSnd.create(
399399
pSettings->r_string(section, "heavy_breath_snd"), st_Effect, SOUND_TYPE_MONSTER_INJURING);

src/xrGame/Actor_Movement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void CActor::g_cl_CheckControls(u32 mstate_wf, Fvector& vControlAccel, float& Ju
339339
xr_sprintf(eff_name, sizeof(eff_name), "%s.anm", state_anm);
340340
string_path ce_path;
341341
string_path anm_name;
342-
strconcat(sizeof(anm_name), anm_name, "camera_effects\\actor_move\\", eff_name);
342+
strconcat(sizeof(anm_name), anm_name, "camera_effects" DELIMITER "actor_move" DELIMITER, eff_name);
343343
if (FS.exist(ce_path, "$game_anims$", anm_name))
344344
{
345345
CAnimatorCamLerpEffectorConst* e = new CAnimatorCamLerpEffectorConst();

src/xrGame/BlackGraviArtifact.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ BOOL CBlackGraviArtefact::net_Spawn(CSE_Abstract* DC)
4242
return FALSE;
4343

4444
CParticlesObject* pStaticPG;
45-
pStaticPG = CParticlesObject::Create("anomaly\\galantine", FALSE);
45+
pStaticPG = CParticlesObject::Create("anomaly" DELIMITER "galantine", FALSE);
4646
Fmatrix pos;
4747
// pos.rotateY(1.57);
4848
// pos.mulA(pos);

src/xrGame/Car.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ CCar::CCar()
7070
///////////////////////////////
7171
//////////////////////////////
7272
/////////////////////////////
73-
m_exhaust_particles = "vehiclefx\\exhaust_1";
73+
m_exhaust_particles = "vehiclefx" DELIMITER "exhaust_1";
7474
m_car_sound = new SCarSound(this);
7575

7676
//у машины слотов в инвентаре нет

src/xrGame/CarSound.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ void CCar::SCarSound::Init()
2626
volume = ini->r_float("car_sound", "snd_volume");
2727

2828
snd_engine.create(ini->r_string("car_sound", "snd_name"), st_Effect, sg_SourceType); //
29-
snd_engine_start.create(READ_IF_EXISTS(ini, r_string, "car_sound", "engine_start", "car\\test_car_start"),
29+
snd_engine_start.create(READ_IF_EXISTS(ini, r_string, "car_sound", "engine_start", "car" DELIMITER "test_car_start"),
3030
st_Effect, sg_SourceType);
3131
snd_engine_stop.create(
32-
READ_IF_EXISTS(ini, r_string, "car_sound", "engine_stop", "car\\test_car_stop"), st_Effect, sg_SourceType);
32+
READ_IF_EXISTS(ini, r_string, "car_sound", "engine_stop", "car" DELIMITER "test_car_stop"), st_Effect, sg_SourceType);
3333
float fengine_start_delay = READ_IF_EXISTS(ini, r_float, "car_sound", "engine_sound_start_dellay", 0.25f);
3434
engine_start_delay =
3535
iFloor((snd_engine_start._handle() ? iFloor(snd_engine_start.get_length_sec() * 1000.0f) : 1.f) *

src/xrGame/GamePersistent.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ void FillUIStyleToken()
5151
UIStyleToken.emplace_back("ui_style_default", 0);
5252

5353
string_path path;
54-
strconcat(sizeof(path), path, UI_PATH, "\\styles\\");
54+
strconcat(sizeof(path), path, UI_PATH, DELIMITER "styles" DELIMITER);
5555
FS.update_path(path, _game_config_, path);
5656
auto styles = FS.file_list_open(path, FS_ListFolders | FS_RootOnly);
5757
if (styles != nullptr)
5858
{
5959
int i = 1; // It's 1, because 0 is default style
6060
for (const auto& style : *styles)
6161
{
62-
const auto pos = strchr(style, '\\');
62+
const auto pos = strchr(style, _DELIMITER);
6363
*pos = '\0'; // we don't need that backslash in the end
6464
UIStyleToken.emplace_back(xr_strdup(style), i++); // It's important to have postfix increment!
6565
}
@@ -82,7 +82,7 @@ void SetupUIStyle()
8282
selectedStyle = token.name;
8383

8484
string128 selectedStylePath;
85-
strconcat(sizeof(selectedStylePath), selectedStylePath, UI_PATH, "\\styles\\", selectedStyle);
85+
strconcat(sizeof(selectedStylePath), selectedStylePath, UI_PATH, DELIMITER "styles" DELIMITER, selectedStyle);
8686

8787
UI_PATH = xr_strdup(selectedStylePath);
8888
defaultUIStyle = false;

0 commit comments

Comments
 (0)