Friday, August 5, 2022
HomeGame DevelopmentCCTexture2D crash on cocos2d-x v3 - C++

CCTexture2D crash on cocos2d-x v3 – C++


I’ve skilled a crash that’s brought on by a return on opengl error in initWithMipmaps methodology. This crash solely occurs when cocos’s font atlas is used. The reason being: when early return is used, _name is ready however _pixelFormat isn’t set. When Texture2D::updateWithData methodology known as from font atlas, it passes _name null test but it surely crashes on at methodology of std::map as a result of _pixelFormat hasn’t been set and it’s worth is PixelFormat::AUTO enum worth and a format information doesn’t current for PixelFormat::AUTO in _pixelFormatInfoTables map. I’ve checked cocos2d-x v4 and this code block had been eliminated on this model. Ought to we take away this code block on cocos2d 3.17 whether it is protected to take away? I added the code snippet from CCTexture2D. The road numbers are 688-693 on cocos2d-x 3.17.

The code snippet is from initWithMipmaps in CCTexture2D on v3.17:

err = glGetError();
if (err != GL_NO_ERROR)
{
    CCLOG("cocos2d: Texture2D: Error importing compressed texture degree: %u . glError: 0xpercent04X", i, err);
    return false;
}


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments