summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorAdrian Graber <adrian@adriangraber.com>2021-07-04 18:52:48 +0200
committerAdrian Graber <adrian@adriangraber.com>2021-07-13 00:49:13 +0200
commit28f266302fbeea2d75d5a62de651d464ab380798 (patch)
treee9ae6bc810489c798e6bb3f27d75afe803c7f9ae /src/core
parentf50026828ad3bfb656496b3321b8e6b5c71fc7b1 (diff)
Add Nintendo Switch initial support
Diffstat (limited to 'src/core')
-rw-r--r--src/core/common.h4
-rw-r--r--src/core/config.h9
-rw-r--r--src/core/re3.cpp2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/core/common.h b/src/core/common.h
index da162762..99aafc5a 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -11,6 +11,10 @@
#define __STDC_LIMIT_MACROS // so we get UINT32_MAX etc
#endif
+#ifdef GTA_SWITCH
+#include <switch.h>
+#endif
+
#include <stdint.h>
#include <string.h>
#include <math.h>
diff --git a/src/core/config.h b/src/core/config.h
index 885f98b8..edb5fb5a 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -319,7 +319,7 @@ enum Config {
#if !defined(RW_GL3) && defined(_WIN32)
#define XINPUT
#endif
-#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined __SWITCH__)
+#if defined XINPUT || (defined RW_GL3 && !defined LIBRW_SDL2 && !defined GTA_SWITCH)
#define DETECT_JOYSTICK_MENU // Then we'll expect user to enter Controller->Detect joysticks if his joystick isn't detected at the start.
#endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
@@ -439,7 +439,7 @@ enum Config {
#endif
// Streaming
-#if !defined(_WIN32) && !defined(__SWITCH__)
+#if !defined(_WIN32) && !defined(GTA_SWITCH)
//#define ONE_THREAD_PER_CHANNEL // Don't use if you're not on SSD/Flash - also not utilized too much right now(see commented LoadAllRequestedModels in Streaming.cpp)
#define FLUSHABLE_STREAMING // Make it possible to interrupt reading when processing file isn't needed anymore.
#endif
@@ -461,4 +461,9 @@ enum Config {
#undef PEDS_REPORT_CRIMES_ON_PHONE
#endif
+#ifdef GTA_SWITCH
+ #define IGNORE_MOUSE_KEYBOARD // ignore mouse & keyboard input
+ #define USE_UNNAMED_SEM // named semaphores are unsupported on the switch
+#endif
+
#endif // VANILLA_DEFINES
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index b7d89363..40be153a 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -45,9 +45,7 @@
#include "Population.h"
#include "IniFile.h"
-#ifdef DETECT_JOYSTICK_MENU
#include "crossplatform.h"
-#endif
#ifndef _WIN32
#include "assert.h"