- Rework some automap functions in prep for floatification.

This commit is contained in:
Mitchell Richters 2022-08-30 00:08:15 +10:00 committed by Christoph Oelckers
parent 85f7297ad3
commit 60f5d9b67c
4 changed files with 11 additions and 6 deletions

View file

@ -1075,7 +1075,7 @@ void F2DDrawer::AddLine(double x1, double y1, double x2, double y2, const IntRec
//
//==========================================================================
void F2DDrawer::AddThickLine(int x1, int y1, int x2, int y2, double thickness, uint32_t color, uint8_t alpha)
void F2DDrawer::AddThickLine(double x1, double y1, double x2, double y2, double thickness, uint32_t color, uint8_t alpha)
{
PalEntry p = (PalEntry)color;
p.a = alpha;

View file

@ -228,7 +228,7 @@ public:
void AddLine(double x1, double y1, double x2, double y2, const IntRect* clip, uint32_t color, uint8_t alpha = 255);
void AddThickLine(int x1, int y1, int x2, int y2, double thickness, uint32_t color, uint8_t alpha = 255);
void AddThickLine(double x1, double y1, double x2, double y2, double thickness, uint32_t color, uint8_t alpha = 255);
void AddPixel(int x1, int y1, uint32_t color);
void AddEnableStencil(bool on);

View file

@ -318,13 +318,13 @@ void MarkSectorSeen(sectortype* sec)
//
//---------------------------------------------------------------------------
void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p)
void drawlinergb(const double x1, const double y1, const double x2, const double y2, PalEntry p)
{
if (am_linethickness >= 2) {
twod->AddThickLine(x1 / 4096, y1 / 4096, x2 / 4096, y2 / 4096, am_linethickness, p, uint8_t(am_linealpha * 255));
twod->AddThickLine(x1, y1, x2, y2, am_linethickness, p, uint8_t(am_linealpha * 255));
} else {
// Use more efficient thin line drawing routine.
twod->AddLine(x1 / 4096.f, y1 / 4096.f, x2 / 4096.f, y2 / 4096.f, &viewport3d, p, uint8_t(am_linealpha * 255));
twod->AddLine(x1, y1, x2, y2, &viewport3d, p, uint8_t(am_linealpha * 255));
}
}

View file

@ -18,7 +18,12 @@ void ClearAutomap();
void MarkSectorSeen(sectortype* sect);
void DrawOverheadMap(int pl_x, int pl_y, const DAngle pl_angle, double const smoothratio);
bool AM_Responder(event_t* ev, bool last);
void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p);
void drawlinergb(const double x1, const double y1, const double x2, const double y2, PalEntry p);
inline void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p)
{
drawlinergb(x1 / 4096., y1 / 4096., x2 / 4096., y2 / 4096., p);
}
enum AM_Mode
{