X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsprite.h;h=0671e270ce10200ce000e16b9d096e27861c451b;hb=157cef71aeb9ae25b7bb90f37dda11bc09329d11;hp=dcd4b72a378dac620924afce81f8caee39d6cd47;hpb=cf8bf29d39d117783c3068270a3564595b21a53a;p=supertux.git diff --git a/src/sprite.h b/src/sprite.h index dcd4b72a3..0671e270c 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -24,10 +24,13 @@ #include #include "lispreader.h" #include "texture.h" +#include "vector.h" class Sprite { private: + std::string name; + int x_hotspot; int y_hotspot; @@ -40,21 +43,33 @@ class Sprite float time; - std::vector surfaces; + std::vector surfaces; void init_defaults(); public: /** cur has to be a pointer to data in the form of ((x-hotspot 5) (y-hotspot 10) ...) */ Sprite(lisp_object_t* cur); + ~Sprite(); + + void reset(); /** Update the sprite and process to the next frame */ void update(float delta); - void draw(int x, int y); + void draw(float x, float y); + void draw_part(float sx, float sy, float x, float y, float w, float h); + int get_current_frame() const; + + void draw(const Vector& pos) + { draw(pos.x, pos.y); } + + std::string get_name() const { return name; } + int get_width() const; + int get_height() const; }; #endif /* Local Variables: */ /* mode:c++ */ -/* End */ +/* End: */