X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fvertexformat.cpp;h=e529f4eb2632770e91ae68b3bd221cc913ca0382;hb=a3cc9f4469153396c7ad0868f3cbb2d2f698d710;hp=65bbea49887ad82f1cdf4097204861bba79e197b;hpb=2815449aa1c2a3c813f50ff85325cc2a3334430c;p=libs%2Fgl.git diff --git a/source/core/vertexformat.cpp b/source/core/vertexformat.cpp index 65bbea49..e529f4eb 100644 --- a/source/core/vertexformat.cpp +++ b/source/core/vertexformat.cpp @@ -1,11 +1,10 @@ #include +#include #include #include #include #include "error.h" -#include "misc.h" #include "vertexformat.h" -#include using namespace std; @@ -95,11 +94,7 @@ VertexAttribute make_indexed_attribute(VertexAttribute attr, unsigned index) else if(attrGENERIC4) throw invalid_argument("make_indexed_attribute"); - static int max_attribs = -1; - if(max_attribs<0) - max_attribs = get_i(GL_MAX_VERTEX_ATTRIBS); - - if(static_cast((base>>3)+index)>=max_attribs) + if(static_cast((base>>3)+index)>=31) throw out_of_range("make_indexed_attribute"); return static_cast(base+index*8); @@ -147,7 +142,10 @@ void operator>>(const LexicalConverter &conv, VertexAttribute &a) else if(str=="TANGENT3") a = TANGENT3; else if(str=="BINORMAL3") - a = BINORMAL3; + { + IO::print(IO::cerr, "BINORMAL3 attribute is deprecated\n"); + a = make_indexed_attribute(GENERIC3, 5); + } else if(!convert_attribute(str, "VERTEX", 2, 4, a, VERTEX2) && !convert_attribute(str, "GROUP", 1, 4, a, GROUP1) && !convert_attribute(str, "WEIGHT", 1, 4, a, WEIGHT1) &&