aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ImprovedNoise.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.World/ImprovedNoise.cpp
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.World/ImprovedNoise.cpp')
-rw-r--r--Minecraft.World/ImprovedNoise.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/ImprovedNoise.cpp b/Minecraft.World/ImprovedNoise.cpp
index 8be9e385..47f39085 100644
--- a/Minecraft.World/ImprovedNoise.cpp
+++ b/Minecraft.World/ImprovedNoise.cpp
@@ -46,9 +46,9 @@ double ImprovedNoise::noise(double _x, double _y, double _z)
double y = _y + yo;
double z = _z + zo;
- int xf = (int) x;
- int yf = (int) y;
- int zf = (int) z;
+ int xf = static_cast<int>(x);
+ int yf = static_cast<int>(y);
+ int zf = static_cast<int>(z);
if (x < xf) xf--;
if (y < yf) yf--;
@@ -125,7 +125,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int
for (int xx = 0; xx < xSize; xx++)
{
double x = _x + (xx) * xs + xo;
- int xf = (int) x;
+ int xf = static_cast<int>(x);
if (x < xf) xf--;
int X = xf & 255;
x -= xf;
@@ -134,7 +134,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int
for (int zz = 0; zz < zSize; zz++)
{
double z = _z + (zz) * zs + zo;
- int zf = (int) z;
+ int zf = static_cast<int>(z);
if (z < zf) zf--;
int Z = zf & 255;
z -= zf;
@@ -163,7 +163,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int
for (int xx = 0; xx < xSize; xx++)
{
double x = _x + (xx) * xs + xo;
- int xf = (int) x;
+ int xf = static_cast<int>(x);
if (x < xf) xf--;
int X = xf & 255;
x -= xf;
@@ -173,7 +173,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int
for (int zz = 0; zz < zSize; zz++)
{
double z = _z + (zz) * zs + zo;
- int zf = (int) z;
+ int zf = static_cast<int>(z);
if (z < zf) zf--;
int Z = zf & 255;
z -= zf;
@@ -183,7 +183,7 @@ void ImprovedNoise::add(doubleArray buffer, double _x, double _y, double _z, int
for (int yy = 0; yy < ySize; yy++)
{
double y = _y + (yy) * ys + yo;
- int yf = (int) y;
+ int yf = static_cast<int>(y);
if (y < yf) yf--;
int Y = yf & 255;
y -= yf;