summaryrefslogtreecommitdiffstats
path: root/src/Map.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-02-24 15:21:28 +0100
committerMattes D <github@xoft.cz>2014-02-24 15:21:28 +0100
commit2deeef3cdfd432854447bb5fec0270a36e5ee881 (patch)
tree341d2dec13f382f43452c2f9c01e818c293dcba7 /src/Map.cpp
parentSmall improvements to boats. (diff)
parentFixed MCServer not compiling with C++03 compilers (diff)
downloadcuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar.gz
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar.bz2
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar.lz
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar.xz
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.tar.zst
cuberite-2deeef3cdfd432854447bb5fec0270a36e5ee881.zip
Diffstat (limited to 'src/Map.cpp')
-rw-r--r--src/Map.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Map.cpp b/src/Map.cpp
index 2b8c4c74c..337c9cd31 100644
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -51,8 +51,8 @@ void cMapDecorator::Update(void)
int InsideWidth = (m_Map->GetWidth() / 2) - 1;
int InsideHeight = (m_Map->GetHeight() / 2) - 1;
- int PixelX = (m_Player->GetPosX() - m_Map->GetCenterX()) / PixelWidth;
- int PixelZ = (m_Player->GetPosZ() - m_Map->GetCenterZ()) / PixelWidth;
+ int PixelX = (int) (m_Player->GetPosX() - m_Map->GetCenterX()) / PixelWidth;
+ int PixelZ = (int) (m_Player->GetPosZ() - m_Map->GetCenterZ()) / PixelWidth;
// Center of pixel
m_PixelX = (2 * PixelX) + 1;
@@ -69,11 +69,11 @@ void cMapDecorator::Update(void)
Int64 WorldAge = m_Player->GetWorld()->GetWorldAge();
// TODO 2014-02-19 xdot: Refine
- m_Rot = Random.NextInt(16, WorldAge);
+ m_Rot = Random.NextInt(16, (int) WorldAge);
}
else
{
- m_Rot = (Yaw * 16) / 360;
+ m_Rot = (int) (Yaw * 16) / 360;
}
m_Type = E_TYPE_PLAYER;
@@ -183,8 +183,8 @@ void cMap::UpdateRadius(cPlayer & a_Player, unsigned int a_Radius)
{
unsigned int PixelWidth = GetPixelWidth();
- int PixelX = (a_Player.GetPosX() - m_CenterX) / PixelWidth + (m_Width / 2);
- int PixelZ = (a_Player.GetPosZ() - m_CenterZ) / PixelWidth + (m_Height / 2);
+ int PixelX = (int) (a_Player.GetPosX() - m_CenterX) / PixelWidth + (m_Width / 2);
+ int PixelZ = (int) (a_Player.GetPosZ() - m_CenterZ) / PixelWidth + (m_Height / 2);
UpdateRadius(PixelX, PixelZ, a_Radius);
}
@@ -620,7 +620,7 @@ unsigned int cMap::GetNumDecorators(void) const
unsigned int cMap::GetPixelWidth(void) const
{
- return pow(2, m_Scale);
+ return (int) pow(2.0, (double) m_Scale);
}