mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.
Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column". --HG-- branch : minor
This commit is contained in:
@@ -135,9 +135,14 @@ int w_Transform_setMatrix(lua_State *L)
|
||||
bool columnmajor = false;
|
||||
|
||||
int idx = 2;
|
||||
if (lua_isboolean(L, idx))
|
||||
if (lua_type(L, idx) == LUA_TSTRING)
|
||||
{
|
||||
columnmajor = luax_toboolean(L, idx);
|
||||
const char *layoutstr = lua_tostring(L, idx);
|
||||
Transform::MatrixLayout layout;
|
||||
if (!Transform::getConstant(layoutstr, layout))
|
||||
return luaL_error(L, "Invalid matrix layout: %s", layoutstr);
|
||||
|
||||
columnmajor = (layout == Transform::MATRIX_COLUMN_MAJOR);
|
||||
idx++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user