+static void skaterift_populate_world_savedata( savedata_file *file,
+ enum world_purpose which ){
+ file->path[0] = '\0';
+ file->len = 0;
+ addon_reg *reg = NULL;
+ if( which == k_world_purpose_hub ) reg = world_static.addon_hub;
+ else reg = world_static.addon_client;
+
+ if( !reg ){
+ vg_error( "Tried to save unspecified world (reg was null)\n" );
+ return;
+ }
+
+ skaterift_world_get_save_path( which, file->path );
+
+ vg_msg sav = {0};
+ sav.buf = file->buf;
+ sav.max = sizeof(file->buf);
+
+ if( which == k_world_purpose_hub ){
+ if( world_static.instances[0].status == k_world_status_loaded )
+ world_entity_serialize( &world_static.instances[0], &sav );
+ }
+ else {
+ for( u32 i=1; i<vg_list_size(world_static.instances); i++ ){
+ world_instance *instance = &world_static.instances[i];
+ if( instance->status == k_world_status_loaded ){
+ world_entity_serialize( instance, &sav );
+ }
+ }
+ }
+
+ file->len = sav.len;
+}
+
+static void skaterift_populate_main_savedata( savedata_file *file ){
+ strcpy( file->path, str_skaterift_main_save );