diff options
author | Matias N. Goldberg <dark_sylinc@yahoo.com.ar> | 2024-10-31 16:52:26 -0300 |
---|---|---|
committer | Matias N. Goldberg <dark_sylinc@yahoo.com.ar> | 2024-10-31 16:52:26 -0300 |
commit | b9a2f108fc055de6a093fcec89624de0583da9cd (patch) | |
tree | 1e693c7257ec0819c3a85ae30b2b3ce1822718b9 /platform/android/java | |
parent | ef8d981267702de38ffc24136f9d823d31781c60 (diff) | |
download | redot-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')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/GodotIO.java | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java index 5543745444..79751dd58f 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java @@ -296,28 +296,6 @@ public class GodotIO { } } - /** - This function is used by DisplayServer::screen_get_internal_current_rotation (C++) - and is used to implement a performance optimization in devices that do not offer - a HW rotator. - @return - Rotation in degrees, in multiples of 90° - */ - public int getInternalCurrentScreenRotation() { - int rotation = activity.getWindowManager().getDefaultDisplay().getRotation(); - - switch (rotation) { - case Surface.ROTATION_90: - return 90; - case Surface.ROTATION_180: - return 180; - case Surface.ROTATION_270: - return 270; - default: - return 0; - } - } - public void setEdit(GodotEditText _edit) { edit = _edit; } |