Search
lxdream.org :: lxdream :: r1278:2f0de47738d0
lxdream 0.9.1
released Jun 29
Download Now
changeset1278:2f0de47738d0
parent1277:f727227cc4f8
child1279:142110f63902
authornkeynes
dateWed Mar 21 14:44:14 2012 +1000 (9 years ago)
Dreamcast.stop() on pause, get rid of unnecessary onAppPause()/onAppResume() methods
Set the run menu item to the right icon/state on pause as well.
android/src/org/lxdream/Dreamcast.java
android/src/org/lxdream/LxdreamActivity.java
src/gui_android.c
1.1 --- a/android/src/org/lxdream/Dreamcast.java Wed Mar 21 09:01:41 2012 +1000
1.2 +++ b/android/src/org/lxdream/Dreamcast.java Wed Mar 21 14:44:14 2012 +1000
1.3 @@ -33,9 +33,6 @@
1.4 public static native boolean isRunnable();
1.5 public static native boolean isRunning();
1.6
1.7 - public static native void onAppPause();
1.8 - public static native void onAppResume();
1.9 -
1.10 /* GD-Rom */
1.11 public static native boolean mount( String filename );
1.12 public static native void unmount();
2.1 --- a/android/src/org/lxdream/LxdreamActivity.java Wed Mar 21 09:01:41 2012 +1000
2.2 +++ b/android/src/org/lxdream/LxdreamActivity.java Wed Mar 21 14:44:14 2012 +1000
2.3 @@ -37,6 +37,7 @@
2.4 boolean isRunning = false;
2.5 Context ctx;
2.6 Drawable runIcon, pauseIcon;
2.7 + MenuItem runMenuItem;
2.8
2.9 @Override
2.10 protected void onCreate(Bundle bundle) {
2.11 @@ -57,19 +58,21 @@
2.12 public boolean onCreateOptionsMenu(Menu menu) {
2.13 MenuInflater inflater = getMenuInflater();
2.14 inflater.inflate(R.menu.main, menu);
2.15 + runMenuItem = menu.findItem(R.id.menu_run);
2.16 return true;
2.17 }
2.18
2.19
2.20 @Override
2.21 protected void onPause() {
2.22 - Dreamcast.onAppPause();
2.23 + Dreamcast.stop();
2.24 + runMenuItem.setIcon( runIcon );
2.25 + isRunning = false;
2.26 super.onPause();
2.27 }
2.28
2.29 @Override
2.30 protected void onResume() {
2.31 - Dreamcast.onAppResume();
2.32 super.onResume();
2.33 }
2.34
3.1 --- a/src/gui_android.c Wed Mar 21 09:01:41 2012 +1000
3.2 +++ b/src/gui_android.c Wed Mar 21 14:44:14 2012 +1000
3.3 @@ -90,21 +90,6 @@
3.4 return 0;
3.5 }
3.6
3.7 -int android_do_pause(void *data)
3.8 -{
3.9 - if( dreamcast_is_running() ) {
3.10 - dreamcast_stop();
3.11 - }
3.12 - INFO( "Paused" );
3.13 - return 0;
3.14 -}
3.15 -
3.16 -int android_do_resume(void *data)
3.17 -{
3.18 - INFO( "Resumed" );
3.19 - return 0;
3.20 -}
3.21 -
3.22 int android_clear_surface(void *data)
3.23 {
3.24 struct surface_info *surface = (struct surface_info *)data;
3.25 @@ -304,17 +289,6 @@
3.26 tqueue_send_message( android_callback_wrapper, dreamcast_stop );
3.27 }
3.28
3.29 -JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_onAppPause(JNIEnv * env, jclass obj)
3.30 -{
3.31 - /* Need to make sure this completely shuts down before we return */
3.32 - tqueue_send_message( android_do_pause, &current_surface );
3.33 -}
3.34 -
3.35 -JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_onAppResume(JNIEnv * env, jclass obj)
3.36 -{
3.37 - tqueue_post_message( android_do_resume, &current_surface );
3.38 -}
3.39 -
3.40 JNIEXPORT jboolean JNICALL Java_org_lxdream_Dreamcast_isRunning(JNIEnv *env, jclass obj)
3.41 {
3.42 return dreamcast_is_running();
.