mirror of https://github.com/axmolengine/axmol.git
check if plist file exist
This commit is contained in:
parent
6ebe1169f6
commit
097d4f3266
|
@ -235,10 +235,18 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const s
|
||||||
void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist)
|
void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist)
|
||||||
{
|
{
|
||||||
CCASSERT(plist.size()>0, "plist filename should not be nullptr");
|
CCASSERT(plist.size()>0, "plist filename should not be nullptr");
|
||||||
|
|
||||||
|
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
|
||||||
|
if (fullPath.size() == 0)
|
||||||
|
{
|
||||||
|
// return if plist file doesn't exist
|
||||||
|
CCLOG("cocos2d: SpriteFrameCache: can not find %s", plist.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_loadedFileNames->find(plist) == _loadedFileNames->end())
|
if (_loadedFileNames->find(plist) == _loadedFileNames->end())
|
||||||
{
|
{
|
||||||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
|
|
||||||
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
|
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
|
||||||
|
|
||||||
string texturePath("");
|
string texturePath("");
|
||||||
|
|
Loading…
Reference in New Issue