aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Dimension.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/Dimension.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/Dimension.cpp')
-rw-r--r--Minecraft.World/Dimension.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/Dimension.cpp b/Minecraft.World/Dimension.cpp
index b7a2ea7c..479edae8 100644
--- a/Minecraft.World/Dimension.cpp
+++ b/Minecraft.World/Dimension.cpp
@@ -30,7 +30,7 @@ void Dimension::updateLightRamp()
float ambientLight = 0.00f;
for (int i = 0; i <= Level::MAX_BRIGHTNESS; i++)
{
- float v = (1 - i / static_cast<float>(Level::MAX_BRIGHTNESS));
+ float v = (1 - i / (float) (Level::MAX_BRIGHTNESS));
brightnessRamp[i] = ((1 - v) / (v * 3 + 1)) * (1 - ambientLight) + ambientLight;
}
}
@@ -70,7 +70,7 @@ Dimension::~Dimension()
{
delete[] brightnessRamp;
- if(biomeSource != nullptr)
+ if(biomeSource != NULL)
delete biomeSource;
}
@@ -115,7 +115,7 @@ bool Dimension::isValidSpawn(int x, int z) const
float Dimension::getTimeOfDay(int64_t time, float a) const
{
- int dayStep = static_cast<int>(time % Level::TICKS_PER_DAY);
+ int dayStep = (int) (time % Level::TICKS_PER_DAY);
float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f;
if (td < 0) td += 1;
if (td > 1) td -= 1;
@@ -127,7 +127,7 @@ float Dimension::getTimeOfDay(int64_t time, float a) const
int Dimension::getMoonPhase(int64_t time) const
{
- return static_cast<int>(time / Level::TICKS_PER_DAY) % 8;
+ return ((int) (time / Level::TICKS_PER_DAY)) % 8;
}
bool Dimension::isNaturalDimension()
@@ -161,7 +161,7 @@ float *Dimension::getSunriseColor(float td, float a)
return sunriseCol;
}
- return nullptr;
+ return NULL;
}
Vec3 *Dimension::getFogColor(float td, float a) const
@@ -192,12 +192,12 @@ Dimension *Dimension::getNew(int id)
if (id == 0) return new NormalDimension();
if (id == 1) return new TheEndDimension();
- return nullptr;
+ return NULL;
}
float Dimension::getCloudHeight()
{
- return static_cast<float>(Level::genDepth);
+ return (float)Level::genDepth;
}
bool Dimension::hasGround()
@@ -207,7 +207,7 @@ bool Dimension::hasGround()
Pos *Dimension::getSpawnPos()
{
- return nullptr;
+ return NULL;
}
int Dimension::getSpawnYPosition()