reader.get("scroll-speed-y", scroll_speed.y);
reader.get("layer", layer);
+ if (layer > (LAYER_GUI - 100)) {
+ log_warning << "Layer of background (" << layer << ") is too large. "
+ << "Clipping to " << (LAYER_GUI - 100) << "." << std::endl;
+ layer = LAYER_GUI - 100;
+ }
+
if(!reader.get("image", imagefile) || !reader.get("speed", speed))
throw std::runtime_error("Must specify image and speed for background");
speed_y = 1;
}
+ if (z_pos > (LAYER_GUI - 100)) {
+ log_warning << "z-pos of "
+ << ((name == "") ? "unnamed tilemap" : name) << " (" << z_pos << ") "
+ << "is too large. "
+ << "Clipping to " << (LAYER_GUI - 100) << "." << std::endl;
+ z_pos = LAYER_GUI - 100;
+ }
+
const lisp::Lisp* pathLisp = reader.get_lisp("path");
if (pathLisp) {
path.reset(new Path());
{
this->name = name;
+ if (this->z_pos > (LAYER_GUI - 100))
+ this->z_pos = LAYER_GUI - 100;
+
resize(width, height);
}
tiles.resize(newt.size());
tiles = newt;
- z_pos = new_z_pos;
+ if (new_z_pos > (LAYER_GUI - 100))
+ z_pos = LAYER_GUI - 100;
+ else
+ z_pos = new_z_pos;
solid = newsolid;
// make sure all tiles are loaded