Cocos2d-x 3.15.1 released

Download

Can download it here.

What’s new

Add optimization code for Huawei devices. Engine will collect some information, such as node count, particle count, and use these information to determine if engine needs more power. If needs more power, such as speed up CPU frequency, then engine will report the information to system service, the system service will speed up the CPU frequency. The system service only exists on Huawei devices that provide the system service. It has not effect on other devices.

When the system service detects the device is too hot, it will call back engine to slow down fps, minus particle count and may stop background music and effects.

If you don’t need the optimization, then you can disable it like this

public class AppActivity extends Cocos2dxActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            Cocos2dxEngineDataManager.disable(); // disable before `super.onCreate`
            super.onCreate(savedInstanceState);
            ...
            ...
        }
    }
1 Like

Hi @zhangxm

I’m sorry, but I did not understand.

This only applies to Huawei or all devices?

And thanks for your work!

cocos2d-x-3.15.1 May.27 2017

[REFINE] Add optimization codes for huawei devices

Only one fix? What about wrong variable in build.gradle which will case crash on 4.x device if u set it higher then minsdkversion?

3 Likes

Yes, the gradle fix seems important enough to not wait till 3.16.

@BPri only applies to Huawei devices, because only huawei devices has the service. Cocos2d-x cooperates with Huawei company.

@energyy @schngrg
It is easy to fix, if i remember correctly, @energyy already fixed it. And you can follow similar method to fix it, don’t have to wait 3.16.

Okay, thank you!

When can we expect this gradle fix?