Fix Buffer constructor bug;

This commit is contained in:
bjorn 2016-11-13 02:42:05 -08:00
parent 11f35763b7
commit b619a65946
1 changed files with 2 additions and 1 deletions

View File

@ -452,12 +452,13 @@ int l_lovrGraphicsNewBuffer(lua_State* L) {
if (lua_isnumber(L, 1)) {
size = lua_tointeger(L, 1);
} else if (lua_istable(L, 1)) {
drawModeIndex++;
if (lua_isnumber(L, 2)) {
drawModeIndex++;
luax_checkbufferformat(L, 1, &format);
size = lua_tointeger(L, 2);
dataIndex = 0;
} else if (lua_istable(L, 2)) {
drawModeIndex++;
luax_checkbufferformat(L, 1, &format);
size = lua_objlen(L, 2);
dataIndex = 2;