initial commit, lordsawar source, slightly modified
[lordsawar] / src / GraphicsCache.h
1 // Copyright (C) 2003, 2004, 2005, 2006, 2007 Ulf Lorenz
2 // Copyright (C) 2004, 2006 Andrea Paternesi
3 // Copyright (C) 2006, 2007, 2008, 2009 Ben Asselstine
4 //
5 //  This program 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.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU Library General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
18 //  02110-1301, USA.
19
20 #ifndef GRAPHICS_CACHE_H
21 #define GRAPHICS_CACHE_H
22
23 #include <string>
24 #include <list>
25 #include <map>
26 #include <vector>
27 #include <string.h>
28
29 #include "player.h"
30 #include "defs.h"
31 #include "PixMask.h"
32 #include "maptile.h"
33
34 class Tileset;
35
36 struct ArmyCacheItem;
37 struct ShipCacheItem;
38 struct CityCacheItem;
39 struct TowerCacheItem;
40 struct TempleCacheItem;
41 struct RuinCacheItem;
42 struct DiplomacyCacheItem;
43 struct StoneCacheItem;
44 struct RoadCacheItem;
45 struct BridgeCacheItem;
46 struct CursorCacheItem;
47 struct FlagCacheItem;
48 struct SelectorCacheItem;
49 struct ShieldCacheItem;
50 struct ProdShieldCacheItem;
51 struct MoveBonusCacheItem;
52 struct FogCacheItem;
53 struct PlantedStandardCacheItem;
54 struct NewLevelCacheItem;
55 struct TileCacheItem;
56 struct PortCacheItem;
57 struct SignpostCacheItem;
58 struct BagCacheItem;
59 struct ExplosionCacheItem;
60 class City;
61
62 /** Soliton class for caching army and map images
63   * 
64   * With the introduction of player-specific colors, the problem of caching
65   * images has popped up. The player colors are implemented by taking an army
66   * picture and a mask, with the mask being a 16 color image, substituting
67   * the colors in the mask and blitting the mask over the army (or e.g. city)
68   * image. This takes several blits (>3, there are also things like medals 
69   * to be considered) and is therefore costly.
70   *
71   * This class approaches this problem by caching formatted images. You get
72   * e.g. an army image by querying the cache, which either gives you the cached
73   * image or creates a new one. If the size is exceeded, the class will free
74   * the oldest (not used for the longest time) images until it gets below the
75   * treshold. It maintains some kind of balance between cached city pictures
76   * and cached army pictures, but the kind of balance may change, so I'll
77   * better not describe it here. :)
78   *
79   * Recently, it has been improved to cache flag pictures (showing how many
80   * armies a stack contains) as well.
81   *
82   * The maximum cache size can be changed on the fly by modifying the value in 
83   * the Configuration class. However, if set too small (around 1 megabyte), this
84   * value will silently be ignored.
85   *
86   * @note For efficiency reasons, the class will not copy the surfaces it has,
87   * so DON'T MODIFY THEM unless you know what you do! (i.e. never)
88   */
89
90 class GraphicsCache
91 {
92     public:
93   enum CursorType
94     {
95       POINTER = 0,
96       MAGNIFYING_GLASS,
97       SHIP,
98       ROOK,
99       HAND,
100       TARGET,
101       FEET,
102       RUIN,
103       SWORD,
104       QUESTION,
105       HEART,
106       GOTO_ARROW
107     };
108         //! Method for getting/creating the soliton instance.
109         static GraphicsCache* getInstance();
110
111         //! Explicitely deletes the soliton instance
112         static void deleteInstance();
113
114         //! Clears the whole cache.
115         void clear();
116
117         //! Get the current cache size, the maximum is in Configuration::s_cacheSize
118         guint32 getCacheSize() const {return d_cachesize;}
119
120         /** Method for getting the army picture from the cache
121           * 
122           * This method returns either the cached image of the given type or
123           * creates a new one and caches it. Use this method to access
124           * army images! And: Don't touch the returned surface!! For performance
125           * reasons you get the original surface which is also in the cache.
126           *
127           * The returned surface contains the correct player colors and some
128           * icons displaying the level of the unit.
129           *
130           * @param armyset      the armyset to be used
131           * @param army         the index of the army to be used
132           * @param player       the player owning the army
133           * @param greyed       the image is greyed out; deselected/inactive.
134           * @return the image of the unit
135           */
136         PixMask* getArmyPic(guint32 armyset, guint32 army, const Player* p,
137                                 const bool* medals, bool greyed = false);
138         PixMask* getArmyPic(Army *a, bool greyed = false);
139
140         PixMask* getTilePic(int tile_style_id, int fog_type_id, bool has_bag, bool has_standard, int standard_player_id, int stack_size, int stack_player_id, int army_type_id, bool has_tower, bool has_ship, Maptile::Building building_type, int building_subtype, Vector<int> building_tile, int building_player_id, guint32 tilesize, bool has_grid, guint32 tileset, guint32 cityset);
141         PixMask* getTilePic(int tile_style_id, int fog_type_id, bool has_bag, bool has_standard, int standard_player_id, int stack_size, int stack_player_id, int army_type_id, bool has_tower, bool has_ship, Maptile::Building building_type, int building_subtype, Vector<int> building_tile, int building_player_id, guint32 tilesize, bool has_grid);
142
143         /** Method for getting the shield picture from the cache
144           * 
145           * This method returns either the cached image of the given type or
146           * creates a new one and caches it. Use this method to access
147           * army images! And: Don't touch the returned surface!! For performance
148           * reasons you get the original surface which is also in the cache.
149           *
150           * The returned surface contains the correct player colors and some
151           * icons displaying the level of the unit.
152           *
153           * @param shieldset    the id of the shieldset to be used
154           * @param type         the size of the shield: 0=sm, 1=med, 2=lg
155           * @param colour       which player the shield is for
156           * @return the image of the shield
157           */
158         PixMask* getShieldPic(guint32 shieldset, guint32 type, guint32 colour);
159         PixMask* getShieldPic(guint32 type, Player *p);
160
161         /** Method for getting a ruin picture
162           *
163           * @param type         the type of the ruin
164           * @return image of the ruin 
165           */
166         PixMask* getRuinPic(int type);
167         PixMask* getRuinPic(int type, guint32 cityset);
168
169         /** Method for getting a diplomacy icon
170           *
171           * @param type         o = small, or 1 = large.
172           * @param state        the diplomatic state.  e.g. peace, war, etc
173           * @return image of the icon
174           */
175         PixMask* getDiplomacyPic(int type, Player::DiplomaticState state);
176
177         /** Method for getting a temple picture
178           *
179           * @param type         the type of the temple
180           * @return image of the temple
181           */
182         PixMask* getTemplePic(int type);
183         PixMask* getTemplePic(int type, guint32 cityset);
184
185         /** Method for getting a road picture
186           *
187           * @param type         the type of the road
188           * @return image of the road
189           */
190         PixMask* getRoadPic(int type, guint32 tileset);
191         PixMask* getRoadPic(int type);
192
193         /** Method for getting a fog picture
194           *
195           * @param type         the type of the fog
196           * @return image of the fog
197           */
198         PixMask* getFogPic(int type, guint32 tileset);
199         PixMask* getFogPic(int type);
200
201         /** Method for getting a bridge picture
202           *
203           * @param type         the type of the bridge 0=e/w 1=n/s
204           * @return image of the bridge
205           */
206         PixMask* getBridgePic(int type, guint32 tileset);
207         PixMask* getBridgePic(int type);
208
209         /** Method for getting a cursor picture
210           *
211           * @param type         the type of the cursor 
212           * @return image of the cursor
213           */
214         PixMask* getCursorPic(int type);
215
216         /** Method for getting a ship picture.  This is the picture
217           * that appears when the stack goes into the water.
218           *
219           * @param p            the player to colour the ship as
220           * @return image of the ship
221           */
222         PixMask* getShipPic(const Player* p);
223
224         /** Method for getting a standard picture.  This is the picture
225           * that appears when the hero plants a flag..
226           *
227           * @param p            the player to colour the flag as
228           * @return image of the standard
229           */
230         PixMask* getPlantedStandardPic(const Player* p);
231
232         /** Method for getting a port picture.  This is the picture
233           * that appears often as an anchor on coastal regions.
234           *
235           * @return image of the port
236           */
237         PixMask* getPortPic();
238         PixMask* getPortPic(guint32 cityset);
239
240         /** Method for getting a signpost picture.  This is the picture
241           * that appears as a little tiny sign on grassy tiles.
242           *
243           * @return image of the signpost
244           */
245         PixMask* getSignpostPic();
246         PixMask* getSignpostPic(guint32 cityset);
247
248         /** Method for getting a bag-of-items picture.  This is the picture
249           * that shows when a hero drops one or more items on the ground.
250           *
251           * @return image of the sack of items
252           */
253         PixMask* getBagPic();
254         PixMask* getBagPic(guint32 armyset);
255
256         /** Method for getting an explosion picture.  This is the picture
257           * that shows when stacks are fighting.
258           *
259           * @return image of the explosion.
260           */
261         PixMask* getExplosionPic();
262         PixMask* getExplosionPic(guint32 tileset);
263
264         /** Method for getting a new-level picture.  This is the picture
265          * that appears when a hero gains a new level, and subsequently gets
266          * to increase a stat.
267          *
268          * @param p the player to colour the image as.
269          * @return new-level image.
270          */
271         PixMask* getNewLevelPic(const Player* p, guint32 gender);
272
273         /** Method for getting a city picture
274           * 
275           * For simplicity we have extended the basic_image/mask style to
276           * cities as well, since it greatly reduces the number of images.
277           * Use this method solely to get city images, and don't touch the
278           * images!
279           *
280           * @param type         the level of the city; -1 returns the pic for
281           *                     the razed city
282           * @param player       the player owning the city
283           * @param cityset      the cityset that has the city image
284           * @return image of the described city
285           */
286         PixMask* getCityPic(int type, const Player* p, guint32 cityset);
287         /** Another method for getting a city picture
288           *
289           * Most often, we don't need such a sophisticated method. So just
290           * supply the city instance and be happy. :)
291           *
292           * @param city     the city whose picture we want to get
293           * @return image of the city
294           */
295         PixMask* getCityPic(const City* city);
296         PixMask* getCityPic(const City* city, guint32 cityset);
297
298         /** Method for getting tower pictures.
299           *
300           * As with the other methods, use solely this method to get the tower 
301           * images. And DON'T modify the images!
302           *
303           * @param p the player for which we want to get the tower
304           * @return image for the tower
305           */
306         PixMask* getTowerPic(const Player *p);
307         PixMask* getTowerPic(const Player* p, guint32 cityset);
308
309         /** Method for getting flag pictures.
310           *
311           * As with the other methods, use solely this method to get the flag
312           * images. And DON'T modify the images!
313           *
314           * @param stack    the stack for which we want to get the flag
315           * @return image for the flag
316           */
317         PixMask* getFlagPic(const Stack* s);
318         PixMask* getFlagPic(const Stack* s, guint32 tileset);
319         PixMask* getFlagPic(guint32 stack_size, const Player *p);
320         PixMask* getFlagPic(guint32 stack_size, const Player *p, guint32 tileset);
321
322         /** Method for getting selector pictures.
323           *
324           * As with the other methods, use solely this method to get the 
325           * selector images. And DON'T modify the images!
326           *
327           * @param type the frame of the selector
328           * @param p the player to draw it for
329           * @return image for the flag
330           */
331         PixMask* getSelectorPic(guint32 type, guint32 frame, const Player* p, guint32 tileset);
332
333         PixMask* getSelectorPic(guint32 type, guint32 frame, const Player *p);
334
335         /** Method for getting shield pictures.
336           *
337           * As with the other methods, use solely this method to get the 
338           * shield images. And DON'T modify the images!
339           *
340           * @param type small, medium or large shield size
341           * @param p the player to draw it for
342           * @return image for the shield
343           */
344         PixMask* getShieldPic(guint32 type, const Player* p);
345
346
347         PixMask* getSmallRuinedCityPic();
348         //! Return a small hero picture, either white (active==true) or black.
349         PixMask* getSmallHeroPic(bool active);
350         PixMask* getMoveBonusPic(guint32 bonus, bool has_ship);
351         PixMask*getSmallTemplePic();
352         PixMask*getSmallRuinExploredPic();
353         PixMask* getSmallRuinUnexploredPic();
354         PixMask* getSmallStrongholdUnexploredPic();
355
356         /** Method for getting production shield pictures.
357           *
358           * As with the other methods, use solely this method to get the 
359           * shield images. And DON'T modify the images!
360           *
361           * @param type home/away/destination/source/invalid.  
362           * one sees home/away
363           * normally, but when "see all" is turned on, one sees source/dest.
364           * @param prod city production is going on, true or false
365           * @return image for the shield
366           * note that type=source, production=false is impossible
367           * note that type=invalid,production=true is used to show the symbol
368           * that means no more units can be vectored to this city.
369           */
370         PixMask* getProdShieldPic(guint32 type, bool prod);
371
372         PixMask* getMedalPic(bool large, int type);
373
374
375         /** Modify an image with player colors.
376           * 
377           * Take an arbitray surface and mask image, apply the player colors such
378           * that the pixels in the mask image reflect this and blit the mask over
379           * the original image. This has been made public to allow arbitrary images
380           * (in detail the win game image) to have masks.
381           *
382           * @param image    the original image
383           * @param mask     the mask; is only opaque where player colors are wanted
384           * @return a surface with player colors applied.
385           */
386
387         PixMask* applyMask(PixMask* image, PixMask* mask, const Player* p);
388
389         static PixMask* applyMask(PixMask* image, PixMask* mask, Gdk::Color colour, bool isNeutral);
390
391         static PixMask* greyOut(PixMask* image);
392
393         static bool loadSelectorImages(std::string filename, guint32 tilesize, std::vector<PixMask* > &images, std::vector<PixMask* > &masks);
394
395         static bool loadFlagImages(std::string filename, guint32 size, std::vector<PixMask* > &images, std::vector<PixMask* > &masks);
396
397         /** Load misc pic
398           * 
399           * @param picname  the name of the image (including the suffix).
400           * @param alpha    set this to false if you encounter transparent
401           *                 images that should be opaque. :)
402           *                 Especially for background images...
403           * @return the surface which contains the image
404           */
405         static PixMask* getMiscPicture(std::string picname, bool alpha=true);
406
407     private:
408         GraphicsCache();
409         ~GraphicsCache();
410
411         //! Creates a new temple picture with the given parameters.
412         TempleCacheItem* addTemplePic(int type, guint32 cityset);
413
414         //! Creates a new ruin picture with the given parameters.
415         RuinCacheItem* addRuinPic(int type, guint32 cityset);
416
417         //! Creates a new diplomacy icon with the given parameters.
418         DiplomacyCacheItem* addDiplomacyPic(int type, Player::DiplomaticState state);
419
420         //! Creates a new road picture with the given parameters.
421         RoadCacheItem* addRoadPic(int type, guint32 tileset);
422
423         //! Creates a new fog picture with the given parameters.
424         FogCacheItem* addFogPic(FogCacheItem *item);
425
426         //! Creates a new bridge picture with the given parameters.
427         BridgeCacheItem* addBridgePic(int type, guint32 tileset);
428
429         //! Creates a new cursor picture with the given parameters.
430         CursorCacheItem* addCursorPic(int type);
431
432         //! Creates a new army picture with the given parameters.
433         ArmyCacheItem* addArmyPic(ArmyCacheItem*item);
434
435         //! Creates a new drawn tile with the given parameters.
436         TileCacheItem* addTilePic(TileCacheItem*item);
437
438         //! Creates a new shield picture with the given parameters.
439         ShieldCacheItem* addShieldPic(guint32 shieldset, guint32 type, guint32 colour);
440
441         //! Creates a new city picture with the given parameters.
442         CityCacheItem* addCityPic(int type, const Player* p, guint32 cityset);
443
444         //! Creates a new tower picture with the given parameters.
445         TowerCacheItem* addTowerPic(const Player* p, guint32 cityset);
446
447         //! Creates a new ship picture with the given parameters.
448         ShipCacheItem* addShipPic(const Player* p);
449
450         //! Creates a new planted standard picture with the given parameters.
451         PlantedStandardCacheItem* addPlantedStandardPic(const Player* p);
452
453         //! Creates a new port picture with the given parameters.
454         PortCacheItem* addPortPic(guint32 cityset);
455
456         //! Creates a new port picture with the given parameters.
457         SignpostCacheItem* addSignpostPic(guint32 cityset);
458
459         //! Creates a new bag-of-items picture with the given parameters.
460         BagCacheItem* addBagPic(guint32 armyset);
461
462         //! Creates a new explosion picture with the given parameters.
463         ExplosionCacheItem* addExplosionPic(guint32 tileset);
464
465         //! Creates a new new-level picture in the player's colour.
466         NewLevelCacheItem* addNewLevelPic(const Player* p, guint32 gender);
467
468         //! Creates a new flag picture with the given parameters.
469         FlagCacheItem* addFlagPic(int size, const Player *p, guint32 tileset);
470
471         //! Creates a new selector picture with the given parameters.
472         SelectorCacheItem* addSelectorPic(guint32 type, guint32 frame, 
473                                           const Player* p, guint32 tileset);
474
475         //! Creates a new production shield picture with the given parameters.
476         ProdShieldCacheItem* addProdShieldPic(guint32 type, bool prod);
477
478         //! Creates a new movement bonus picture with the given parameters.
479         MoveBonusCacheItem* addMoveBonusPic(guint32 type);
480
481
482         //! Checks if the cache has exceeded the maximum size and reduce it.
483         void checkPictures();
484         
485         //! Erases the oldest (least recently requested) army cache item.
486         void eraseLastArmyItem();
487
488         //! Erases the oldest (least recently requested) army cache item.
489         void eraseLastTileItem();
490
491         //! Erases the oldest (least recently requested) temple cache item.
492         void eraseLastTempleItem();
493
494         //! Erases the oldest (least recently requested) ruin cache item.
495         void eraseLastRuinItem();
496
497         //! Erases the oldest (least recently requested) diplomacy cache item.
498         void eraseLastDiplomacyItem();
499
500         //! Erases the oldest (least recently requested) road cache item.
501         void eraseLastRoadItem();
502
503         //! Erases the oldest (least recently requested) fog cache item.
504         void eraseLastFogItem();
505
506         //! Erases the oldest (least recently requested) bridge cache item.
507         void eraseLastBridgeItem();
508
509         //! Erases the oldest (least recently requested) cursor cache item.
510         void eraseLastCursorItem();
511
512         //! Erases the oldest (least recently requested) city cache item.
513         void eraseLastCityItem();
514
515         //! Erases the oldest (least recently requested) tower cache item.
516         void eraseLastTowerItem();
517
518         //! Erases the oldest (least recently requested) ship cache item.
519         void eraseLastShipItem();
520
521         //! Erases the oldest planted standard cache item.
522         void eraseLastPlantedStandardItem();
523
524         //! Erases the oldest port cache item.
525         void eraseLastPortItem();
526
527         //! Erases the oldest bag-of-items cache item.
528         void eraseLastBagItem();
529
530         //! Erases the oldest explosion cache item.
531         void eraseLastExplosionItem();
532
533         //! Erases the oldest signpost cache item.
534         void eraseLastSignpostItem();
535
536         //! Erase the oldest picture of a hero gaining a level.
537         void eraseLastNewLevelItem();
538
539         //! Erases the oldest flag cache item
540         void eraseLastFlagItem();
541
542         //! Erases the oldest selector cache item
543         void eraseLastSelectorItem();
544
545         //! Erases the oldest shield cache item
546         void eraseLastShieldItem();
547
548         //! Erases the oldest production shield cache item
549         void eraseLastProdShieldItem();
550
551         //! Erases the oldest movement bonus cache item
552         void eraseLastMoveBonusItem();
553
554         //! Loads the images for the city pictures
555         void loadCityPics();
556
557         //! Loads the images for the tower pictures
558         void loadTowerPics();
559
560         //! Loads the images for the temple pictures.
561         void loadTemplePics();
562
563         //! Loads the images for the ruin pictures.
564         void loadRuinPics();
565
566         //! Loads the images for the diplomacy pictures.
567         void loadDiplomacyPics();
568
569         //! Loads the images for the cursor pictures.
570         void loadCursorPics();
571
572         //! Loads the images for the medals.
573         void loadMedalPics();
574         
575         //! Loads the images for the production shields
576         void loadProdShields();
577         
578         //! Loads the images associated with heroes gaining a new level.
579         void loadNewLevelPics();
580
581         //! Loads the images for the movement bonuses
582         void loadMoveBonusPics();
583
584         void drawTilePic(PixMask *surface, int fog_type_id, bool has_bag, bool has_standard, int standard_player_id, int stack_size, int stack_player_id, int army_type_id, bool has_tower, bool has_ship, Maptile::Building building_type, int building_subtype, Vector<int> building_tile, int building_player_id, guint32 ts, bool has_grid, guint32 tileset, guint32 cityset);
585
586         /** Loads an image
587           * 
588           * This method loads an image, adjusts it to the current resolution etc.
589           * to improve blitting performance.
590           *
591           * @note Some of the images (.jpg??) become transparent if the alpha
592           * channel is copied (they don't have transparent bits anyway), so they
593           * should be loaded with alpha set to false
594           *
595           * @param filename     full filename (with path) of the image to load
596           * @param alpha        if set to true, copy the alpha channel as well
597           *                     (i.e. if the file has transparent pixels, they
598           *                     will be marked as transparent in the returned image)
599           * @return converted image or 0 if anything failed.
600           */
601         static PixMask* loadImage(std::string filename, bool alpha = true);
602         //the data
603         static GraphicsCache* s_instance;
604
605         guint32 d_cachesize;
606         std::list<ArmyCacheItem*> d_armylist;
607         typedef std::map<ArmyCacheItem, std::list<ArmyCacheItem*>::iterator > ArmyMap;
608
609         ArmyMap d_armymap;
610         std::list<TileCacheItem*> d_tilelist;
611         typedef std::map<TileCacheItem, std::list<TileCacheItem*>::iterator > TileMap;
612         TileMap d_tilemap;
613         std::list<CityCacheItem*> d_citylist;
614         std::list<TowerCacheItem*> d_towerlist;
615         std::list<FlagCacheItem*> d_flaglist;
616         std::list<TempleCacheItem*> d_templelist;
617         std::list<RuinCacheItem*> d_ruinlist;
618         std::list<DiplomacyCacheItem*> d_diplomacylist;
619         std::list<RoadCacheItem*> d_roadlist;
620         std::list<FogCacheItem*> d_foglist;
621         typedef std::map<FogCacheItem, std::list<FogCacheItem*>::iterator > FogCacheMap;
622
623         FogCacheMap d_fogmap;
624         std::list<BridgeCacheItem*> d_bridgelist;
625         std::list<CursorCacheItem*> d_cursorlist;
626         std::list<SelectorCacheItem*> d_selectorlist;
627         std::list<ShieldCacheItem*> d_shieldlist;
628         std::list<ProdShieldCacheItem*> d_prodshieldlist;
629         std::list<MoveBonusCacheItem*> d_movebonuslist;
630         std::list<ShipCacheItem*> d_shiplist;
631         std::list<PlantedStandardCacheItem*> d_plantedstandardlist;
632         std::list<PortCacheItem*> d_portlist;
633         std::list<SignpostCacheItem*> d_signpostlist;
634         std::list<BagCacheItem*> d_baglist;
635         std::list<ExplosionCacheItem*> d_explosionlist;
636         std::list<NewLevelCacheItem*> d_newlevellist;
637
638         //some private surfaces
639         PixMask* d_diplomacypic[2][DIPLOMACY_TYPES];
640
641         PixMask* d_cursorpic[CURSOR_TYPES];
642         PixMask* d_prodshieldpic[PRODUCTION_SHIELD_TYPES];
643         PixMask* d_smallruinedcity;
644         PixMask* d_smallhero;
645         PixMask* d_smallinactivehero;
646         PixMask* d_movebonuspic[MOVE_BONUS_TYPES];
647         PixMask* d_medalpic[2][MEDAL_TYPES];
648         PixMask* d_small_ruin_unexplored;
649         PixMask* d_small_stronghold_unexplored;
650         PixMask* d_small_ruin_explored;
651         PixMask* d_small_temple;
652         PixMask *d_newlevel_male;
653         PixMask *d_newlevelmask_male;
654         PixMask *d_newlevel_female;
655         PixMask *d_newlevelmask_female;
656 };
657
658 bool operator <(ArmyCacheItem lhs, ArmyCacheItem rhs);
659 bool operator <(TileCacheItem lhs, TileCacheItem rhs);
660 bool operator <(FogCacheItem lhs, FogCacheItem rhs);
661 #endif