mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15874 from mogemimi/fix-unused-variable
Fix unused variable warnings when compiling release mode
This commit is contained in:
commit
ee7ceee007
|
@ -253,7 +253,6 @@ std::vector<cocos2d::Vec2> AutoPolygon::marchSquare(const Rect& rect, const Vec2
|
|||
int curx = startx;
|
||||
int cury = starty;
|
||||
unsigned int count = 0;
|
||||
unsigned int totalPixel = _width*_height;
|
||||
bool problem = false;
|
||||
std::vector<int> case9s;
|
||||
std::vector<int> case6s;
|
||||
|
@ -408,7 +407,11 @@ std::vector<cocos2d::Vec2> AutoPolygon::marchSquare(const Rect& rect, const Vec2
|
|||
prevx = stepx;
|
||||
prevy = stepy;
|
||||
problem = false;
|
||||
|
||||
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
||||
const auto totalPixel = _width * _height;
|
||||
CCASSERT(count <= totalPixel, "oh no, marching square cannot find starting position");
|
||||
#endif
|
||||
} while(curx != startx || cury != starty);
|
||||
return _points;
|
||||
}
|
||||
|
|
|
@ -326,6 +326,11 @@ Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key)
|
|||
CCASSERT(imageResult, "Failed to create image from base64!");
|
||||
free(decoded);
|
||||
|
||||
if (!imageResult) {
|
||||
CC_SAFE_RELEASE_NULL(image);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
texture = Director::getInstance()->getTextureCache()->addImage(image, key);
|
||||
image->release();
|
||||
}
|
||||
|
@ -345,6 +350,11 @@ Sprite* createSpriteFromBase64(const char* base64String)
|
|||
CCASSERT(imageResult, "Failed to create image from base64!");
|
||||
free(decoded);
|
||||
|
||||
if (!imageResult) {
|
||||
CC_SAFE_RELEASE_NULL(image);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Texture2D *texture = new (std::nothrow) Texture2D();
|
||||
texture->initWithImage(image);
|
||||
texture->setAliasTexParameters();
|
||||
|
|
Loading…
Reference in New Issue