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
This commit is contained in:
parent
d17c519f88
commit
c74230a9ea
2 changed files with 13 additions and 4 deletions
11
src/models.c
11
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue