mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3617 from boyu0/bug2745_after_PerformanceTextureTest_render_error
closed #2745: fix bug: _dataLen not set at Image::initWithString() and I...
This commit is contained in:
commit
0fe28b7410
|
@ -170,6 +170,7 @@ bool Image::initWithString(
|
||||||
_height = (short)dc._height;
|
_height = (short)dc._height;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
bRet = true;
|
bRet = true;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
@ -221,6 +222,7 @@ bool Image::initWithStringShadowStroke(
|
||||||
_height = (short)dc._height;
|
_height = (short)dc._height;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
// swap the alpha channel (ARGB to RGBA)
|
// swap the alpha channel (ARGB to RGBA)
|
||||||
swapAlphaChannel((unsigned int *)_data, (_width * _height) );
|
swapAlphaChannel((unsigned int *)_data, (_width * _height) );
|
||||||
|
|
|
@ -344,6 +344,7 @@ bool Image::initWithString(
|
||||||
_height = (short)dc.iMaxLineHeight;
|
_height = (short)dc.iMaxLineHeight;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
bRet = true;
|
bRet = true;
|
||||||
|
|
||||||
|
|
|
@ -375,6 +375,7 @@ bool Image::initWithStringShadowStroke(
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
_preMulti = info.isPremultipliedAlpha;
|
_preMulti = info.isPremultipliedAlpha;
|
||||||
_data = info.data;
|
_data = info.data;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,6 +452,7 @@ bool Image::initWithString(
|
||||||
_height = (short)dc.iMaxLineHeight;
|
_height = (short)dc.iMaxLineHeight;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
bRet = true;
|
bRet = true;
|
||||||
|
|
||||||
|
|
|
@ -222,6 +222,7 @@ bool Image::initWithString(
|
||||||
CC_SAFE_DELETE_ARRAY(_data);
|
CC_SAFE_DELETE_ARRAY(_data);
|
||||||
}
|
}
|
||||||
_data = info.data;
|
_data = info.data;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,6 +464,7 @@ bool Image::initWithString(
|
||||||
_height = (short)dc.iMaxLineHeight;
|
_height = (short)dc.iMaxLineHeight;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
bRet = true;
|
bRet = true;
|
||||||
|
|
||||||
|
|
|
@ -451,6 +451,7 @@ bool Image::initWithString(
|
||||||
_height = (short)dc.iMaxLineHeight;
|
_height = (short)dc.iMaxLineHeight;
|
||||||
_preMulti = true;
|
_preMulti = true;
|
||||||
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
_renderFormat = Texture2D::PixelFormat::RGBA8888;
|
||||||
|
_dataLen = _width * _height * 4;
|
||||||
|
|
||||||
bRet = true;
|
bRet = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue