summaryrefslogtreecommitdiffstats
path: root/libdimension/scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/scene.c')
-rw-r--r--libdimension/scene.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libdimension/scene.c b/libdimension/scene.c
index 177e7fe..58d2eda 100644
--- a/libdimension/scene.c
+++ b/libdimension/scene.c
@@ -50,17 +50,11 @@ void
dmnsn_delete_scene(dmnsn_scene *scene)
{
if (scene) {
- dmnsn_light *light;
- dmnsn_object *object;
-
- for (size_t i = 0; i < dmnsn_array_size(scene->lights); ++i) {
- dmnsn_array_get(scene->lights, i, &light);
- dmnsn_delete_light(light);
+ DMNSN_ARRAY_FOREACH (dmnsn_light **, light, scene->lights) {
+ dmnsn_delete_light(*light);
}
-
- for (size_t i = 0; i < dmnsn_array_size(scene->objects); ++i) {
- dmnsn_array_get(scene->objects, i, &object);
- dmnsn_delete_object(object);
+ DMNSN_ARRAY_FOREACH (dmnsn_object **, object, scene->objects) {
+ dmnsn_delete_object(*object);
}
dmnsn_delete_array(scene->lights);