X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gen.h;h=b35c6c25f036a3a4380b1d7a0b24afa47ee2f401;hb=620beae94b362ae4d4c42e5ba3329a6211d67a8f;hp=9aaa0f3a7168bf9bb246b5b23709e3a167ad53a8;hpb=a1056ed8198f0f5be0e0f341da8bd49aa6c47198;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gen.h b/world_gen.h index 9aaa0f3..b35c6c2 100644 --- a/world_gen.h +++ b/world_gen.h @@ -875,18 +875,22 @@ VG_STATIC void world_unload( world_instance *world ) mesh_free( &world->mesh_route_lines ); mesh_free( &world->mesh_geo ); mesh_free( &world->mesh_no_collide ); - + + /* glDeleteBuffers silently ignores 0's and names that do not correspond to + * existing buffer objects. + * */ glDeleteBuffers( 1, &world->tbo_light_entities ); glDeleteTextures( 1, &world->tex_light_entities ); glDeleteTextures( 1, &world->tex_light_cubes ); /* FIXME: CANT DO THIS HERE */ + /* whynot? */ + /* oh this should be moved to a global function */ world_global.time = 0.0; world_global.rewind_from = 0.0; world_global.rewind_to = 0.0; world_global.last_use = 0.0; - world_global.current_run_version = 2; - world_global.active_route_board = 0; + world_global.sfd.active_route_board = 0; /* delete textures and meshes */ glDeleteTextures( world->texture_count, world->textures ); @@ -898,7 +902,6 @@ VG_STATIC void world_unload( world_instance *world ) vg_linear_clear( world->audio_vgl ); #endif - vg_release_thread_sync(); } @@ -907,8 +910,11 @@ VG_STATIC void world_clean( world_instance *world ) memset( &world->meta, 0, sizeof(mdl_context) ); /* - * TODO: Theres probably a better way to do this? - */ + * TODO: Theres probably a better way to do this? */ + /* yep, find all members that can be memsetted to 0. this is probably + * every member anyway, given the below is just setting to 0 + * + * also: rename clean to init? */ world->textures = NULL; world->texture_count = 0; @@ -922,6 +928,7 @@ VG_STATIC void world_clean( world_instance *world ) world->geo_bh = NULL; world->volume_bh = NULL; world->audio_bh = NULL; + world->rendering_gate = NULL; world->water.enabled = 0;