X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gen.h;h=b35c6c25f036a3a4380b1d7a0b24afa47ee2f401;hb=6e29d444f89478d5965fc652373272e5d70e84e4;hp=38d2b6677ed366e43368d0c63e41927908335226;hpb=919d1227839218c57430fe9cab8f74d594c7bd14;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gen.h b/world_gen.h index 38d2b66..b35c6c2 100644 --- a/world_gen.h +++ b/world_gen.h @@ -875,17 +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.active_route_board = 0; + world_global.sfd.active_route_board = 0; /* delete textures and meshes */ glDeleteTextures( world->texture_count, world->textures ); @@ -897,7 +902,6 @@ VG_STATIC void world_unload( world_instance *world ) vg_linear_clear( world->audio_vgl ); #endif - vg_release_thread_sync(); } @@ -906,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; @@ -921,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;