win32可以用,但是Android闪退

我把png文件加密变成指定后缀的文件,然后读取。主要是修改了加载的部分。
CCSprite::create(“gameRes1.cogmz”)
这句在win32上没有问题,但是到了Android上面就有问题。

bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/)
{
bool bRet = false;

#ifdef EMSCRIPTEN
// Emscripten includes a re-implementation of SDL that uses HTML5 canvas
// operations underneath. Consequently, loading images via IMG_Load (an SDL
// API) will be a lot faster than running libpng et al as compiled with
// Emscripten.
SDL_Surface *iSurf = IMG_Load(strPath);

int size = 4 * (iSurf->w * iSurf->h);
bRet = _initWithRawData((void*)iSurf->pixels, size, iSurf->w, iSurf->h, 8, true);


unsigned int *tmp = (unsigned int *)m_pData;
int nrPixels = iSurf->w * iSurf->h;
for(int i = 0; i < nrPixels; i++)
{
    unsigned char *p = m_pData + i * 4;
    tmp* = CC_RGB_PREMULTIPLY_ALPHA( p, p, p, p );
}


SDL_FreeSurface(iSurf);

#else
unsigned long nSize = 0;
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(strPath);
unsigned char* pBuffer = CCFileUtils::sharedFileUtils()->getFileData(fullPath.c_str(), “rb”, &nSize);

if(eImgFmt==kFmtCogmz)
{
for (int i= 0; i < nSize; i++) {
pBuffer* = pBuffer*-2;**
}
eImgFmt = kFmtPng;
}
if (pBuffer != NULL && nSize > 0)
{
bRet = initWithImageData(pBuffer, nSize, eImgFmt);
}
CC_SAFE_DELETE_ARRAY(pBuffer);
#endif // EMSCRIPTEN

return bRet;

}

跪求指导!!
*

报的错呢。。。。

没有报错。CCSprite::create(“gameRes1.cogmz”) 返回的是 null,因为我cclog在Eclipse中打印不了,所以不知道位置啊。

资源名的大写R换成小写试试,我以前就因为这个问题报错好像