X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstancescene.cpp;fp=source%2Finstancescene.cpp;h=adaebbba3ef364b34522df0a49dad2802c990b2f;hb=25c81b4953dd38993250321b9407ce8b0139cbeb;hp=e3e63767243a1a88ba1ea98655bb480b6ad4584b;hpb=d51a234320449909eb34c802faa1f0c516ef70a0;p=libs%2Fgl.git diff --git a/source/instancescene.cpp b/source/instancescene.cpp index e3e63767..adaebbba 100644 --- a/source/instancescene.cpp +++ b/source/instancescene.cpp @@ -1,13 +1,14 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2008, 2010-2011 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #include "object.h" #include "objectinstance.h" #include "instancescene.h" +#include "renderer.h" namespace Msp { namespace GL { @@ -36,13 +37,15 @@ void InstanceScene::remove(const Renderable &r) renderables.erase(&r); } -void InstanceScene::render(const Tag &tag) const +void InstanceScene::render(Renderer &renderer, const Tag &tag) const { + // XXX Check that the object has this pass to avoid some unnecessary function calls for(ObjectMap::const_iterator i=objects.begin(); i!=objects.end(); ++i) - i->first->render(i->second.begin(), i->second.end(), tag); + for(InstanceSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j) + (*j)->render(renderer, tag); for(RenderableSet::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) - (*i)->render(tag); + (*i)->render(renderer, tag); } } // namespace GL