]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexformat.cpp
Use standard fixed-size integer types
[libs/gl.git] / source / core / vertexformat.cpp
index 7dcb7aba5472e9438671ef31da1036ef15276c8b..9bfca5d295ad9688303d575434999700a368240e 100644 (file)
@@ -38,7 +38,7 @@ VertexFormat VertexFormat::operator,(DataType t) const
                throw invalid_operation("VertexFormat::operator,");
 
        VertexFormat r = *this;
-       UInt16 &a = r.attributes[r.count-1];
+       uint16_t &a = r.attributes[r.count-1];
        a = make_typed_attribute(static_cast<VertexAttribute>(a), t);
 
        return r;
@@ -50,7 +50,7 @@ VertexFormat VertexFormat::operator,(unsigned i) const
                throw invalid_operation("VertexFormat::operator,");
 
        VertexFormat r = *this;
-       UInt16 &a = r.attributes[r.count-1];
+       uint16_t &a = r.attributes[r.count-1];
        a = make_indexed_attribute(static_cast<VertexAttribute>(a), i);
 
        return r;
@@ -66,7 +66,7 @@ bool VertexFormat::operator==(const VertexFormat &other) const
 unsigned VertexFormat::stride() const
 {
        unsigned s = 0;
-       for(const UInt16 *i=begin(); i!=end(); ++i)
+       for(const uint16_t *i=begin(); i!=end(); ++i)
                s += get_attribute_size(*i);
        return s;
 }
@@ -75,7 +75,7 @@ int VertexFormat::offset(VertexAttribute attr) const
 {
        unsigned sem = get_attribute_semantic(attr);
        unsigned offs = 0;
-       for(const UInt16 *i=begin(); i!=end(); ++i)
+       for(const uint16_t *i=begin(); i!=end(); ++i)
        {
                if(get_attribute_semantic(*i)==sem)
                {
@@ -125,7 +125,7 @@ VertexAttribute make_indexed_attribute(VertexAttribute attr, unsigned index)
 
 bool convert_attribute_type(string::const_iterator &i, string::const_iterator end, const char *name, VertexAttribute &attr, DataType type)
 {
-       string::const_iterator j = i;
+       auto j = i;
        for(; (j!=end && *j!='_' && *name); ++name, ++j)
                if(*j!=*name)
                        return false;
@@ -138,7 +138,7 @@ bool convert_attribute_type(string::const_iterator &i, string::const_iterator en
 
 bool convert_attribute(const string &str, const char *name, int min_size, int max_size, VertexAttribute &attr, VertexAttribute base_attr)
 {
-       string::const_iterator i = str.begin();
+       auto i = str.begin();
        for(; *name; ++name, ++i)
                if(*i!=*name)
                        return false;