mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
added polyline support to love.graphics.line (the syntax is the same as love.graphics.polygon - either a list or a table of vertices)
This commit is contained in:
@@ -660,11 +660,16 @@ namespace opengl
|
||||
|
||||
int w_line(lua_State * L)
|
||||
{
|
||||
float x1 = (float)luaL_checknumber(L, 1);
|
||||
float y1 = (float)luaL_checknumber(L, 2);
|
||||
float x2 = (float)luaL_checknumber(L, 3);
|
||||
float y2 = (float)luaL_checknumber(L, 4);
|
||||
instance->line(x1, y1, x2, y2);
|
||||
int args = lua_gettop(L);
|
||||
if( args == 1 || args > 4) {
|
||||
instance->polyline(L);
|
||||
} else {
|
||||
float x1 = (float)luaL_checknumber(L, 1);
|
||||
float y1 = (float)luaL_checknumber(L, 2);
|
||||
float x2 = (float)luaL_checknumber(L, 3);
|
||||
float y2 = (float)luaL_checknumber(L, 4);
|
||||
instance->line(x1, y1, x2, y2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user