more missing asserts
[supertux.git] / src / scripting / floating_image.cpp
1 #include <config.h>
2
3 #include <assert.h>
4 #include "floating_image.hpp"
5 #include "sector.hpp"
6 #include "object/floating_image.hpp"
7
8 namespace Scripting
9 {
10
11 FloatingImage::FloatingImage(const std::string& spritefile)
12 {
13   assert(Sector::current() != NULL);
14   floating_image = new _FloatingImage(spritefile); 
15   Sector::current()->add_object(floating_image);
16 }
17
18 FloatingImage::~FloatingImage()
19 {
20   floating_image->remove_me();
21   // no delete here, Sector will do that
22 }
23
24 void
25 FloatingImage::set_layer(int layer)
26 {
27   floating_image->set_layer(layer);
28 }
29
30 int
31 FloatingImage::get_layer()
32 {
33   return floating_image->get_layer();
34 }
35
36 void
37 FloatingImage::set_pos(float x, float y)
38 {
39   floating_image->set_pos(Vector(x, y));
40 }
41
42 float
43 FloatingImage::get_pos_x()
44 {
45   return floating_image->get_pos().x;
46 }
47
48 float
49 FloatingImage::get_pos_y()
50 {
51   return floating_image->get_pos().y;
52 }
53
54 void
55 FloatingImage::set_anchor_point(int anchor)
56 {
57   floating_image->set_anchor_point((AnchorPoint) anchor);
58 }
59
60 int
61 FloatingImage::get_anchor_point()
62 {
63   return (int) floating_image->get_anchor_point();
64 }
65
66 bool
67 FloatingImage::get_visible()
68 {
69   return floating_image->get_visible();
70 }
71
72 void
73 FloatingImage::set_visible(bool visible)
74 {
75   floating_image->set_visible(visible);
76 }
77
78 }