X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=workshop.h;h=9029ed09d12d0bfddff000aae8edc869dcb6a67f;hb=63b5ac44f74599b21c4b9b18398c29b797337bea;hp=a08bc4d25602ad631880b5f04e3dc741d29ad19a;hpb=ac6288a8951db15eab6c681b8add8f350eb60746;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/workshop.h b/workshop.h index a08bc4d..9029ed0 100644 --- a/workshop.h +++ b/workshop.h @@ -4,19 +4,22 @@ #define VG_GAME #include "vg/vg.h" #include "vg/vg_steam_remote_storage.h" +#include "skaterift.h" +#include "pointcloud.h" -struct workshop{ - enum workshop_operation{ - k_workshop_form_op_none, - k_workshop_form_op_loading_model, - k_workshop_form_op_downloading_submission, - k_workshop_form_op_publishing_update, - k_workshop_op_item_scan, - k_workshop_op_item_load - } - operation; -} -static workshop; +struct workshop_file_info{ + u64 author; + char author_name[32]; + char title[64]; +}; + +struct world_file_info{ + char title[64]; /* extracted from ent_worldinfo */ + char location[64]; + + u32 pointcloud_count; + pointcloud_vert pointcloud[]; +}; struct async_workshop_filepath_info{ PublishedFileId_t id; @@ -29,32 +32,21 @@ struct async_workshop_installed_files_info{ u32 *len; /* inout */ }; -VG_STATIC void async_workshop_get_filepath( void *data, u32 len ); -VG_STATIC void async_workshop_get_installed_files( void *data, u32 len ); +struct async_workshop_metadata_info{ + struct workshop_file_info *info; + const char *path; +}; -/* - * Start a new operation and crash if we are already running one. - */ -VG_STATIC int workshop_begin_op( enum workshop_operation op ) +VG_STATIC void workshop_file_info_clear( struct workshop_file_info *info ) { - if( workshop.operation != k_workshop_form_op_none ){ - vg_error( "Workshop form currently executing op(%d), tried to " - "start op(%d)\n", workshop.operation, op ); - return 0; - } - - workshop.operation = op; - vg_info( "Starting op( %d )\n", op ); - return 1; + info->author = 0ul; + info->author_name[0] = '\0'; + info->title[0] = '\0'; } -/* - * Finished operation, otheres can now run - */ -VG_STATIC void workshop_end_op(void) -{ - vg_info( "Finishing op( %d )\n", workshop.operation ); - workshop.operation = k_workshop_form_op_none; -} +VG_STATIC void async_workshop_get_filepath( void *data, u32 len ); +VG_STATIC void async_workshop_get_installed_files( void *data, u32 len ); +VG_STATIC void workshop_load_metadata( const char *path, + struct workshop_file_info *info ); #endif /* WORKSHOP_H */