32x/GBA: Disable menu UI code altogether

This commit is contained in:
UnknownShadow200 2025-02-17 18:15:11 +11:00
parent 876b81cc45
commit ad80542a57
8 changed files with 30 additions and 19 deletions

View File

@ -359,6 +359,7 @@ typedef cc_uint8 cc_bool;
#undef CC_BUILD_RESOURCES #undef CC_BUILD_RESOURCES
#undef CC_BUILD_PLUGINS #undef CC_BUILD_PLUGINS
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL2 #define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL2
#define CC_DISABLE_LAUNCHER
#elif defined __psp__ #elif defined __psp__
#define CC_BUILD_PSP #define CC_BUILD_PSP
#define CC_BUILD_CONSOLE #define CC_BUILD_CONSOLE
@ -444,6 +445,7 @@ typedef cc_uint8 cc_bool;
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN #define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
#define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */ #define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */
#define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */ #define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */
#define CC_DISABLE_UI
#undef CC_BUILD_ADVLIGHTING #undef CC_BUILD_ADVLIGHTING
#undef CC_BUILD_FILESYSTEM #undef CC_BUILD_FILESYSTEM
#define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU #define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU
@ -538,6 +540,7 @@ typedef cc_uint8 cc_bool;
#undef CC_BUILD_NETWORKING #undef CC_BUILD_NETWORKING
#define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */ #define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */
#define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */ #define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */
#define CC_DISABLE_UI
#undef CC_BUILD_ADVLIGHTING #undef CC_BUILD_ADVLIGHTING
#undef CC_BUILD_FILESYSTEM #undef CC_BUILD_FILESYSTEM
#define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU #define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU

View File

@ -303,11 +303,13 @@ void Gui_UpdateInputGrab(void) {
} }
void Gui_ShowPauseMenu(void) { void Gui_ShowPauseMenu(void) {
#ifndef CC_DISABLE_UI
if (Gui.ClassicMenu) { if (Gui.ClassicMenu) {
ClassicPauseScreen_Show(); ClassicPauseScreen_Show();
} else { } else {
PauseScreen_Show(); PauseScreen_Show();
} }
#endif
} }
void Gui_ShowCinematicBars() { void Gui_ShowCinematicBars() {

View File

@ -1,6 +1,6 @@
#include "LBackend.h" #include "LBackend.h"
#if defined CC_BUILD_WEB #if defined CC_DISABLE_LAUNCHER
/* Web backend doesn't use the launcher */ /* e.g. web backend doesn't use the launcher */
#elif defined CC_BUILD_WIN_TEST #elif defined CC_BUILD_WIN_TEST
/* Testing windows UI backend */ /* Testing windows UI backend */
#include "LBackend_Win.c" #include "LBackend_Win.c"

View File

@ -1,5 +1,5 @@
#include "LScreens.h" #include "LScreens.h"
#ifndef CC_BUILD_WEB #ifndef CC_DISABLE_LAUNCHER
#include "String.h" #include "String.h"
#include "LWidgets.h" #include "LWidgets.h"
#include "LWeb.h" #include "LWeb.h"

View File

@ -1,5 +1,5 @@
#include "LWeb.h" #include "LWeb.h"
#ifndef CC_BUILD_WEB #ifndef CC_DISABLE_LAUNCHER
#include "String.h" #include "String.h"
#include "Launcher.h" #include "Launcher.h"
#include "Platform.h" #include "Platform.h"

View File

@ -1,5 +1,5 @@
#include "LWidgets.h" #include "LWidgets.h"
#ifndef CC_BUILD_WEB #ifndef CC_DISABLE_LAUNCHER
#include "String.h" #include "String.h"
#include "Gui.h" #include "Gui.h"
#include "Drawer2D.h" #include "Drawer2D.h"

View File

@ -186,6 +186,7 @@ int Menu_InputDown(void* screen, int key, struct InputDevice* device) {
/*########################################################################################################################* /*########################################################################################################################*
*------------------------------------------------------Menu utilities-----------------------------------------------------* *------------------------------------------------------Menu utilities-----------------------------------------------------*
*#########################################################################################################################*/ *#########################################################################################################################*/
#ifndef CC_DISABLE_UI
static void Menu_BeginGen(int width, int height, int length) { static void Menu_BeginGen(int width, int height, int length) {
World_NewMap(); World_NewMap();
World_SetDimensions(width, height, length); World_SetDimensions(width, height, length);
@ -242,7 +243,7 @@ static struct ListScreen {
const char* titleText; const char* titleText;
struct TextWidget title; struct TextWidget title;
struct StringsBuffer entries; struct StringsBuffer entries;
} ListScreen CC_BIG_VAR; } ListScreen;
static struct Widget* list_widgets[LIST_SCREEN_ITEMS + 4 + 1]; static struct Widget* list_widgets[LIST_SCREEN_ITEMS + 4 + 1];
#define LISTSCREEN_EMPTY "-" #define LISTSCREEN_EMPTY "-"
@ -472,7 +473,7 @@ static struct PauseScreen {
const struct SimpleButtonDesc* descs; const struct SimpleButtonDesc* descs;
struct ButtonWidget btns[PAUSE_MAX_BTNS], quit, back; struct ButtonWidget btns[PAUSE_MAX_BTNS], quit, back;
struct TextWidget title; struct TextWidget title;
} PauseScreen CC_BIG_VAR; } PauseScreen;
static void PauseScreenBase_Quit(void* a, void* b) { static void PauseScreenBase_Quit(void* a, void* b) {
Window_RequestClose(); Window_RequestClose();
@ -645,7 +646,7 @@ static struct OptionsGroupScreen {
struct ButtonWidget btns[8]; struct ButtonWidget btns[8];
struct TextWidget desc; struct TextWidget desc;
struct ButtonWidget done; struct ButtonWidget done;
} OptionsGroupScreen CC_BIG_VAR; } OptionsGroupScreen;
static struct Widget* optGroups_widgets[8 + 2]; static struct Widget* optGroups_widgets[8 + 2];
@ -769,7 +770,7 @@ static struct EditHotkeyScreen {
struct FontDesc titleFont, textFont; struct FontDesc titleFont, textFont;
struct TextInputWidget input; struct TextInputWidget input;
struct ButtonWidget btns[5], cancel; struct ButtonWidget btns[5], cancel;
} EditHotkeyScreen CC_BIG_VAR; } EditHotkeyScreen;
static struct Widget* edithotkey_widgets[1 + 5 + 1]; static struct Widget* edithotkey_widgets[1 + 5 + 1];
@ -1028,7 +1029,7 @@ static struct GenLevelScreen {
struct ButtonWidget flatgrass, vanilla, cancel; struct ButtonWidget flatgrass, vanilla, cancel;
struct TextInputWidget inputs[4]; struct TextInputWidget inputs[4];
struct TextWidget labels[4], title; struct TextWidget labels[4], title;
} GenLevelScreen CC_BIG_VAR; } GenLevelScreen;
#define GENLEVEL_NUM_INPUTS 4 #define GENLEVEL_NUM_INPUTS 4
static struct Widget* gen_widgets[2 * GENLEVEL_NUM_INPUTS + 4]; static struct Widget* gen_widgets[2 * GENLEVEL_NUM_INPUTS + 4];
@ -1234,7 +1235,7 @@ static struct ClassicGenScreen {
Screen_Body Screen_Body
struct ButtonWidget btns[3], cancel; struct ButtonWidget btns[3], cancel;
struct TextWidget title; struct TextWidget title;
} ClassicGenScreen CC_BIG_VAR; } ClassicGenScreen;
static struct Widget* classicgen_widgets[1 + 3 + 1]; static struct Widget* classicgen_widgets[1 + 3 + 1];
@ -1315,7 +1316,7 @@ static struct SaveLevelScreen {
struct ButtonWidget save, file, cancel; struct ButtonWidget save, file, cancel;
struct TextInputWidget input; struct TextInputWidget input;
struct TextWidget desc; struct TextWidget desc;
} SaveLevelScreen CC_BIG_VAR; } SaveLevelScreen;
static struct Widget* save_widgets[3 + 1 + 1]; static struct Widget* save_widgets[3 + 1 + 1];
@ -1860,7 +1861,7 @@ void LoadLevelScreen_Show(void) {
static struct BindsSourceScreen { static struct BindsSourceScreen {
Screen_Body Screen_Body
struct ButtonWidget btns[2], cancel; struct ButtonWidget btns[2], cancel;
} BindsSourceScreen CC_BIG_VAR; } BindsSourceScreen;
static struct InputDevice* bind_device; static struct InputDevice* bind_device;
static struct Widget* bindsSource_widgets[3]; static struct Widget* bindsSource_widgets[3];
@ -1958,7 +1959,7 @@ static struct KeyBindsScreen {
struct TextWidget title, msg; struct TextWidget title, msg;
struct ButtonWidget back, left, right; struct ButtonWidget back, left, right;
struct ButtonWidget buttons[KEYBINDS_MAX_BTNS]; struct ButtonWidget buttons[KEYBINDS_MAX_BTNS];
} KeyBindsScreen CC_BIG_VAR; } KeyBindsScreen;
static struct Widget* key_widgets[KEYBINDS_MAX_BTNS + 5]; static struct Widget* key_widgets[KEYBINDS_MAX_BTNS + 5];
@ -2248,7 +2249,7 @@ static struct MenuInputOverlay {
struct MenuInputDesc* desc; struct MenuInputDesc* desc;
MenuInputDone onDone; MenuInputDone onDone;
cc_string value; char valueBuffer[STRING_SIZE]; cc_string value; char valueBuffer[STRING_SIZE];
} MenuInputOverlay CC_BIG_VAR; } MenuInputOverlay;
static struct Widget* menuInput_widgets[2 + 1]; static struct Widget* menuInput_widgets[2 + 1];
@ -2441,7 +2442,7 @@ static struct TexIdsOverlay {
int xOffset, yOffset, tileSize, textVertices; int xOffset, yOffset, tileSize, textVertices;
struct TextAtlas idAtlas; struct TextAtlas idAtlas;
struct TextWidget title; struct TextWidget title;
} TexIdsOverlay CC_BIG_VAR; } TexIdsOverlay;
static struct Widget* texids_widgets[1]; static struct Widget* texids_widgets[1];
#define TEXIDS_MAX_ROWS_PER_PAGE 16 #define TEXIDS_MAX_ROWS_PER_PAGE 16
@ -2639,7 +2640,7 @@ static struct UrlWarningOverlay {
struct ButtonWidget btns[2]; struct ButtonWidget btns[2];
struct TextWidget lbls[4]; struct TextWidget lbls[4];
char _urlBuffer[STRING_SIZE * 4]; char _urlBuffer[STRING_SIZE * 4];
} UrlWarningOverlay CC_BIG_VAR; } UrlWarningOverlay;
static struct Widget* urlwarning_widgets[4 + 2]; static struct Widget* urlwarning_widgets[4 + 2];
@ -2726,7 +2727,7 @@ static struct TexPackOverlay {
struct ButtonWidget btns[4]; struct ButtonWidget btns[4];
struct TextWidget lbls[4]; struct TextWidget lbls[4];
char _urlBuffer[URL_MAX_SIZE]; char _urlBuffer[URL_MAX_SIZE];
} TexPackOverlay CC_BIG_VAR; } TexPackOverlay;
static struct Widget* texpack_widgets[4 + 4]; static struct Widget* texpack_widgets[4 + 4];
@ -2910,7 +2911,7 @@ static struct NostalgiaMenuScreen {
Screen_Body Screen_Body
struct ButtonWidget btnA, btnF, done; struct ButtonWidget btnA, btnF, done;
struct TextWidget title; struct TextWidget title;
} NostalgiaMenuScreen CC_BIG_VAR; } NostalgiaMenuScreen;
static struct Widget* nostalgiaMenu_widgets[4]; static struct Widget* nostalgiaMenu_widgets[4];
@ -2972,3 +2973,7 @@ void NostalgiaMenuScreen_Show(void) {
s->VTABLE = &NostalgiaMenuScreen_VTABLE; s->VTABLE = &NostalgiaMenuScreen_VTABLE;
Gui_Add((struct Screen*)s, GUI_PRIORITY_MENU); Gui_Add((struct Screen*)s, GUI_PRIORITY_MENU);
} }
#else
void TexIdsOverlay_Show(void) { }
void UrlWarningOverlay_Show(const cc_string* url) { }
#endif

View File

@ -437,6 +437,7 @@ void HUDScreen_Show(void) {
*----------------------------------------------------TabListOverlay-----------------------------------------------------* *----------------------------------------------------TabListOverlay-----------------------------------------------------*
*#########################################################################################################################*/ *#########################################################################################################################*/
#ifdef CC_BUILD_NETWORKING #ifdef CC_BUILD_NETWORKING
#define GROUP_NAME_ID UInt16_MaxValue #define GROUP_NAME_ID UInt16_MaxValue
#define LIST_COLUMN_PADDING 5 #define LIST_COLUMN_PADDING 5
#define LIST_NAMES_PER_COLUMN 16 #define LIST_NAMES_PER_COLUMN 16