Skip to content

Commit

Permalink
Fix Mesh:setDrawRange base vertex;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Sep 26, 2024
1 parent cc0f86c commit 139af13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/l_graphics_mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int l_lovrMeshSetDrawRange(lua_State* L) {
} else {
uint32_t start = luax_checku32(L, 2) - 1;
uint32_t count = luax_checku32(L, 3);
uint32_t offset = luax_optu32(L, 3, 0);
uint32_t offset = luax_optu32(L, 4, 0);
luax_assert(L, lovrMeshSetDrawRange(mesh, start, count, offset));
}

Expand Down
6 changes: 6 additions & 0 deletions test/lovr/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ group('graphics', function()
expect(mesh:getVertexBuffer():getData()).to.equal({{ x = 42 }})
end)
end)

test(':setDrawRange', function()
mesh = lovr.graphics.newMesh({{ 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }})
mesh:setDrawRange(1, 3, 2)
expect({ mesh:getDrawRange() }).to.equal({ 1, 3, 2 })
end)
end)

group('Pass', function()
Expand Down

0 comments on commit 139af13

Please sign in to comment.