home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************
- // DIVE Laboratories, Inc.
- // Copyright(c) 1995
- // All rights reserved.
- // FILE: FIRE.HPP
- //
- // DESCRIPTION
- // This file provides the function prototypes for the fireClass
- // Fire is created as a modifiable texture that is manipulated
- // by a fire algorithm.
- //
- // Author: M. Doucet / P. Cattrone
- //
- // Modification History:
- // 6/5/95 Created
- // 9/8/95 Fire now looks like fire + added user controllable
- // variables. P.C.
- //
- //**********************************************************************
- #ifndef _FIRE_HPP
- #define _FIRE_HPP
-
- #include "style.hpp"
- #include "texture.hpp"
- #include "geometry.hpp"
-
-
- typedef unsigned char colorValueType[4];
-
- class fireClass : public styleClass {
-
- private:
-
-
- colorValueType pallette[256];
- short flameBuffer[32][32];
- short flameArray[32];
-
- int Rand(int rng);
- int Random(int rng);
- void hsiToRGB(float H, float S, float I, colorValueType C);
- void createPallette();
- void burn();
- sLinkClass polyList;
- textureClass *texture;
-
- public:
-
- BOOL start;
-
- BOOL alphaBlend; //If TRUE, the fire pixels are blended
- // with the background.
- //If FALSE, the fire pixels are opaque.
- //Default: FALSE
-
- int flare; //Possible values:
- // 0 = pressurized gas line
- // 1 = bon fire
- // 2 = wild fire
- //Default=1
-
- int water; //The distance away from the edge of
- // the texture map (in pixels) the
- // base of the fire burns.
- //Default=5
- //Note: Increase water value if the
- // fire is being clipped by the left
- // and right edges of the texture map.
-
- int burnability; //Burning material.
- //3 is like lighting a piece of wood.
- //90 is like lighting a pool of fuel.
- //Default=75
-
- int intensity; //Cooling down or heating up
- //Default=1
- //Note: Experiment with values between
- // -2 and 5.
-
- int decay; //The speed at which the flames go out.
- //Default=20
- //Note: Increase decay if the fire is
- // being clipped by the top of the
- // texture map. Decrease decay to
- // make the fire larger.
-
- int wind; //Is there wind and which way is it
- // blowing.
- //Possible values:
- // -1 = blows fire left.
- // 0 = no wind.
- // 1 = blows fire right.
- //Default: 0
- //Note: Looks best with a flare of 1.
-
- int fireBase; //The maximum possible increase in
- // random flame intensity at the base
- // of the fire.
- //Default=20
-
- int minFire; //The limit between smoldering and on
- // fire.
- //Possible values: 0 to 255
- //Default=50
-
- int smooth; //Dampens descrete flames
- //Default=1
-
- void style(void);
-
- // Add polygons to apply the fire texture to.
- void addPoly(polygonClass *poly);
- void removePoly(polygonClass *poly);
-
- //Constructor & Destructor
- fireClass(BOOL strt=TRUE, BOOL translucent=FALSE, int flr=1,
- int wtr=5, int burn=75, int intense=1, int dec=20,
- int wnd=0, int fBase=20, int mFire=50,int smth=1);
- ~fireClass();
-
- };
- #endif
-