mirror of https://github.com/bjornbytes/lovr.git
Support table vector for buffer:setData
This commit is contained in:
parent
1a321d004b
commit
cd5b95efce
|
@ -248,6 +248,8 @@ void luax_checkdatatuples(lua_State* L, int index, int start, uint32_t count, co
|
|||
const DataField* field = &format->fields[f];
|
||||
if (lua_isuserdata(L, -1)) {
|
||||
luax_checkfieldv(L, -1, field->type, data + field->offset);
|
||||
} else if (lua_istable(L, -1)) {
|
||||
luax_checkfieldt(L, -1, field->type, data + field->offset);
|
||||
} else {
|
||||
while (n < (int) typeComponents[field->type]) {
|
||||
lua_rawgeti(L, -n - 1, subindex + n);
|
||||
|
|
|
@ -183,7 +183,7 @@ int luax_readmat4(lua_State* L, int index, mat4 m, int scaleComponents) {
|
|||
} // Fall through
|
||||
|
||||
case LUA_TTABLE:
|
||||
if (lua_type(L, index) == LUA_TTABLE && lua_objlen(L, index) >= 16) {
|
||||
if (lua_istable(L, index) && luax_len(L, index) >= 16) {
|
||||
luax_readobjarr(L, index, 16, m, "mat4");
|
||||
return index + 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue