فهرست منبع

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.
Alex Szpakowski 5 سال پیش
والد
کامیت
3c65d5ae41
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/modules/graphics/wrap_Graphics.cpp

+ 2 - 2
src/modules/graphics/wrap_Graphics.cpp

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