aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/ParticleEngine.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/ParticleEngine.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/ParticleEngine.h')
-rw-r--r--Minecraft.Client/ParticleEngine.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Minecraft.Client/ParticleEngine.h b/Minecraft.Client/ParticleEngine.h
new file mode 100644
index 00000000..09e3685b
--- /dev/null
+++ b/Minecraft.Client/ParticleEngine.h
@@ -0,0 +1,44 @@
+#pragma once
+using namespace std;
+
+class Particle;
+class Level;
+class Textures;
+class Entity;
+class Random;
+using namespace std;
+
+class ParticleEngine
+{
+private:
+ static const int MAX_PARTICLES_PER_LAYER = 200; // 4J - reduced from 4000
+ static const int MAX_DRAGON_BREATH_PARTICLES = 1000;
+
+public:
+ static const int MISC_TEXTURE = 0;
+ static const int TERRAIN_TEXTURE = 1;
+ static const int ITEM_TEXTURE = 2;
+ static const int ENTITY_PARTICLE_TEXTURE = 3;
+ static const int DRAGON_BREATH_TEXTURE = 4; // 4J Added
+
+ static const int TEXTURE_COUNT = 5;
+
+protected:
+ Level *level;
+private:
+ deque<shared_ptr<Particle> > particles[3][TEXTURE_COUNT]; // 4J made two arrays to cope with simultaneous two dimensions
+ Textures *textures;
+ Random *random;
+
+public:
+ ParticleEngine(Level *level, Textures *textures);
+ ~ParticleEngine();
+ void add(shared_ptr<Particle> p);
+ void tick();
+ void render(shared_ptr<Entity> player, float a);
+ void renderLit(shared_ptr<Entity> player, float a);
+ void setLevel(Level *level);
+ void destroy(int x, int y, int z, int tid, int data);
+ void crack(int x, int y, int z, int face);
+ wstring countParticles();
+}; \ No newline at end of file