Add VFS handling logic to mj_openResource.

PiperOrigin-RevId: 653124909
Change-Id: I4d031eb0bfb0070f8493753d2aeaac60ac283b85
This commit is contained in:
Kyle Bayes
2024-07-17 00:40:20 -07:00
committed by Copybara-Service
parent 7f46e936f6
commit 2cf352c2e6
13 changed files with 244 additions and 247 deletions
+2 -1
View File
@@ -169,7 +169,8 @@ static std::string ResolveFilePath(XMLElement* e, std::string filename,
// TODO(kylebayes): We first look in the base model directory for files to
// remain backwards compatible.
std::string full_filename = mjuu_combinePaths(dir, filename);
mjResource *resource = mju_openResource(full_filename.c_str(), nullptr, 0);
mjResource *resource = mju_openResource(full_filename.c_str(), nullptr,
nullptr, 0);
if (resource != nullptr) {
mju_closeResource(resource);
return filename;