summaryrefslogtreecommitdiffstats
path: root/libdimensionxx/scene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libdimensionxx/scene.cpp')
-rw-r--r--libdimensionxx/scene.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libdimensionxx/scene.cpp b/libdimensionxx/scene.cpp
index 4ff19e1..1bff351 100644
--- a/libdimensionxx/scene.cpp
+++ b/libdimensionxx/scene.cpp
@@ -99,6 +99,23 @@ namespace Dimension
dmnsn_array_push(dmnsn()->objects, &cobject);
}
+ // Remove an object
+ void
+ Scene::remove_object(Iterator i)
+ {
+ // Find it in the dmnsn_array* of objects and remove it
+ for (unsigned int j = 0; j < dmnsn_array_size(dmnsn()->objects); ++j) {
+ dmnsn_object* cobject;
+ dmnsn_array_get(dmnsn()->objects, j, &cobject);
+ if (cobject == i->dmnsn()) {
+ dmnsn_array_remove(dmnsn()->objects, j);
+ break;
+ }
+ }
+ // Remove it from the std::list
+ m_objects.erase(i.iterator());
+ }
+
// Access the wrapped C object.
dmnsn_scene*