00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__INCLUDE_GroundMapsh_INCLUDE__)
00022 #define __INCLUDE_GroundMapsh_INCLUDE__
00023
00024 #include <landscapemap/HeightMap.h>
00025 #include <landscapemap/NapalmMap.h>
00026 #include <landscapemap/TargetGroups.h>
00027
00028 class RandomGenerator;
00029 class ScorchedContext;
00030 class LandscapeInclude;
00031 class LandscapeDefinitionCache;
00032 class GroundMaps
00033 {
00034 public:
00035 GroundMaps(LandscapeDefinitionCache &defnCache);
00036 virtual ~GroundMaps();
00037
00038
00039 void generateMaps(
00040 ScorchedContext &context,
00041 ProgressCounter *counter = 0);
00042
00043
00044 fixed getHeight(int w, int h);
00045 fixed getInterpHeight(fixed w, fixed h);
00046 FixedVector &getNormal(int w, int h);
00047 void getInterpNormal(fixed w, fixed h, FixedVector &normal);
00048 bool getIntersect(Line &direction, Vector &intersect);
00049
00050
00051 fixed &getNapalmHeight(int w, int h)
00052 { return nmap_.getNapalmHeight(w, h); }
00053
00054
00055 int getLandscapeWidth();
00056 int getLandscapeHeight();
00057
00058
00059 int getArenaWidth();
00060 int getArenaHeight();
00061 int getArenaX();
00062 int getArenaY();
00063
00064
00065 TargetGroups &getGroups() { return groups_; }
00066
00067
00068 HeightMap &getHeightMap() { return map_; }
00069
00070 protected:
00071 int arenaX_, arenaY_;
00072 int arenaWidth_, arenaHeight_;
00073 HeightMap map_;
00074 NapalmMap nmap_;
00075 TargetGroups groups_;
00076 LandscapeDefinitionCache &defnCache_;
00077
00078
00079 void generateHMap(
00080 ScorchedContext &context,
00081 ProgressCounter *counter = 0);
00082 void generateObjects(
00083 ScorchedContext &context,
00084 ProgressCounter *counter = 0);
00085 void generateObject(RandomGenerator &generator,
00086 LandscapeInclude &place,
00087 ScorchedContext &context,
00088 unsigned int &playerId,
00089 ProgressCounter *counter = 0);
00090
00091 };
00092
00093 #endif // __INCLUDE_GroundMapsh_INCLUDE__