@@ -38,10 +38,19 @@ void world_despawn_widget(te_world* world, struct te_widget* widget);
3838// The camera must be previously spawned in this world.
3939void world_set_active_camera (te_world * world , struct te_camera * camera );
4040
41+ // Serializes all spawned world entities into the specified file
42+ // (path relative to the `res` directory).
43+ void world_save_to_file (te_world * world , const char * relative_path );
44+
4145// Returns NULL if the world has no active camera.
4246// Do not free/destroy returned pointer, valid until the camera is not destroyed.
4347struct te_camera * world_get_active_camera (te_world * world );
4448
49+ // Returns NULL if no camera is spawned, otherwise all spawned cameras.
50+ // Do not save/store returned pointer as it might become invalid after a camera is spawned/despawned.
51+ struct te_camera * * world_get_cameras_tmp (te_world * world , unsigned int * count );
52+ struct te_model * * world_get_models_tmp (te_world * world , unsigned int * count );
53+
4554// Do not free/destroy returned pointer, valid while the world exists.
4655struct te_model_renderer * world_get_opaque_model_renderer (te_world * world );
4756struct te_model_renderer * world_get_transparent_model_renderer (te_world * world );
@@ -67,6 +76,15 @@ bool prv_world_is_being_destroyed(te_world* world);
6776// Called to possibly notify widgets.
6877void prv_world_on_window_size_changed (te_world * world );
6978
79+ // Adds/removes the specified item to/from the array of spawned root item
80+ // (does nothing if already added/removed). Does not notify the item.
81+ void prv_world_add_root_model_no_notify (te_world * world , struct te_model * model , bool check_if_already_added );
82+ void prv_world_remove_root_model_no_notify (te_world * world , struct te_model * model , bool must_exist_in_array );
83+ void prv_world_add_root_widget_no_notify (te_world * world , struct te_widget * widget , bool check_if_already_added );
84+ void prv_world_remove_root_widget_no_notify (te_world * world , struct te_widget * widget , bool must_exist_in_array );
85+ void prv_world_add_root_camera_no_notify (te_world * world , struct te_camera * camera , bool check_if_already_added );
86+ void prv_world_remove_root_camera_no_notify (te_world * world , struct te_camera * camera , bool must_exist_in_array );
87+
7088// Called by spawned widgets that receive input (for example buttons).
7189// Note: these functions are not called from the base te_widget type (base type does not implement such functionality).
7290void prv_world_add_interactable_widget (te_world * world , struct te_widget * widget );
0 commit comments