graphicset.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           graphicset.h  -  description
00003                              -------------------
00004     begin                : Sun Jan 28 2001
00005     copyright            : (C) 2001 by Martin Bickel
00006     email                : bickel@asc-hq.org
00007  ***************************************************************************/
00008 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef graphicsetH
00023  #define graphicsetH
00024 
00025 #include <map>
00026 #include "loki/Singleton.h"
00027 
00028 #include "global.h" 
00029 #include "graphics/surface.h" 
00030 #include "typen.h"
00031 #include "overviewmapimage.h"
00032 
00033  extern int getGraphicSetIdFromFilename ( const ASCString& filename );
00034 
00035 
00036  class GraphicSetManager_Base {
00037 
00038         class GraphicSet {
00039               public:
00040                 int id;
00041                 vector<Surface> image;
00042                 vector<int>     picmode;
00043                 map<int,OverviewMapImage> quickViewImages;
00044 
00045                 bool  picAvail ( int num ) const 
00046                 { 
00047                    if ( picmode.size() > num ) 
00048                       return picmode[num] < 256;
00049                    else
00050                       return false;
00051                 };
00052         };
00053 
00054  
00055      GraphicSet* activeSet;
00056      typedef vector<GraphicSet*> GraphicSets;
00057      GraphicSets graphicSets;
00058 
00059      GraphicSetManager_Base ();   // should be made private
00060    public:
00061      int setActive ( int id );
00062      int getActiveID ( ) { if ( activeSet ) return activeSet->id; else return -1; };
00063 
00064      void loadData();
00065      
00066     
00067      bool picAvail ( int num ) const;
00068      int  getMode( int num ) const;
00069      Surface& getPic ( int num );
00070      void setPic( int num, Surface pic );
00071      const OverviewMapImage* getQuickView( int id );
00072      friend struct Loki::CreateUsingNew<GraphicSetManager_Base>;
00073      // friend struct CreateUsingNew;
00074 
00075      ~GraphicSetManager_Base();
00076  };
00077 
00078  typedef Loki::SingletonHolder<GraphicSetManager_Base> GraphicSetManager;
00079   
00080 #endif

Generated on Mon May 21 01:26:33 2012 for Advanced Strategic Command by  doxygen 1.5.1