mission is possible 2
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_skateshop.h
1 #ifndef ENT_SKATESHOP_H
2 #define ENT_SKATESHOP_H
3
4 #include "world.h"
5 #include "world_load.h"
6 #include "player.h"
7 #include "vg/vg_steam_remote_storage.h"
8 #include "workshop.h"
9
10 #define SKATESHOP_REGISTRY_MAX 64
11 #define SKATESHOP_BOARD_CACHE_MAX 10
12 #define SKATESHOP_WORLDS_MAX 32
13 #define SKATESHOP_VIEW_SLOT_MAX 6
14 #define SKATESHOP_REGISTRYID_NONE 0xffffffff
15
16 struct{
17 v3f look_target;
18 ent_skateshop *ptr_ent;
19
20 int active;
21 float factive;
22
23 struct cache_board{
24 enum cache_board_state{
25 k_cache_board_state_none,
26 k_cache_board_state_loaded,
27 k_cache_board_state_load_request
28 }
29 state;
30
31 struct player_board board;
32 u32 registry_id;
33
34 u32 ref_count;
35 double last_use_time;
36 }
37 *cache;
38 SDL_SpinLock sl_cache_access;
39
40 struct shop_view_slot{
41 struct cache_board *cache_ptr;
42 float view_blend;
43 }
44 shop_view_slots[ SKATESHOP_VIEW_SLOT_MAX ];
45
46 struct registry_board{
47 PublishedFileId_t workshop_id;
48
49 /* only for steam workshop files */
50 struct workshop_file_info workshop;
51 struct cache_board *cache_ptr;
52
53 char filename[64]; /* if workshop, string version of its published ID. */
54 u32 filename_hash;
55
56 enum registry_board_state{
57 k_registry_board_state_none,
58 k_registry_board_state_indexed,
59 k_registry_board_state_indexed_absent /*was found but is now missing*/
60 }
61 state;
62 }
63 *registry;
64 u32 t1_registry_count,
65 registry_count;
66
67 u32 selected_registry_id;
68
69 /* worlds */
70 struct registry_world{
71 enum registry_board_state state;
72 char foldername[64];
73 u32 foldername_hash;
74 enum world_load_type type;
75
76 #if 0
77 int meta_present;
78 ent_worldinfo info;
79 #endif
80 }
81 *world_registry;
82 u32 t1_world_registry_count,
83 world_registry_count,
84 selected_world_id,
85 pointcloud_world_id;
86 }
87 static global_skateshop;
88
89 VG_STATIC void global_skateshop_exit(void);
90 VG_STATIC void watch_cache_board( struct cache_board *ptr );
91 VG_STATIC void unwatch_cache_board( struct cache_board *ptr );
92
93 #endif /* ENT_SKATESHOP_H */