From fae5ba054cf9b82da218cfc4df7686f13d3107d3 Mon Sep 17 00:00:00 2001
From: cpasjuste <cpasjuste@gmail.com>
Date: Fri, 24 Apr 2020 13:29:55 +0200
Subject: switch: add escape button (+) switch: change default screen size

---
 src/const/render/graphics.h |  5 +++++
 src/input/inputactionmap.h  | 20 ++++++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/const/render/graphics.h b/src/const/render/graphics.h
index c30c2fd57..3ce01edd5 100644
--- a/src/const/render/graphics.h
+++ b/src/const/render/graphics.h
@@ -25,7 +25,12 @@
 
 #include "localconsts.h"
 
+#ifdef __SWITCH__
+static const int defaultScreenWidth = 1280;
+static const int defaultScreenHeight = 720;
+#else
 static const int defaultScreenWidth = 800;
 static const int defaultScreenHeight = 600;
+#endif
 
 #endif  // CONST_RENDER_GRAPHICS_H
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index ba8830130..9a7983312 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -351,11 +351,15 @@ static const InputActionData inputActionData
         Protected_false},
     {"keyQuit",
         addKey(SDLK_ESCAPE),
-#if defined(USE_SDL2) && defined(ANDROID)
+#if defined(USE_SDL2)
+#if defined(ANDROID)
         addKey(SDLK_AC_BACK),
-#else  // defined(USE_SDL2) && defined(ANDROID)
+#elif defined(__SWITCH__)
+        joystickButton(10),
+#else
         emptyKey,
-#endif  // defined(USE_SDL2) && defined(ANDROID)
+#endif
+#endif  // defined(USE_SDL2)
         Input::GRP_DEFAULT,
         &Actions::quit,
         InputAction::NO_VALUE, 50,
@@ -2779,11 +2783,15 @@ static const InputActionData inputActionData
         Protected_false},
     {"keyGUICancel",
         addKey(SDLK_ESCAPE),
-#if defined(USE_SDL2) && defined(ANDROID)
+#if defined(USE_SDL2)
+#if defined(ANDROID)
         addKey(SDLK_AC_BACK),
-#else  // defined(USE_SDL2) && defined(ANDROID)
+#elif defined(__SWITCH__)
+        joystickButton(10),
+#else
         emptyKey,
-#endif  // defined(USE_SDL2) && defined(ANDROID)
+#endif
+#endif  // defined(USE_SDL2)
         Input::GRP_GUICHAN,
         nullptr,
         InputAction::NO_VALUE, 50,
-- 
cgit v1.2.3-70-g09d2