diff options
author | dhewg | 2011-02-26 23:04:18 +0100 |
---|---|---|
committer | dhewg | 2011-02-27 09:04:38 +0100 |
commit | a73b2ec97279b1ef1562ece18c7905591e6a7cc4 (patch) | |
tree | 915c7d7534ccfec8bc05b8c57a3ef7e7b95ab49c /backends/platform | |
parent | d4c0501d1fcc8c98d39b2b7ba627cccb29cbc476 (diff) | |
download | scummvm-rg350-a73b2ec97279b1ef1562ece18c7905591e6a7cc4.tar.gz scummvm-rg350-a73b2ec97279b1ef1562ece18c7905591e6a7cc4.tar.bz2 scummvm-rg350-a73b2ec97279b1ef1562ece18c7905591e6a7cc4.zip |
ANDROID: Remove unnecessary code
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/android/jni.cpp | 10 | ||||
-rw-r--r-- | backends/platform/android/org/inodes/gus/scummvm/ScummVM.java | 12 |
2 files changed, 5 insertions, 17 deletions
diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index 8964fe63d8..d8203e2a57 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -52,7 +52,6 @@ jfieldID JNI::_FID_Event_kbd_flags = 0; jfieldID JNI::_FID_Event_mouse_x = 0; jfieldID JNI::_FID_Event_mouse_y = 0; jfieldID JNI::_FID_Event_mouse_relative = 0; -jfieldID JNI::_FID_ScummVM_nativeScummVM = 0; jmethodID JNI::_MID_displayMessageOnOSD = 0; jmethodID JNI::_MID_setWindowCaption = 0; @@ -111,10 +110,6 @@ jint JNI::onLoad(JavaVM *vm) { if (env->RegisterNatives(cls, _natives, ARRAYSIZE(_natives)) < 0) return JNI_ERR; - _FID_ScummVM_nativeScummVM = env->GetFieldID(cls, "nativeScummVM", "J"); - if (_FID_ScummVM_nativeScummVM == 0) - return JNI_ERR; - jclass event = env->FindClass("org/inodes/gus/scummvm/Event"); if (event == 0) return JNI_ERR; @@ -415,8 +410,6 @@ void JNI::create(JNIEnv *env, jobject self, jobject am, jobject at, #undef FIND_METHOD - env->SetLongField(self, _FID_ScummVM_nativeScummVM, (jlong)_system); - _jobj_audio_track = env->NewGlobalRef(at); cls = env->GetObjectClass(_jobj_audio_track); @@ -439,7 +432,8 @@ void JNI::create(JNIEnv *env, jobject self, jobject am, jobject at, } void JNI::destroy(JNIEnv *env, jobject self) { - assert(_system); + if (!_system) + return; OSystem_Android *tmp = _system; g_system = 0; diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index 7a326454d9..a6bc5fafc0 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java @@ -35,10 +35,6 @@ import java.util.LinkedHashMap; public class ScummVM implements SurfaceHolder.Callback { protected final static String LOG_TAG = "ScummVM"; - // native code hangs itself here - private long nativeScummVM; - boolean scummVMRunning = false; - private native void create(AssetManager am, AudioTrack audio_track, int sample_rate, int buffer_size); @@ -75,17 +71,14 @@ public class ScummVM implements SurfaceHolder.Callback { String.format("Error initialising AudioTrack: %d", audio_track.getState())); - // Init C++ code, set nativeScummVM + // Init C++ code create(context.getAssets(), audio_track, sample_rate, buffer_size); } private native void nativeDestroy(); public synchronized void destroy() { - if (nativeScummVM != 0) { - nativeDestroy(); - nativeScummVM = 0; - } + nativeDestroy(); } protected void finalize() { @@ -295,6 +288,7 @@ public class ScummVM implements SurfaceHolder.Callback { // Called by ScummVM thread static private boolean _log_version = true; + protected void setupScummVMSurface() { try { surfaceLock.acquire(); |