- added Screen.DrawThickLine for drawing lines with thickness

This commit is contained in:
Jonathan Russell 2018-08-30 16:49:10 +01:00 committed by Christoph Oelckers
commit ea81ab4097
5 changed files with 63 additions and 0 deletions

View file

@ -1088,6 +1088,24 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawLine)
return 0;
}
void DFrameBuffer::DrawThickLine(int x0, int y0, int x1, int y1, double thickness, uint32_t realcolor) {
m2DDrawer.AddThickLine(x0, y0, x1, y1, thickness, realcolor);
}
DEFINE_ACTION_FUNCTION(_Screen, DrawThickLine)
{
PARAM_PROLOGUE;
PARAM_INT(x0);
PARAM_INT(y0);
PARAM_INT(x1);
PARAM_INT(y1);
PARAM_FLOAT(thickness);
PARAM_INT(color);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->DrawThickLine(x0, y0, x1, y1, thickness, color);
return 0;
}
//==========================================================================
//
// Draw a single pixel