X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarraybuilder.cpp;h=09b0a1f2a85655e21e3f87b15525a7f8ac87d756;hb=bc3c82a86eeadde54be9fe32a8a8a76872ca99c3;hp=8e7e2cb5dd4433625747545cea073fee6715e89c;hpb=b8fef9be469eb16e54068bac7e275ea225efc71c;p=libs%2Fgl.git diff --git a/source/vertexarraybuilder.cpp b/source/vertexarraybuilder.cpp index 8e7e2cb5..09b0a1f2 100644 --- a/source/vertexarraybuilder.cpp +++ b/source/vertexarraybuilder.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -26,7 +26,8 @@ void VertexArrayBuilder::vertex_(float x, float y, float z, float w) for(const unsigned char *c=array.get_format().begin(); c!=array.get_format().end(); ++c) { uint size=(*c&3)+1; - switch(*c>>2) + uint type=*c>>2; + switch(type) { case 0: *ptr++=x; @@ -64,7 +65,7 @@ void VertexArrayBuilder::vertex_(float x, float y, float z, float w) } break; default: - const Attrib &a=av[(*c>>2)-4]; + const Attrib &a=av[type-4]; *ptr++=a.x; if(size>=2) *ptr++=a.y; if(size>=3) *ptr++=a.z;