Merge pull request #1462 from wenbin1989/gles20

fix getDeviceModel bug in android CocosDenshion
This commit is contained in:
minggo 2012-10-16 18:32:13 -07:00
commit 0cca1cb023
2 changed files with 7 additions and 6 deletions

View File

@ -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()

View File

@ -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;
}
}