From 0e993ff6d4118fbcfa1e762e72a42aebfdbc3bc1 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 26 May 2024 18:04:17 +1000 Subject: [PATCH] Move autogenerated header files out of src directory --- src/_CCIcon_X11.h => misc/linux/CCIcon_X11.h | 0 src/_CCIcon_mac.h => misc/macOS/CCIcon_mac.h | 0 src/_D3D11Shaders.h => misc/windows/D3D11Shaders.h | 0 src/Graphics_D3D11.c | 2 +- src/Menus.c | 11 ++++++++--- src/VirtualKeyboard.h | 4 ++-- src/Window_X11.c | 4 ++-- src/interop_cocoa.m | 4 ++-- 8 files changed, 15 insertions(+), 10 deletions(-) rename src/_CCIcon_X11.h => misc/linux/CCIcon_X11.h (100%) rename src/_CCIcon_mac.h => misc/macOS/CCIcon_mac.h (100%) rename src/_D3D11Shaders.h => misc/windows/D3D11Shaders.h (100%) diff --git a/src/_CCIcon_X11.h b/misc/linux/CCIcon_X11.h similarity index 100% rename from src/_CCIcon_X11.h rename to misc/linux/CCIcon_X11.h diff --git a/src/_CCIcon_mac.h b/misc/macOS/CCIcon_mac.h similarity index 100% rename from src/_CCIcon_mac.h rename to misc/macOS/CCIcon_mac.h diff --git a/src/_D3D11Shaders.h b/misc/windows/D3D11Shaders.h similarity index 100% rename from src/_D3D11Shaders.h rename to misc/windows/D3D11Shaders.h diff --git a/src/Graphics_D3D11.c b/src/Graphics_D3D11.c index 538461caa..a6005ac4a 100644 --- a/src/Graphics_D3D11.c +++ b/src/Graphics_D3D11.c @@ -3,7 +3,7 @@ #include "_GraphicsBase.h" #include "Errors.h" #include "Window.h" -#include "_D3D11Shaders.h" +#include "../misc/windows/D3D11Shaders.h" /* Avoid pointless includes */ #define WIN32_LEAN_AND_MEAN diff --git a/src/Menus.c b/src/Menus.c index 00b2f0627..3444127ec 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -1943,14 +1943,19 @@ static struct KeyBindsScreen { static struct Widget* key_widgets[KEYBINDS_MAX_BTNS + 5]; +static BindMapping KeyBindsScreen_GetBinding(struct KeyBindsScreen* s, int i) { + const BindMapping* curBinds; + + curBinds = binds_gamepad ? PadBind_Mappings : KeyBind_Mappings; + return curBinds[s->binds[i]]; +} + static void KeyBindsScreen_Update(struct KeyBindsScreen* s, int i) { cc_string text; char textBuffer[STRING_SIZE]; - const BindMapping* curBinds; BindMapping curBind; String_InitArray(text, textBuffer); - curBinds = binds_gamepad ? PadBind_Mappings : KeyBind_Mappings; - curBind = curBinds[s->binds[i]]; + curBind = KeyBindsScreen_GetBinding(s, i); String_Format4(&text, s->curI == i ? "> %c: %c%c%c <" : "%c: %c%c%c", s->descs[i], diff --git a/src/VirtualKeyboard.h b/src/VirtualKeyboard.h index cf041b5bf..93012a37e 100644 --- a/src/VirtualKeyboard.h +++ b/src/VirtualKeyboard.h @@ -206,9 +206,9 @@ static void VirtualKeyboard_ProcessDown(void* obj, int key, cc_bool was) { } else if (key == CCPAD_X) { VirtualKeyboard_Backspace(); } else if (key == CCPAD_Y) { - VirtualKeyboard_AppendChar(' '); - } else if (key == CCPAD_L) { VirtualKeyboard_AppendChar('@'); + } else if (key == CCPAD_L) { + VirtualKeyboard_AppendChar(' '); } else if (key == CCPAD_R) { VirtualKeyboard_AppendChar('/'); } diff --git a/src/Window_X11.c b/src/Window_X11.c index 6fbaf74a8..1df262f4f 100644 --- a/src/Window_X11.c +++ b/src/Window_X11.c @@ -309,8 +309,8 @@ void Window_Init(void) { void Window_Free(void) { } #ifdef CC_BUILD_ICON -/* See misc/linux_icon_gen.cs for how to generate this file */ -#include "_CCIcon_X11.h" +/* See misc/linux/linux_icon_gen.cs for how to generate this file */ +#include "../misc/linux/CCIcon_X11.h" static void ApplyIcon(void) { Atom net_wm_icon = XInternAtom(win_display, "_NET_WM_ICON", false); diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index 10b076d61..ba310e65c 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -322,8 +322,8 @@ static void MakeContentView(void) { } #ifdef CC_BUILD_ICON -// See misc/mac_icon_gen.cs for how to generate this file -#include "_CCIcon_mac.h" +// See misc/macOS/mac_icon_gen.cs for how to generate this file +#include "../misc/macOS/CCIcon_mac.h" static void ApplyIcon(void) { NSImage* img;