mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:16:56 +02:00
Make sure we start fade in once an item becomes ready
This commit is contained in:
parent
2514587899
commit
c5628b615c
1 changed files with 12 additions and 1 deletions
|
@ -533,10 +533,21 @@ void ModelMeshPartPayload::startFade() {
|
||||||
void ModelMeshPartPayload::render(RenderArgs* args) const {
|
void ModelMeshPartPayload::render(RenderArgs* args) const {
|
||||||
PerformanceTimer perfTimer("ModelMeshPartPayload::render");
|
PerformanceTimer perfTimer("ModelMeshPartPayload::render");
|
||||||
|
|
||||||
if (!_model->_readyWhenAdded || !_model->_isVisible || !_hasStartedFade) {
|
if (!_model->_readyWhenAdded || !_model->_isVisible) {
|
||||||
return; // bail asap
|
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
|
// When an individual mesh parts like this finishes its fade, we will mark the Model as
|
||||||
// having render items that need updating
|
// having render items that need updating
|
||||||
bool nextIsFading = _isFading ? isStillFading() : false;
|
bool nextIsFading = _isFading ? isStillFading() : false;
|
||||||
|
|
Loading…
Reference in a new issue