D:/simple_rts/include/FogOfWar.h

Go to the documentation of this file.
00001 #ifndef __FOG_OF_WAR_H__
00002 #define __FOG_OF_WAR_H__
00003 
00004 #include "OgreTexture.h"
00005 #include "OgreHardwarePixelBuffer.h"
00006 
00007 using Ogre::TexturePtr;
00008 using Ogre::HardwarePixelBufferSharedPtr;
00009 
00010 namespace ASR
00011 {
00012         class Unit;
00013 
00014         // ----------------------------------------------------------------------------
00015         class FogOfWar
00016         {
00017         // Data Storage
00018         // ----------------------------------------------------------------------------
00019         private:
00020                 static int                      mNumFogs;
00021 
00022                 int             mWidth;
00023                 int             mHeight;
00024                 unsigned int*   mBuffer;
00025 
00026                 TexturePtr                                              mFogTexture;
00027                 HardwarePixelBufferSharedPtr    mPixBuffer;
00028 
00029 
00030         // Construction
00031         // ----------------------------------------------------------------------------
00032         public:
00033                 FogOfWar ( int width, int height );
00034                 ~FogOfWar ();
00035 
00036 
00037         // Update Management
00038         // ----------------------------------------------------------------------------
00039         public:
00040                 void blackOut ();
00041                 void setVisible ( int x, int y, int radius );
00042                 void updateTexture ();
00043                 void fadeOut ();
00044 
00045 
00046         // Query Methods
00047         // ----------------------------------------------------------------------------
00048         public:
00049                 bool isUnitVisible ( const Unit* unit ) const;
00050 
00051 
00052         // Rendering Functions
00053         // ----------------------------------------------------------------------------
00054         private:
00055                 void _drawHorizontalLine ( int xStart, int xEnd, int y );
00056         };
00057 }
00058 
00059 #endif

Generated on Sun Jun 25 19:23:43 2006 for Valors End by  doxygen 1.4.7