projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mirror actions now cache the horizontal flipped Surfaces, rather than flipping them...
[supertux.git]
/
lib
/
special
/
sprite.h
diff --git
a/lib/special/sprite.h
b/lib/special/sprite.h
index
a5ddbff
..
8239f49
100644
(file)
--- a/
lib/special/sprite.h
+++ b/
lib/special/sprite.h
@@
-39,18
+39,25
@@
namespace SuperTux
{
std::string name;
{
std::string name;
- int x_hotspot;
- int y_hotspot;
+ /** Position correction */
+ int x_offset;
+ int y_offset;
+ /** Drawing priority in queue */
+ int z_order;
/** Frames per second */
float fps;
/** Frames per second */
float fps;
+ /** Mirror is used to avoid duplicating left and right side
+ sprites */
+// bool mirror;
+
std::vector<Surface*> surfaces;
};
public:
std::vector<Surface*> surfaces;
};
public:
- /** cur has to be a pointer to data in the form of ((x-
hotspo
t 5)
- (y-
hotspo
t 10) ...) */
+ /** cur has to be a pointer to data in the form of ((x-
offse
t 5)
+ (y-
offse
t 10) ...) */
Sprite(lisp_object_t* cur);
~Sprite();
Sprite(lisp_object_t* cur);
~Sprite();
@@
-58,6
+65,10
@@
namespace SuperTux
void draw(DrawingContext& context, const Vector& pos, int layer,
Uint32 drawing_effect = NONE_EFFECT);
void draw(DrawingContext& context, const Vector& pos, int layer,
Uint32 drawing_effect = NONE_EFFECT);
+ void draw_part(DrawingContext& context, const Vector& source,
+ const Vector& size, const Vector& pos, int layer,
+ Uint32 drawing_effect = NONE_EFFECT);
+
/** Set action (or state) */
void set_action(std::string act);
/** Set action (or state) */
void set_action(std::string act);
@@
-105,6
+116,9
@@
namespace SuperTux
void init_defaults(Action* act);
void parse_action(LispReader& lispreader);
void init_defaults(Action* act);
void parse_action(LispReader& lispreader);
+ /** Get an action */
+ Action* get_action(std::string act);
+
void update();
void reset();
void update();
void reset();