Make sure we start fade in once an item becomes ready

This commit is contained in:
Brad Davis 2016-08-24 16:05:22 -07:00
parent 2514587899
commit c5628b615c

View file

@ -533,10 +533,21 @@ void ModelMeshPartPayload::startFade() {
void ModelMeshPartPayload::render(RenderArgs* args) const {
PerformanceTimer perfTimer("ModelMeshPartPayload::render");
if (!_model->_readyWhenAdded || !_model->_isVisible || !_hasStartedFade) {
if (!_model->_readyWhenAdded || !_model->_isVisible) {
return; // bail asap
}
// If we didn't start the fade in, check if we are ready to now....
if (!_hasStartedFade && _model->isLoaded() && _model->getGeometry()->areTexturesLoaded()) {
const_cast<ModelMeshPartPayload&>(*this).startFade();
}
// If we still didn't start the fade in, bail
if (!_hasStartedFade) {
return;
}
// When an individual mesh parts like this finishes its fade, we will mark the Model as
// having render items that need updating
bool nextIsFading = _isFading ? isStillFading() : false;