mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-19 13:25:38 +00:00
Disabled rlottie caching in debug mode so animations can be replaced on the fly.
This commit is contained in:
parent
ac6cc41059
commit
8497967510
|
@ -105,8 +105,17 @@ void LottieAnimComponent::setAnimation(const std::string& path)
|
||||||
ResourceData animData {ResourceManager::getInstance().getFileData(mPath)};
|
ResourceData animData {ResourceManager::getInstance().getFileData(mPath)};
|
||||||
std::string cache;
|
std::string cache;
|
||||||
|
|
||||||
mAnimation = rlottie::Animation::loadFromData(
|
// If in debug mode, then disable the rlottie caching so that animations can be replaced on
|
||||||
std::string(reinterpret_cast<char*>(animData.ptr.get()), animData.length), cache);
|
// the fly using Ctrl+r reloads.
|
||||||
|
if (Settings::getInstance()->getBool("Debug")) {
|
||||||
|
mAnimation = rlottie::Animation::loadFromData(
|
||||||
|
std::string(reinterpret_cast<char*>(animData.ptr.get()), animData.length), cache, "",
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mAnimation = rlottie::Animation::loadFromData(
|
||||||
|
std::string(reinterpret_cast<char*>(animData.ptr.get()), animData.length), cache);
|
||||||
|
}
|
||||||
|
|
||||||
if (mAnimation == nullptr) {
|
if (mAnimation == nullptr) {
|
||||||
LOG(LogError) << "Couldn't parse Lottie animation file \"" << mPath << "\"";
|
LOG(LogError) << "Couldn't parse Lottie animation file \"" << mPath << "\"";
|
||||||
|
|
Loading…
Reference in a new issue