From a04e4054b3001d24a540a0e7b088d270f3e07c07 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 13 Sep 2021 20:03:12 +0300 Subject: [PATCH] Tweak the comma operator between VertexAttribute and unsigned It now returns VertexAttribute instead of VertexFormat, avoiding the need to call make_indexed_attribute in some cases. --- source/core/vertexformat.h | 6 +++--- source/render/instancearray.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/core/vertexformat.h b/source/core/vertexformat.h index c7a2fcf1..e3c12050 100644 --- a/source/core/vertexformat.h +++ b/source/core/vertexformat.h @@ -77,11 +77,11 @@ public: inline VertexFormat operator,(VertexAttribute a1, VertexAttribute a2) { return (VertexFormat(a1), a2); } -inline VertexFormat operator,(VertexAttribute a, unsigned i) -{ return (VertexFormat(a), i); } - VertexAttribute make_indexed_attribute(VertexAttribute, unsigned); +inline VertexAttribute operator,(VertexAttribute a, unsigned i) +{ return make_indexed_attribute(a, i); } + DEPRECATED inline VertexAttribute make_indexed_component(VertexAttribute a, unsigned i) { return make_indexed_attribute(a, i); } diff --git a/source/render/instancearray.cpp b/source/render/instancearray.cpp index 039a50ec..42797612 100644 --- a/source/render/instancearray.cpp +++ b/source/render/instancearray.cpp @@ -46,7 +46,7 @@ InstanceArray::InstanceArray(const Object &o): { instance_data = new VertexArray((RAW_ATTRIB4,matrix_location, RAW_ATTRIB4,matrix_location+1, RAW_ATTRIB4,matrix_location+2)); const VertexFormat &fmt = instance_data->get_format(); - matrix_offset = fmt.offset(make_indexed_attribute(RAW_ATTRIB4, matrix_location)); + matrix_offset = fmt.offset((RAW_ATTRIB4,matrix_location)); instance_buffer = new Buffer; instance_data->use_buffer(instance_buffer); -- 2.43.0