Fixes a typo introduced in cb048b4738 in shore calculations, found by Angen and fixes style notes by elexis.

Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1949
This was SVN commit r22334.
This commit is contained in:
vladislavbelov
2019-06-03 20:19:18 +00:00
parent f4194df416
commit 4b65cc0317
+17 -17
View File
@@ -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 <set>
#include <algorithm>
#include <numeric>
#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 <algorithm>
#include <numeric>
#include <set>
const ssize_t BlendOffsets[9][2] = {
{ 0, -1 },
@@ -1344,10 +1344,10 @@ void CPatchRData::BuildWater()
// 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 @@ void CPatchRData::BuildWater()
// 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 @@ void CPatchRData::BuildWater()
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);