Android: Fix logo not displaying during loading
This commit is contained in:
parent
de33c7fa2b
commit
533722456b
|
@ -366,16 +366,26 @@ bool AndroidHostInterface::AcquireHostDisplay()
|
|||
!display->InitializeRenderDevice(GetShaderCacheBasePath(), g_settings.gpu_use_debug_device))
|
||||
{
|
||||
ReportError("Failed to acquire host display.");
|
||||
display->DestroyRenderDevice();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_display = std::move(display);
|
||||
|
||||
if (!CreateHostDisplayResources())
|
||||
{
|
||||
ReportError("Failed to create host display resources");
|
||||
ReleaseHostDisplay();
|
||||
return false;
|
||||
}
|
||||
|
||||
ImGui::NewFrame();
|
||||
return true;
|
||||
}
|
||||
|
||||
void AndroidHostInterface::ReleaseHostDisplay()
|
||||
{
|
||||
ReleaseHostDisplayResources();
|
||||
m_display->DestroyRenderDevice();
|
||||
m_display.reset();
|
||||
}
|
||||
|
@ -830,3 +840,9 @@ DEFINE_JNI_ARGS_METHOD(void, AndroidHostInterface_setCheatEnabled, jobject obj,
|
|||
AndroidHostInterface* hi = AndroidHelpers::GetNativeClass(env, obj);
|
||||
hi->RunOnEmulationThread([index, enabled, hi]() { hi->SetCheatCodeState(static_cast<u32>(index), enabled, true); });
|
||||
}
|
||||
|
||||
DEFINE_JNI_ARGS_METHOD(void, AndroidHostInterface_addOSDMessage, jobject obj, jstring message, jfloat duration)
|
||||
{
|
||||
AndroidHostInterface* hi = AndroidHelpers::GetNativeClass(env, obj);
|
||||
hi->AddOSDMessage(AndroidHelpers::JStringToString(env, message), duration);
|
||||
}
|
||||
|
|
|
@ -74,6 +74,8 @@ public class AndroidHostInterface {
|
|||
public native CheatCode[] getCheatList();
|
||||
public native void setCheatEnabled(int index, boolean enabled);
|
||||
|
||||
public native void addOSDMessage(String message, float duration);
|
||||
|
||||
static {
|
||||
System.loadLibrary("duckstation-native");
|
||||
}
|
||||
|
|
|
@ -372,7 +372,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
private void showCheatsMenu() {
|
||||
final CheatCode[] cheats = AndroidHostInterface.getInstance().getCheatList();
|
||||
if (cheats == null) {
|
||||
Toast.makeText(this, "No cheats are loaded.", Toast.LENGTH_LONG);
|
||||
AndroidHostInterface.getInstance().addOSDMessage("No cheats are loaded.", 5.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue