LandscapeTex.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(__INCLUDE_LandscapeTexh_INCLUDE__)
00022 #define __INCLUDE_LandscapeTexh_INCLUDE__
00023 
00024 #include <landscapedef/LandscapeTexDefn.h>
00025 #include <common/ModelID.h>
00026 #include <XML/XMLFile.h>
00027 #include <string>
00028 #include <vector>
00029 
00030 class ScorchedContext;
00031 class LandscapeTexType
00032 {
00033 public:
00034         enum TexType
00035         {
00036                 eNone,
00037                 ePrecipitationRain,
00038                 ePrecipitationSnow,
00039                 eWater,
00040                 eTextureGenerate
00041         };
00042 
00043         virtual bool readXML(XMLNode *node) = 0;
00044         virtual TexType getType() = 0;
00045 };
00046 
00047 class LandscapeTexTypeNone : public LandscapeTexType
00048 {
00049 public:
00050         virtual bool readXML(XMLNode *node);
00051         virtual TexType getType() { return eNone; }
00052 };
00053 
00054 class LandscapeTexPrecipitation : public LandscapeTexType
00055 {
00056 public:
00057         int particles;
00058 
00059         virtual bool readXML(XMLNode *node);
00060 };
00061 
00062 class LandscapeTexPrecipitationRain : public LandscapeTexPrecipitation
00063 {
00064 public:
00065         virtual TexType getType() { return ePrecipitationRain; }
00066 };
00067 
00068 class LandscapeTexPrecipitationSnow : public LandscapeTexPrecipitation
00069 {
00070 public:
00071         virtual TexType getType() { return ePrecipitationSnow; }
00072 };
00073 
00074 class LandscapeTexBorderWater : public LandscapeTexType
00075 {
00076 public:
00077         // Non-shader
00078         std::string reflection;
00079         std::string texture;
00080         std::string foam;
00081 
00082         // Shader
00083         Vector wavetopa;
00084         Vector wavetopb;
00085         Vector wavebottoma;
00086         Vector wavebottomb;
00087         Vector wavelight;
00088 
00089         // Both
00090         fixed height;
00091         
00092         virtual bool readXML(XMLNode *node);
00093         virtual TexType getType() { return eWater; }
00094 };
00095 
00096 class LandscapeTexTextureGenerate : public LandscapeTexType
00097 {
00098 public:
00099         std::string roof;
00100         std::string rockside;
00101         std::string shore;
00102         std::string texture0;
00103         std::string texture1;
00104         std::string texture2;
00105         std::string texture3;
00106 
00107         virtual bool readXML(XMLNode *node);
00108         virtual TexType getType() { return eTextureGenerate; }
00109 };
00110 
00111 class LandscapeTex
00112 {
00113 public:
00114         LandscapeTex();
00115         virtual ~LandscapeTex();
00116 
00117         unsigned int seed;
00118         std::string detail;
00119         std::string magmasmall;
00120         std::string scorch;
00121         Vector fog;
00122         Vector suncolor;
00123         bool nosunfog;
00124         bool nohorizonglow;
00125         bool nosunblend;
00126         std::string suntexture;
00127         std::string suntexturemask;
00128         float fogdensity;
00129         std::string skytexture;
00130         std::string skytexturestatic;
00131         std::string skytexturemask;
00132         std::string skycolormap;
00133         std::string skyline;
00134         std::string skylinemask;
00135         int skytimeofday;
00136         float skysunxy;
00137         float skysunyz;
00138         Vector skydiffuse;
00139         Vector skyambience;
00140 
00141         LandscapeTexType *border;
00142         LandscapeTexType *texture;
00143         LandscapeTexType *precipitation;
00144         LandscapeTexDefn texDefn;
00145 
00146         bool readXML(LandscapeDefinitions *definitions, XMLNode *node);
00147 
00148 private:
00149         LandscapeTex(const LandscapeTex &other);
00150         LandscapeTex &operator=(LandscapeTex &other);
00151 };
00152 
00153 #endif

Generated on Mon Feb 16 15:14:50 2009 for Scorched3D by  doxygen 1.5.3