X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexformat.cpp;h=457cffad2724548cc31577fc0267e2c368ec421b;hb=c6c4fc39952e372eba1f44f2bc504428140f3d0e;hp=b9bd7b9402414f16ad3b0c70d11a835b12ef9c3f;hpb=e20075bffbbe1f3aaa9cc149953525a7e855f496;p=libs%2Fgl.git diff --git a/source/vertexformat.cpp b/source/vertexformat.cpp index b9bd7b94..457cffad 100644 --- a/source/vertexformat.cpp +++ b/source/vertexformat.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -55,6 +55,14 @@ VertexFormat::~VertexFormat() delete[] data; } +unsigned VertexFormat::stride() const +{ + uint s=0; + for(const unsigned char *i=begin(); i!=end(); ++i) + s+=(*i&3)+1; + return s; +} + VertexFormat operator,(const VertexFormat &f, VertexComponent c) { VertexFormat r=f; @@ -96,14 +104,6 @@ VertexFormat operator,(const VertexFormat &f, unsigned i) return r; } -uint get_stride(const VertexFormat &f) -{ - uint stride=0; - for(const unsigned char *i=f.begin(); i!=f.end(); ++i) - stride+=(*i&3)+1; - return stride; -} - istream &operator>>(istream &in, VertexFormat &f) { string str;