Skip to content

Commit

Permalink
xrCore, xrRender: more linux delimiter replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent c569c37 commit 71da06b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/Layers/xrRender/FBasicVisual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
IRender_Mesh::~IRender_Mesh()
{
#ifdef USE_OGL
GLuint buffers[] = { p_rm_Vertices, p_rm_Indices };
glDeleteBuffers(2, buffers);
GLuint buffers[] = { p_rm_Vertices, p_rm_Indices };
glDeleteBuffers(2, buffers);
#else
_RELEASE(p_rm_Vertices);
_RELEASE(p_rm_Indices);
Expand Down Expand Up @@ -68,6 +68,10 @@ void dxRender_Visual::Load(const char* N, IReader* data, u32)
string256 fnT, fnS;
data->r_stringZ(fnT, sizeof(fnT));
data->r_stringZ(fnS, sizeof(fnS));
#ifdef LINUX
while (char* sep = strchr(fnT, '\\')) *sep = '/';
while (char* sep = strchr(fnS, '\\')) *sep = '/';
#endif
shader.create(fnS, fnT);
}

Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRender/SkeletonAnimated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,9 @@ void CKinematicsAnimated::Load(const char* N, IReader* data, u32 dwFlags)
for (u32 k = 0; k < set_cnt; ++k)
{
data->r_stringZ(nm, sizeof(nm));
#ifdef LINUX
while (char* sep = strchr(nm, '\\')) *sep = '/';
#endif
xr_strcat(nm, ".omf");
string_path fn;
if (!FS.exist(fn, "$level$", nm))
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRender/SkeletonCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ void CKinematics::Load(const char* N, IReader* data, u32 dwFlags)
{
string_path lod_name;
LD->r_string(lod_name, sizeof(lod_name));
#ifdef LINUX
while (char* sep = strchr(lod_name, '\\')) *sep = '/';
#endif
//. strconcat (sizeof(name_load),name_load, short_name, ":lod:", lod_name.c_str());
m_lod = (dxRender_Visual*)GEnv.Render->model_CreateChild(lod_name, nullptr);

Expand Down
5 changes: 3 additions & 2 deletions src/Layers/xrRenderGL/glSH_Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,10 @@ void CTexture::Load()

pSurface = pTexture;
desc = GL_TEXTURE_2D;
if (glGetError() != GL_NO_ERROR)
GLenum err = glGetError();
if (err != GL_NO_ERROR)
{
FATAL("Invalid video stream");
FATAL_F("Invalid video stream: 0x%x", err);
xr_delete(pTheora);
pSurface = 0;
}
Expand Down
8 changes: 2 additions & 6 deletions src/xrCore/xr_ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,8 @@ void CInifile::Load(IReader* F, pcstr path, allow_include_func_t allow_include_f
R_ASSERT(path && path[0]);
if (_GetItem(str, 1, inc_name, '"'))
{
#if defined(LINUX)
char *tmp_ptr = strchr(inc_name, '\\');
while (tmp_ptr) {
*tmp_ptr = '/';
tmp_ptr = strchr(tmp_ptr, '\\');
}
#ifdef LINUX
while (char* sep = strchr(inc_name, '\\')) *sep = '/';
#endif
xr_strlwr(inc_name); // compensate removed xr_strlwr on path

Expand Down

0 comments on commit 71da06b

Please sign in to comment.