put in its own file
[carveJwlIkooP6JGAAIwe30JlM.git] / addon.h
diff --git a/addon.h b/addon.h
index f1d466e10f7938237331c95a5e3d565e7af760e8..85b5014bf7c9d7e036a837cd6f6067d464d536e5 100644 (file)
--- a/addon.h
+++ b/addon.h
@@ -4,9 +4,20 @@
 #include "common.h"
 #include "vg/vg_steam_ugc.h"
 #include "workshop_types.h"
-#define ADDON_MOUNTED_MAX 128
+#include "addon_cache.h"
+
+#include "world.h"
+#include "player.h"
+
 #define ADDON_FOLDERNAME_MAX 64
 
+/* total count that we have knowledge of */
+#define ADDON_MOUNTED_MAX 128
+
+/* in memory and loaded stuffs */
+#define CACHE_BOARD_MAX  10
+#define CACHE_PLAYER_MAX 10
+
 typedef struct addon_reg addon_reg;
 struct {
    struct addon_reg{
@@ -32,6 +43,25 @@ struct {
 
    /* deffered: updates in main thread */
    u32 registry_type_counts[k_workshop_file_type_max]; 
+
+   /* caches */
+   struct cache_board{
+      enum cache_board_state{
+         k_cache_board_state_none,
+         k_cache_board_state_loaded,
+         k_cache_board_state_load_request
+      }
+      state;
+      struct player_board board;
+      u32 reg_index;
+      addon_reg *reg_ptr;
+
+      addon_cache_node cachenode;
+   }
+   *boards;
+   addon_cache board_cache;
+
+   SDL_SpinLock sl_cache;
 }
 static addon_system;