-/*
- * op: k_async_op_world_scan
- * -----------------------------------------------------------------------------
- */
-
-/*
- * Reciever for scan completion. copies the registry_count back into t0
- */
-VG_STATIC void workshop_async_world_reg_update( void *data, u32 size )
-{
- vg_info( "World registry update notify\n" );
- global_skateshop.world_registry_count =
- global_skateshop.t1_world_registry_count;
- skaterift_end_op();
-}
-
-/*
- * Add a local world folder to the registry, it will verify existing ones are
- * still there too.
- */
-VG_STATIC void world_scan_register_local( const char *folder_name )
-{
- u32 hash = vg_strdjb2( folder_name );
- for( u32 i=0; i<global_skateshop.t1_world_registry_count; i++ ){
- struct registry_world *reg =
- &global_skateshop.world_registry[i];
-
- if( const_str_eq( hash, folder_name, reg->foldername ) ){
- reg->state = k_registry_board_state_indexed;
- return;
- }
- }
-
- if( global_skateshop.t1_world_registry_count == SKATESHOP_WORLDS_MAX ){
- vg_error( "You have too many worlds installed!\n" );
- return;
- }
-
- vg_info( "new listing!: %s\n", folder_name );
-
- struct registry_world *reg = &global_skateshop.world_registry[
- global_skateshop.t1_world_registry_count ++ ];
-
- vg_strncpy( folder_name, reg->foldername, 64, k_strncpy_overflow_fatal );
- reg->foldername_hash = hash;
- reg->state = k_registry_board_state_indexed;
- //reg->meta_present = 0;
- reg->type = k_world_load_type_local;
-}
-
-/*
- * Async thread which scans local files for boards, as well as scheduling
- * synchronous calls to the workshop
- */
-VG_STATIC void world_scan_thread( void *_args )
-{
- vg_linear_clear( vg_mem.scratch );
-
- for( u32 i=0; i<global_skateshop.t1_world_registry_count; i++ ){
- struct registry_world *reg = &global_skateshop.world_registry[i];
- reg->state = k_registry_board_state_indexed_absent;
- }
-
- /*
- * Local disk scan
- */
- vg_info( "Scanning maps/*.mdl\n" );
-
- char path_buf[4096];
- vg_str path;
- vg_strnull( &path, path_buf, 4096 );
- vg_strcat( &path, "maps/" );
-
- DIR *dir = opendir( path.buffer );
- if( !dir ){
- vg_error( "opendir('maps') failed\n" );
- vg_async_call( workshop_async_any_complete, NULL, 0 );
- return;
- }
-
- struct dirent *entry;
- while( (entry = readdir(dir)) ){
- if( entry->d_type == DT_DIR ){
- if( entry->d_name[0] == '.' ) continue;