Add HANDHELD build flag

This commit is contained in:
Agent X 2024-07-01 12:28:42 -04:00
parent 898b6ea937
commit a64cc6a77c
4 changed files with 18 additions and 0 deletions

View File

@ -59,6 +59,8 @@ HEADLESS ?= 0
ICON ?= 1 ICON ?= 1
# Use .app (for macOS) # Use .app (for macOS)
USE_APP ?= 1 USE_APP ?= 1
# Make some small adjustments for handheld devices
HANDHELD ?= 0
# Various workarounds for weird toolchains # Various workarounds for weird toolchains
NO_BZERO_BCOPY ?= 0 NO_BZERO_BCOPY ?= 0
@ -1031,6 +1033,12 @@ ifeq ($(ENHANCE_LEVEL_TEXTURES),1)
CFLAGS += -DENHANCE_LEVEL_TEXTURES CFLAGS += -DENHANCE_LEVEL_TEXTURES
endif endif
# Check for handheld option
ifeq ($(HANDHELD),1)
CC_CHECK_CFLAGS += -DHANDHELD
CFLAGS += -DHANDHELD
endif
# Check for no bzero/bcopy workaround option # Check for no bzero/bcopy workaround option
ifeq ($(NO_BZERO_BCOPY),1) ifeq ($(NO_BZERO_BCOPY),1)
CC_CHECK_CFLAGS += -DNO_BZERO_BCOPY CC_CHECK_CFLAGS += -DNO_BZERO_BCOPY

View File

@ -179,7 +179,11 @@ char configPassword[MAX_CONFIG_STRING] = "";
char configDestId[MAX_CONFIG_STRING] = "0"; char configDestId[MAX_CONFIG_STRING] = "0";
// DJUI settings // DJUI settings
unsigned int configDjuiTheme = DJUI_THEME_DARK; unsigned int configDjuiTheme = DJUI_THEME_DARK;
#ifdef HANDHELD
bool configDjuiThemeCenter = false;
#else
bool configDjuiThemeCenter = true; bool configDjuiThemeCenter = true;
#endif
unsigned int configDjuiThemeFont = FONT_NORMAL; unsigned int configDjuiThemeFont = FONT_NORMAL;
unsigned int configDjuiScale = 0; unsigned int configDjuiScale = 0;
// other // other
@ -239,7 +243,9 @@ static const struct ConfigOption options[] = {
{.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength}, {.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength},
{.name = "gamepad_number", .type = CONFIG_TYPE_UINT, .uintValue = &configGamepadNumber}, {.name = "gamepad_number", .type = CONFIG_TYPE_UINT, .uintValue = &configGamepadNumber},
{.name = "background_gamepad", .type = CONFIG_TYPE_UINT, .boolValue = &configBackgroundGamepad}, {.name = "background_gamepad", .type = CONFIG_TYPE_UINT, .boolValue = &configBackgroundGamepad},
#ifndef HANDHELD
{.name = "disable_gamepads", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisableGamepads}, {.name = "disable_gamepads", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisableGamepads},
#endif
{.name = "use_standard_key_bindings_chat", .type = CONFIG_TYPE_BOOL, .boolValue = &configUseStandardKeyBindingsChat}, {.name = "use_standard_key_bindings_chat", .type = CONFIG_TYPE_BOOL, .boolValue = &configUseStandardKeyBindingsChat},
// free camera settings // free camera settings
{.name = "bettercam_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configEnableCamera}, {.name = "bettercam_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configEnableCamera},

View File

@ -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, 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_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); djui_checkbox_create(body, DLANG(CONTROLS, BACKGROUND_GAMEPAD), &configBackgroundGamepad, NULL);
#ifndef HANDHELD
djui_checkbox_create(body, DLANG(CONTROLS, DISABLE_GAMEPADS), &configDisableGamepads, NULL); djui_checkbox_create(body, DLANG(CONTROLS, DISABLE_GAMEPADS), &configDisableGamepads, NULL);
#endif
djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL); djui_checkbox_create(body, DLANG(MISC, USE_STANDARD_KEY_BINDINGS_CHAT), &configUseStandardKeyBindingsChat, NULL);
#ifdef HAVE_SDL2 #ifdef HAVE_SDL2

View File

@ -76,10 +76,12 @@ void djui_panel_misc_create(struct DjuiBase* caller) {
#ifdef DEVELOPMENT #ifdef DEVELOPMENT
djui_button_create(body, DLANG(MISC, DEBUG), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_debug_create); djui_button_create(body, DLANG(MISC, DEBUG), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_debug_create);
#endif #endif
#ifndef HANDHELD
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
djui_button_create(body, DLANG(OPTIONS, APPDATA), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder); djui_button_create(body, DLANG(OPTIONS, APPDATA), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder);
#elif __linux__ || __APPLE__ || __MACH__ #elif __linux__ || __APPLE__ || __MACH__
djui_button_create(body, DLANG(OPTIONS, USER_FOLDER), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder); djui_button_create(body, DLANG(OPTIONS, USER_FOLDER), DJUI_BUTTON_STYLE_NORMAL, djui_panel_options_open_user_folder);
#endif
#endif #endif
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back); djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);
} }