From f9b2dfe0373f7b9adafc1af051d581b6f994f3aa Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 6 Mar 2022 11:36:19 +0100 Subject: [PATCH] (Windows) Made LottieAnimComponent work with filenames containing Unicode characters. --- es-core/src/components/LottieAnimComponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/LottieAnimComponent.cpp b/es-core/src/components/LottieAnimComponent.cpp index 9f27ed58e..3c25a0b87 100644 --- a/es-core/src/components/LottieAnimComponent.cpp +++ b/es-core/src/components/LottieAnimComponent.cpp @@ -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(animData.ptr.get()), animData.length), cache); if (mAnimation == nullptr) { LOG(LogError) << "Couldn't parse Lottie animation file \"" << mPath << "\"";