Add cvars to control automap line alpha and thickness

This can be used to improve automap readability on high-resolution
displays.

Some automap options in the menu were reordered to follow a more
logical order.
This commit is contained in:
Hugo Locurcio 2021-07-09 12:09:41 +02:00 committed by Christoph Oelckers
parent 7c591cd0e9
commit d0975467f5
2 changed files with 15 additions and 2 deletions

View File

@ -131,6 +131,8 @@ struct islope_t
//=============================================================================
CVAR(Bool, am_textured, false, CVAR_ARCHIVE)
CVAR(Float, am_linealpha, 1.0f, CVAR_ARCHIVE)
CVAR(Int, am_linethickness, 1, CVAR_ARCHIVE)
CVAR(Bool, am_thingrenderstyles, true, CVAR_ARCHIVE)
CVAR(Int, am_showsubsector, -1, 0);
@ -1735,7 +1737,16 @@ void DAutomap::drawMline (mline_t *ml, const AMColor &color)
if (clipMline (ml, &fl))
{
twod->AddLine (f_x + fl.a.x, f_y + fl.a.y, f_x + fl.b.x, f_y + fl.b.y, -1, -1, INT_MAX, INT_MAX, color.RGB);
const int x1 = f_x + fl.a.x;
const int y1 = f_y + fl.a.y;
const int x2 = f_x + fl.b.x;
const int y2 = f_y + fl.b.y;
if (am_linethickness >= 2) {
twod->AddThickLine(x1, y1, x2, y2, am_linethickness, color.RGB, uint8_t(am_linealpha * 255));
} else {
// Use more efficient thin line drawing routine.
twod->AddLine(x1, y1, x2, y2, -1, -1, INT_MAX, INT_MAX, color.RGB, uint8_t(am_linealpha * 255));
}
}
}

View File

@ -1339,9 +1339,11 @@ OptionMenu AutomapOptions protected
StaticText ""
Option "$AUTOMAPMNU_ROTATE", "am_rotate", "RotateTypes"
Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff"
Option "$AUTOMAPMNU_OVERLAY", "am_overlay", "OverlayTypes"
Option "$AUTOMAPMNU_TEXTURED", "am_textured", "OnOff"
Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff"
Slider "$AUTOMAPMNU_LINEALPHA", "am_linealpha", 0.1, 1.0, 0.1, 1
Slider "$AUTOMAPMNU_LINETHICKNESS", "am_linethickness", 1, 8, 1, 0
StaticText ""
Option "$AUTOMAPMNU_SHOWITEMS", "am_showitems", "OnOff"