Skip to content

Commit

Permalink
Allow map markers to scale relative to automap zoom.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa Kirisame authored and coelckers committed Oct 8, 2021
1 parent 3fcb1cc commit 7c591cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/am_map.cpp
Expand Up @@ -3130,11 +3130,20 @@ void DAutomap::drawAuthorMarkers ()
auto it = Level->GetActorIterator(mark->args[0]);
AActor *marked = mark->args[0] == 0 ? mark : it.Next();

double xscale = mark->Scale.X;
double yscale = mark->Scale.Y;
// [MK] scale with automap zoom if args[2] is 1, otherwise keep a constant scale
if (mark->args[2] == 1)
{
xscale = MTOF(xscale);
yscale = MTOF(yscale);
}

while (marked != nullptr)
{
if (mark->args[1] == 0 || (mark->args[1] == 1 && (marked->subsector->flags & SSECMF_DRAWN)))
{
DrawMarker (tex, marked->X(), marked->Y(), 0, flip, mark->Scale.X, mark->Scale.Y, mark->Translation,
DrawMarker (tex, marked->X(), marked->Y(), 0, flip, xscale, yscale, mark->Translation,
mark->Alpha, mark->fillcolor, mark->RenderStyle);
}
marked = mark->args[0] != 0 ? it.Next() : nullptr;
Expand Down
3 changes: 3 additions & 0 deletions wadsrc/static/zscript/actors/shared/mapmarker.zs
Expand Up @@ -7,6 +7,9 @@
// args[1] == 0, show the sprite always
// == 1, show the sprite only after its sector has been drawn
//
// args[2] == 0, show the sprite with a constant scale
// == 1, show the sprite with a scale relative to automap zoom
//
// To enable display of the sprite, activate it. To turn off the sprite,
// deactivate it.
//
Expand Down

0 comments on commit 7c591cd

Please sign in to comment.