From fac83e394886b530be78db52690be0fe694f574b Mon Sep 17 00:00:00 2001 From: Bauumm Date: Sun, 20 Aug 2023 23:43:21 +0200 Subject: [PATCH] make the game work in love 12 (still using deprecated functions) --- compat/game21/dynamic_quads.lua | 3 ++- compat/game21/dynamic_tris.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compat/game21/dynamic_quads.lua b/compat/game21/dynamic_quads.lua index 8464b9c..d5fe823 100644 --- a/compat/game21/dynamic_quads.lua +++ b/compat/game21/dynamic_quads.lua @@ -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) diff --git a/compat/game21/dynamic_tris.lua b/compat/game21/dynamic_tris.lua index 3b1cf13..afcb151 100644 --- a/compat/game21/dynamic_tris.lua +++ b/compat/game21/dynamic_tris.lua @@ -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)