I try your game, it works perfect.
I try to do the changes that you say.
The change two it easy, just uncomment, it’s done.
Change 1, the CC_ENABLE_CACHE_TEXTURE_DATA is defined in the CCTexture2D.cpp file, I just change the code that I find
#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
#else
#define CC_ENABLE_CACHE_TEXTURE_DATA 0
#endif
to
#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#define CC_ENABLE_CACHE_TEXTURE_DATA 1
#else
#define CC_ENABLE_CACHE_TEXTURE_DATA 0
#endif
I receive an error on the line
VolatileTexture::addStringTexture(this, text, dimensions, hAlignment, vAlignment, fontName, fontSize);
inside the method “CCTexture2D::initWithString” in the CCTexture2D.cpp file.
To compile the project a comment the addStringTexture method.
The change 3 I don’t understand, I need to replace the following code that you describe for what code?
I try to run my game and now it works, I lock and unlock the scrren and the game don’t crash, but I found one small problem, I use the ‘draw’ method to draw some lines in my game, when I lock and unlock the phone, the lines are gone.
But this is not a problem for me, because I can easily replace these lines using a CCSprite.
Thanks “Kirill Bark”, you help me a lot.