diff --git a/source/common/2d/v_2ddrawer.h b/source/common/2d/v_2ddrawer.h index 322e31a8f..82c8aeada 100644 --- a/source/common/2d/v_2ddrawer.h +++ b/source/common/2d/v_2ddrawer.h @@ -231,15 +231,6 @@ public: void AddThickLine(const DVector2& v1, const DVector2& v2, double thickness, uint32_t color, uint8_t alpha = 255); void AddPixel(int x1, int y1, uint32_t color); - void AddLine(double x1, double y1, double x2, double y2, const IntRect* clip, uint32_t color, uint8_t alpha = 255) - { - AddLine(DVector2(x1, y1), DVector2(x2, y2), clip, color, alpha); - } - void AddThickLine(double x1, double y1, double x2, double y2, double thickness, uint32_t color, uint8_t alpha = 255) - { - AddThickLine(DVector2(x1, y1), DVector2(x2, y2), thickness, color, alpha); - } - void AddEnableStencil(bool on); void AddSetStencil(int offs, int op, int flags); void AddClearStencil(); diff --git a/source/common/2d/v_draw.cpp b/source/common/2d/v_draw.cpp index 2516d75b1..941306dd4 100644 --- a/source/common/2d/v_draw.cpp +++ b/source/common/2d/v_draw.cpp @@ -1555,10 +1555,10 @@ void VirtualToRealCoordsInt(F2DDrawer *drawer, int &x, int &y, int &w, int &h, // //========================================================================== -static void DrawLine(int x0, int y0, int x1, int y1, uint32_t realcolor, int alpha) +static void DrawLine(double x1, double y1, double x2, double y2, uint32_t realcolor, int alpha) { if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - twod->AddLine((float)x0, (float)y0, (float)x1, (float)y1, nullptr, realcolor | MAKEARGB(255, 0, 0, 0), alpha); + twod->AddLine(DVector2(x1, y1), DVector2(x2, y2), nullptr, realcolor | MAKEARGB(255, 0, 0, 0), alpha); } DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawLine, DrawLine) @@ -1583,15 +1583,15 @@ DEFINE_ACTION_FUNCTION(FCanvas, DrawLine) PARAM_INT(y1); PARAM_INT(color); PARAM_INT(alpha); - self->Drawer.AddLine((float)x0, (float)y0, (float)x1, (float)y1, nullptr, color | MAKEARGB(255, 0, 0, 0), alpha); + self->Drawer.AddLine(DVector2(x0, y0), DVector2(x1, y1), nullptr, color | MAKEARGB(255, 0, 0, 0), alpha); self->Tex->NeedUpdate(); return 0; } -static void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, uint32_t realcolor, int alpha) +static void DrawThickLine(double x1, double y1, double x2, double y2, double thickness, uint32_t realcolor, int alpha) { if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - twod->AddThickLine(x0, y0, x1, y1, thickness, realcolor, alpha); + twod->AddThickLine(DVector2(x1, y1), DVector2(x2, y2), thickness, realcolor, alpha); } DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawThickLine, DrawThickLine) @@ -1618,7 +1618,7 @@ DEFINE_ACTION_FUNCTION(FCanvas, DrawThickLine) PARAM_FLOAT(thickness); PARAM_INT(color); PARAM_INT(alpha); - self->Drawer.AddThickLine(x0, y0, x1, y1, thickness, color, alpha); + self->Drawer.AddThickLine(DVector2(x0, y0), DVector2(x1, y1), thickness, color, alpha); self->Tex->NeedUpdate(); return 0; }