Skip to content

Commit 71b9867

Browse files
committed
common: fix some linux file loading
1 parent 354bfed commit 71b9867

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/xrCore/XML/XMLDocument.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ void ParseFile(pcstr path, CMemoryWriter& W, IReader* F, XMLDocument* xml)
2222
string256 inc_name;
2323
if (_GetItem(str, 1, inc_name, '"'))
2424
{
25+
#if defined(LINUX)
26+
while (char* sep = strchr(inc_name, '\\')) *sep = '/';
27+
#endif
2528
IReader* I = nullptr;
2629
if (inc_name == strstr(inc_name, "ui" DELIMITER ))
2730
{

src/xrEngine/thunderbolt.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect)
6262

6363
// models
6464
LPCSTR m_name = pIni.r_string(sect, "lightning_model");
65-
m_pRender->CreateModel(m_name);
65+
string_path tmp;
66+
xr_strcpy(tmp, m_name);
67+
#if defined(LINUX)
68+
while (char* sep = strchr(tmp, '\\')) *sep = '/';
69+
#endif
70+
m_pRender->CreateModel(tmp);
6671

6772
/*
6873
IReader* F = 0;
@@ -73,8 +78,11 @@ void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect)
7378

7479
// sound
7580
m_name = pIni.r_string(sect, "sound");
81+
#if defined(LINUX)
82+
while (char* sep = strchr(tmp, '\\')) *sep = '/';
83+
#endif
7684
if (m_name && m_name[0])
77-
snd.create(m_name, st_Effect, sg_Undefined);
85+
snd.create(tmp, st_Effect, sg_Undefined);
7886
}
7987

8088
//----------------------------------------------------------------------------------------------

src/xrSound/SoundRender_Source_loader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ void CSoundRender_Source::load(pcstr name)
126126
{
127127
string_path fn, N;
128128
xr_strcpy(N, name);
129+
#ifdef WINDOWS
129130
xr_strlwr(N);
131+
#elif defined(LINUX)
132+
while (char* sep = strchr(N, '\\')) *sep = '/';
133+
#endif
134+
130135
if (strext(N))
131136
*strext(N) = 0;
132137

0 commit comments

Comments
 (0)