Remove unneeded braces and whitespace in empty lines.

This was SVN commit r18882.
This commit is contained in:
elexis 2016-10-28 16:11:59 +00:00
parent d8665adf42
commit 4898e94c81

View File

@ -250,7 +250,6 @@ struct SerializeEntityData
}
};
/**
* Functor for sorting entities by distance from a source point.
* It must only be passed entities that are in 'entities'
@ -300,9 +299,7 @@ public:
componentManager.SubscribeGloballyToMessageType(MT_VisionRangeChanged);
componentManager.SubscribeToMessageType(MT_Deserialized);
componentManager.SubscribeToMessageType(MT_Update);
componentManager.SubscribeToMessageType(MT_RenderSubmit); // for debug overlays
}
@ -336,7 +333,7 @@ public:
std::vector<bool> m_LosRevealAll;
bool m_LosCircular;
i32 m_TerrainVerticesPerSide;
// Cache for visibility tracking
i32 m_LosTilesPerSide;
bool m_GlobalVisibilityUpdate;
@ -737,16 +734,10 @@ public:
{
// recalc current exploration stats.
for (i32 j = 0; j < m_TerrainVerticesPerSide; j++)
{
for (i32 i = 0; i < m_TerrainVerticesPerSide; i++)
{
if (!LosIsOffWorld(i, j))
{
for (u8 k = 1; k < MAX_LOS_PLAYER_ID+1; ++k)
m_ExploredVertices.at(k) += ((m_LosState[j*m_TerrainVerticesPerSide + i] & (LOS_EXPLORED << (2*(k-1)))) > 0);
}
}
}
}
else
{
@ -767,7 +758,6 @@ public:
m_LosTiles.resize(m_LosTilesPerSide*m_LosTilesPerSide);
for (EntityMap<EntityData>::const_iterator it = m_EntityData.begin(); it != m_EntityData.end(); ++it)
{
if (it->second.inWorld)
{
LosAdd(it->second.owner, it->second.visionRange, CFixedVector2D(it->second.x, it->second.z));
@ -776,7 +766,6 @@ public:
if (it->second.revealShore)
RevealShore(it->second.owner, true);
}
}
m_TotalInworldVertices = 0;
for (ssize_t j = 0; j < m_TerrainVerticesPerSide; ++j)
@ -797,10 +786,8 @@ public:
m_Subdivision.Reset(x1, z1);
for (EntityMap<EntityData>::const_iterator it = m_EntityData.begin(); it != m_EntityData.end(); ++it)
{
if (it->second.inWorld)
m_Subdivision.Add(it->first, CFixedVector2D(it->second.x, it->second.z), it->second.size);
}
}
virtual tag_t CreateActiveQuery(entity_id_t source,
@ -1179,9 +1166,7 @@ public:
entity_pos_t part = entity_pos_t::FromInt(numberOfSteps);
for (int i = 0; i < numberOfSteps; i++)
{
r = r + CFixedVector2D(coords[2*i],coords[2*i+1]).Length() / part;
}
return r;
@ -1306,7 +1291,6 @@ public:
return q;
}
void RenderSubmit(SceneCollector& collector)
{
if (!m_DebugOverlayEnabled)
@ -1397,9 +1381,7 @@ public:
// Draw the min range circle
if (!q.minRange.IsZero())
{
SimRender::ConstructCircleOnGround(GetSimContext(), pos.X.ToFloat(), pos.Y.ToFloat(), q.minRange.ToFloat(), m_DebugOverlayLines.back(), true);
}
// Draw a ray from the source to each matched entity
for (size_t i = 0; i < q.lastMatch.size(); ++i)
@ -1605,7 +1587,7 @@ public:
virtual ELosVisibility GetLosVisibility(CEntityHandle ent, player_id_t player)
{
entity_id_t entId = ent.GetId();
// Entities not with positions in the world are never visible
if (entId == INVALID_ENTITY)
return VIS_HIDDEN;
@ -1678,13 +1660,10 @@ public:
for (i32 n = 0; n < m_LosTilesPerSide * m_LosTilesPerSide; ++n)
{
for (player_id_t player = 1; player < MAX_LOS_PLAYER_ID + 1; ++player)
{
if (IsVisibilityDirty(m_DirtyVisibility[n], player) || m_GlobalPlayerVisibilityUpdate[player-1] == 1 || m_GlobalVisibilityUpdate)
{
for (const entity_id_t& ent : m_LosTiles[n])
UpdateVisibility(ent, player);
}
}
m_DirtyVisibility[n] = 0;
}
@ -1798,7 +1777,6 @@ public:
void ExploreAllTiles(player_id_t p)
{
for (u16 j = 0; j < m_TerrainVerticesPerSide; ++j)
{
for (u16 i = 0; i < m_TerrainVerticesPerSide; ++i)
{
if (LosIsOffWorld(i,j))
@ -1807,7 +1785,6 @@ public:
explored += !(m_LosState[i + j*m_TerrainVerticesPerSide] & (LOS_EXPLORED << (2*(p-1))));
m_LosState[i + j*m_TerrainVerticesPerSide] |= (LOS_EXPLORED << (2*(p-1)));
}
}
SeeExploredEntities(p);
}
@ -1835,7 +1812,6 @@ public:
ENSURE(grid.m_W*scale == m_TerrainVerticesPerSide-1 && grid.m_H*scale == m_TerrainVerticesPerSide-1);
for (u16 j = 0; j < grid.m_H; ++j)
{
for (u16 i = 0; i < grid.m_W; ++i)
{
u8 p = grid.get(i, j) & ICmpTerritoryManager::TERRITORY_PLAYER_MASK;
@ -1843,7 +1819,6 @@ public:
{
u32& explored = m_ExploredVertices.at(p);
for (int dj = 0; dj <= scale; ++dj)
{
for (int di = 0; di <= scale; ++di)
{
u32& losState = m_LosState[(i*scale+di) + (j*scale+dj)*m_TerrainVerticesPerSide];
@ -1853,10 +1828,8 @@ public:
losState |= (LOS_EXPLORED << (2*(p-1)));
}
}
}
}
}
}
for (player_id_t p = 1; p < MAX_LOS_PLAYER_ID+1; ++p)
SeeExploredEntities(p);
@ -1875,7 +1848,7 @@ public:
// change the indexes in the map, leading to segfaults.
// So we just remember what entities to mirage and do that later.
std::vector<entity_id_t> miragableEntities;
for (EntityMap<EntityData>::iterator it = m_EntityData.begin(); it != m_EntityData.end(); ++it)
{
CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), it->first);
@ -1920,7 +1893,6 @@ public:
u16* countsData = &counts[0];
for (u16 j = 0; j < shoreGrid.m_H; ++j)
{
for (u16 i = 0; i < shoreGrid.m_W; ++i)
{
u16 shoredist = shoreGrid.get(i, j);
@ -1933,7 +1905,6 @@ public:
else
LosRemoveStripHelper(p, i, i, j, countsData);
}
}
}
/**
@ -2299,11 +2270,8 @@ public:
LosUpdateHelper<true>((u8)owner, visionRange, to);
}
else
{
// Otherwise use the version optimised for mostly-overlapping circles
LosUpdateHelperIncremental((u8)owner, visionRange, from, to);
}
}
virtual u8 GetPercentMapExplored(player_id_t player)
@ -2317,22 +2285,18 @@ public:
std::vector<player_id_t>::const_iterator playerIt;
for (i32 j = 0; j < m_TerrainVerticesPerSide; j++)
{
for (i32 i = 0; i < m_TerrainVerticesPerSide; i++)
{
if (LosIsOffWorld(i, j))
continue;
for (playerIt = players.begin(); playerIt != players.end(); ++playerIt)
{
if (m_LosState[j*m_TerrainVerticesPerSide + i] & (LOS_EXPLORED << (2*((*playerIt)-1))))
{
exploredVertices += 1;
break;
}
}
}
}
return exploredVertices * 100 / m_TotalInworldVertices;
}