summaryrefslogtreecommitdiffstats
path: root/platform/android/java_godot_io_wrapper.h
diff options
context:
space:
mode:
authorMatias N. Goldberg <dark_sylinc@yahoo.com.ar>2024-10-31 16:52:26 -0300
committerMatias N. Goldberg <dark_sylinc@yahoo.com.ar>2024-10-31 16:52:26 -0300
commitb9a2f108fc055de6a093fcec89624de0583da9cd (patch)
tree1e693c7257ec0819c3a85ae30b2b3ce1822718b9 /platform/android/java_godot_io_wrapper.h
parentef8d981267702de38ffc24136f9d823d31781c60 (diff)
downloadredot-engine-b9a2f108fc055de6a093fcec89624de0583da9cd.tar.gz
Fix splash screen upside down on Android
Fixes an issue introduced in #96439 (see https://github.com/godotengine/godot/pull/96439#issuecomment-2447288702) Godot was relying on Java's activity.getWindowManager().getDefaultDisplay().getRotation(); to apply pre-rotation but this is wrong. First, getRotation() may temporarily return a different value from the correct one; which is what was causing the splash screen to be upside down. It would return -90 instead of 90 for the first rendered frame. But unfortunately, the splash screen is just one frame rendered for a very long time, so the error lingered for a long time for everyone to see. Second, to determine what rotation to use, we should be looking at what Vulkan told us, which is the value we pass to VkSurfaceTransformFlagBitsKHR::preTransform. This commit removes the now-unnecessary screen_get_internal_current_rotation() function (which was introduced by #96439) and now saves the preTransform value in the swapchain.
Diffstat (limited to 'platform/android/java_godot_io_wrapper.h')
-rw-r--r--platform/android/java_godot_io_wrapper.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/platform/android/java_godot_io_wrapper.h b/platform/android/java_godot_io_wrapper.h
index 903bdce4be..0a372641cb 100644
--- a/platform/android/java_godot_io_wrapper.h
+++ b/platform/android/java_godot_io_wrapper.h
@@ -61,7 +61,6 @@ private:
jmethodID _has_hardware_keyboard = 0;
jmethodID _set_screen_orientation = 0;
jmethodID _get_screen_orientation = 0;
- jmethodID _get_internal_current_screen_rotation = 0;
jmethodID _get_system_dir = 0;
public:
@@ -89,7 +88,6 @@ public:
void set_vk_height(int p_height);
void set_screen_orientation(int p_orient);
int get_screen_orientation();
- int get_internal_current_screen_rotation();
String get_system_dir(int p_dir, bool p_shared_storage);
};