aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/FireworksParticles.h
blob: ac06be07352543e2cf22523965303e220094a78f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "Particle.h"
#include "..\Minecraft.World\CompoundTag.h"

class ParticleEngine;

class FireworksParticles
{
public:

	class FireworksStarter : public Particle
	{
	public:
		virtual eINSTANCEOF GetType() { return eType_FIREWORKSSTARTERPARTICLE; }

	private:
		int life;
		ParticleEngine *engine;
		ListTag<CompoundTag> *explosions;
		bool twinkleDelay;

	public:
		FireworksStarter(Level *level, double x, double y, double z, double xd, double yd, double zd, ParticleEngine *engine, CompoundTag *infoTag);
		virtual void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2);
		virtual void tick();
		bool isFarAwayFromCamera();
		void createParticle(double x, double y, double z, double xa, double ya, double za, intArray rgbColors, intArray fadeColors, bool trail, bool flicker);
		void createParticleBall(double baseSpeed, int steps, intArray rgbColors, intArray fadeColors, bool trail, bool flicker);
		void createParticleShape(double baseSpeed, coords2DArray coords, intArray rgbColors, intArray fadeColors, bool trail, bool flicker, bool flat);
		void createParticleBurst(intArray rgbColors, intArray fadeColors, bool trail, bool flicker);

	public:
		int getParticleTexture();
	};

	class FireworksSparkParticle : public Particle
	{
	public:
		virtual eINSTANCEOF GetType() { return eType_FIREWORKSSPARKPARTICLE; }

	private:
		int baseTex;
		bool trail;
		bool flicker;
		ParticleEngine *engine;

		float fadeR;
		float fadeG;
		float fadeB;
		bool hasFade;

	public:
		FireworksSparkParticle(Level *level, double x, double y, double z, double xa, double ya, double za, ParticleEngine *engine);
		void setTrail(bool trail);
		void setFlicker(bool flicker);
		using Particle::setColor;
		void setColor(int rgb);
		void setFadeColor(int rgb);
		virtual AABB *getCollideBox();
		virtual bool isPushable();
		virtual void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2);
		virtual void tick();
		virtual void setBaseTex(int baseTex);
		virtual int getLightColor(float a);
		virtual float getBrightness(float a);
	};

	class FireworksOverlayParticle : public Particle
	{
	public:
		virtual eINSTANCEOF GetType() { return eType_FIREWORKSOVERLAYPARTICLE; }
	
		FireworksOverlayParticle(Level *level, double x, double y, double z);

		void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2);
	};
};