@@ -179,26 +179,23 @@ namespace ren {
179179 GLsizei npixelx, GLsizei npixely, GLsizei npixelz,
180180 const std::string& assetName)
181181 {
182- // get fbo
183- // uint64_t containerID = spire::getESTypeID<ren::FBO>();
184- // spire::BaseComponentContainer* container =
185- // core.getComponentContainer(containerID);
186- // spire::CerealHeap<ren::FBO>* contFBO =
187- // dynamic_cast<spire::CerealHeap<ren::FBO>*>(container);
188- spire::CerealHeap<ren::FBO>* contFBO =
189- core.getOrCreateComponentContainer <ren::FBO>();
190- std::pair<const ren::FBO*, size_t > component =
191- contFBO->getComponent (getEntityIDForName (assetName));
192- if (component.first == nullptr )
182+ auto contFBO = core.getOrCreateComponentContainer <ren::FBO>();
183+ auto component = contFBO->getComponent (getEntityIDForName (assetName));
184+ if (!component.first )
185+ {
193186 return createFBO (core, ttype, npixelx, npixely, npixelz, assetName);
187+ }
194188 else
195189 {
196190 FBOData fboData = getFBOData (assetName);
197- if (fboData.numPixelsX == npixelx &&
198- fboData. numPixelsY == npixely)
191+ if (fboData.numPixelsX == npixelx && fboData. numPixelsY == npixely)
192+ {
199193 return component.first ->glid ;
194+ }
200195 else
196+ {
201197 return resizeFBO (core, assetName, npixelx, npixely, npixelz);
198+ }
202199 }
203200 }
204201
@@ -296,7 +293,6 @@ namespace ren {
296293 return it->second ;
297294 }
298295 }
299-
300296 throw std::runtime_error (" FBOMan: Unable to find FBO data" );
301297 }
302298
@@ -352,7 +348,7 @@ namespace ren {
352348 // GARBAGE COLLECTION
353349 // ------------------------------------------------------------------------------
354350
355- void FBOMan::runGCAgainstVaidIDs (const std::set<GLuint>& validKeys)
351+ void FBOMan::runGCAgainstValidIDs (const std::set<GLuint>& validKeys)
356352 {
357353 // Every GLuint in validKeys should be in our map. If there is not, then
358354 // there is an error in the system, and it should be reported.
@@ -374,7 +370,7 @@ namespace ren {
374370
375371 if (it == mFBOData .end ())
376372 {
377- std::cerr << " runGCAgainstVaidIDs : terminating early, validKeys contains "
373+ std::cerr << " runGCAgainstValidIDs : terminating early, validKeys contains "
378374 << " elements not in FBO map." << std::endl;
379375 break ;
380376 }
@@ -384,7 +380,7 @@ namespace ren {
384380 // component, this is not an error.
385381 if (it->first > id)
386382 {
387- std::cerr << " runGCAgainstVaidIDs : validKeys contains elements not in the FBO map." << std::endl;
383+ std::cerr << " runGCAgainstValidIDs : validKeys contains elements not in the FBO map." << std::endl;
388384 }
389385
390386 // Increment passed current validKey id.
@@ -414,8 +410,9 @@ namespace ren {
414410 void postWalkComponents (spire::ESCoreBase& core) override
415411 {
416412 std::weak_ptr<FBOMan> im = core.getStaticComponent <StaticFBOMan>()->instance_ ;
417- if (std::shared_ptr<FBOMan> man = im.lock ()) {
418- man->runGCAgainstVaidIDs (mValidKeys );
413+ if (std::shared_ptr<FBOMan> man = im.lock ())
414+ {
415+ man->runGCAgainstValidIDs (mValidKeys );
419416 mValidKeys .clear ();
420417 }
421418 else
0 commit comments