Skip to content

Commit

Permalink
Make some menu items report current resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Nov 11, 2023
1 parent 236b586 commit 41b5505
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Disabled Armor icon by default.
- **Implemented Teleporter Zoom for multiplayer respawning**
- **MDK Fist attacks now prioritize enemies over friends**
- **Current resolution is now reported by some video-related menu items**
- **Disabled `input_spy` and `input_menu_reloadlevel` when typing in Chat**

## Bug Fixes
Expand Down
20 changes: 18 additions & 2 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,19 @@ void M_DrawInstructions()
strcpy(menu_buffer, s);
M_DrawMenuString(x,20,color);
}

// [Nugget] Report current resolution
if (flags & S_RESOLUTION)
{
char str[48];

M_snprintf(str, sizeof(str), "Current Resolution: %ix%i",
(SCREENWIDTH << hires),
(use_aspect ? (6 * SCREENHEIGHT / 5) : SCREENHEIGHT) << hires);

M_DrawString((ORIGWIDTH / 2) - (M_GetPixelWidth(str) / 2),
M_Y + (14 * M_SPC), CR_GOLD, str);
}
}

// [FG] reload current level / go to next level
Expand Down Expand Up @@ -4317,10 +4330,13 @@ setup_menu_t gen_settings1[] = { // General Settings screen1

{"Video" ,S_SKIP|S_TITLE, m_null, M_X, M_Y},

{"Renderer Resolution", S_CHOICE, m_null, M_X, M_Y+ gen1_hires*M_SPC,
// [Nugget] These first two items now report
// the current resolution when sitting on them

{"Renderer Resolution", S_CHOICE|S_RESOLUTION, m_null, M_X, M_Y+ gen1_hires*M_SPC,
{"hires"}, 0, M_ResetScreen, hires_strings},

{"Widescreen Rendering", S_CHOICE, m_null, M_X, M_Y+ gen1_widescreen*M_SPC,
{"Widescreen Rendering", S_CHOICE|S_RESOLUTION, m_null, M_X, M_Y+ gen1_widescreen*M_SPC,
{"widescreen"}, 0, M_ResetScreen, widescreen_ratios}, // [Nugget] Widescreen ratios

{"", S_SKIP, m_null, M_X, M_Y + gen1_gap1*M_SPC},
Expand Down
1 change: 1 addition & 0 deletions src/m_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ extern int warning_about_changes, print_warning_about_changes;
#define S_BOOM 0x10000000 // Disable if complevel < boom
#define S_VANILLA 0x20000000 // Disable if complevel != vanilla
#define S_CRITICAL 0x40000000 // Disable when recording/playing a demo and in netgame
#define S_RESOLUTION 0x80000000 // [Nugget] Report current resolution

// S_SHOWDESC = the set of items whose description should be displayed
// S_SHOWSET = the set of items whose setting should be displayed
Expand Down

0 comments on commit 41b5505

Please sign in to comment.