{
}
+Tile::Tile(unsigned int id_, Uint32 attributes_, const ImageSpec& imagespec)
+ : id(id_), editor_image(0), attributes(attributes_), data(0), anim_fps(1)
+{
+ imagespecs.push_back(imagespec);
+}
+
Tile::~Tile()
{
for(std::vector<Surface*>::iterator i = images.begin(); i != images.end();
throw std::runtime_error("Missing tile-id.");
}
- bool value;
+ bool value = false;
if(reader.get("solid", value) && value)
attributes |= SOLID;
if(reader.get("unisolid", value) && value)
const lisp::Lisp* ptr = cur->get_cdr();
std::string file;
- float x, y, w, h;
+ float x = 0, y = 0, w = 0, h = 0;
ptr->get_car()->get(file); ptr = ptr->get_cdr();
ptr->get_car()->get(x); ptr = ptr->get_cdr();
ptr->get_car()->get(y); ptr = ptr->get_cdr();
Surface* surface;
std::string file = tilesetpath + spec.file;
if(spec.rect.get_width() <= 0) {
- surface = new Surface(file, true);
+ surface = new Surface(file);
} else {
surface = new Surface(file,
(int) spec.rect.p1.x,
(int) spec.rect.p1.y,
(int) spec.rect.get_width(),
- (int) spec.rect.get_height(), true);
+ (int) spec.rect.get_height());
}
images.push_back(surface);
}
if(editor_imagefile != "") {
- editor_image = new Surface(tilesetpath + editor_imagefile, true);
+ editor_image = new Surface(tilesetpath + editor_imagefile);
}
}