Skip to content

Commit

Permalink
Reduce maximum width/height arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
JNechaevsky committed Dec 28, 2024
1 parent d322a54 commit 2cc0065
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/doom/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ static void M_Draw_ID_Video (void)
const char *resolution;

M_snprintf(width, 8, "%d", (ORIGWIDTH + (WIDESCREENDELTA*2)) * vid_resolution);
M_snprintf(height, 8, "%d", (vid_aspect_ratio_correct == 1 ? ORIGHEIGHT_4_3 : ORIGHEIGHT) * vid_resolution);
M_snprintf(height, 8, "%d", (ORIGHEIGHT * vid_resolution));
resolution = M_StringJoin("CURRENT RESOLUTION: ", width, "x", height, NULL);

M_WriteTextCentered(135, resolution, cr[CR_LIGHTGRAY_DARK1]);
Expand Down
2 changes: 1 addition & 1 deletion src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ static void M_Draw_ID_Video (void)
const char *resolution;

M_snprintf(width, 8, "%d", (ORIGWIDTH + (WIDESCREENDELTA*2)) * vid_resolution);
M_snprintf(height, 8, "%d", (vid_aspect_ratio_correct == 1 ? ORIGHEIGHT_4_3 : ORIGHEIGHT) * vid_resolution);
M_snprintf(height, 8, "%d", (ORIGHEIGHT * vid_resolution));
resolution = M_StringJoin("CURRENT RESOLUTION: ", width, "X", height, NULL);

MN_DrTextACentered(resolution, 150, cr[CR_LIGHTGRAY_DARK1]);
Expand Down
2 changes: 1 addition & 1 deletion src/hexen/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ static void M_Draw_ID_Video (void)
const char *resolution;

M_snprintf(width, 8, "%d", (ORIGWIDTH + (WIDESCREENDELTA*2)) * vid_resolution);
M_snprintf(height, 8, "%d", (vid_aspect_ratio_correct == 1 ? ORIGHEIGHT_4_3 : ORIGHEIGHT) * vid_resolution);
M_snprintf(height, 8, "%d", (ORIGHEIGHT * vid_resolution));
resolution = M_StringJoin("CURRENT RESOLUTION: ", width, "X", height, NULL);

MN_DrTextACentered(resolution, 150, cr[CR_LIGHTGRAY_DARK1]);
Expand Down
11 changes: 5 additions & 6 deletions src/i_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#define ORIGWIDTH 320 // [crispy]
#define ORIGHEIGHT 200 // [crispy]

// [JN] Allocate enough to support higher rendering resolutions.
#define MAXWIDTH (ORIGWIDTH << 5) // [crispy]
#define MAXHEIGHT (ORIGHEIGHT << 4) // [crispy]

// [JN] Maximum available rendering resolution.
#define MAXHIRES 6

// [JN] Allocate enough to support higher rendering resolutions and 32:9 ratio.
#define MAXWIDTH 5136 // [crispy] [JN] 856 * 6
#define MAXHEIGHT 1200 // [crispy] [JN] 200 * 6

extern int SCREENWIDTH;
extern int SCREENHEIGHT;
extern int NONWIDEWIDTH; // [crispy] non-widescreen SCREENWIDTH
Expand Down Expand Up @@ -70,8 +70,7 @@ enum
// Screen height used when vid_aspect_ratio_correct=true.

#define ORIGHEIGHT_4_3 240 // [crispy]
// [JN] Increase more (+2) to support quad rendering resolution.
#define MAXHEIGHT_4_3 (ORIGHEIGHT_4_3 << 4) // [crispy]
#define MAXHEIGHT_4_3 1440 // [crispy] [JN] 240 * 6

extern int SCREENHEIGHT_4_3;

Expand Down

0 comments on commit 2cc0065

Please sign in to comment.