CocosDenshion bugs on I9100 in cocos2d-x 2.0.3

  1. in file “CocosDenshion/android/opensl/OpenSLEngine.cpp”, line 21
    #define CLASS_NAME “org/cocos2dx/lib/Cocos2dxActivity”
    must change to
    #define CLASS_NAME “org/cocos2dx/lib/Cocos2dxHelper”

the java method “getAssetManager” is moved from Cocos2dxActivity.java to Cocos2dxActivity.java, but didn’t change the jni file.

  1. in file “CocosDenshion/android/SimpleAudioEngine.cpp”, line 157

const char* deviceModel = methodInfo.env~~>GetStringUTFChars;
methodInfo.env~~>ReleaseStringUTFChars(jstr, deviceModel);
methodInfo.env~~>DeleteLocalRef;
LOGD (deviceModel);
if 0)
{
LOGD(“i9100 model\nSwitch to OpenSLES”);
s_bI9100 = true;
}

will cause deviceModel release before compare with I9100_MODEL, sometime LOGD(deviceModel); will print garbled character in logcat. change to following code will fix it

const char\* deviceModel = methodInfo.env-\>GetStringUTFChars(jstr, NULL);
LOGD(deviceModel);
if (strcmp(I9100\_MODEL, deviceModel)  0)

{
LOGD (“i9100 model\nSwitch to OpenSLES”);
s_bI9100 = true;
}
methodInfo.env~~>ReleaseStringUTFChars(jstr, deviceModel);
methodInfo.env->DeleteLocalRef(jstr);

Thank you.