-VG_STATIC void skateshop_init(void){
- u32 cache_size = sizeof(struct cache_board)*SKATESHOP_BOARD_CACHE_MAX;
- global_skateshop.cache = vg_linear_alloc( vg_mem.rtmemory, cache_size );
- memset( global_skateshop.cache, 0, cache_size );
-
- for( i32 ib=0; ib<SKATESHOP_BOARD_CACHE_MAX; ib++ ){
- i32 ia = ib-1, ic = ib+1;
- struct cache_board *arr = global_skateshop.cache,
- *pb = &arr[ib],
- *pa = ia>=0? &arr[ia]: NULL,
- *pc = ic<SKATESHOP_BOARD_CACHE_MAX? &arr[ic]: NULL;
- pb->left = pa;
- pb->right = pc;
-
- pb->state = k_cache_board_state_none;
- pb->reg_ptr= NULL;
- pb->reg_index = 0xffffffff;
- pb->ref_count = 0;
- }
-
- global_skateshop.cache_head = global_skateshop.cache;
- global_skateshop.cache_tail =
- &global_skateshop.cache[SKATESHOP_BOARD_CACHE_MAX-1];
-}
-
-VG_STATIC struct cache_board *skateshop_selected_cache_if_loaded(void)
-{
- if( addon_count(k_workshop_file_type_board) ){
- addon_reg *reg = get_addon_from_index(k_workshop_file_type_board,
- global_skateshop.selected_board_id);
-
- SDL_AtomicLock( &global_skateshop.sl_cache_access );
- if( reg->userdata ){
- struct cache_board *cache_ptr = reg->userdata;
- if( cache_ptr->state == k_cache_board_state_loaded ){
- SDL_AtomicUnlock( &global_skateshop.sl_cache_access );
- return cache_ptr;
- }
- }
- SDL_AtomicUnlock( &global_skateshop.sl_cache_access );
- }
-
- return NULL;
-}
-
-VG_STATIC void pointcloud_async_end(void *_, u32 __)
-{
- pointcloud_animate( k_pointcloud_anim_opening );
-}