From ac1ed33ac5eac7e450bf72bdabb53b1e0a3f4348 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sat, 5 Oct 2024 07:21:39 +1000 Subject: [PATCH] Minor tweaks --- src/am_map.c | 40 +++++++++++++++++----------------------- src/c_console.c | 10 +++++----- src/hu_lib.c | 9 +++++++-- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 2755bebfe..3b4a9e811 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -100,15 +100,15 @@ static byte *am_crosshaircolor2; // how much the automap moves window per tic in map coordinates // moves 140 pixels in 1 second -#define F_PANINC ((uint64_t)8 << speedtoggle) +#define F_PANINC (8 << speedtoggle) // how much zoom-in per tic // goes to 2x in 1 second -#define M_ZOOMIN (fixed_t)((uint64_t)FRACUNIT * (1.0 + F_PANINC / 100.0)) +#define M_ZOOMIN (fixed_t)(FRACUNIT * (1.0 + F_PANINC / 100.0)) // how much zoom-out per tic // pulls out to 0.5x in 1 second -#define M_ZOOMOUT (fixed_t)((uint64_t)FRACUNIT / (1.0 + F_PANINC / 100.0)) +#define M_ZOOMOUT (fixed_t)(FRACUNIT / (1.0 + F_PANINC / 100.0)) #define PLAYERRADIUS (16 * (1 << MAPBITS)) @@ -119,8 +119,8 @@ static byte *am_crosshaircolor2; #define MTOF(x) (fixed_t)((((int64_t)(x) * scale_mtof) >> FRACBITS) >> FRACBITS) // translates between frame-buffer and map coordinates -#define CXMTOF(x) MTOF((int64_t)(x) - m_x) -#define CYMTOF(y) (MAPHEIGHT - MTOF((int64_t)(y) - m_y)) +#define CXMTOF(x) MTOF((x) - m_x) +#define CYMTOF(y) (MAPHEIGHT - MTOF((y) - m_y)) #define AM_CORRECTASPECTRATIO (5 * FRACUNIT / 6) @@ -1451,12 +1451,6 @@ static void AM_DrawGrid(void) int64_t endx = startx + minlen; int64_t endy = starty + minlen; - if (am_correctaspectratio) - { - starty += starty * 6 / 5; - endy += endy * 6 / 5; - } - // Draw vertical gridlines for (int64_t x = startx - ((startx - (bmaporgx >> FRACTOMAPBITS)) % gridwidth); x < endx; x += gridwidth) { @@ -2174,26 +2168,26 @@ static void AM_SetFrameVariables(void) const fixed_t x = m_x + dx; const fixed_t y = m_y + dy; const fixed_t r = (fixed_t)sqrt((double)dx * dx + (double)dy * dy); - int angle = 0; - - if (am_rotatemode) - { - angle = (ANG90 - viewangle) >> ANGLETOFINESHIFT; - rotatelinefunc = &AM_RotateLine; - } - else - rotatelinefunc = &AM_DoNotRotateLine; am_frame.center.x = x; am_frame.center.y = y; - am_frame.sin = finesine[angle]; - am_frame.cos = finecosine[angle]; - am_frame.bbox[BOXLEFT] = x - r; am_frame.bbox[BOXRIGHT] = x + r; am_frame.bbox[BOXBOTTOM] = y - r; am_frame.bbox[BOXTOP] = y + r; + + if (am_rotatemode) + { + const int angle = (ANG90 - viewangle) >> ANGLETOFINESHIFT; + + am_frame.sin = finesine[angle]; + am_frame.cos = finecosine[angle]; + + rotatelinefunc = &AM_RotateLine; + } + else + rotatelinefunc = &AM_DoNotRotateLine; } static void AM_ApplyAntialiasing(void) diff --git a/src/c_console.c b/src/c_console.c index d7670e375..b26782fe6 100644 --- a/src/c_console.c +++ b/src/c_console.c @@ -1334,7 +1334,7 @@ void C_UpdateFPSOverlay(void) { char buffer[32]; char *temp = commify(framespersecond); - const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab70 : tinttab50) : NULL); + const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab80 : tinttab50) : NULL); M_snprintf(buffer, sizeof(buffer), "%s FPS", temp); @@ -1347,7 +1347,7 @@ void C_UpdateTimerOverlay(void) { static char buffer[10]; static int prevtime = -1; - const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab70 : tinttab50) : NULL); + const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab80 : tinttab50) : NULL); int y = OVERLAYTEXTY; if (vid_showfps && framespersecond) @@ -1376,7 +1376,7 @@ void C_UpdatePlayerPositionOverlay(void) const int x = SCREENWIDTH - OVERLAYTEXTX + 1; int y = OVERLAYTEXTY; const int color = C_GetOverlayTextColor(); - const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab70 : tinttab50) : NULL); + const byte *tinttab = (r_hud_translucency ? (automapactive ? tinttab80 : tinttab50) : NULL); static char angle[32]; static char coordinates[32]; @@ -1457,7 +1457,7 @@ void C_UpdatePathOverlay(void) y += OVERLAYLINEHEIGHT * 2 + OVERLAYSPACING; } - C_DrawOverlayText(mapscreen, MAPWIDTH, x - width, y, (r_hud_translucency ? tinttab70 : NULL), + C_DrawOverlayText(mapscreen, MAPWIDTH, x - width, y, (r_hud_translucency ? tinttab80 : NULL), distance, C_GetOverlayTextColor(), true); pathoverlay = true; @@ -1471,7 +1471,7 @@ void C_UpdatePlayerStatsOverlay(void) int x; int y; const int color = C_GetOverlayTextColor(); - const byte *tinttab = (r_hud_translucency ? tinttab70 : NULL); + const byte *tinttab = (r_hud_translucency ? tinttab80 : NULL); static char time[10]; static int prevmaptime = -1; static int width; diff --git a/src/hu_lib.c b/src/hu_lib.c index 5a15ee19c..630ec0bd4 100644 --- a/src/hu_lib.c +++ b/src/hu_lib.c @@ -147,13 +147,18 @@ static void HUlib_DrawAltHUDTextLine(hu_textline_t *l) int color = (message_secret ? nearestgold : (message_warning ? nearestred : (r_hud_translucency ? nearestwhite : nearestlightgray))); const int len = l->len; - byte *tinttab = (automapactive ? tinttab75 : tinttab50); + byte *tinttab; - if (!automapactive) + if (automapactive) + tinttab = tinttab80; + else + { color = (r_textures ? (viewplayer->fixedcolormap == INVERSECOLORMAP ? colormaps[0][32 * 256 + color] : color) : (viewplayer->fixedcolormap == INVERSECOLORMAP ? colormaps[0][32 * 256 + color] : (message_secret ? nearestgold : (message_warning ? nearestred : nearestblack)))); + tinttab = tinttab50; + } if (fade) {