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 "csextern.h"
00024 
00025 #include "csutil/cscolor.h"
00026 #include "csutil/randomgen.h"
00027 #include "cstool/proctex.h"
00028 #include "itexture/ifire.h"
00029 
00030 class csGradient;
00031 struct csRGBcolor;
00032 
00036 class CS_CSTOOL_EXPORT csProcFire : public csProcTexture, public iFireTexture
00037 {
00038 private:
00040   csRGBcolor* palette;
00041   int* palette_idx;
00043   int palsize;
00044 
00046   uint8 *fireline;
00048   uint8 *image[2];
00049   int curimg;
00050   unsigned char* blitbuf;
00051 
00053   void MakePalette (int max);
00055   void SetHSI (csColor& col, float H, float S, float I);
00057   uint8& GetFireLine (int x);
00058 
00061   int possburn, addburn;
00063   int contburn;
00065   int smoothing;
00067   int extinguish;
00068 
00070   bool single_flame_mode;
00072   int halfbase;
00074   int postsmooth;
00075 
00076   csRandomGen rng;
00077 
00078 public:
00079   SCF_DECLARE_IBASE_EXT(csProcTexture);
00080 
00082   csProcFire (int w = 128, int h = 128);
00084   virtual ~csProcFire ();
00085 
00086   virtual bool PrepareAnim ();
00087 
00089   virtual void Animate (csTicks current_time);
00090 
00092   void SetSingleFlame(bool enable, int halfflame)
00093   { single_flame_mode = enable; halfbase = halfflame; }
00095   bool GetSingleFlame() const {return single_flame_mode;}
00096 
00097   virtual void SetPossibleBurn (int possburn);
00098   virtual int GetPossibleBurn();
00099 
00100   virtual void SetAdditionalBurn (int addburn);
00101   virtual int GetAdditionalBurn();
00102   
00103   virtual void SetContinuedBurn (int contburn);
00104   virtual int GetContinuedBurn();
00105   
00106   virtual void SetSmoothing (int smoothing);
00107   virtual int GetSmoothing();
00108   
00109   virtual void SetExtinguish (int extinguish);
00110   virtual int GetExtinguish();
00111   
00112   virtual void SetSingleFlameMode (bool enable);
00113   virtual bool GetSingleFlameMode();
00114   
00115   virtual void SetHalfBase (int halfbase);
00116   virtual int GetHalfBase();
00117 
00118   virtual void SetPostSmoothing (int amount);
00119   virtual int GetPostSmoothing ();
00120 
00121   virtual void SetPalette (const csGradient gradient);
00122 };
00123 
00124 #endif // __CS_PROCFIRETEX_H__
00125 

Generated for Crystal Space by doxygen 1.2.18