glider bugfixes & animation
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_skateshop.h
index e7acd43255d456db1d2bb291431eafcba768ff58..68a34f4f7980a2f7224ba07402d2b70ad97bb3db 100644 (file)
@@ -2,77 +2,53 @@
 #define ENT_SKATESHOP_H
 
 #include "world.h"
+#include "world_load.h"
 #include "player.h"
+#include "vg/vg_steam_remote_storage.h"
+#include "workshop.h"
+#include "addon.h"
 
-#define MAX_LOCAL_BOARDS 64
-#define BILL_TIN_BOARDS  1
-#define MAX_DYNAMIC_BOARDS 9
+#define SKATESHOP_VIEW_SLOT_MAX    5
 
 struct{
    v3f look_target;
-   ent_skateshop *ptr_ent;
 
-   int active;
-   float factive;
-
-   enum skateshop_loc{
-      k_skateshop_loc_page__viewing,
-
-      k_skateshop_loc_select_use,
-      k_skateshop_loc_select_cancel,
-      k_skateshop_loc_select_upload,
-      k_skateshop_loc_page__selected,
-
-      k_skateshop_loc_page__upload,
+   struct shop_view_slot{
+      u16 cache_id;
+      float view_blend;
    }
-   interface_loc;
-
-   struct dynamic_board
-   {
-      enum dynamic_board_state{
-         k_dynamic_board_state_none,
-         k_dynamic_board_state_loaded,
-         k_dynamic_board_state_loading,
-      }
-      state;
-
-      u32 ref_count;
+   shop_view_slots[ SKATESHOP_VIEW_SLOT_MAX ];
 
-      struct player_board board;
+   u32 selected_world_id,
+       selected_board_id,
+       selected_player_id,
+       pointcloud_world_id;
 
-      u32 registry_id;
+   struct {
+      const char *item_title, *item_desc;
+      u32 reg_id;
 
-      double last_use_time;
+      const char *world_title, *world_loc;
+      u32 world_reg;
    }
-   *dynamic_boards;
+   render;
 
-   struct shop_view_slot
-   {
-      struct dynamic_board *db;
-      float view_blend;
-   }
-   shop_view_slots[6];
-
-   struct board_registry
-   {
-      int workshop;
-      u64 uid;
+   union {
+      struct gui_helper *helper_pick, *helper_toggle;
+   };
 
-      struct dynamic_board *dynamic;
+   struct gui_helper *helper_browse;
 
-      char filename[64];   /* if workshop, string version of uid. */
-      u32 filename_hash;
 
-      int ghost;
-   } 
-   *registry;
-   u32 registry_count;
-
-   int loading;
-   float interaction_cooldown;
-
-   u32 selected_registry_id;
+   addon_reg *reg_preview, *reg_loaded_preview;
+   GLuint tex_preview;
 }
-static global_skateshop;
+static global_skateshop={
+   .render={.reg_id=0xffffffff,.world_reg=0xffffffff}
+};
+
+static void ent_skateshop_preupdate( ent_skateshop *shop, int active );
+static void skateshop_render( ent_skateshop *shop );
+static void skateshop_render_nonfocused( world_instance *world, camera *cam );
 
 #endif /* ENT_SKATESHOP_H */