Fixed MSVC 64-bit build warnings.
This commit is contained in:
@@ -239,9 +239,15 @@ void cCaveTunnel::Randomize(cNoise & a_Noise)
|
||||
|
||||
bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints & a_Dst)
|
||||
{
|
||||
if (a_Src.size() < 2)
|
||||
{
|
||||
// There are no midpoints, nothing to smooth
|
||||
return true;
|
||||
}
|
||||
|
||||
// Smoothing: for each line segment, add points on its 1/4 lengths
|
||||
bool res = false;
|
||||
int Num = a_Src.size() - 2; // this many intermediary points
|
||||
size_t Num = a_Src.size() - 2; // this many intermediary points
|
||||
a_Dst.clear();
|
||||
a_Dst.reserve(Num * 2 + 2);
|
||||
cCaveDefPoints::const_iterator itr = a_Src.begin() + 1;
|
||||
@@ -251,7 +257,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
|
||||
int PrevY = Source.m_BlockY;
|
||||
int PrevZ = Source.m_BlockZ;
|
||||
int PrevR = Source.m_Radius;
|
||||
for (int i = 0; i <= Num; ++i, ++itr)
|
||||
for (size_t i = 0; i <= Num; ++i, ++itr)
|
||||
{
|
||||
int dx = itr->m_BlockX - PrevX;
|
||||
int dy = itr->m_BlockY - PrevY;
|
||||
|
||||
@@ -543,7 +543,7 @@ cMineShaft * cMineShaftCorridor::CreateAndFit(
|
||||
{
|
||||
cCuboid BoundingBox(a_PivotX, a_PivotY - 1, a_PivotZ);
|
||||
BoundingBox.p2.y += 3;
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
int NumSegments = 2 + (rnd) % (MAX_SEGMENTS - 1); // 2 .. MAX_SEGMENTS
|
||||
switch (a_Direction)
|
||||
{
|
||||
@@ -985,7 +985,7 @@ cMineShaft * cMineShaftCrossing::CreateAndFit(
|
||||
)
|
||||
{
|
||||
cCuboid BoundingBox(a_PivotX, a_PivotY - 1, a_PivotZ);
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
BoundingBox.p2.y += 3;
|
||||
if ((rnd % 4) < 2)
|
||||
{
|
||||
@@ -1127,7 +1127,7 @@ cMineShaft * cMineShaftStaircase::CreateAndFit(
|
||||
cNoise & a_Noise
|
||||
)
|
||||
{
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
|
||||
cCuboid Box;
|
||||
switch (a_Direction)
|
||||
{
|
||||
|
||||
@@ -339,9 +339,9 @@ cPlacedPiece * cPieceGenerator::PlaceStartingPiece(int a_BlockX, int a_BlockY, i
|
||||
int NumRotations = 1;
|
||||
for (size_t i = 1; i < ARRAYCOUNT(Rotations); i++)
|
||||
{
|
||||
if (StartingPiece->CanRotateCCW(i))
|
||||
if (StartingPiece->CanRotateCCW((int)i))
|
||||
{
|
||||
Rotations[NumRotations] = i;
|
||||
Rotations[NumRotations] = (int)i;
|
||||
NumRotations += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,8 +306,14 @@ void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_Block
|
||||
|
||||
void cStructGenRavines::cRavine::RefineDefPoints(const cRavDefPoints & a_Src, cRavDefPoints & a_Dst)
|
||||
{
|
||||
if (a_Src.size() < 2)
|
||||
{
|
||||
// No midpoints, nothing to refine
|
||||
return;
|
||||
}
|
||||
|
||||
// Smoothing: for each line segment, add points on its 1/4 lengths
|
||||
int Num = a_Src.size() - 2; // this many intermediary points
|
||||
size_t Num = a_Src.size() - 2; // this many intermediary points
|
||||
a_Dst.clear();
|
||||
a_Dst.reserve(Num * 2 + 2);
|
||||
cRavDefPoints::const_iterator itr = a_Src.begin() + 1;
|
||||
@@ -318,7 +324,7 @@ void cStructGenRavines::cRavine::RefineDefPoints(const cRavDefPoints & a_Src, cR
|
||||
int PrevR = Source.m_Radius;
|
||||
int PrevT = Source.m_Top;
|
||||
int PrevB = Source.m_Bottom;
|
||||
for (int i = 0; i <= Num; ++i, ++itr)
|
||||
for (size_t i = 0; i <= Num; ++i, ++itr)
|
||||
{
|
||||
int dx = itr->m_BlockX - PrevX;
|
||||
int dz = itr->m_BlockZ - PrevZ;
|
||||
|
||||
@@ -136,7 +136,7 @@ inline void PushSomeColumns(int a_BlockX, int a_Height, int a_BlockZ, int a_Colu
|
||||
{
|
||||
int x = a_BlockX + a_Coords[i].x;
|
||||
int z = a_BlockZ + a_Coords[i].z;
|
||||
if (a_Noise.IntNoise3DInt(x + 64 * a_Seq, a_Height + i, z + 64 * a_Seq) <= a_Chance)
|
||||
if (a_Noise.IntNoise3DInt(x + 64 * a_Seq, a_Height + (int)i, z + 64 * a_Seq) <= a_Chance)
|
||||
{
|
||||
for (int j = 0; j < a_ColumnHeight; j++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user