Entity deletion
This commit is contained in:
@@ -84,10 +84,18 @@ save_scene :: (scene: *Scene, path: string) {
|
||||
|
||||
for scene.entities {
|
||||
if it.flags & .DONT_SAVE continue;
|
||||
if it.flags & .DELETED continue;
|
||||
|
||||
serialize_entity(it, full_path);
|
||||
}
|
||||
|
||||
for scene.entities {
|
||||
if it.flags & .DELETED {
|
||||
delete_entity(it);
|
||||
remove it;
|
||||
}
|
||||
}
|
||||
|
||||
// Save camera
|
||||
//print_to_builder(*builder, "Camera: % % % % %\n", scene.camera.position.x, scene.camera.position.y, scene.camera.position.z, scene.camera.rotation.yaw, scene.camera.rotation.pitch);
|
||||
|
||||
@@ -96,7 +104,7 @@ save_scene :: (scene: *Scene, path: string) {
|
||||
|
||||
unload_scene :: (scene: *Scene) {
|
||||
for e: scene.entities {
|
||||
destroy_entity(e, false);
|
||||
destroy_entity(e);
|
||||
}
|
||||
|
||||
free(scene.name);
|
||||
|
||||
Reference in New Issue
Block a user