static void pollScaling() { // Check the event queue. if (gEventQueueMutex == NULL) { return; } loom_mutex_lock(gEventQueueMutex); while (gEventQueue.size() > 0) { RescaleEventStatus curItem = gEventQueue.front(); gImageScaleProgressDelegate.pushArgument(curItem.path.c_str()); gImageScaleProgressDelegate.pushArgument(curItem.progress); gImageScaleProgressDelegate.invoke(); // Flush the asset (only works on main thread atm) if (curItem.progress == 1.0f) { loom_asset_flush(curItem.path.c_str()); } gEventQueue.pop_front(); } loom_mutex_unlock(gEventQueueMutex); }
void loom_asset_flushAll() { // Call flush on everything in the hash. utHashTableIterator<utHashTable<utHashedString, loom_asset_t *> > assetIterator(gAssetHash); while (assetIterator.hasMoreElements()) { utHashedString key = assetIterator.peekNextKey(); loom_asset_flush(key.str().c_str()); assetIterator.next(); } }