mirror of https://github.com/axmolengine/axmol.git
fixed #630 To realize the buffer-saving function in CCRenderTexture
This commit is contained in:
parent
a253909030
commit
eda6228374
|
@ -225,7 +225,7 @@ bool CCRenderTexture::saveBuffer(const char *fileName, int format)
|
|||
|
||||
bool bRet = false;
|
||||
CCAssert(format == kCCImageFormatJPG || format == kCCImageFormatPNG,
|
||||
@"the image can only be saved as JPG or PNG format");
|
||||
"the image can only be saved as JPG or PNG format");
|
||||
|
||||
CCImage *pImage = new CCImage();
|
||||
if (pImage != NULL && getUIImageFromBuffer(pImage))
|
||||
|
@ -261,7 +261,7 @@ bool CCRenderTexture::getUIImageFromBuffer(CCImage *pImage)
|
|||
|
||||
do
|
||||
{
|
||||
CCAssert(m_ePixelFormat == kCCTexture2DPixelFormat_RGBA8888,@"only RGBA8888 can be saved as image");
|
||||
CCAssert(m_ePixelFormat == kCCTexture2DPixelFormat_RGBA8888, "only RGBA8888 can be saved as image");
|
||||
|
||||
CCSize s = m_pTexture->getContentSizeInPixels();
|
||||
int tx = (int)s.width;
|
||||
|
|
Loading…
Reference in New Issue