Skip to content

Commit

Permalink
Improve menu background when r_detail CVAR is low
Browse files Browse the repository at this point in the history
While reverting previous changes...
  • Loading branch information
bradharding committed Mar 6, 2023
1 parent 79c7ec9 commit eef7941
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* The mouse wheel may now be used to scroll among menu items again.
* If the mouse pointer is hidden, pressing a mouse button without moving the mouse now opens the menu from the title screen, or selects the currently highlighted item if the menu is open.
* The fade effect when opening the menu is now slightly faster than closing it when the `fade` CVAR is `on`.
* Minor improvements have been made to the menu’s background.
* Minor improvements have been made to the menu’s background when the `r_detail` CVAR is `low`.
* Two additional savegame slots are now available in the load and save game menus.
* A random sound effect now plays when quitting the game by entering the `quit` CCMD in the console or pressing <kbd>ALT</kbd> + <kbd>F4</kbd>.
* Improvements have been made to parsing [`BRGHTMPS`](https://raw.githubusercontent.com/bradharding/doomretro/master/res/BRGHTMPS) lumps.
Expand Down
17 changes: 0 additions & 17 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,23 +523,6 @@ void M_DrawMenuBackground(void)
return;
}

if (r_detail == r_detail_high || !r_supersampling)
for (int y = 0; y < SCREENAREA; y += 2 * SCREENWIDTH)
for (int x = 0; x < SCREENWIDTH; x += 2)
{
byte *dot1 = *screens + y + x;
byte *dot2 = dot1 + 1;
byte *dot3 = dot2 + SCREENWIDTH;
byte *dot4 = dot3 - 1;
const byte color = tinttab50[(tinttab50[(*dot1 << 8) + *dot2] << 8)
+ tinttab50[(*dot3 << 8) + *dot4]];

*dot1 = color;
*dot2 = color;
*dot3 = color;
*dot4 = color;
}

if (gametime != blurtic)
{
for (int y = 2 * SCREENWIDTH; y < SCREENAREA; y += 4 * SCREENWIDTH)
Expand Down
18 changes: 18 additions & 0 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,24 @@ void GetPixelSize(void)
}
}

void V_LowGraphicDetail_Menu(void)
{
for (int y = 0; y < SCREENAREA; y += 2 * SCREENWIDTH)
for (int x = 0; x < SCREENWIDTH; x += 2)
{
byte *dot1 = *screens + y + x;
byte *dot2 = dot1 + 1;
byte *dot3 = dot2 + SCREENWIDTH;
byte *dot4 = dot3 - 1;
const byte color = tinttab50[(tinttab50[(*dot1 << 8) + *dot2] << 8) + tinttab50[(*dot3 << 8) + *dot4]];

*dot1 = color;
*dot2 = color;
*dot3 = color;
*dot4 = color;
}
}

void V_InvertScreen(void)
{
const int width = viewwindowx + viewwidth;
Expand Down
1 change: 1 addition & 0 deletions src/v_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void V_DrawPagePatch(int screen, patch_t *patch);
void V_DrawPixel(int x, int y, byte color, bool drawshadow);

void GetPixelSize(void);
void V_LowGraphicDetail_Menu(void);
void V_InvertScreen(void);

bool V_ScreenShot(void);

0 comments on commit eef7941

Please sign in to comment.