summaryrefslogtreecommitdiff
path: root/library.h
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.h
parenta871e68ebd153d9ab4f9f9e36d7b099689e05c38 (diff)
instance_destroy that actually works; no more shared_ptr
Diffstat (limited to 'library.h')
-rw-r--r--library.h8
1 files changed, 5 insertions, 3 deletions
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 <typename ObjT>
-shared_ptr<Object> instance_create(int x,int y){
- shared_ptr<Object> 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)));