#include "util/log.hpp"
#include "util/reader.hpp"
+#include <stdexcept>
+
Background::Background() :
alignment(NO_ALIGNMENT),
layer(LAYER_BACKGROUND0),
{
Vector p(pos.x - parallax_image_size.width / 2.0f,
pos.y + y * image->get_height() - image->get_height() / 2.0f);
- context.draw_surface(image.get(), p, layer);
+ context.draw_surface(image, p, layer);
}
break;
{
Vector p(pos.x + parallax_image_size.width / 2.0f - image->get_width(),
pos.y + y * image->get_height() - image->get_height() / 2.0f);
- context.draw_surface(image.get(), p, layer);
+ context.draw_surface(image, p, layer);
}
break;
{
Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f,
pos.y - parallax_image_size.height / 2.0f);
- context.draw_surface(image.get(), p, layer);
+ context.draw_surface(image, p, layer);
}
break;
{
Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f,
pos.y - image->get_height() + parallax_image_size.height / 2.0f);
- context.draw_surface(image.get(), p, layer);
+ context.draw_surface(image, p, layer);
}
break;
if (image_top.get() != NULL && (y < 0))
{
- context.draw_surface(image_top.get(), p, layer);
+ context.draw_surface(image_top, p, layer);
}
else if (image_bottom.get() != NULL && (y > 0))
{
- context.draw_surface(image_bottom.get(), p, layer);
+ context.draw_surface(image_bottom, p, layer);
}
else
{
- context.draw_surface(image.get(), p, layer);
+ context.draw_surface(image, p, layer);
}
}
break;