Просмотр исходного кода

describe roads placement in log

AlexVinS 10 лет назад
Родитель
Сommit
27c46c83d6
2 измененных файлов с 10 добавлено и 6 удалено
  1. 8 4
      lib/rmg/CRmgTemplateZone.cpp
  2. 2 2
      lib/rmg/CRmgTemplateZone.h

+ 8 - 4
lib/rmg/CRmgTemplateZone.cpp

@@ -1488,6 +1488,8 @@ void CRmgTemplateZone::drawRoads(CMapGenerator* gen)
 		
 	};
 	
+	logGlobal->debug("Started building roads");
+	
 	while(!roadNodes.empty())
 	{
 		int3 node = *roadNodes.begin(); 
@@ -1496,15 +1498,17 @@ void CRmgTemplateZone::drawRoads(CMapGenerator* gen)
 		{
 			//start road network
 			roads.insert(node);
+			logGlobal->debugStream() << "First node of road network: " << node; 
 		}
 		else
 		{
-			
 			int3 cross = *RandomGeneratorUtil::nextItem(roads, gen->rand);
-			
-			crunchRoad(gen, node, cross, &freePaths);						
-		}		
+			logGlobal->debugStream() << "Building road from " << node << " to " << cross; 
+			crunchRoad(gen, node, cross, &freePaths);
+		}
 	}
+	
+	logGlobal->debug("Finished building roads");	
 }
 
 void CRmgTemplateZone::buildRoads(CMapGenerator* gen)

+ 2 - 2
lib/rmg/CRmgTemplateZone.h

@@ -223,8 +223,8 @@ private:
 	std::set<int3> roadNodes; //tiles to be connected with roads
 	std::set<int3> roads; //all tiles with roads
 	
-	void drawRoads(CMapGenerator* gen); //fills "roads" according to "roadNodes" 
-	void buildRoads(CMapGenerator* gen); //actually updates tiles
+	void drawRoads(CMapGenerator * gen); //fills "roads" according to "roadNodes" 
+	void buildRoads(CMapGenerator * gen); //actually updates tiles
 
 	bool pointIsIn(int x, int y);
 	void addAllPossibleObjects (CMapGenerator* gen); //add objects, including zone-specific, to possibleObjects