mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-27 17:31:31 +00:00
[android] Modified compiliance of Android's Surface in older API's
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/api-level.h>
|
||||
#endif
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
@@ -170,9 +174,7 @@ bool Swapchain::AcquireNextImage() {
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
scheduler.Wait(resource_ticks[image_index]);
|
||||
#else
|
||||
const auto wait_with_frame_pacing = [this, image_index] {
|
||||
switch (Settings::values.frame_pacing_mode.GetValue()) {
|
||||
case Settings::FramePacingMode::Target_Auto:
|
||||
scheduler.Wait(resource_ticks[image_index]);
|
||||
@@ -190,6 +192,16 @@ bool Swapchain::AcquireNextImage() {
|
||||
scheduler.Wait(resource_ticks[image_index], 120.0);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __ANDROID__
|
||||
if (android_get_device_api_level() >= 30) {
|
||||
scheduler.Wait(resource_ticks[image_index]);
|
||||
} else {
|
||||
wait_with_frame_pacing();
|
||||
}
|
||||
#else
|
||||
wait_with_frame_pacing();
|
||||
#endif
|
||||
|
||||
resource_ticks[image_index] = scheduler.CurrentTick();
|
||||
|
||||
Reference in New Issue
Block a user