From 8906ff2e2755f6f8a2e52f5252afbcbea248c947 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 1 Jan 2017 12:03:58 +0100 Subject: instance_destroy that actually works; no more shared_ptr --- library.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'library.h') diff --git a/library.h b/library.h index e3e87c3..42be890 100644 --- a/library.h +++ b/library.h @@ -13,13 +13,15 @@ extern sf::RenderWindow window; template -shared_ptr instance_create(int x,int y){ - shared_ptr ptr(new ObjT(x,y)); - global.objects.push_back(ptr); +Object* instance_create(int x,int y){ + Object *ptr=new ObjT(x,y); + global.objects.insert(ptr); ptr->create(); return ptr; } +void instance_destroy(Object *obj); + void draw_text(int x,int y,const char *s); void draw_textf(int x,int y,const char *format,...) __attribute__((format (printf, 3, 4))); -- cgit v1.2.3-70-g09d2