Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Crispy HUD #2077

Merged
merged 7 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,040 changes: 1,040 additions & 0 deletions base/all-all/sbardef.lmp

Large diffs are not rendered by default.

1,040 changes: 1,040 additions & 0 deletions base/extras.wad/sbardef.lmp

Large diffs are not rendered by default.

1,040 changes: 1,040 additions & 0 deletions base/id1.wad/sbardef.lmp

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/mn_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ typedef enum
key_mode
} menu_input_mode_t;

extern int maxscreenblocks;

extern int bigfont_priority;

extern menu_input_mode_t help_input, old_help_input; // pad_mode or key_mode.
Expand Down
6 changes: 3 additions & 3 deletions src/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

// Blocky mode, has default, 0 = high, 1 = normal
// int detailLevel; obsolete -- killough
int screenblocks; // has default
int screenblocks, maxscreenblocks; // has default

static int quickSaveSlot; // -1 = no quicksave slot picked!

Expand Down Expand Up @@ -147,7 +147,7 @@
CHOICE_VALUE = 0,
} mchoice_t;

typedef struct

Check warning on line 150 in src/mn_menu.c

View workflow job for this annotation

GitHub Actions / Clang-Tidy

src/mn_menu.c:150:9 [clang-analyzer-optin.performance.Padding]

Excessive padding in 'menuitem_t' (15 padding bytes, where 7 is optimal). Optimal fields order: routine, alttext, flags, status, rect, alphaKey, name, consider reordering the fields or adding explicit padding members
{
short status; // 0 = no cursor here, 1 = ok, 2 = arrows ok
char name[10];
Expand Down Expand Up @@ -1798,7 +1798,7 @@
default:
break;
}
screenblocks = BETWEEN(3, 12, screenblocks);
screenblocks = BETWEEN(3, maxscreenblocks, screenblocks);
R_SetViewSize(screenblocks /*, detailLevel obsolete -- killough */);
}

Expand Down Expand Up @@ -2549,7 +2549,7 @@
else
{
++screenblocks;
if (screenblocks > 12)
if (screenblocks > maxscreenblocks)
{
screenblocks = 10;
}
Expand Down
32 changes: 25 additions & 7 deletions src/mn_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,12 +1816,6 @@ static void RefreshSolidBackground(void)
st_refresh_background = true;
}

static const char *screensize_strings[] = {
"", "", "", "Status Bar", "Status Bar",
"Status Bar", "Status Bar", "Status Bar", "Status Bar", "Status Bar",
"Status Bar", "Fullscreen", "Fullscreen"
};

static const char *st_layout_strings[] = {
"Original", "Wide"
};
Expand Down Expand Up @@ -4784,7 +4778,7 @@ static const char **selectstrings[] = {
percent_strings,
curve_strings,
center_weapon_strings,
screensize_strings,
NULL, // str_screensize
st_layout_strings,
show_widgets_strings,
show_adv_widgets_strings,
Expand Down Expand Up @@ -4842,6 +4836,29 @@ static const char **GetMidiPlayerStrings(void)
return I_DeviceList();
}

static const char **GetScreenSizeStrings(void)
{
const char **strings = NULL;

for (int i = 0; i < 3; ++i)
{
array_push(strings, "");
}
for (int i = 3; i < 10; ++i)
{
array_push(strings, "Status Bar");
}

const char **st_strings = ST_StatusbarList();
for (int i = 0; i < array_size(st_strings); ++i)
{
array_push(strings, st_strings[i]);
}

maxscreenblocks = array_size(strings) - 1;
return strings;
}

void MN_InitMenuStrings(void)
{
UpdateWeaponSlotLabels();
Expand All @@ -4854,6 +4871,7 @@ void MN_InitMenuStrings(void)
selectstrings[str_gyro_sens] = GetGyroSensitivityStrings();
selectstrings[str_gyro_accel] = GetGyroAccelStrings();
selectstrings[str_resampler] = GetResamplerStrings();
selectstrings[str_screensize] = GetScreenSizeStrings();
}

void MN_SetupResetMenu(void)
Expand Down
2 changes: 1 addition & 1 deletion src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ void R_BindRenderVariables(void)
BIND_NUM_GENERAL(invul_mode, INVUL_MBF, INVUL_VANILLA, INVUL_GRAY,
"Invulnerability effect (0 = Vanilla; 1 = MBF; 2 = Gray)");
BIND_BOOL(flashing_hom, true, "Enable flashing of the HOM indicator");
BIND_NUM(screenblocks, 10, 3, 12, "Size of game-world screen");
BIND_NUM(screenblocks, 10, 3, UL, "Size of game-world screen");

M_BindBool("translucency", &translucency, NULL, true, ss_gen, wad_yes,
"Translucency for some things");
Expand Down
34 changes: 34 additions & 0 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,11 @@ static void UpdateStatusBar(player_t *player)

int barindex = MAX(screenblocks - 10, 0);

if (barindex >= array_size(sbardef->statusbars))
{
barindex = array_size(sbardef->statusbars) - 1;
}

if (automapactive && automapoverlay == AM_OVERLAY_OFF)
{
barindex = 0;
Expand Down Expand Up @@ -1833,6 +1838,35 @@ void ST_InitRes(void)
PU_RENDERER, 0);
}

const char **ST_StatusbarList(void)
{
if (!sbardef)
{
return NULL;
}

static const char **strings;

if (array_size(strings))
{
return strings;
}

statusbar_t *item;
array_foreach(item, sbardef->statusbars)
{
if (item->fullscreenrender)
{
array_push(strings, "Fullscreen");
}
else
{
array_push(strings, "Status Bar");
}
}
return strings;
}

void ST_ResetPalette(void)
{
I_SetPalette(W_CacheLumpName("PLAYPAL", PU_CACHE));
Expand Down
2 changes: 2 additions & 0 deletions src/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ extern struct patch_s **hu_font;
void WI_UpdateWidgets(void);
void WI_DrawWidgets(void);

const char **ST_StatusbarList(void);

void ST_BindSTSVariables(void);

#endif
Expand Down