+/* TODO: migrate to addon.c */
+void addon_system_pre_update(void)
+{
+ if( !vg_loader_availible() ) return;
+
+ SDL_AtomicLock( &addon_system.sl_cache_using_resources );
+ for( u32 type=0; type<k_addon_type_max; type++ )
+ {
+ struct addon_cache *cache = &addon_system.cache[type];
+
+ for( u32 id=1; id<=cache->pool.count; id++ )
+ {
+ addon_cache_entry *entry = vg_pool_item( &cache->pool, id );
+ if( entry->state == k_addon_cache_state_load_request )
+ {
+ SDL_AtomicUnlock( &addon_system.sl_cache_using_resources );
+ vg_loader_start( T1_addon_cache_load_loop, NULL );
+ return;
+ }
+ }
+ }
+ SDL_AtomicUnlock( &addon_system.sl_cache_using_resources );
+}
+