- unsigned n;
- try
- {
- n = lexical_cast<unsigned>(str.substr(9));
- }
- catch(const lexical_error &)
- {
- throw lexical_error(format("conversion of '%s' to VertexAttribute", str));
- }
- a = make_indexed_attribute(static_cast<VertexAttribute>(GENERIC1+(str[7]-'1')), n);
+ if(convert_attribute(str, "VERTEX", 2, 4, a, VERTEX2) ||
+ convert_attribute(str, "COLOR", 3, 4, a, COLOR3) ||
+ convert_attribute(str, "NORMAL", 3, 3, a, NORMAL3) ||
+ convert_attribute(str, "TANGENT", 3, 3, a, TANGENT3) ||
+ convert_attribute(str, "GROUP", 1, 4, a, GROUP1) ||
+ convert_attribute(str, "WEIGHT", 1, 4, a, WEIGHT1) ||
+ convert_attribute(str, "TEXCOORD", 1, 4, a, TEXCOORD1) ||
+ convert_attribute(str, "GENERIC", 1, 4, a, GENERIC1))
+ return;