From e76feceada777980898ca172d7658351f5349448 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 30 May 2014 15:13:59 +0800 Subject: [PATCH] fix coding style --- cocos/2d/CCSpriteFrameCache.cpp | 28 ++++++++++++++-------------- cocos/2d/CCSpriteFrameCache.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index deb7d028eb..66b06f76c0 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -65,7 +65,7 @@ void SpriteFrameCache::destroyInstance() CC_SAFE_RELEASE_NULL(_sharedSpriteFrameCache); } -bool SpriteFrameCache::init(void) +bool SpriteFrameCache::init() { _spriteFrames.reserve(20); _spriteFramesAliases.reserve(20); @@ -73,7 +73,7 @@ bool SpriteFrameCache::init(void) return true; } -SpriteFrameCache::~SpriteFrameCache(void) +SpriteFrameCache::~SpriteFrameCache() { CC_SAFE_DELETE(_loadedFileNames); } @@ -200,18 +200,18 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu } } -void SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist, Texture2D *pobTexture) +void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture2D *texture) { - if (_loadedFileNames->find(pszPlist) != _loadedFileNames->end()) + if (_loadedFileNames->find(plist) != _loadedFileNames->end()) { return; // We already added it } - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszPlist); + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); - addSpriteFramesWithDictionary(dict, pobTexture); - _loadedFileNames->insert(pszPlist); + addSpriteFramesWithDictionary(dict, texture); + _loadedFileNames->insert(plist); } void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) @@ -229,13 +229,13 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const s } } -void SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist) +void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist) { - CCASSERT(pszPlist.size()>0, "plist filename should not be nullptr"); + CCASSERT(plist.size()>0, "plist filename should not be nullptr"); - if (_loadedFileNames->find(pszPlist) == _loadedFileNames->end()) + if (_loadedFileNames->find(plist) == _loadedFileNames->end()) { - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszPlist); + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); string texturePath(""); @@ -250,12 +250,12 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist) if (!texturePath.empty()) { // build texture path relative to plist file - texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath.c_str(), pszPlist); + texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath.c_str(), plist); } else { // build texture path by replacing file extension - texturePath = pszPlist; + texturePath = plist; // remove .xxx size_t startPos = texturePath.find_last_of("."); @@ -272,7 +272,7 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist) if (texture) { addSpriteFramesWithDictionary(dict, texture); - _loadedFileNames->insert(pszPlist); + _loadedFileNames->insert(plist); } else { diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index 7e01d33e7d..b9eaa2973c 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -61,7 +61,7 @@ class CC_DLL SpriteFrameCache : public Ref { public: /** Returns the shared instance of the Sprite Frame cache */ - static SpriteFrameCache* getInstance(void); + static SpriteFrameCache* getInstance(); /** @deprecated Use getInstance() instead */ CC_DEPRECATED_ATTRIBUTE static SpriteFrameCache* sharedSpriteFrameCache() { return SpriteFrameCache::getInstance(); } @@ -82,7 +82,7 @@ public: * @lua NA */ virtual ~SpriteFrameCache(); - bool init(void); + bool init(); public: /** Adds multiple Sprite Frames from a plist file.