From 177077c6563245504e4aa443cce3bdba7c65db42 Mon Sep 17 00:00:00 2001 From: cpasjuste Date: Thu, 23 Apr 2020 09:56:49 +0200 Subject: switch: enable sound and keyboard button by default, disable joysticks for now --- src/maingui.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/maingui.cpp') diff --git a/src/maingui.cpp b/src/maingui.cpp index be25ded1d..f10c0efe7 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -97,26 +97,32 @@ PRAGMA48(GCC diagnostic pop) #include "debug.h" -#if defined(__SWITCH__) && !defined(NDEBUG) +#ifdef __SWITCH__ extern "C" { #include #include } +#ifndef NDEBUG #include static int sock = -1; -void initNxLink() { +#endif +void nxInit() { socketInitializeDefault(); +#ifndef NDEBUG sock = nxlinkStdio(); if (sock < 0) { socketExit(); } +#endif } -void deinitNxLink() { +void NxDeinit() { +#ifndef NDEBUG if (sock >= 0) { close(sock); - socketExit(); sock = -1; } +#endif + socketExit(); } #endif @@ -130,8 +136,8 @@ int main(int argc, char *argv[]) int mainGui(int argc, char *argv[]) #endif // ANDROID { -#if defined(__SWITCH__) && !defined(NDEBUG) - initNxLink(); +#ifdef __SWITCH__ + nxInit(); #endif #if defined(__MINGW32__) // load mingw crash handler. Won't fail if dll is not present. @@ -185,8 +191,8 @@ int mainGui(int argc, char *argv[]) IMG_Quit(); #endif // SDL_IMAGE_VERSION_ATLEAST(1, 2, 11) -#if defined(__SWITCH__) && !defined(NDEBUG) - deinitNxLink(); +#ifdef __SWITCH__ + NxDeinit(); #endif return ret; -- cgit v1.2.3-70-g09d2