(Windows) Made LottieAnimComponent work with filenames containing Unicode characters.

This commit is contained in:
Leon Styhre 2022-03-06 11:36:19 +01:00
parent 60213003b1
commit f9b2dfe037

View file

@ -102,7 +102,11 @@ void LottieAnimComponent::setAnimation(const std::string& path)
return;
}
mAnimation = rlottie::Animation::loadFromFile(mPath);
ResourceData animData {ResourceManager::getInstance().getFileData(mPath)};
std::string cache;
mAnimation = rlottie::Animation::loadFromData(
std::string(reinterpret_cast<char*>(animData.ptr.get()), animData.length), cache);
if (mAnimation == nullptr) {
LOG(LogError) << "Couldn't parse Lottie animation file \"" << mPath << "\"";