summaryrefslogtreecommitdiffstats
path: root/main/main.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-05-24 19:53:19 +0200
committerGitHub <noreply@github.com>2021-05-24 19:53:19 +0200
commitaf03e9c83018b47cb82da67e5f8e277b29b82d66 (patch)
tree4880b70a38730cde1a0c6879ec94326924190ae7 /main/main.cpp
parent215e43242c2a5b2ec5a8ccb4d26d716f965cbbd9 (diff)
parent660952a85773e959664376faf5c09e63aa613092 (diff)
downloadredot-engine-af03e9c83018b47cb82da67e5f8e277b29b82d66.tar.gz
Merge pull request #48939 from Calinou/screen-orientation-use-enum
Use an enum to represent screen orientation in the Project Settings
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 67d8d93728..2f191b5f63 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1327,23 +1327,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
{
- String orientation = GLOBAL_DEF("display/window/handheld/orientation", "landscape");
-
- if (orientation == "portrait") {
- window_orientation = DisplayServer::SCREEN_PORTRAIT;
- } else if (orientation == "reverse_landscape") {
- window_orientation = DisplayServer::SCREEN_REVERSE_LANDSCAPE;
- } else if (orientation == "reverse_portrait") {
- window_orientation = DisplayServer::SCREEN_REVERSE_PORTRAIT;
- } else if (orientation == "sensor_landscape") {
- window_orientation = DisplayServer::SCREEN_SENSOR_LANDSCAPE;
- } else if (orientation == "sensor_portrait") {
- window_orientation = DisplayServer::SCREEN_SENSOR_PORTRAIT;
- } else if (orientation == "sensor") {
- window_orientation = DisplayServer::SCREEN_SENSOR;
- } else {
- window_orientation = DisplayServer::SCREEN_LANDSCAPE;
- }
+ window_orientation = DisplayServer::ScreenOrientation(int(GLOBAL_DEF_BASIC("display/window/handheld/orientation", DisplayServer::ScreenOrientation::SCREEN_LANDSCAPE)));
}
Engine::get_singleton()->set_iterations_per_second(GLOBAL_DEF_BASIC("physics/common/physics_fps", 60));