From 4387935f16c638f72f0ba36933162407a058d003 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Fri, 29 Mar 2024 21:01:04 -0300 Subject: [PATCH] Allow drawing a Mesh that has no VertexPosition attribute, if it has custom attributes. --- src/modules/graphics/Mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/Mesh.cpp b/src/modules/graphics/Mesh.cpp index adbd8c896..d4ea341dd 100644 --- a/src/modules/graphics/Mesh.cpp +++ b/src/modules/graphics/Mesh.cpp @@ -634,8 +634,8 @@ void Mesh::drawInternal(Graphics *gfx, const Matrix4 &m, int instancecount, Buff } // Not supported on all platforms or GL versions, I believe. - if (!attributes.isEnabled(ATTRIB_POS)) - throw love::Exception("Mesh must have an enabled VertexPosition attribute to be drawn."); + if ((attributes.enableBits & ~(ATTRIBFLAG_TEXCOORD | ATTRIBFLAG_COLOR)) == 0) + throw love::Exception("Mesh must have an enabled VertexPosition or custom attribute to be drawn."); Graphics::TempTransform transform(gfx, m);