Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GXLandGenerator.h

Go to the documentation of this file.
00001 #ifndef __GXLANDGEN
00002 #define __GXLANDGEN
00003 
00004 
00005 
00006 #include "GXStandardDefines.h"
00007 #include "GXAutoArray.h"
00008 #include "GXBitmapLand.h"
00009 #include "GXSquareTemplate.h"
00010 
00011 class CGXLandGenerator
00012 {
00013 public:
00014         CGXLandGenerator();
00015         virtual ~CGXLandGenerator();
00016 
00017         virtual bool LoadFromStream(IStream* pStream);
00018         virtual bool SaveToStream(IStream* pStream);
00019         
00020         virtual bool LoadFromData(CGXSquare<D3DXCOLOR>* pColorSpline,//x=height, y=rand
00021                                                                 CGXAutoArray<float>* pHeightSpline);
00022 
00023 
00024         //uDataSideSize=size of generated height and color squares, usually same as uLandSideSize
00025         virtual bool GenerateLand(CGXDeviceContainer* pDevice,
00026                                                            CGXBitmapLand* pOut,
00027                                                                 UINT uLandDataSideSize,
00028                                                                 UINT uColorDataSideSize,
00029                                                                 UINT uMipCount,
00030                                                                 float fSideSize, float fNormalAmp,
00031                                                                 float fHeightAmp, UINT uLandSideSize);
00032         
00033         inline CGXSquare<D3DXCOLOR>* GetColorSpline(){return &m_ColorSpline;}
00034         inline CGXAutoArray<float>* GetHeightSpline(){return &m_HeightSpline;}
00035         inline CGXSquare<float>*        GetHeightMap(){return &m_HeightMap;}
00036 
00037 
00038 protected:
00039         CGXSquare<D3DXCOLOR>            m_ColorSpline;
00040         CGXAutoArray<float>                     m_HeightSpline;
00041         UINT                                            m_uMipLevels;
00042         float                                           m_fFalloff;
00043 
00044         CGXSquare<float>                        m_HeightMap;
00045 };
00046 
00047 
00048 
00049 //(*pCallBack)(type*, const type*, const type*, float, void*, const D3DXVECTOR2*)
00050 
00051 void GXColorFiller(D3DXCOLOR*, const D3DXCOLOR*, const D3DXCOLOR*, float, void*, const D3DXVECTOR2*);
00052 void GXHeightFiller(float*, const float*, const float*, float, void*, const D3DXVECTOR2*);
00053 
00054 
00055 #endif

Generated on Thu May 23 17:51:00 2002 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001