- Floatified drawredlines().

This commit is contained in:
Mitchell Richters 2022-08-30 00:08:41 +10:00 committed by Christoph Oelckers
parent 60f5d9b67c
commit bb3959fb0f

View file

@ -409,10 +409,10 @@ bool ShowRedLine(int j, int i)
//
//---------------------------------------------------------------------------
static void drawredlines(int cposx, int cposy, const double czoom, const DAngle cang)
static void drawredlines(const DVector2& cpos, const double czoom, const DAngle cang)
{
int xvect = -cang.Sin() * 16384. * czoom;
int yvect = -cang.Cos() * 16384. * czoom;
double xvect = -cang.Sin() * czoom * (1. / 1024.);
double yvect = -cang.Cos() * czoom * (1. / 1024.);
int width = screen->GetWidth();
int height = screen->GetHeight();
@ -434,16 +434,14 @@ static void drawredlines(int cposx, int cposy, const double czoom, const DAngle
if (ShowRedLine(wallnum(&wal), i))
{
int ox = wal.wall_int_pos().X - cposx;
int oy = wal.wall_int_pos().Y - cposy;
int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
auto oxy1 = wal.pos - cpos;
double x1 = (oxy1.X * xvect) - (oxy1.Y * yvect) + (width * 0.5);
double y1 = (oxy1.Y * xvect) + (oxy1.X * yvect) + (height * 0.5);
auto wal2 = wal.point2Wall();
ox = wal2->wall_int_pos().X - cposx;
oy = wal2->wall_int_pos().Y - cposy;
int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
auto oxy2 = wal2->pos - cpos;
double x2 = (oxy2.X * xvect) - (oxy2.Y * yvect) + (width * 0.5);
double y2 = (oxy2.Y * xvect) + (oxy2.X * yvect) + (height * 0.5);
drawlinergb(x1, y1, x2, y2, RedLineColor());
}
@ -670,7 +668,7 @@ void DrawOverheadMap(int pl_x, int pl_y, const DAngle pl_angle, double const smo
twod->ClearScreen();
renderDrawMapView(follow, gZoom, follow_a);
}
drawredlines(x, y, gZoom, follow_a);
drawredlines(follow, gZoom, follow_a);
drawwhitelines(x, y, gZoom, follow_a);
if (!gi->DrawAutomapPlayer(pl_x, pl_y, x, y, gZoom, follow_a, smoothratio))
DrawPlayerArrow(x, y, follow_a, pl_x, pl_y, gZoom, -pl_angle);