Skip to content

Commit

Permalink
common: fix some linux file loading
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Oct 9, 2018
1 parent 354bfed commit 71b9867
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/xrCore/XML/XMLDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ void ParseFile(pcstr path, CMemoryWriter& W, IReader* F, XMLDocument* xml)
string256 inc_name;
if (_GetItem(str, 1, inc_name, '"'))
{
#if defined(LINUX)
while (char* sep = strchr(inc_name, '\\')) *sep = '/';
#endif
IReader* I = nullptr;
if (inc_name == strstr(inc_name, "ui" DELIMITER ))
{
Expand Down
12 changes: 10 additions & 2 deletions src/xrEngine/thunderbolt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect)

// models
LPCSTR m_name = pIni.r_string(sect, "lightning_model");
m_pRender->CreateModel(m_name);
string_path tmp;
xr_strcpy(tmp, m_name);
#if defined(LINUX)
while (char* sep = strchr(tmp, '\\')) *sep = '/';
#endif
m_pRender->CreateModel(tmp);

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

// sound
m_name = pIni.r_string(sect, "sound");
#if defined(LINUX)
while (char* sep = strchr(tmp, '\\')) *sep = '/';
#endif
if (m_name && m_name[0])
snd.create(m_name, st_Effect, sg_Undefined);
snd.create(tmp, st_Effect, sg_Undefined);
}

//----------------------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions src/xrSound/SoundRender_Source_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ void CSoundRender_Source::load(pcstr name)
{
string_path fn, N;
xr_strcpy(N, name);
#ifdef WINDOWS
xr_strlwr(N);
#elif defined(LINUX)
while (char* sep = strchr(N, '\\')) *sep = '/';
#endif

if (strext(N))
*strext(N) = 0;

Expand Down

0 comments on commit 71b9867

Please sign in to comment.