Optimizations for OPPO devices
Note: This document applies to Cocos2d-x 3.17.2 and later only. Cocos2d-x has a few optimizations for OPPO devices. These optimizations will only work on OPPO devices (specially Reno devices currently) .
There are two places that are optimized:
- load a scene
- engine's internal shaders compiling
Loading scene optimizations start when
Scene is created, and ended in
Scene::onEnter() and therefore you should create resources between them.
Invoke optimization codes manually
The application knows where more power is needed, better than engine knows. You can invoke this API to get more power when needed. You can invoke the API in both C++ or Java.
Example usage in C++
// Scene loading starts, need more power. DataManager::onSceneLoaderBegin(); // Scene loading ends. DataManager::onSceneLoaderEnd(); // Shader compiling begin, need more power. DataManager::onShaderLoaderBegin(); // Shader compiling ends. DataManager::onShaderLoaderEnd();
Example usage in Java:
Cocos2dxDataManager::setOptimise(String thing, float value);
Table Of Values
After v3.17.2, the type of
value changed from
string to make it more freshable.