Skip to content

Commit 71da06b

Browse files
committed
xrCore, xrRender: more linux delimiter replacement
1 parent c569c37 commit 71da06b

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

src/Layers/xrRender/FBasicVisual.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
IRender_Mesh::~IRender_Mesh()
2020
{
2121
#ifdef USE_OGL
22-
GLuint buffers[] = { p_rm_Vertices, p_rm_Indices };
23-
glDeleteBuffers(2, buffers);
22+
GLuint buffers[] = { p_rm_Vertices, p_rm_Indices };
23+
glDeleteBuffers(2, buffers);
2424
#else
2525
_RELEASE(p_rm_Vertices);
2626
_RELEASE(p_rm_Indices);
@@ -68,6 +68,10 @@ void dxRender_Visual::Load(const char* N, IReader* data, u32)
6868
string256 fnT, fnS;
6969
data->r_stringZ(fnT, sizeof(fnT));
7070
data->r_stringZ(fnS, sizeof(fnS));
71+
#ifdef LINUX
72+
while (char* sep = strchr(fnT, '\\')) *sep = '/';
73+
while (char* sep = strchr(fnS, '\\')) *sep = '/';
74+
#endif
7175
shader.create(fnS, fnT);
7276
}
7377

src/Layers/xrRender/SkeletonAnimated.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ void CKinematicsAnimated::Load(const char* N, IReader* data, u32 dwFlags)
771771
for (u32 k = 0; k < set_cnt; ++k)
772772
{
773773
data->r_stringZ(nm, sizeof(nm));
774+
#ifdef LINUX
775+
while (char* sep = strchr(nm, '\\')) *sep = '/';
776+
#endif
774777
xr_strcat(nm, ".omf");
775778
string_path fn;
776779
if (!FS.exist(fn, "$level$", nm))

src/Layers/xrRender/SkeletonCustom.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ void CKinematics::Load(const char* N, IReader* data, u32 dwFlags)
184184
{
185185
string_path lod_name;
186186
LD->r_string(lod_name, sizeof(lod_name));
187+
#ifdef LINUX
188+
while (char* sep = strchr(lod_name, '\\')) *sep = '/';
189+
#endif
187190
//. strconcat (sizeof(name_load),name_load, short_name, ":lod:", lod_name.c_str());
188191
m_lod = (dxRender_Visual*)GEnv.Render->model_CreateChild(lod_name, nullptr);
189192

src/Layers/xrRenderGL/glSH_Texture.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,10 @@ void CTexture::Load()
209209

210210
pSurface = pTexture;
211211
desc = GL_TEXTURE_2D;
212-
if (glGetError() != GL_NO_ERROR)
212+
GLenum err = glGetError();
213+
if (err != GL_NO_ERROR)
213214
{
214-
FATAL("Invalid video stream");
215+
FATAL_F("Invalid video stream: 0x%x", err);
215216
xr_delete(pTheora);
216217
pSurface = 0;
217218
}

src/xrCore/xr_ini.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,8 @@ void CInifile::Load(IReader* F, pcstr path, allow_include_func_t allow_include_f
450450
R_ASSERT(path && path[0]);
451451
if (_GetItem(str, 1, inc_name, '"'))
452452
{
453-
#if defined(LINUX)
454-
char *tmp_ptr = strchr(inc_name, '\\');
455-
while (tmp_ptr) {
456-
*tmp_ptr = '/';
457-
tmp_ptr = strchr(tmp_ptr, '\\');
458-
}
453+
#ifdef LINUX
454+
while (char* sep = strchr(inc_name, '\\')) *sep = '/';
459455
#endif
460456
xr_strlwr(inc_name); // compensate removed xr_strlwr on path
461457

0 commit comments

Comments
 (0)