From 835f84584e9f6bcd8f53f91c862688f5005307b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Thu, 23 Dec 2021 22:47:44 +0100 Subject: [PATCH] Refactored Math::IntPoint in CTerrain --- src/graphics/engine/terrain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp index 9433fd1e..4b2d728c 100644 --- a/src/graphics/engine/terrain.cpp +++ b/src/graphics/engine/terrain.cpp @@ -237,7 +237,7 @@ bool CTerrain::LoadResources(const std::string& fileName) { for (int y = 0; y < size; ++y) { - Gfx::IntColor pixel = img.GetPixelInt(Math::IntPoint(x, size - y - 1)); + Gfx::IntColor pixel = img.GetPixelInt({ x, size - y - 1 }); TerrainRes res = TR_NULL; for (const auto& it : RESOURCE_PALETTE) @@ -324,7 +324,7 @@ bool CTerrain::LoadRelief(const std::string &fileName, float scaleRelief, { for (int x = 0; x < size; x++) { - Gfx::IntColor color = img.GetPixelInt(Math::IntPoint(x, size - y - 1)); + Gfx::IntColor color = img.GetPixelInt({ x, size - y - 1 }); float avg = (color.r + color.g + color.b) / 3.0f; // to be sure it is grayscale float level = (255.0f - avg) * scaleRelief; @@ -1285,7 +1285,7 @@ bool CTerrain::Terraform(const Math::Vector &p1, const Math::Vector &p2, float h { float dim = (m_mosaicCount*m_brickCount*m_brickSize)/2.0f; - Math::IntPoint tp1, tp2; + glm::ivec2 tp1, tp2; tp1.x = static_cast((p1.x+dim+m_brickSize/2.0f)/m_brickSize); tp1.y = static_cast((p1.z+dim+m_brickSize/2.0f)/m_brickSize); tp2.x = static_cast((p2.x+dim+m_brickSize/2.0f)/m_brickSize); @@ -1342,7 +1342,7 @@ bool CTerrain::Terraform(const Math::Vector &p1, const Math::Vector &p2, float h } AdjustRelief(); - Math::IntPoint pp1, pp2; + glm::ivec2 pp1, pp2; pp1.x = (tp1.x-2)/m_brickCount; pp1.y = (tp1.y-2)/m_brickCount; pp2.x = (tp2.x+1)/m_brickCount;