#include "supertux/object_factory.hpp"
#include "util/reader.hpp"
+#include <stdexcept>
+
Gradient::Gradient() :
layer(LAYER_BACKGROUND0),
gradient_top(),
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))
gradient_top = top;
gradient_bottom = bottom;
- if (gradient_top.red > 1.0 || gradient_top.green > 1.0
- || gradient_top.blue > 1.0 || gradient_top.alpha > 1.0)
+ if (gradient_top.red > 1.0 || gradient_top.green > 1.0 ||
+ gradient_top.blue > 1.0 || gradient_top.alpha > 1.0)
+ {
log_warning << "top gradient color has values above 1.0" << std::endl;
- if (gradient_bottom.red > 1.0 || gradient_bottom.green > 1.0
- || gradient_bottom.blue > 1.0 || gradient_bottom.alpha > 1.0)
+ }
+
+ if (gradient_bottom.red > 1.0 || gradient_bottom.green > 1.0 ||
+ gradient_bottom.blue > 1.0 || gradient_bottom.alpha > 1.0)
+ {
log_warning << "bottom gradient color has values above 1.0" << std::endl;
+ }
}
void