aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Particle.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.Client/Particle.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.Client/Particle.cpp')
-rw-r--r--Minecraft.Client/Particle.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.Client/Particle.cpp b/Minecraft.Client/Particle.cpp
index 643dc669..1091a26a 100644
--- a/Minecraft.Client/Particle.cpp
+++ b/Minecraft.Client/Particle.cpp
@@ -19,7 +19,7 @@ void Particle::_init(Level *level, double x, double y, double z)
{
// 4J - added these initialisers
alpha = 1.0f;
- tex = nullptr;
+ tex = NULL;
gravity = 0.0f;
setSize(0.2f, 0.2f);
@@ -35,7 +35,7 @@ void Particle::_init(Level *level, double x, double y, double z)
size = (random->nextFloat() * 0.5f + 0.5f) * 2;
- lifetime = static_cast<int>(4 / (random->nextFloat() * 0.9f + 0.1f));
+ lifetime = (int) (4 / (random->nextFloat() * 0.9f + 0.1f));
age = 0;
texX = 0;
@@ -51,10 +51,10 @@ Particle::Particle(Level *level, double x, double y, double z, double xa, double
{
_init(level,x,y,z);
- xd = xa + static_cast<float>(Math::random() * 2 - 1) * 0.4f;
- yd = ya + static_cast<float>(Math::random() * 2 - 1) * 0.4f;
- zd = za + static_cast<float>(Math::random() * 2 - 1) * 0.4f;
- float speed = static_cast<float>(Math::random() + Math::random() + 1) * 0.15f;
+ xd = xa + (float) (Math::random() * 2 - 1) * 0.4f;
+ yd = ya + (float) (Math::random() * 2 - 1) * 0.4f;
+ zd = za + (float) (Math::random() * 2 - 1) * 0.4f;
+ float speed = (float) (Math::random() + Math::random() + 1) * 0.15f;
float dd = (float) (Mth::sqrt(xd * xd + yd * yd + zd * zd));
xd = xd / dd * speed * 0.4f;
@@ -156,7 +156,7 @@ void Particle::render(Tesselator *t, float a, float xa, float ya, float za, floa
float v1 = v0 + 0.999f / 16.0f;
float r = 0.1f * size;
- if (tex != nullptr)
+ if (tex != NULL)
{
u0 = tex->getU0();
u1 = tex->getU1();
@@ -164,9 +164,9 @@ void Particle::render(Tesselator *t, float a, float xa, float ya, float za, floa
v1 = tex->getV1();
}
- float x = static_cast<float>(xo + (this->x - xo) * a - xOff);
- float y = static_cast<float>(yo + (this->y - yo) * a - yOff);
- float z = static_cast<float>(zo + (this->z - zo) * a - zOff);
+ float x = (float) (xo + (this->x - xo) * a - xOff);
+ float y = (float) (yo + (this->y - yo) * a - yOff);
+ float z = (float) (zo + (this->z - zo) * a - zOff);
float br = 1.0f; // 4J - change brought forward from 1.8.2
if( !SharedConstants::TEXTURE_LIGHTING )