Scene loading/saving improvements, transform gizmo, entity creation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Entity_Id :: #type, isa s64;
|
||||
|
||||
Entity_Flags :: enum_flags u8 {
|
||||
Entity_Flags :: enum_flags u16 {
|
||||
NONE;
|
||||
RENDERABLE;
|
||||
COLLISION;
|
||||
@@ -10,6 +10,9 @@ Entity_Flags :: enum_flags u8 {
|
||||
|
||||
ANIMATED;
|
||||
|
||||
SNAP_TO_GRID;
|
||||
UNIFORM_SCALE;
|
||||
|
||||
DONT_SAVE;
|
||||
}
|
||||
|
||||
@@ -66,6 +69,7 @@ Entity :: struct {
|
||||
transform: Transform;
|
||||
|
||||
snap_offset: Vector3;
|
||||
snap_intervals: Vector3;
|
||||
|
||||
renderable: Renderable; @DontSerialize
|
||||
animator: Animator; @DontSerialize
|
||||
@@ -182,9 +186,8 @@ destroy_entity :: (e: *Entity, remove_from_scene: bool = true) {
|
||||
}
|
||||
|
||||
if remove_from_scene {
|
||||
array_unordered_remove_by_value(*game_state.engine.current_scene.entities, e);
|
||||
if e.type == {
|
||||
case Block; bucket_array_remove(*game_state.engine.current_scene.by_type._Block, e._locator);
|
||||
}
|
||||
array_unordered_remove_by_value(*engine.current_scene.entities, e);
|
||||
|
||||
delete_entity(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user