Only print Sprite warnings if we have Sprites set

If we don't set Sprites at all or the Sprites were not
loaded yet, the warnings can be misleading.
This commit is contained in:
Thiago Marcos P. Santos
2015-07-16 17:32:44 +03:00
parent dd818874cc
commit 38351554f4

View File

@@ -54,7 +54,9 @@ std::shared_ptr<const SpriteImage> SpriteStore::getSprite(const std::string& nam
if (it != sprites.end()) {
return it->second;
} else {
Log::Info(Event::Sprite, "Can't find sprite named '%s'", name.c_str());
if (!sprites.empty()) {
Log::Info(Event::Sprite, "Can't find sprite named '%s'", name.c_str());
}
return nullptr;
}
}