getting stuff working on windows again
[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 #include "addon.h"
10
11 #define SKATESHOP_BOARD_CACHE_MAX 10
12 #define SKATESHOP_VIEW_SLOT_MAX 6
13
14 struct{
15 v3f look_target;
16 ent_skateshop *ptr_ent;
17
18 int active;
19 float factive;
20
21 struct cache_board{
22 enum cache_board_state{
23 k_cache_board_state_none,
24 k_cache_board_state_loaded,
25 k_cache_board_state_load_request
26 }
27 state;
28
29 struct player_board board;
30 u32 reg_index;
31 addon_reg *reg_ptr;
32
33 u32 ref_count;
34 double last_use_time;
35 }
36 *cache;
37 SDL_SpinLock sl_cache_access;
38
39 struct shop_view_slot{
40 struct cache_board *cache_ptr;
41 float view_blend;
42 }
43 shop_view_slots[ SKATESHOP_VIEW_SLOT_MAX ];
44
45 #if 0
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 foldername[64]; /* if workshop, string version of its published ID. */
54 u32 foldername_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 /* worlds */
68 struct registry_world{
69 PublishedFileId_t workshop_id;
70 enum registry_board_state state;
71 char foldername[64];
72 u32 foldername_hash;
73 enum world_load_type type;
74
75 #if 0
76 int meta_present;
77 ent_worldinfo info;
78 #endif
79 }
80 *world_registry;
81 u32 t1_world_registry_count,
82 world_registry_count;
83 #endif
84 u32 selected_world_id,
85 selected_board_id,
86 pointcloud_world_id;
87 }
88 static global_skateshop;
89
90 VG_STATIC void global_skateshop_exit(void);
91 VG_STATIC void watch_cache_board( struct cache_board *ptr );
92 VG_STATIC void unwatch_cache_board( struct cache_board *ptr );
93
94 #endif /* ENT_SKATESHOP_H */