]> git.tdb.fi Git - libs/gl.git/commitdiff
Tweak the comma operator between VertexAttribute and unsigned
authorMikko Rasa <tdb@tdb.fi>
Mon, 13 Sep 2021 17:03:12 +0000 (20:03 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 13 Sep 2021 17:03:12 +0000 (20:03 +0300)
It now returns VertexAttribute instead of VertexFormat, avoiding the need
to call make_indexed_attribute in some cases.

source/core/vertexformat.h
source/render/instancearray.cpp

index c7a2fcf166ef28d468289891db3ca9a82ab31e9b..e3c1205058fe3e889e6deea55d2d401c42ab7f24 100644 (file)
@@ -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); }
 
index 039a50ecde32a7500850ca107f040169fe0b5692..427976129d65b1a4e5f0c82caf725822111a44b7 100644 (file)
@@ -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);