From 05eaafb79e6fa1bebff157e94563334d7ead700b Mon Sep 17 00:00:00 2001 From: jussi Date: Mon, 20 Nov 2023 21:04:53 +0200 Subject: Initial changes for Raylib 5.0 and some missing functions. --- src/shapes.c | 67 +++++++++++++++--------------------------------------------- 1 file changed, 16 insertions(+), 51 deletions(-) (limited to 'src/shapes.c') diff --git a/src/shapes.c b/src/shapes.c index c68504c..80e5f05 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -54,57 +54,6 @@ int lshapesDrawLine( lua_State *L ) { return 0; } -/* -> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color ) - -Draw a line using cubic-bezier curves in-out -*/ -int lshapesDrawLineBezier( lua_State *L ) { - Vector2 startPos = uluaGetVector2( L, 1 ); - Vector2 endPos = uluaGetVector2( L, 2 ); - float thickness = luaL_checknumber( L, 3 ); - Color color = uluaGetColor( L, 4 ); - - DrawLineBezier( startPos, endPos, thickness, color ); - - return 0; -} - -/* -> RL.DrawLineBezierQuad( Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thickness, Color color ) - -Draw line using quadratic bezier curves with a control point -*/ -int lshapesDrawLineBezierQuad( lua_State *L ) { - Vector2 startPos = uluaGetVector2( L, 1 ); - Vector2 endPos = uluaGetVector2( L, 2 ); - Vector2 controlPos = uluaGetVector2( L, 3 ); - float thickness = luaL_checknumber( L, 4 ); - Color color = uluaGetColor( L, 5 ); - - DrawLineBezierQuad( startPos, endPos, controlPos, thickness, color ); - - return 0; -} - -/* -> RL.DrawLineBezierCubic( Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thickness, Color color ) - -Draw line using quadratic bezier curves with a control point -*/ -int lshapesDrawLineBezierCubic( lua_State *L ) { - Vector2 startPos = uluaGetVector2( L, 1 ); - Vector2 endPos = uluaGetVector2( L, 2 ); - Vector2 startControlPos = uluaGetVector2( L, 3 ); - Vector2 endControlPos = uluaGetVector2( L, 4 ); - float thickness = luaL_checknumber( L, 5 ); - Color color = uluaGetColor( L, 6 ); - - DrawLineBezierCubic( startPos, endPos, startControlPos, endControlPos, thickness, color ); - - return 0; -} - /* > RL.DrawLineStrip( Vector2{} points, Color color ) @@ -130,6 +79,22 @@ int lshapesDrawLineStrip( lua_State *L ) { return 0; } +/* +> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color ) + +Draw a line using cubic-bezier curves in-out +*/ +int lshapesDrawLineBezier( lua_State *L ) { + Vector2 startPos = uluaGetVector2( L, 1 ); + Vector2 endPos = uluaGetVector2( L, 2 ); + float thickness = luaL_checknumber( L, 3 ); + Color color = uluaGetColor( L, 4 ); + + DrawLineBezier( startPos, endPos, thickness, color ); + + return 0; +} + /* > RL.DrawCircle( Vector2 center, float radius, Color color ) -- cgit v1.2.3