mirror of https://github.com/axmolengine/axmol.git
issue #396 android modified.
This commit is contained in:
parent
4b86cec4be
commit
dceff2d179
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
private:
|
||||
class Impl;
|
||||
ccxScopedPtr<CCLock::Impl> m_pImp;
|
||||
CCLock::Impl * m_pImp;
|
||||
};
|
||||
#else // CC_SUPPORT_MULTITHREAD
|
||||
|
||||
|
|
|
@ -233,12 +233,12 @@ bool CCImage::initWithString(
|
|||
CC_BREAK_IF(nWidth <= 0 || nHeight <= 0);
|
||||
|
||||
int nDataLen = pBitmap->rowBytes() * pBitmap->height();
|
||||
m_pData.reset(new ccxByte[nDataLen]);
|
||||
CC_BREAK_IF(! m_pData.get());
|
||||
memcpy((void*) m_pData.get(), pBitmap->getPixels(), nDataLen);
|
||||
m_pData = new unsigned char[nDataLen];
|
||||
CC_BREAK_IF(! m_pData);
|
||||
memcpy((void*) m_pData, pBitmap->getPixels(), nDataLen);
|
||||
|
||||
m_nWidth = (ccxInt16)nWidth;
|
||||
m_nHeight = (ccxInt16)nHeight;
|
||||
m_nWidth = (short)nWidth;
|
||||
m_nHeight = (short)nHeight;
|
||||
m_bHasAlpha = true;
|
||||
m_bPreMulti = true;
|
||||
m_nBitsPerComponent = pBitmap->bytesPerPixel();
|
||||
|
|
|
@ -52,10 +52,7 @@ CCLock::CCLock()
|
|||
|
||||
CCLock::~CCLock()
|
||||
{
|
||||
if (m_pImp)
|
||||
{
|
||||
delete m_pImp;
|
||||
}
|
||||
CC_SAFE_DELETE(m_pImp);
|
||||
}
|
||||
|
||||
void CCLock::lock()
|
||||
|
|
|
@ -46,6 +46,7 @@ CCXLock::CCXLock()
|
|||
|
||||
CCXLock::~CCXLock()
|
||||
{
|
||||
CC_SAFE_DELETE(m_pImp);
|
||||
}
|
||||
|
||||
void CCXLock::lock()
|
||||
|
|
|
@ -58,6 +58,7 @@ CCLock::CCLock()
|
|||
|
||||
CCLock::~CCLock()
|
||||
{
|
||||
CC_SAFE_DELETE(m_pImp);
|
||||
}
|
||||
|
||||
void CCLock::lock()
|
||||
|
|
|
@ -128,11 +128,11 @@ namespace cocos2d {
|
|||
case kCCTexture2DPixelFormat_RGB5A1:
|
||||
case kCCTexture2DPixelFormat_RGB565:
|
||||
case kCCTexture2DPixelFormat_A8:
|
||||
vt->data = new ccxByte[w * h * 4];
|
||||
vt->data = new unsigned char[w * h * 4];
|
||||
memcpy(vt->data, d, w * h * 4);
|
||||
break;
|
||||
case kCCTexture2DPixelFormat_RGB888:
|
||||
vt->data = new ccxByte[w * h * 3];
|
||||
vt->data = new unsigned char[w * h * 3];
|
||||
memcpy(vt->data, d, w * h * 3);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue