OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

Background.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Background.h  -  description
00003                              -------------------
00004     begin                : Sun Jan 11 2004
00005     copyright            : (C) 2004 by upi
00006     email                : upi@feel
00007  ***************************************************************************/
00008 
00009 #ifndef __BACKGROUND_H
00010 #define __BACKGROUND_H
00011 
00012 
00013 #include <vector>
00014 struct SDL_Surface;
00015 
00032 class CBackground
00033 {
00034 public:
00035     struct SBackgroundLayer
00036     {
00037         SDL_Surface*    m_poSurface;
00038         int             m_iXOffset;
00039         int             m_iYOffset;
00040         double          m_dDistance;
00041     };
00042     
00043 private:
00044     typedef std::vector<SBackgroundLayer> CLayerVector;
00045     typedef CLayerVector::iterator CLayerIterator;
00046 
00047     void            Clear();
00048 
00049 public:
00050     CBackground();
00051     ~CBackground();
00052 
00053     void            Load( int a_iBackgroundNumber );
00054     void            AddExtraLayer( const SBackgroundLayer& a_roLayer );
00055     void            DeleteExtraLayers();
00056 
00057     bool            IsOK();
00058     void            Draw( int a_iXPosition, int a_iYPosition, int a_iYOffset );
00059 
00060 protected:
00061     int             m_iNumber;
00062     int             m_iFirstExtraLayer;
00063     bool            m_bOK;
00064     CLayerVector    m_aLayers;
00065 };
00066 
00067 #endif // __BACKGROUND_H