fixed #630 To realize the buffer-saving function in CCRenderTexture

This commit is contained in:
RongHong 2011-07-28 10:09:56 +08:00
parent a253909030
commit eda6228374
1 changed files with 2 additions and 2 deletions

View File

@ -225,7 +225,7 @@ bool CCRenderTexture::saveBuffer(const char *fileName, int format)
bool bRet = false; bool bRet = false;
CCAssert(format == kCCImageFormatJPG || format == kCCImageFormatPNG, 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(); CCImage *pImage = new CCImage();
if (pImage != NULL && getUIImageFromBuffer(pImage)) if (pImage != NULL && getUIImageFromBuffer(pImage))
@ -261,7 +261,7 @@ bool CCRenderTexture::getUIImageFromBuffer(CCImage *pImage)
do 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(); CCSize s = m_pTexture->getContentSizeInPixels();
int tx = (int)s.width; int tx = (int)s.width;