mirror of https://github.com/axmolengine/axmol.git
Better code style
This commit is contained in:
parent
65b2b8f65d
commit
6ff9a28f78
|
@ -48,7 +48,7 @@ static Texture2D* getDefaultTexture()
|
|||
|
||||
image = new (std::nothrow) Image();
|
||||
CC_BREAK_IF(nullptr == image);
|
||||
bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData), false);
|
||||
bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData));
|
||||
CC_BREAK_IF(!ret);
|
||||
|
||||
texture = Director::getInstance()->getTextureCache()->addImage(image, key);
|
||||
|
|
|
@ -656,7 +656,12 @@ bool Image::initWithImageFileThreadSafe(const std::string& fullpath)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool Image::initWithImageData(const uint8_t* data, ssize_t dataLen, bool ownData)
|
||||
bool Image::initWithImageData(const uint8_t* data, ssize_t dataLen)
|
||||
{
|
||||
return initWithImageData(const_cast<uint8_t*>(data), dataLen, false);
|
||||
}
|
||||
|
||||
bool Image::initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
|
|
@ -157,7 +157,8 @@ public:
|
|||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
bool initWithImageData(const uint8_t* data, ssize_t dataLen, bool ownData = false);
|
||||
bool initWithImageData(const uint8_t* data, ssize_t dataLen);
|
||||
bool initWithImageData(uint8_t* data, ssize_t dataLen, bool ownData);
|
||||
|
||||
// @warning kFmtRawData only support RGBA8888
|
||||
bool initWithRawData(const uint8_t* data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti = false);
|
||||
|
|
Loading…
Reference in New Issue