Skip to content

Commit

Permalink
make the game work in love 12 (still using deprecated functions)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Aug 20, 2023
1 parent 9b27603 commit fac83e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compat/game21/dynamic_quads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ end

function quads:set_instance_attribute_array(attribute, attr_type, components, values)
if self.instance_meshes[attribute] == nil or #values ~= self.instance_meshes[attribute]:getVertexCount() then
-- give some fake draw mode as love 12 does not like nil as draw mode anymore
self.instance_meshes[attribute] =
love.graphics.newMesh({ { attribute, attr_type, components } }, values, nil, "stream")
love.graphics.newMesh({ { attribute, attr_type, components } }, values, "strip", "stream")
self.mesh:attachAttribute(attribute, self.instance_meshes[attribute], "perinstance")
else
self.instance_meshes[attribute]:setVertices(values)
Expand Down
3 changes: 2 additions & 1 deletion compat/game21/dynamic_tris.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ end

function tris:set_instance_attribute_array(attribute, attr_type, components, values)
if self.instance_meshes[attribute] == nil or #values ~= self.instance_meshes[attribute]:getVertexCount() then
-- give some fake draw mode as love 12 does not like nil as draw mode anymore
self.instance_meshes[attribute] =
love.graphics.newMesh({ { attribute, attr_type, components } }, values, nil, "stream")
love.graphics.newMesh({ { attribute, attr_type, components } }, values, "strip", "stream")
self.mesh:attachAttribute(attribute, self.instance_meshes[attribute], "perinstance")
else
self.instance_meshes[attribute]:setVertices(values)
Expand Down

0 comments on commit fac83e3

Please sign in to comment.