1
0
forked from 0ad/0ad

Change a few things to avoid warnings with gcc. Should fix #2359

This was SVN commit r14529.
This commit is contained in:
wraitii 2014-01-06 22:14:27 +00:00
parent baf6925b66
commit d0e57cb0ff
2 changed files with 5 additions and 4 deletions

View File

@ -718,12 +718,14 @@ void CXMLReader::ReadEnvironment(XMBElement parent)
if (!m_MapReader.pWaterMan)
continue;
float this_avoids_a_warning_about_unused_variables = 0;
if (element_name == el_type)
{
// TODO: implement this, when WaterManager supports it
}
else if (element_name == el_shininess)
{
// deprecated.
}
#define READ_COLOUR(el, out) \
else if (element_name == el) \
{ \
@ -742,7 +744,6 @@ void CXMLReader::ReadEnvironment(XMBElement parent)
} \
READ_COLOUR(el_colour, m_MapReader.pWaterMan->m_WaterColor)
READ_FLOAT(el_shininess, this_avoids_a_warning_about_unused_variables)
READ_FLOAT(el_waviness, m_MapReader.pWaterMan->m_Waviness)
READ_FLOAT(el_murkiness, m_MapReader.pWaterMan->m_Murkiness)
READ_COLOUR(el_tint, m_MapReader.pWaterMan->m_WaterTint)

View File

@ -363,7 +363,7 @@ void WaterManager::CreateSuperfancyInfo(CSimulation2* simulation)
// search a 5x5 array with us in the center (do not search me)
// much faster since we spiral search and can just stop once we've found the shore.
// also everything is precomputed and we get exact results instead.
int offset[24] = { -1,1,-m_MapSize,+m_MapSize, -1-m_MapSize,+1-m_MapSize,-1+m_MapSize,1+m_MapSize,
size_t offset[24] = { -1,1,-m_MapSize,+m_MapSize, -1-m_MapSize,+1-m_MapSize,-1+m_MapSize,1+m_MapSize,
-2,2,-2*m_MapSize,2*m_MapSize,-2-m_MapSize,-2+m_MapSize,2-m_MapSize,2+m_MapSize,
-1-2*m_MapSize,+1-2*m_MapSize,-1+2*m_MapSize,1+2*m_MapSize,
-2-2*m_MapSize,2+2*m_MapSize,-2+2*m_MapSize,2-2*m_MapSize };