X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprimitivebuilder.cpp;h=22106a344a828326c7329c5f482bc2a230e56a92;hb=4443707c752ab8ee288f1c22be08cf82f27439d7;hp=6a4d9bf0b866ccd1585a68ef05acf9b1c42df682;hpb=16f6f15328b3a6eec87b1b5e5822368966d44a38;p=libs%2Fgl.git diff --git a/source/primitivebuilder.cpp b/source/primitivebuilder.cpp index 6a4d9bf0..22106a34 100644 --- a/source/primitivebuilder.cpp +++ b/source/primitivebuilder.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2008, 2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -21,8 +21,8 @@ void PrimitiveBuilder::begin(PrimitiveType t) if(in_batch) throw InvalidState("begin() already called"); - type=t; - in_batch=true; + type = t; + in_batch = true; begin_(); } @@ -32,7 +32,7 @@ void PrimitiveBuilder::end() if(!in_batch) throw InvalidState("end() called without begin()"); - in_batch=false; + in_batch = false; end_(); } @@ -55,9 +55,12 @@ PrimitiveType PrimitiveBuilder::get_type() const void PrimitiveBuilder::vertex_(float x, float y, float z, float w) { - vab.texcoord(ts, tt, tr,tq); - vab.color(cr, cg, cb, ca); - vab.normal(nx, ny, nz); + vab.color(col); + vab.normal(nor); + for(std::map::iterator i=texc.begin(); i!=texc.end(); ++i) + vab.multitexcoord(i->first, i->second); + for(std::map::iterator i=attr.begin(); i!=attr.end(); ++i) + vab.attrib(i->first, i->second); vab.vertex(x, y, z, w); if(in_batch)