Ignore effects if there's none in the list

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2022-11-01 21:38:12 +01:00
parent 4641420bb3
commit 69657a0014

View File

@ -222,6 +222,7 @@ void CImage::setup ()
this->m_image->getMaterial () this->m_image->getMaterial ()
); );
if (this->getImage ()->getEffects ().empty () == false)
{ {
// generate the effects used by this material // generate the effects used by this material
auto cur = this->getImage ()->getEffects ().begin (); auto cur = this->getImage ()->getEffects ().begin ();
@ -248,9 +249,7 @@ void CImage::setup ()
auto passEnd = (*materialCur)->getPasses ().end (); auto passEnd = (*materialCur)->getPasses ().end ();
for (; passCur != passEnd; passCur ++) for (; passCur != passEnd; passCur ++)
{
this->m_passes.push_back (*passCur); this->m_passes.push_back (*passCur);
}
} }
} }
} }
@ -258,11 +257,11 @@ void CImage::setup ()
// add the final passes too // add the final passes too
if (this->m_material->getPasses ().empty () == false) if (this->m_material->getPasses ().empty () == false)
{ {
auto passCur = this->m_material->getPasses ().begin (); auto cur = this->m_material->getPasses ().begin ();
auto passEnd = this->m_material->getPasses ().end (); auto end = this->m_material->getPasses ().end ();
for (; passCur != passEnd; passCur ++) for (; cur != end; cur ++)
this->m_passes.push_back (*passCur); this->m_passes.push_back (*cur);
} }
// calculate full animation time (if any) // calculate full animation time (if any)