home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / level / global_effect.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  2.2 KB  |  82 lines

  1. /***************************************************************************
  2.  * global_effect.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2006 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_GLOBAL_EFFECT_H
  17. #define SMC_GLOBAL_EFFECT_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../core/math/rect.h"
  21. #include "../video/animation.h"
  22.  
  23. /* *** *** *** *** *** *** *** Global Effect Type *** *** *** *** *** *** *** *** *** *** */
  24.  
  25. enum  GlobalEffectType
  26. {
  27.     GL_EFF_NONE = 0,    // disabled
  28.     GL_EFF_FALLING = 1
  29. };
  30.  
  31. /* *** *** *** *** *** *** *** Global effect class *** *** *** *** *** *** *** *** *** *** */
  32.  
  33. class cGlobal_effect : public cParticle_Emitter
  34. {
  35. public:
  36.     // default constructor
  37.     cGlobal_effect( void );
  38.     // create from stream
  39.     cGlobal_effect( CEGUI::XMLAttributes &attributes );
  40.     // destructor
  41.     virtual ~cGlobal_effect( void );
  42.  
  43.     // initialise
  44.     virtual void Init_Anim( void );
  45.     // clear
  46.     virtual void Clear( void );
  47.  
  48.     // create from stream
  49.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  50.     // save to stream
  51.     virtual void Save_to_Stream( ofstream &file );
  52.  
  53.     // update
  54.     virtual void Update( void );
  55.     // find out of camera particles and move them to the opposite screen side
  56.     void Update_Particles( void );
  57.     // draw
  58.     virtual void Draw( void );
  59.  
  60.     // Sets global effect type
  61.     void Set_Type( GlobalEffectType ntype );
  62.     void Set_Type( string ntype );
  63.     // Set image
  64.     void Set_Image( string nimg_file );
  65.  
  66.     // Return the type name
  67.     string Get_Type_Name( void );
  68.  
  69.     // type
  70.     GlobalEffectType ge_type;
  71.  
  72.     // image filename
  73.     string image_filename;
  74.  
  75.     // valid global effect
  76.     bool valid;
  77. };
  78.  
  79. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  80.  
  81. #endif
  82.