mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1462 from wenbin1989/gles20
fix getDeviceModel bug in android CocosDenshion
This commit is contained in:
commit
0cca1cb023
|
@ -155,16 +155,17 @@ SimpleAudioEngine::SimpleAudioEngine()
|
|||
methodInfo.env->DeleteLocalRef(methodInfo.classID);
|
||||
|
||||
const char* deviceModel = methodInfo.env->GetStringUTFChars(jstr, NULL);
|
||||
methodInfo.env->ReleaseStringUTFChars(jstr, deviceModel);
|
||||
methodInfo.env->DeleteLocalRef(jstr);
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
SimpleAudioEngine::~SimpleAudioEngine()
|
||||
|
|
|
@ -18,7 +18,7 @@ OpenSLEngine::~OpenSLEngine()
|
|||
/**********************************************************************************
|
||||
* jni
|
||||
**********************************************************************************/
|
||||
#define CLASS_NAME "org/cocos2dx/lib/Cocos2dxActivity"
|
||||
#define CLASS_NAME "org/cocos2dx/lib/Cocos2dxHelper"
|
||||
|
||||
typedef struct JniMethodInfo_
|
||||
{
|
||||
|
@ -672,4 +672,4 @@ float OpenSLEngine::getEffectsVolume()
|
|||
{
|
||||
float volume = (m_effectVolume - MIN_VOLUME_MILLIBEL) / (1.0f * RANGE_VOLUME_MILLIBEL);
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue