mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
[Android] Fix the ability to stop the game and start another.
This commit is contained in:
parent
bab91494d5
commit
96a77f9feb
@ -2,7 +2,6 @@ package org.dolphinemu.dolphinemu;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -35,7 +35,10 @@ public final class NativeGLSurfaceView extends SurfaceView
|
|||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
NativeLibrary.Run(getHolder().getSurface());
|
NativeLibrary.Run(getHolder().getSurface());
|
||||||
|
Created = false;
|
||||||
|
Running = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -177,6 +177,8 @@ namespace ButtonManager
|
|||||||
delete *it;
|
delete *it;
|
||||||
for (auto it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
for (auto it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
||||||
delete it->second;
|
delete it->second;
|
||||||
|
m_controllers.clear();
|
||||||
|
m_buttons.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawButtons()
|
void DrawButtons()
|
||||||
|
@ -118,7 +118,7 @@ namespace ButtonManager
|
|||||||
~InputDevice()
|
~InputDevice()
|
||||||
{
|
{
|
||||||
for (auto it = m_binds.begin(); it != m_binds.end(); ++it)
|
for (auto it = m_binds.begin(); it != m_binds.end(); ++it)
|
||||||
delete it->second;
|
delete it->second;
|
||||||
}
|
}
|
||||||
void AddBind(sBind *bind) { m_binds[bind->m_buttontype] = bind; }
|
void AddBind(sBind *bind) { m_binds[bind->m_buttontype] = bind; }
|
||||||
void PressEvent(int button, int action);
|
void PressEvent(int button, int action);
|
||||||
|
@ -199,7 +199,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulati
|
|||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj)
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj)
|
||||||
{
|
{
|
||||||
PowerPC::Stop();
|
Core::Stop();
|
||||||
updateMainFrameEvent.Set(); // Kick the waiting event
|
updateMainFrameEvent.Set(); // Kick the waiting event
|
||||||
}
|
}
|
||||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onTouchEvent(JNIEnv *env, jobject obj, jint Action, jfloat X, jfloat Y)
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onTouchEvent(JNIEnv *env, jobject obj, jint Action, jfloat X, jfloat Y)
|
||||||
@ -358,6 +358,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
|||||||
VideoBackend::ClearList();
|
VideoBackend::ClearList();
|
||||||
SConfig::Shutdown();
|
SConfig::Shutdown();
|
||||||
LogManager::Shutdown();
|
LogManager::Shutdown();
|
||||||
|
ANativeWindow_release(surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,6 +84,10 @@ void DoCallbacks(CallbackType type)
|
|||||||
{
|
{
|
||||||
it->second();
|
it->second();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wipe all callbacks on shutdown
|
||||||
|
if (type == OSD_SHUTDOWN)
|
||||||
|
s_callbacks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user