summaryrefslogtreecommitdiff
path: root/library.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-01 12:03:58 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-01 12:03:58 +0100
commit8906ff2e2755f6f8a2e52f5252afbcbea248c947 (patch)
treee684823e99b9182badcb49dd6c2e35409fe40d02 /library.cpp
parenta871e68ebd153d9ab4f9f9e36d7b099689e05c38 (diff)
instance_destroy that actually works; no more shared_ptr
Diffstat (limited to 'library.cpp')
-rw-r--r--library.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/library.cpp b/library.cpp
index 38bbf48..2386c0b 100644
--- a/library.cpp
+++ b/library.cpp
@@ -20,6 +20,14 @@ public:
}
} init_object;
+
+void instance_destroy(Object *obj){
+ assert(global.objects.find(obj)!=global.objects.end());
+ obj->destroy();
+ global.objects_todelete.push_back(obj);
+}
+
+
static void draw_text(int x,int y,const char *s,size_t len){
if(currentFont!=nullptr){
sharedSfText.setFont(currentFont->sf_font);