mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
love.graphics.newIndexBuffer uses 0-based index values.
It can't be consistent with other buffer types or Buffer methods if it's 1-based.
This commit is contained in:
@@ -1734,7 +1734,7 @@ int w_newIndexBuffer(lua_State *L)
|
||||
for (size_t i = 0; i < arraylength; i++)
|
||||
{
|
||||
lua_rawgeti(L, 1, i + 1);
|
||||
lua_Integer v = luaL_checkinteger(L, -1) - 1;
|
||||
lua_Integer v = luaL_checkinteger(L, -1);
|
||||
lua_pop(L, 1);
|
||||
if (v < 0)
|
||||
return luaL_argerror(L, 1, "expected positive integer values in array");
|
||||
@@ -1771,7 +1771,7 @@ int w_newIndexBuffer(lua_State *L)
|
||||
for (size_t i = 0; i < arraylength; i++)
|
||||
{
|
||||
lua_rawgeti(L, 1, i + 1);
|
||||
lua_Integer v = luaL_checkinteger(L, -1) - 1;
|
||||
lua_Integer v = luaL_checkinteger(L, -1);
|
||||
lua_pop(L, 1);
|
||||
if (format == DATAFORMAT_UINT16)
|
||||
u16data[i] = (uint16) v;
|
||||
|
||||
Reference in New Issue
Block a user