Changeset 6495 in orxonox.OLD for height_map_merge/src
- Timestamp:
- Jan 11, 2006, 5:34:45 PM (19 years ago)
- Location:
- height_map_merge/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
height_map_merge/src/world_entities/terrain.cc
r6341 r6495 26 26 #include "network_game_manager.h" 27 27 28 #include "height_map.h" 29 #include "material.h" 28 30 29 31 #include "glincl.h" … … 100 102 this->ssp = NULL; 101 103 this->vegetation = NULL; 104 105 this->heightMap = NULL; 106 this->heightMapMaterial = NULL; 102 107 } 103 108 … … 105 110 void Terrain::loadParams(const TiXmlElement* root) 106 111 { 107 static_cast<WorldEntity*>(this)->loadParams(root);112 WorldEntity::loadParams(root); 108 113 109 114 LoadParam(root, "vegetation", this, Terrain, loadVegetation) 110 115 .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ; 111 } 116 117 118 LoadParam(root, "height-map", this, Terrain, loadHeightMap) 119 .describe("The HeightMap, splitted into two strings seperated by ','. 1: HeighMap, 2: ColorMap"); 120 121 122 LoadParam(root, "heigt-texture", this, Terrain, loadTexture) 123 .describe("The name of the Texture for this heightMap"); 124 } 125 126 void Terrain::loadHeightMap(const char* heightMapFile, const char* colorMap) 127 { 128 if (this->heightMap != NULL) 129 delete this->heightMap; 130 this->heightMap = NULL; 131 132 133 this->heightMap = new HeightMap(heightMapFile, colorMap); 134 135 } 136 137 138 void Terrain::loadTexture(const char* textureName) 139 { 140 if (this->heightMapMaterial != NULL) 141 delete this->heightMapMaterial; 142 } 143 144 112 145 113 146 void Terrain::loadVegetation(const char* vegetationFile) … … 124 157 this->vegetation = NULL; 125 158 } 159 160 126 161 127 162 -
height_map_merge/src/world_entities/terrain.h
r6341 r6495 15 15 // FORWARD DECLARATION 16 16 class SpatialSeparation; 17 class HeightMap; 18 class Material; 17 19 18 20 //! A simple method to call a desired debug world. … … 40 42 void loadVegetation(const char* vegetationFile); 41 43 44 void loadHeightMap(const char* heightMapFile, const char* colorMap = NULL); 45 void loadTexture(const char* textureName); 46 42 47 void buildDebugTerrain(DebugTerrain debugTerrain); 43 48 virtual void draw() const; … … 50 55 int objectList; 51 56 57 HeightMap* heightMap; 58 Material* heightMapMaterial; 52 59 }; 53 60
Note: See TracChangeset
for help on using the changeset viewer.