Support table vector for buffer:setData

This commit is contained in:
xiejiangzhi 2024-02-07 11:43:20 +08:00
parent 1a321d004b
commit cd5b95efce
2 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}