From 6ee2b901f73a0b32660d1a25e99ef494768d75b6 Mon Sep 17 00:00:00 2001 From: bjorn Date: Thu, 28 Apr 2022 20:26:47 -0700 Subject: [PATCH] Fix to buffer constructor; --- src/api/l_graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/l_graphics.c b/src/api/l_graphics.c index e4a2893a..13ded53b 100644 --- a/src/api/l_graphics.c +++ b/src/api/l_graphics.c @@ -184,7 +184,7 @@ static void luax_checkbufferformat(lua_State* L, int index, BufferInfo* info) { field->location = lua_isnil(L, -1) ? location++ : luaL_checkinteger(L, -1); // TODO names lua_pop(L, 1); } else if (lua_isstring(L, -1)) { - FieldType type = luax_checkfieldtype(L, index); + FieldType type = luax_checkfieldtype(L, -1); uint32_t align = layout == LAYOUT_PACKED ? fieldInfo[type].scalarAlign : fieldInfo[type].baseAlign; field->offset = ALIGN(offset, align); field->location = location++;