Advanced Strategic Command
graphicset.h
Go to the documentation of this file.
1 /***************************************************************************
2  graphicset.h - description
3  -------------------
4  begin : Sun Jan 28 2001
5  copyright : (C) 2001 by Martin Bickel
6  email : bickel@asc-hq.org
7  ***************************************************************************/
8 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #ifndef graphicsetH
23  #define graphicsetH
24 
25 #include <map>
26 #include "loki/Singleton.h"
27 
28 #include "global.h"
29 #include "graphics/surface.h"
30 #include "typen.h"
31 #include "overviewmapimage.h"
32 
33  extern int getGraphicSetIdFromFilename ( const ASCString& filename );
34 
35 
37 
38  class GraphicSet {
39  public:
40  int id;
41  vector<Surface> image;
42  vector<int> picmode;
43  map<int,OverviewMapImage> quickViewImages;
44 
45  bool picAvail ( int num ) const
46  {
47  if ( picmode.size() > num )
48  return picmode[num] < 256;
49  else
50  return false;
51  };
52  };
53 
54 
55  GraphicSet* activeSet;
56  typedef vector<GraphicSet*> GraphicSets;
57  GraphicSets graphicSets;
58 
59  GraphicSetManager_Base (); // should be made private
60  public:
61  int setActive ( int id );
62  int getActiveID ( ) { if ( activeSet ) return activeSet->id; else return -1; };
63 
64  void loadData();
65 
66 
67  bool picAvail ( int num ) const;
68  int getMode( int num ) const;
69  Surface& getPic ( int num );
70  void setPic( int num, Surface pic );
71  const OverviewMapImage* getQuickView( int id );
72  friend struct Loki::CreateUsingNew<GraphicSetManager_Base>;
73  // friend struct CreateUsingNew;
74 
76  };
77 
78  typedef Loki::SingletonHolder<GraphicSetManager_Base> GraphicSetManager;
79 
80 #endif
Global platform dependant definitions. This file just branches to the platform specific files in thei...
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
int getGraphicSetIdFromFilename(const ASCString &filename)
Definition: graphicset.cpp:117
Loki::SingletonHolder< GraphicSetManager_Base > GraphicSetManager
Definition: graphicset.h:78
const OverviewMapImage * getQuickView(int id)
Definition: graphicset.cpp:94
bool picAvail(int num) const
Definition: graphicset.cpp:43
int getMode(int num) const
Definition: graphicset.cpp:52
void setPic(int num, Surface pic)
Definition: graphicset.cpp:70
the image for a TerrainType that is shown on the small map
Surface & getPic(int num)
Definition: graphicset.cpp:62