Update StarNetworkedAnimator.cpp
This commit is contained in:
parent
f2fedb0c87
commit
94c84ad013
@ -636,14 +636,14 @@ List<pair<Drawable, float>> NetworkedAnimator::drawablesWithZLevel(Vec2F const&
|
|||||||
String const& usedImage = processedImage ? processedImage.get() : image;
|
String const& usedImage = processedImage ? processedImage.get() : image;
|
||||||
|
|
||||||
if (!usedImage.empty() && usedImage[0] != ':' && usedImage[0] != '?') {
|
if (!usedImage.empty() && usedImage[0] != ':' && usedImage[0] != '?') {
|
||||||
|
size_t hash = hashOf(usedImage);
|
||||||
|
auto find = m_cachedPartDrawables.find(partName);
|
||||||
|
bool fail = find == m_cachedPartDrawables.end() || find->second.first != hash;
|
||||||
|
if (fail) {
|
||||||
String relativeImage;
|
String relativeImage;
|
||||||
if (usedImage[0] != '/')
|
if (usedImage[0] != '/')
|
||||||
relativeImage = AssetPath::relativeTo(m_relativePath, usedImage);
|
relativeImage = AssetPath::relativeTo(m_relativePath, usedImage);
|
||||||
|
|
||||||
size_t hash = hashOf(relativeImage);
|
|
||||||
auto find = m_cachedPartDrawables.find(partName);
|
|
||||||
bool fail = find == m_cachedPartDrawables.end() || find->second.first != hash;
|
|
||||||
if (fail) {
|
|
||||||
Drawable drawable = Drawable::makeImage(!relativeImage.empty() ? relativeImage : usedImage, 1.0f / TilePixels, centered, Vec2F());
|
Drawable drawable = Drawable::makeImage(!relativeImage.empty() ? relativeImage : usedImage, 1.0f / TilePixels, centered, Vec2F());
|
||||||
if (find == m_cachedPartDrawables.end())
|
if (find == m_cachedPartDrawables.end())
|
||||||
find = m_cachedPartDrawables.emplace(partName, std::pair{ hash, move(drawable) }).first;
|
find = m_cachedPartDrawables.emplace(partName, std::pair{ hash, move(drawable) }).first;
|
||||||
|
Loading…
Reference in New Issue
Block a user