Skip to content

Commit

Permalink
Fixed colladaLoader on Windows (#200)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Apr 13, 2021
1 parent 4a9f2ff commit 72820ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions graphics/src/ColladaLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,13 @@ Mesh *ColladaLoader::Load(const std::string &_filename)
tinyxml2::XMLDocument xmlDoc;

this->dataPtr->path.clear();
if (_filename.rfind('/') != std::string::npos)
std::string separator("/");
#ifdef WIN32
separator = std::string("\\");
#endif
if (_filename.rfind(separator) != std::string::npos)
{
this->dataPtr->path = _filename.substr(0, _filename.rfind('/'));
this->dataPtr->path = _filename.substr(0, _filename.rfind(separator));
}

this->dataPtr->filename = _filename;
Expand Down

0 comments on commit 72820ee

Please sign in to comment.