1 /* Tower Toppler - Nebulus
2  * Copyright (C) 2000-2012  Andreas R�ver
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18 
19 #ifndef SPRITES_H
20 #define SPRITES_H
21 
22 #include <SDL.h>
23 
24 /* coordinates a collection of sprites */
25 
26 class spritecontainer {
27 
28 public:
29 
spritecontainer(void)30   spritecontainer(void) : size(0), usage(0), array(0) {};
31   ~spritecontainer(void);
32 
33   void freedata(void);
34 
data(const Uint16 nr)35   SDL_Surface * data(const Uint16 nr) const {if (nr < usage) return array[nr]; else return 0; }
36   Uint16 save(SDL_Surface * s);
37 
38 private:
39 
40   Uint16 size;
41   Uint16 usage;
42 
43   SDL_Surface ** array;
44 };
45 
46 extern spritecontainer fontsprites;   // for all sprites that are alpha toggled with font option
47 extern spritecontainer layersprites;  // for all sprites that are alpha toggled with the layer option
48 extern spritecontainer objectsprites; // for all sprites that are alpha toggled with the robots option
49 extern spritecontainer restsprites;   // for the rest
50 
51 #endif
52