1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 12:45:36 +00:00

Don't reallocate light list vector unnecessarily

This commit is contained in:
bzzt 2019-02-20 13:37:00 +00:00 committed by Capostrophic
parent a567111400
commit 8c649f05e6

View file

@ -234,6 +234,7 @@ namespace SceneUtil
{ {
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet; osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
std::vector<osg::ref_ptr<osg::Light> > lights; std::vector<osg::ref_ptr<osg::Light> > lights;
lights.reserve(lightList.size());
for (unsigned int i=0; i<lightList.size();++i) for (unsigned int i=0; i<lightList.size();++i)
{ {
lights.push_back(lightList[i]->mLightSource->getLight(frameNum)); lights.push_back(lightList[i]->mLightSource->getLight(frameNum));