reader.get("scroll-speed-x", scroll_speed.x);
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;
- }
+ layer = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND0);
if(!reader.get("image", imagefile) || !reader.get("speed", speed))
throw std::runtime_error("Must specify image and speed for background");
void
CloudParticleSystem::parse(const Reader& reader)
{
- reader.get("z-pos", z_pos);
+ z_pos = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND1);
}
CloudParticleSystem::~CloudParticleSystem()
void
CometParticleSystem::parse(const Reader& reader)
{
- reader.get("z-pos", z_pos);
+ z_pos = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND1);
}
CometParticleSystem::~CometParticleSystem()
#include "object/particlesystem_interactive.hpp"
#include "video/surface_ptr.hpp"
+#include "src/video/drawing_request.hpp" /* LAYER_BACKGROUND1 */
class CometParticleSystem : public ParticleSystem_Interactive
{
Decal::Decal(const Reader& reader) :
MovingSprite(reader, LAYER_OBJECTS, COLGROUP_DISABLED)
{
- reader.get("layer", layer);
+ layer = reader_get_layer (reader, /* default = */ LAYER_OBJECTS);
bool solid = false;
reader.get("solid", solid);
void
GhostParticleSystem::parse(const Reader& reader)
{
- reader.get("z-pos", z_pos);
+ z_pos = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND1);
}
GhostParticleSystem::~GhostParticleSystem()
gradient_top(),
gradient_bottom()
{
- reader.get("layer", layer);
+ layer = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND0);
std::vector<float> bkgd_top_color, bkgd_bottom_color;
if(!reader.get("top_color", bkgd_top_color) ||
!reader.get("bottom_color", bkgd_bottom_color))
void
RainParticleSystem::parse(const Reader& reader)
{
- reader.get("z-pos", z_pos);
+ z_pos = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND1);
}
RainParticleSystem::~RainParticleSystem()
lisp.get("solid", solid);
lisp.get("physic-enabled", physic_enabled);
lisp.get("visible", visible);
- lisp.get("z-pos", layer);
+ layer = reader_get_layer (lisp, /* default = */ LAYER_OBJECTS);
if( solid ){
set_group( COLGROUP_MOVING_STATIC );
} else {
void
SnowParticleSystem::parse(const Reader& reader)
{
- reader.get("z-pos", z_pos);
+ z_pos = reader_get_layer (reader, /* default = */ LAYER_BACKGROUND1);
}
SnowParticleSystem::~SnowParticleSystem()
if(interval <= 0) {
log_warning << "Running a thunderstorm with non-positive time interval is a bad idea" << std::endl;
}
- reader.get("layer", layer);
+ layer = reader_get_layer (reader, /* default = */ LAYER_BACKGROUNDTILES-1);
sound_manager->preload("sounds/thunder.wav");
sound_manager->preload("sounds/lightning.wav");
assert(tileset != NULL);
reader.get("name", name);
- reader.get("z-pos", z_pos);
reader.get("solid", solid);
reader.get("speed", speed_x);
reader.get("speed-y", speed_y);
+
+ z_pos = reader_get_layer (reader, /* default = */ 0);
if(solid && ((speed_x != 1) || (speed_y != 1))) {
log_warning << "Speed of solid tilemap is not 1. fixing" << std::endl;
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());