summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJon <[email protected]>2021-04-09 10:57:14 -0700
committerGitHub <[email protected]>2021-04-09 19:57:14 +0200
commitc74230a9ea2f38517b9072b5ee968cc3d4167d65 (patch)
tree00106f412c49c963711bfb6d6e743be0e32d6847 /src
parentd17c519f88ff33084772263f4585a96051c45cfa (diff)
downloadraylib-c74230a9ea2f38517b9072b5ee968cc3d4167d65.tar.gz
raylib-c74230a9ea2f38517b9072b5ee968cc3d4167d65.zip
Enable DRM platform cross compilation support (#1717)
* Log a warning if chdir failed, use agnostic CHDIR instead of chdir * Only include libdrm directory explicitly when not cross compiling
Diffstat (limited to 'src')
-rw-r--r--src/models.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c
index 5f59f535..6c9a75ba 100644
--- a/src/models.c
+++ b/src/models.c
@@ -3168,7 +3168,11 @@ static Model LoadOBJ(const char *fileName)
unsigned int dataSize = (unsigned int)strlen(fileData);
char currentDir[1024] = { 0 };
strcpy(currentDir, GetWorkingDirectory());
- chdir(GetDirectoryPath(fileName));
+ const char *workingDir = GetDirectoryPath(fileName);
+ if (CHDIR(workingDir) != 0)
+ {
+ TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", workingDir);
+ }
unsigned int flags = TINYOBJ_FLAG_TRIANGULATE;
int ret = tinyobj_parse_obj(&attrib, &meshes, &meshCount, &materials, &materialCount, fileData, dataSize, flags);
@@ -3306,7 +3310,10 @@ static Model LoadOBJ(const char *fileName)
RL_FREE(vnCount);
RL_FREE(faceCount);
- chdir(currentDir);
+ if (CHDIR(currentDir) != 0)
+ {
+ TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to change working directory", currentDir);
+ }
}
return model;