CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

cstool/prfire.h

00001 /*
00002     Copyright (C) 2000 by Jorrit Tyberghein
00003     Copyright (C) 2000 by W.C.A. Wijngaards
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_PROCFIRETEX_H__
00021 #define __CS_PROCFIRETEX_H__
00022 
00023 #include "csutil/cscolor.h"
00024 #include "csutil/randomgen.h"
00025 #include "cstool/proctex.h"
00026 #include "itexture/ifire.h"
00027 
00028 class csGradient;
00029 struct csRGBcolor;
00030 
00034 class csProcFire : public csProcTexture, public iFireTexture
00035 {
00036 private:
00038   csRGBcolor* palette;
00039   int* palette_idx;
00041   int palsize;
00042 
00044   uint8 *fireline;
00046   uint8 *image[2];
00047   int curimg;
00048   unsigned char* blitbuf;
00049 
00051   void MakePalette (int max);
00053   void SetHSI (csColor& col, float H, float S, float I);
00055   uint8& GetFireLine (int x);
00056 
00059   int possburn, addburn;
00061   int contburn;
00063   int smoothing;
00065   int extinguish;
00066 
00068   bool single_flame_mode;
00070   int halfbase;
00072   int postsmooth;
00073 
00074   csRandomGen rng;
00075 
00076 public:
00077   SCF_DECLARE_IBASE_EXT(csProcTexture);
00078 
00080   csProcFire (int w = 128, int h = 128);
00082   virtual ~csProcFire ();
00083 
00084   virtual bool PrepareAnim ();
00085 
00087   virtual void Animate (csTicks current_time);
00088 
00090   void SetSingleFlame(bool enable, int halfflame)
00091   { single_flame_mode = enable; halfbase = halfflame; }
00093   bool GetSingleFlame() const {return single_flame_mode;}
00094 
00095   virtual void SetPossibleBurn (int possburn);
00096   virtual int GetPossibleBurn();
00097 
00098   virtual void SetAdditionalBurn (int addburn);
00099   virtual int GetAdditionalBurn();
00100   
00101   virtual void SetContinuedBurn (int contburn);
00102   virtual int GetContinuedBurn();
00103   
00104   virtual void SetSmoothing (int smoothing);
00105   virtual int GetSmoothing();
00106   
00107   virtual void SetExtinguish (int extinguish);
00108   virtual int GetExtinguish();
00109   
00110   virtual void SetSingleFlameMode (bool enable);
00111   virtual bool GetSingleFlameMode();
00112   
00113   virtual void SetHalfBase (int halfbase);
00114   virtual int GetHalfBase();
00115 
00116   virtual void SetPostSmoothing (int amount);
00117   virtual int GetPostSmoothing ();
00118 
00119   virtual void SetPalette (const csGradient gradient);
00120 };
00121 
00122 #endif // __CS_PROCFIRETEX_H__
00123 

Generated for Crystal Space by doxygen 1.2.18