mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-25 10:52:48 -06:00
Merge pull request #11992 from t895/frame-check
android: Hide loading animation on first frame
This commit is contained in:
commit
1906e2724f
4 changed files with 13 additions and 4 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "input_common/drivers/virtual_gamepad.h"
|
||||
#include "input_common/main.h"
|
||||
#include "jni/emu_window/emu_window.h"
|
||||
#include "jni/native.h"
|
||||
|
||||
void EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) {
|
||||
m_window_width = ANativeWindow_getWidth(surface);
|
||||
|
@ -57,6 +58,13 @@ void EmuWindow_Android::OnRemoveNfcTag() {
|
|||
m_input_subsystem->GetVirtualAmiibo()->CloseAmiibo();
|
||||
}
|
||||
|
||||
void EmuWindow_Android::OnFrameDisplayed() {
|
||||
if (!m_first_frame) {
|
||||
EmulationSession::GetInstance().OnEmulationStarted();
|
||||
m_first_frame = true;
|
||||
}
|
||||
}
|
||||
|
||||
EmuWindow_Android::EmuWindow_Android(InputCommon::InputSubsystem* input_subsystem,
|
||||
ANativeWindow* surface,
|
||||
std::shared_ptr<Common::DynamicLibrary> driver_library)
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
float gyro_z, float accel_x, float accel_y, float accel_z);
|
||||
void OnReadNfcTag(std::span<u8> data);
|
||||
void OnRemoveNfcTag();
|
||||
void OnFrameDisplayed() override {}
|
||||
void OnFrameDisplayed() override;
|
||||
|
||||
std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override {
|
||||
return {std::make_unique<GraphicsContext_Android>(m_driver_library)};
|
||||
|
@ -61,4 +61,6 @@ private:
|
|||
float m_window_height{};
|
||||
|
||||
std::shared_ptr<Common::DynamicLibrary> m_driver_library;
|
||||
|
||||
bool m_first_frame = false;
|
||||
};
|
||||
|
|
|
@ -372,8 +372,6 @@ void EmulationSession::RunEmulation() {
|
|||
m_system.InitializeDebugger();
|
||||
}
|
||||
|
||||
OnEmulationStarted();
|
||||
|
||||
while (true) {
|
||||
{
|
||||
[[maybe_unused]] std::unique_lock lock(m_mutex);
|
||||
|
|
|
@ -52,9 +52,10 @@ public:
|
|||
void OnGamepadDisconnectEvent([[maybe_unused]] int index);
|
||||
SoftwareKeyboard::AndroidKeyboard* SoftwareKeyboard();
|
||||
|
||||
static void OnEmulationStarted();
|
||||
|
||||
private:
|
||||
static void LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, int max);
|
||||
static void OnEmulationStarted();
|
||||
static void OnEmulationStopped(Core::SystemResultStatus result);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue