- fixed DrawLine commands by giving them a consistent floating point interface.

This commit is contained in:
Christoph Oelckers 2022-10-19 20:39:41 +02:00
parent c2373fed99
commit dbd6a9dea1
2 changed files with 20 additions and 20 deletions

View file

@ -1564,10 +1564,10 @@ static void DrawLine(double x1, double y1, double x2, double y2, uint32_t realco
DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawLine, DrawLine)
{
PARAM_PROLOGUE;
PARAM_INT(x0);
PARAM_INT(y0);
PARAM_INT(x1);
PARAM_INT(y1);
PARAM_FLOAT(x0);
PARAM_FLOAT(y0);
PARAM_FLOAT(x1);
PARAM_FLOAT(y1);
PARAM_INT(color);
PARAM_INT(alpha);
DrawLine(x0, y0, x1, y1, color, alpha);
@ -1577,10 +1577,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawLine, DrawLine)
DEFINE_ACTION_FUNCTION(FCanvas, DrawLine)
{
PARAM_SELF_PROLOGUE(FCanvas);
PARAM_INT(x0);
PARAM_INT(y0);
PARAM_INT(x1);
PARAM_INT(y1);
PARAM_FLOAT(x0);
PARAM_FLOAT(y0);
PARAM_FLOAT(x1);
PARAM_FLOAT(y1);
PARAM_INT(color);
PARAM_INT(alpha);
self->Drawer.AddLine(DVector2(x0, y0), DVector2(x1, y1), nullptr, color | MAKEARGB(255, 0, 0, 0), alpha);
@ -1597,10 +1597,10 @@ static void DrawThickLine(double x1, double y1, double x2, double y2, double thi
DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawThickLine, DrawThickLine)
{
PARAM_PROLOGUE;
PARAM_INT(x0);
PARAM_INT(y0);
PARAM_INT(x1);
PARAM_INT(y1);
PARAM_FLOAT(x0);
PARAM_FLOAT(y0);
PARAM_FLOAT(x1);
PARAM_FLOAT(y1);
PARAM_FLOAT(thickness);
PARAM_INT(color);
PARAM_INT(alpha);
@ -1611,10 +1611,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawThickLine, DrawThickLine)
DEFINE_ACTION_FUNCTION(FCanvas, DrawThickLine)
{
PARAM_SELF_PROLOGUE(FCanvas);
PARAM_INT(x0);
PARAM_INT(y0);
PARAM_INT(x1);
PARAM_INT(y1);
PARAM_FLOAT(x0);
PARAM_FLOAT(y0);
PARAM_FLOAT(x1);
PARAM_FLOAT(y1);
PARAM_FLOAT(thickness);
PARAM_INT(color);
PARAM_INT(alpha);

View file

@ -513,9 +513,9 @@ class Canvas : Object native abstract
native vararg void DrawShapeFill(Color col, double amount, Shape2D s, ...);
native vararg void DrawChar(Font font, int normalcolor, double x, double y, int character, ...);
native vararg void DrawText(Font font, int normalcolor, double x, double y, String text, ...);
native void DrawLine(int x0, int y0, int x1, int y1, Color color, int alpha = 255);
native void DrawLine(double x0, double y0, double x1, double y1, Color color, int alpha = 255);
native void DrawLineFrame(Color color, int x0, int y0, int w, int h, int thickness = 1);
native void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, Color color, int alpha = 255);
native void DrawThickLine(double x0, double y0, double x1, double y1, double thickness, Color color, int alpha = 255);
native Vector2, Vector2 VirtualToRealCoords(Vector2 pos, Vector2 size, Vector2 vsize, bool vbottom=false, bool handleaspect=true);
native void SetClipRect(int x, int y, int w, int h);
native void ClearClipRect();
@ -546,9 +546,9 @@ struct Screen native
native static vararg void DrawShapeFill(Color col, double amount, Shape2D s, ...);
native static vararg void DrawChar(Font font, int normalcolor, double x, double y, int character, ...);
native static vararg void DrawText(Font font, int normalcolor, double x, double y, String text, ...);
native static void DrawLine(int x0, int y0, int x1, int y1, Color color, int alpha = 255);
native static void DrawLine(double x0, double y0, double x1, double y1, Color color, int alpha = 255);
native static void DrawLineFrame(Color color, int x0, int y0, int w, int h, int thickness = 1);
native static void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, Color color, int alpha = 255);
native static void DrawThickLine(double x0, double y0, double x1, double y1, double thickness, Color color, int alpha = 255);
native static Vector2, Vector2 VirtualToRealCoords(Vector2 pos, Vector2 size, Vector2 vsize, bool vbottom=false, bool handleaspect=true);
native static double GetAspectRatio();
native static void SetClipRect(int x, int y, int w, int h);