Argentum Online - Cliente
animation_pack.h
1 #ifndef __ANIMATION_PACK_H
2 #define __ANIMATION_PACK_H
3 
4 #include "SDL/sdl_animated_sprite.h"
5 
6 #ifndef DIRECTION_T
7 #define DIRECTION_T
8 enum direction_t { UP, DOWN, LEFT, RIGHT };
9 #endif
10 
11 enum movement_status_t { MOVING, IDLE };
12 
18  private:
19  /* Sprites de movimiento. */
20  SDLSprite up_move_sprite;
21  SDLSprite down_move_sprite;
22  SDLSprite left_move_sprite;
23  SDLSprite right_move_sprite;
24 
25  /* Sprites quietos */
26  SDLSprite up_idle_sprite;
27  SDLSprite down_idle_sprite;
28  SDLSprite left_idle_sprite;
29  SDLSprite right_idle_sprite;
30 
31  public:
32  AnimationPack(SDLSprite &up_move_sprite, SDLSprite &down_move_sprite,
33  SDLSprite &left_move_sprite, SDLSprite &right_move_sprite,
34  SDLSprite &up_idle_sprite, SDLSprite &down_idle_sprite,
35  SDLSprite &left_idle_sprite, SDLSprite &right_idle_sprite);
36  ~AnimationPack();
37 
38  void render(direction_t direction, movement_status_t status, SDL_Rect dest);
39 
46  int get_frame_width(direction_t direction);
47 
54  int get_frame_height(direction_t direction);
55 
56  /* Constructor y asignador por copia. */
57  AnimationPack(const AnimationPack &other);
58  AnimationPack& operator=(const AnimationPack &other);
59 
60  /* Constructor y asginador por movimiento. */
62  AnimationPack& operator=(AnimationPack &&other);
63 };
64 
65 #endif
AnimationPack
Wrapper de sprites de un mismo conjunto.
Definition: animation_pack.h:17
AnimationPack::get_frame_width
int get_frame_width(direction_t direction)
Devuelve el ancho en pixeles de un cuadro de la animacion.
Definition: animation_pack.cpp:94
SDLSprite
Sprite animada de SDL.
Definition: sdl_animated_sprite.h:14
AnimationPack::get_frame_height
int get_frame_height(direction_t direction)
Devuelve el alto en pixeles de un cuadro de la animacion.
Definition: animation_pack.cpp:112