|
Torque2D Reference
|
#include <assetManager.h>
Public Member Functions | |
| ScopedAssetUpdate (AssetManager *pAssetManager, const bool suppressDirty=false) | |
| ~ScopedAssetUpdate () | |
Collapses a run of asset changes into a single notification, and optionally stops them marking anything dirty.
Two things need this. A restore replays every setter on an asset, each of which calls refreshAsset, and one undo step should read as one change and should not itself count as an edit. And the notification loop can come back round: ParticleAssetEmitter::onAssetRefreshed calls refreshAsset on its owner, so an image change reaches the owning particle asset once per emitter pointed at it.
Notifications raised inside the scope are queued, deduplicated, and drained when the outermost scope closes. The drain holds the depth, so a notification raised by a callback joins the same drain rather than starting a new one – which also bounds what used to be an unguarded recursion through mutually dependent assets.
| ScopedAssetUpdate | ( | AssetManager * | pAssetManager, |
| const bool | suppressDirty = false ) |
| ~ScopedAssetUpdate | ( | ) |