Skip to content

Commit

Permalink
Cast slightly darker shadow on menu highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Aug 29, 2023
1 parent 4f808a2 commit e68d919
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/i_colors.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ byte *tinttab25;
byte *tinttab30;
byte *tinttab33;
byte *tinttab40;
byte *tinttab45;
byte *tinttab50;
byte *tinttab60;
byte *tinttab66;
Expand Down Expand Up @@ -115,6 +116,7 @@ byte nearestwhite;

byte *black25;
byte *black40;
byte *black45;
byte *white5;
byte *white25;
byte *white33;
Expand Down Expand Up @@ -169,6 +171,7 @@ void FindNearestColors(byte *palette)

black25 = &tinttab25[nearestblack << 8];
black40 = &tinttab40[nearestblack << 8];
black45 = &tinttab45[nearestblack << 8];
white5 = &tinttab5[nearestwhite << 8];
white25 = &tinttab25[nearestwhite << 8];
white33 = &tinttab33[nearestwhite << 8];
Expand Down Expand Up @@ -334,6 +337,7 @@ void I_InitTintTables(byte *palette)
tinttab30 = GenerateTintTable(palette, 30, ALL);
tinttab33 = GenerateTintTable(palette, 33, ALL);
tinttab40 = GenerateTintTable(palette, 40, ALL);
tinttab45 = GenerateTintTable(palette, 45, ALL);
tinttab50 = GenerateTintTable(palette, 50, ALL);
tinttab60 = GenerateTintTable(palette, 60, ALL);
tinttab66 = GenerateTintTable(palette, 66, ALL);
Expand Down
2 changes: 2 additions & 0 deletions src/i_colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extern byte *tinttab25;
extern byte *tinttab30;
extern byte *tinttab33;
extern byte *tinttab40;
extern byte *tinttab45;
extern byte *tinttab50;
extern byte *tinttab60;
extern byte *tinttab66;
Expand Down Expand Up @@ -104,6 +105,7 @@ extern byte nearestwhite;

extern byte *black25;
extern byte *black40;
extern byte *black45;
extern byte *white5;
extern byte *white25;
extern byte *white33;
Expand Down
14 changes: 8 additions & 6 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ void V_DrawTranslucentAltHUDText(int x, int y, byte *screen, patch_t *patch,
void V_DrawMenuPatch(int x, int y, patch_t *patch, bool highlight, int shadowwidth)
{
byte *desttop;
const byte *black = (highlight ? black45 : black40);
const int width = SHORT(patch->width) << FRACBITS;

y -= SHORT(patch->topoffset);
Expand Down Expand Up @@ -885,7 +886,7 @@ void V_DrawMenuPatch(int x, int y, patch_t *patch, bool highlight, int shadowwid
byte *dot = dest + SCREENWIDTH + 2;

if (i <= shadowwidth && *dot != 47 && *dot != 191)
*dot = black40[*dot];
*dot = black[*dot];
}

srccol += DYI;
Expand Down Expand Up @@ -1554,15 +1555,16 @@ void V_DrawPixel(int x, int y, byte color, bool highlight, bool shadow)
{
if (shadow)
{
byte *dot = *screens + ((size_t)y * SCREENWIDTH + x) * 2;
byte *dot = *screens + ((size_t)y * SCREENWIDTH + x) * 2;
const byte *black = (highlight ? black45 : black40);

*dot = black40[*dot];
*dot = black[*dot];
dot++;
*dot = black40[*dot];
*dot = black[*dot];
dot += SCREENWIDTH;
*dot = black40[*dot];
*dot = black[*dot];
dot--;
*dot = black40[*dot];
*dot = black[*dot];
}
}
else if (color && color != 32)
Expand Down

0 comments on commit e68d919

Please sign in to comment.