From a64cc6a77c1a20c7e9bd8081ac07cb346a0799b2 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:28:42 -0400 Subject: [PATCH] Add HANDHELD build flag --- Makefile | 8 ++++++++ src/pc/configfile.c | 6 ++++++ src/pc/djui/djui_panel_controls.c | 2 ++ src/pc/djui/djui_panel_misc.c | 2 ++ 4 files changed, 18 insertions(+) diff --git a/Makefile b/Makefile index 5488b98c..b7caebcc 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,8 @@ HEADLESS ?= 0 ICON ?= 1 # Use .app (for macOS) USE_APP ?= 1 +# Make some small adjustments for handheld devices +HANDHELD ?= 0 # Various workarounds for weird toolchains NO_BZERO_BCOPY ?= 0 @@ -1031,6 +1033,12 @@ ifeq ($(ENHANCE_LEVEL_TEXTURES),1) CFLAGS += -DENHANCE_LEVEL_TEXTURES endif +# Check for handheld option +ifeq ($(HANDHELD),1) + CC_CHECK_CFLAGS += -DHANDHELD + CFLAGS += -DHANDHELD +endif + # Check for no bzero/bcopy workaround option ifeq ($(NO_BZERO_BCOPY),1) CC_CHECK_CFLAGS += -DNO_BZERO_BCOPY diff --git a/src/pc/configfile.c b/src/pc/configfile.c index a050afaf..e68b1b32 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -179,7 +179,11 @@ char configPassword[MAX_CONFIG_STRING] = ""; char configDestId[MAX_CONFIG_STRING] = "0"; // DJUI settings unsigned int configDjuiTheme = DJUI_THEME_DARK; +#ifdef HANDHELD +bool configDjuiThemeCenter = false; +#else bool configDjuiThemeCenter = true; +#endif unsigned int configDjuiThemeFont = FONT_NORMAL; unsigned int configDjuiScale = 0; // other @@ -239,7 +243,9 @@ static const struct ConfigOption options[] = { {.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength}, {.name = "gamepad_number", .type = CONFIG_TYPE_UINT, .uintValue = &configGamepadNumber}, {.name = "background_gamepad", .type = CONFIG_TYPE_UINT, .boolValue = &configBackgroundGamepad}, +#ifndef HANDHELD {.name = "disable_gamepads", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisableGamepads}, +#endif {.name = "use_standard_key_bindings_chat", .type = CONFIG_TYPE_BOOL, .boolValue = &configUseStandardKeyBindingsChat}, // free camera settings {.name = "bettercam_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configEnableCamera}, diff --git a/src/pc/djui/djui_panel_controls.c b/src/pc/djui/djui_panel_controls.c index a0b5357d..04ffc2ff 100644 --- a/src/pc/djui/djui_panel_controls.c +++ b/src/pc/djui/djui_panel_controls.c @@ -19,7 +19,9 @@ void djui_panel_controls_create(struct DjuiBase* caller) { djui_button_create(body, DLANG(CONTROLS, N64_BINDS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_controls_n64_create); djui_button_create(body, DLANG(CONTROLS, EXTRA_BINDS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_controls_extra_create); djui_checkbox_create(body, DLANG(CONTROLS, BACKGROUND_GAMEPAD), &configBackgroundGamepad, NULL); +#ifndef HANDHELD djui_checkbox_create(body, DLANG(CONTROLS, DISABLE_GAMEPADS), &configDisableGamepads, NULL); +#endif djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL); #ifdef HAVE_SDL2 diff --git a/src/pc/djui/djui_panel_misc.c b/src/pc/djui/djui_panel_misc.c index 4407f6ac..b3e8e560 100644 --- a/src/pc/djui/djui_panel_misc.c +++ b/src/pc/djui/djui_panel_misc.c @@ -76,10 +76,12 @@ void djui_panel_misc_create(struct DjuiBase* caller) { #ifdef DEVELOPMENT djui_button_create(body, DLANG(MISC, DEBUG), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_debug_create); #endif +#ifndef HANDHELD #if defined(_WIN32) || defined(_WIN64) djui_button_create(body, DLANG(OPTIONS, APPDATA), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder); #elif __linux__ || __APPLE__ || __MACH__ djui_button_create(body, DLANG(OPTIONS, USER_FOLDER), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder); +#endif #endif djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); }