From 3bde84f6c8480217b2fcd7ec29c28f62672a3279 Mon Sep 17 00:00:00 2001 From: Adrian Graber Date: Mon, 12 Jul 2021 01:26:11 +0200 Subject: [PATCH] Move assets to dedicated folder and redefine GLFW mappings for Switch --- README.md | 2 +- logo.svg => res/images/logo.svg | 0 logo.png => res/images/logo_1024.png | Bin logo_switch.jpg => res/images/logo_256.jpg | Bin src/CMakeLists.txt | 2 +- src/skel/crossplatform.h | 25 +++++++++++++++++++++ 6 files changed, 27 insertions(+), 2 deletions(-) rename logo.svg => res/images/logo.svg (100%) rename logo.png => res/images/logo_1024.png (100%) rename logo_switch.jpg => res/images/logo_256.jpg (100%) diff --git a/README.md b/README.md index 9ccabf1e..bcbecaba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -re3 logo +re3 logo [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=master) diff --git a/logo.svg b/res/images/logo.svg similarity index 100% rename from logo.svg rename to res/images/logo.svg diff --git a/logo.png b/res/images/logo_1024.png similarity index 100% rename from logo.png rename to res/images/logo_1024.png diff --git a/logo_switch.jpg b/res/images/logo_256.jpg similarity index 100% rename from logo_switch.jpg rename to res/images/logo_256.jpg diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cf10d0f..425f2315 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,7 +171,7 @@ if(NINTENDO_SWITCH) nx_create_nro(${EXECUTABLE} NACP ${EXECUTABLE}.nacp - ICON "${PROJECT_SOURCE_DIR}/logo_switch.jpg" + ICON "${PROJECT_SOURCE_DIR}/res/images/logo_256.jpg" ) if(${PROJECT}_INSTALL) diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index aa90ce5a..67bb4282 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -157,3 +157,28 @@ bool FindNextFile(HANDLE, WIN32_FIND_DATA*); void FileTimeToSystemTime(time_t*, SYSTEMTIME*); void GetDateFormat(int, int, SYSTEMTIME*, int, char*, int); #endif + +#ifdef __SWITCH__ + +// tweak glfw values for switch to match expected pc bindings +#ifdef GLFW_GAMEPAD_BUTTON_A + #undef GLFW_GAMEPAD_BUTTON_A +#endif +#define GLFW_GAMEPAD_BUTTON_A 1 + +#ifdef GLFW_GAMEPAD_BUTTON_B + #undef GLFW_GAMEPAD_BUTTON_B +#endif +#define GLFW_GAMEPAD_BUTTON_B 0 + +#ifdef GLFW_GAMEPAD_BUTTON_X + #undef GLFW_GAMEPAD_BUTTON_X +#endif +#define GLFW_GAMEPAD_BUTTON_X 3 + +#ifdef GLFW_GAMEPAD_BUTTON_Y + #undef GLFW_GAMEPAD_BUTTON_Y +#endif +#define GLFW_GAMEPAD_BUTTON_Y 2 + +#endif