1 // Copyright 2008 Brian Caine
3 // This file is part of Potpourri.
5 // Potpourri is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Potpourri is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTIBILITY of FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Potpourri. If not, see <http://www.gnu.org/licenses/>.
21 // This is the Sprite class
23 // The Sprite class represents a static image or an animation. It has a
24 // position, orientation, and a focal point.
31 #include "ImageLoader.h"
43 std::vector
<Frame
> frames
;
46 std::vector
<int> position
; // render to this location
48 std::vector
<int> focal_point
;
49 // this is the point around which
50 // the sprite is rotated, measured relatively from the upper left
52 int angle
; // don't fiddle with this until we've got image
53 // rotation functions going
60 Sprite(std::vector
<SDL_Surface
*> dframes
, SpriteParams dparams
);
62 void draw(SDL_Surface
* dest
);
67 std::vector
<SDL_Surface
*> frames
;
68 SpriteParams sequence
;