mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-23 01:59:22 +01:00
Fixed swapping screens on landscape displays forcing portrait layout
This commit is contained in:
parent
3188aa489f
commit
8af024bddb
@ -29,6 +29,8 @@ add_library(lime-android SHARED
|
||||
ndk_motion.h
|
||||
system_save_game.cpp
|
||||
native_log.cpp
|
||||
util.cpp
|
||||
util.h
|
||||
)
|
||||
|
||||
target_link_libraries(lime-android PRIVATE audio_core lime_common lime_core input_common network)
|
||||
|
@ -13,14 +13,10 @@
|
||||
#include "jni/emu_window/emu_window.h"
|
||||
#include "jni/id_cache.h"
|
||||
#include "jni/input_manager.h"
|
||||
#include "jni/util.h"
|
||||
#include "network/network.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
|
||||
static bool IsPortraitMode() {
|
||||
return JNI_FALSE != IDCache::GetEnvForThread()->CallStaticBooleanMethod(
|
||||
IDCache::GetNativeLibraryClass(), IDCache::GetIsPortraitMode());
|
||||
}
|
||||
|
||||
bool EmuWindow_Android::OnSurfaceChanged(ANativeWindow* surface) {
|
||||
if (render_window == surface) {
|
||||
return false;
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "jni/id_cache.h"
|
||||
#include "jni/input_manager.h"
|
||||
#include "jni/ndk_motion.h"
|
||||
#include "jni/util.h"
|
||||
#include "video_core/debug_utils/debug_utils.h"
|
||||
#include "video_core/gpu.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
@ -364,7 +365,7 @@ void Java_io_github_lime3ds_android_NativeLibrary_swapScreens([[maybe_unused]] J
|
||||
Settings::values.swap_screen = swap_screens;
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (system.IsPoweredOn()) {
|
||||
system.GPU().Renderer().UpdateCurrentFramebufferLayout(!(rotation % 2));
|
||||
system.GPU().Renderer().UpdateCurrentFramebufferLayout(IsPortraitMode());
|
||||
}
|
||||
InputManager::screen_rotation = rotation;
|
||||
Camera::NDK::g_rotation = rotation;
|
||||
|
10
src/android/app/src/main/jni/util.cpp
Normal file
10
src/android/app/src/main/jni/util.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright Citra Emulator Project / Lime3DS Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "jni/id_cache.h"
|
||||
|
||||
bool IsPortraitMode() {
|
||||
return JNI_FALSE != IDCache::GetEnvForThread()->CallStaticBooleanMethod(
|
||||
IDCache::GetNativeLibraryClass(), IDCache::GetIsPortraitMode());
|
||||
}
|
8
src/android/app/src/main/jni/util.h
Normal file
8
src/android/app/src/main/jni/util.h
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright Citra Emulator Project / Lime3DS Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
/// Calls and returns the value of NativeLibrary.isPortraitMode
|
||||
bool IsPortraitMode();
|
Loading…
Reference in New Issue
Block a user