| 1569 | } |
| 1570 | |
| 1571 | void PostEffect::enable() |
| 1572 | { |
| 1573 | // Don't add TexGen PostEffects to the PostEffectManager! |
| 1574 | if ( mRenderTime == PFXTexGenOnDemand ) |
| 1575 | return; |
| 1576 | |
| 1577 | // Ignore it if its already enabled. |
| 1578 | if ( mEnabled ) |
| 1579 | return; |
| 1580 | |
| 1581 | mEnabled = true; |
| 1582 | |
| 1583 | // We cannot really enable the effect |
| 1584 | // until its been registed. |
| 1585 | if ( !isProperlyAdded() ) |
| 1586 | return; |
| 1587 | |
| 1588 | // If the enable callback returns 'false' then |
| 1589 | // leave the effect disabled. |
| 1590 | if ( !onEnabled_callback() ) |
| 1591 | { |
| 1592 | mEnabled = false; |
| 1593 | return; |
| 1594 | } |
| 1595 | |
| 1596 | PFXMGR->_addEffect( this ); |
| 1597 | } |
| 1598 | |
| 1599 | void PostEffect::disable() |
| 1600 | { |
no test coverage detected