浏览代码

Make gcc happy

AlexVinS 11 年之前
父节点
当前提交
c40c79fa94
共有 4 个文件被更改,包括 8 次插入8 次删除
  1. 2 2
      lib/rmg/CRmgTemplateZone.cpp
  2. 2 2
      lib/rmg/CRmgTemplateZone.h
  3. 2 2
      lib/rmg/CZonePlacer.cpp
  4. 2 2
      lib/rmg/CZonePlacer.h

+ 2 - 2
lib/rmg/CRmgTemplateZone.cpp

@@ -306,12 +306,12 @@ int3 CRmgTemplateZone::getPos()
 {
 	return pos;
 }
-void CRmgTemplateZone::setPos(int3 &Pos)
+void CRmgTemplateZone::setPos(const int3 &Pos)
 {
 	pos = Pos;
 }
 
-void CRmgTemplateZone::addTile (int3 &pos)
+void CRmgTemplateZone::addTile (const int3 &pos)
 {
 	tileinfo[pos] = CTileInfo();
 }

+ 2 - 2
lib/rmg/CRmgTemplateZone.h

@@ -103,9 +103,9 @@ public:
 	float3 getCenter() const;
 	void setCenter(float3 f);
 	int3 getPos();
-	void setPos(int3 &pos);
+	void setPos(const int3 &pos);
 
-	void addTile (int3 &pos);
+	void addTile (const int3 &pos);
 	void setShape(std::vector<int3> shape);
 	bool fill(CMapGenerator* gen);
 

+ 2 - 2
lib/rmg/CZonePlacer.cpp

@@ -33,7 +33,7 @@ CZonePlacer::~CZonePlacer()
 
 }
 
-int3 CZonePlacer::cords (float3 f) const
+int3 CZonePlacer::cords (const float3 f) const
 {
 	return int3(std::max(0.f, (f.x * gen->map->width)-1), std::max(0.f, (f.y * gen->map->height-1)), f.z);
 }
@@ -160,7 +160,7 @@ void CZonePlacer::placeZones(shared_ptr<CMapGenOptions> mapGenOptions, CRandomGe
 	}
 }
 
-float CZonePlacer::metric (int3 &A, int3 &B) const
+float CZonePlacer::metric (const int3 &A, const int3 &B) const
 {
 /*
 

+ 2 - 2
lib/rmg/CZonePlacer.h

@@ -39,8 +39,8 @@ class CZonePlacer
 {
 public:
 	explicit CZonePlacer(CMapGenerator * gen);
-	int3 cords (float3 f) const;
-	float metric (int3 &a, int3 &b) const;
+	int3 cords (const float3 f) const;
+	float metric (const int3 &a, const int3 &b) const;
 	~CZonePlacer();
 
 	void placeZones(shared_ptr<CMapGenOptions> mapGenOptions, CRandomGenerator * rand);