Improvements

This commit is contained in:
2024-12-01 17:55:08 +01:00
parent 80de060002
commit 1077800334
6 changed files with 73 additions and 20 deletions

View File

@@ -79,7 +79,7 @@ Entity :: struct {
// Physics
body : Physics_Body; @DontSerialize
collider : Collider; @DontSerialize
collider : Collider;
// End physics
#if NETWORKING {
@@ -174,6 +174,10 @@ mark_entity_deleted :: (e: *Entity) {
}
destroy_entity :: (e: *Entity) {
if e.collider.mesh.vertices.data != null {
array_free(e.collider.mesh.vertices);
}
for 0..e.renderable.num_nodes-1 {
node_data := e.renderable.nodes[it];

View File

@@ -124,6 +124,13 @@ unload_scene :: (scene: *Scene) {
free(scene);
}
switch_to_scene :: (scene_name: string) {
new_scene := load_scene(scene_name);
unload_scene(engine.current_scene);
engine.current_scene = new_scene;
}
reload_scene :: (scene: *Scene) {
name := copy_temporary_string(scene.name);
unload_scene(engine.current_scene);