Index: ps/trunk/source/renderer/PatchRData.cpp =================================================================== --- ps/trunk/source/renderer/PatchRData.cpp +++ ps/trunk/source/renderer/PatchRData.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2019 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -17,10 +17,6 @@ #include "precompiled.h" -#include -#include -#include - #include "graphics/GameView.h" #include "graphics/LightEnv.h" #include "graphics/LOSTexture.h" @@ -33,17 +29,21 @@ #include "maths/MathUtil.h" #include "ps/CLogger.h" #include "ps/Game.h" +#include "ps/GameSetup/Config.h" #include "ps/Profile.h" #include "ps/Pyrogenesis.h" #include "ps/World.h" -#include "ps/GameSetup/Config.h" #include "renderer/AlphaMapCalculator.h" #include "renderer/PatchRData.h" -#include "renderer/TerrainRenderer.h" #include "renderer/Renderer.h" +#include "renderer/TerrainRenderer.h" #include "renderer/WaterManager.h" -#include "simulation2/Simulation2.h" #include "simulation2/components/ICmpWaterManager.h" +#include "simulation2/Simulation2.h" + +#include +#include +#include const ssize_t BlendOffsets[9][2] = { { 0, -1 }, @@ -1344,10 +1344,10 @@ // The 4 points making a water tile. int moves[4][2] = { - {0,0}, - {water_cell_size,0}, - {0,water_cell_size}, - {water_cell_size,water_cell_size} + {0, 0}, + {water_cell_size, 0}, + {0, water_cell_size}, + {water_cell_size, water_cell_size} }; // Where to look for when checking for water for shore tiles. int check[10][2] = { @@ -1413,10 +1413,10 @@ // Check id this tile is partly over land. // If so add a square over the terrain. This is necessary to render waves that go on shore. - if (terrain->GetVertexGroundLevel(x+px, z+pz) < waterHeight - && terrain->GetVertexGroundLevel(x+px + water_cell_size, z+pz) < waterHeight - && terrain->GetVertexGroundLevel(x+px, z+pz+water_cell_size) < waterHeight - && terrain->GetVertexGroundLevel(x+px + water_cell_size, z+pz+water_cell_size) < waterHeight) + if (terrain->GetVertexGroundLevel(x+px, z+pz) < waterHeight && + terrain->GetVertexGroundLevel(x+px + water_cell_size, z+pz) < waterHeight && + terrain->GetVertexGroundLevel(x+px, z+pz+water_cell_size) < waterHeight && + terrain->GetVertexGroundLevel(x+px + water_cell_size, z+pz+water_cell_size) < waterHeight) continue; for (int i = 0; i < 4; ++i) @@ -1424,7 +1424,7 @@ if (water_shore_index_map[z+moves[i][1]][x+moves[i][0]] != 0xFFFF) continue; ssize_t xx = x + px + moves[i][0]; - ssize_t zz = x + pz + moves[i][1]; + ssize_t zz = z + pz + moves[i][1]; SWaterVertex vertex; terrain->CalcPosition(xx,zz, vertex.m_Position);