summaryrefslogtreecommitdiff
path: root/object_base.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-12-31 09:23:28 +0100
committertomsmeding <tom.smeding@gmail.com>2016-12-31 09:23:28 +0100
commit8023d607f128ef4b4e63b833fc2045f7b41a1e3f (patch)
tree6c44c2628c5f36a1564c9010d25ae37ed1b4e3ce /object_base.cpp
parent0cc504d3aa972cc8d5d501d9278e8773a810985a (diff)
SFML sprites!
Diffstat (limited to 'object_base.cpp')
-rw-r--r--object_base.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/object_base.cpp b/object_base.cpp
index ce97f2a..d04d0f5 100644
--- a/object_base.cpp
+++ b/object_base.cpp
@@ -1,5 +1,6 @@
#include <iostream>
#include <cassert>
+#include <SFML/Graphics.hpp>
#include "object_base.h"
#include "library.h"
@@ -21,12 +22,9 @@ void Object::destroy(void){}
void Object::step(void){}
void Object::draw(void){
- /*if(!sprite_index){
+ if(!sprite_index){
return;
}
- if(!sprite_index->fl_image){
- sprite_index->fl_image=new Fl_PNG_Image(nullptr,sprite_index->image,sprite_index->image_len);
- assert(!sprite_index->fl_image->fail());
- }
- sprite_index->fl_image->draw((int)x,(int)y);*/
+ sprite_index->sf_sprite.setPosition(sf::Vector2f(x,y));
+ window.draw(sprite_index->sf_sprite);
}