Caves and Ravines: fixed compilation and linking issues on gcc
git-svn-id: http://mc-server.googlecode.com/svn/trunk@699 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
5b69087b72
commit
015b3a5d19
@ -481,7 +481,7 @@ void cCaveTunnel::ProcessChunk(
|
|||||||
int DifY = itr->m_BlockY;
|
int DifY = itr->m_BlockY;
|
||||||
int DifZ = itr->m_BlockZ - BlockStartZ; // substitution for faster calc
|
int DifZ = itr->m_BlockZ - BlockStartZ; // substitution for faster calc
|
||||||
int Bottom = std::max(itr->m_BlockY - itr->m_Radius, 1);
|
int Bottom = std::max(itr->m_BlockY - itr->m_Radius, 1);
|
||||||
int Top = std::min(itr->m_BlockY + itr->m_Radius, cChunkDef::Height);
|
int Top = std::min(itr->m_BlockY + itr->m_Radius, (int)(cChunkDef::Height)); // Stupid gcc needs int cast
|
||||||
int SqRad = itr->m_Radius * itr->m_Radius;
|
int SqRad = itr->m_Radius * itr->m_Radius;
|
||||||
for (int z = 0; z < cChunkDef::Width; z++) for (int x = 0; x < cChunkDef::Width; x++)
|
for (int z = 0; z < cChunkDef::Width; z++) for (int x = 0; x < cChunkDef::Width; x++)
|
||||||
{
|
{
|
||||||
@ -748,7 +748,7 @@ void cStructGenWormNestCaves::GetCavesForChunk(int a_ChunkX, int a_ChunkZ, cStru
|
|||||||
int EndX = (BaseX + NEIGHBORHOOD_SIZE + 1) * m_Grid;
|
int EndX = (BaseX + NEIGHBORHOOD_SIZE + 1) * m_Grid;
|
||||||
int StartZ = BaseZ * m_Grid;
|
int StartZ = BaseZ * m_Grid;
|
||||||
int EndZ = (BaseZ + NEIGHBORHOOD_SIZE + 1) * m_Grid;
|
int EndZ = (BaseZ + NEIGHBORHOOD_SIZE + 1) * m_Grid;
|
||||||
for (cCaveSystems::const_iterator itr = m_Cache.begin(), end = m_Cache.end(); itr != end;)
|
for (cCaveSystems::iterator itr = m_Cache.begin(), end = m_Cache.end(); itr != end;)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
((*itr)->m_BlockX >= StartX) && ((*itr)->m_BlockX < EndX) &&
|
((*itr)->m_BlockX >= StartX) && ((*itr)->m_BlockX < EndX) &&
|
||||||
@ -795,7 +795,7 @@ void cStructGenWormNestCaves::GetCavesForChunk(int a_ChunkX, int a_ChunkZ, cStru
|
|||||||
// Trim the cache if it's too long:
|
// Trim the cache if it's too long:
|
||||||
if (m_Cache.size() > 100)
|
if (m_Cache.size() > 100)
|
||||||
{
|
{
|
||||||
cCaveSystems::const_iterator itr = m_Cache.begin();
|
cCaveSystems::iterator itr = m_Cache.begin();
|
||||||
std::advance(itr, 100);
|
std::advance(itr, 100);
|
||||||
for (cCaveSystems::const_iterator end = m_Cache.end(); itr != end; ++itr)
|
for (cCaveSystems::const_iterator end = m_Cache.end(); itr != end; ++itr)
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ void cStructGenRavines::cRavine::ProcessChunk(
|
|||||||
int DistSq = (DifX + x) * (DifX + x) + (DifZ + z) * (DifZ + z);
|
int DistSq = (DifX + x) * (DifX + x) + (DifZ + z) * (DifZ + z);
|
||||||
if (DistSq <= RadiusSq)
|
if (DistSq <= RadiusSq)
|
||||||
{
|
{
|
||||||
int Top = std::min(itr->m_Top, cChunkDef::Height);
|
int Top = std::min(itr->m_Top, (int)(cChunkDef::Height)); // Stupid gcc needs int cast
|
||||||
for (int y = std::max(itr->m_Bottom, 1); y <= Top; y++)
|
for (int y = std::max(itr->m_Bottom, 1); y <= Top; y++)
|
||||||
{
|
{
|
||||||
cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_AIR);
|
cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_AIR);
|
||||||
|
Loading…
Reference in New Issue
Block a user