diff --git a/src/Makefile.am b/src/Makefile.am index 5519b34b..d0faae2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,6 +8,7 @@ liblol_a_SOURCES = \ forge.cpp forge.h video.cpp video.h timer.cpp timer.h bitfield.h \ profiler.cpp profiler.h input.h input.cpp world.cpp world.h \ sample.cpp sample.h sampler.cpp sampler.h text.cpp text.h \ + emitter.cpp emitter.h \ \ sdlinput.cpp sdlinput.h \ \ diff --git a/src/core.h b/src/core.h index 7bdb1c63..722f5c65 100644 --- a/src/core.h +++ b/src/core.h @@ -29,6 +29,7 @@ // Entities #include "entity.h" +#include "emitter.h" #include "font.h" #include "sample.h" #include "text.h" diff --git a/src/emitter.cpp b/src/emitter.cpp new file mode 100644 index 00000000..de1384e9 --- /dev/null +++ b/src/emitter.cpp @@ -0,0 +1,63 @@ +// +// Lol Engine +// +// Copyright: (c) 2010-2011 Sam Hocevar +// This program is free software; you can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To +// Public License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/projects/COPYING.WTFPL for more details. +// + +#if defined HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "core.h" + +/* + * Emitter implementation class + */ + +class EmitterData +{ + friend class Emitter; + +private: + int tiler; + Float3 gravity; + int particles[100]; + Float3 positions[100]; + Float3 velocities[100]; + int nparticles; +}; + +/* + * Public Emitter class + */ + +Emitter::Emitter(int tiler, Float3 gravity) + : data(new EmitterData()) +{ + data->tiler = tiler; + data->gravity = gravity; + data->nparticles = 0; +} + +void Emitter::TickGame(float deltams) +{ + Entity::TickGame(deltams); +} + +void Emitter::TickDraw(float deltams) +{ + Entity::TickDraw(deltams); +} + +Emitter::~Emitter() +{ + delete data; +} + diff --git a/src/emitter.h b/src/emitter.h new file mode 100644 index 00000000..0ed51528 --- /dev/null +++ b/src/emitter.h @@ -0,0 +1,38 @@ +// +// Lol Engine +// +// Copyright: (c) 2010-2011 Sam Hocevar +// This program is free software; you can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To +// Public License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/projects/COPYING.WTFPL for more details. +// + +// +// The Emitter class +// ----------------- +// + +#if !defined __DH_EMITTER_H__ +#define __DH_EMITTER_H__ + +#include "entity.h" + +class EmitterData; + +class Emitter : public Entity +{ +public: + Emitter(int tiler, Float3 gravity); + virtual ~Emitter(); + +protected: + virtual void TickGame(float deltams); + virtual void TickDraw(float deltams); + +private: + EmitterData *data; +}; + +#endif // __DH_EMITTER_H__ + diff --git a/win32/deushax.vcxproj b/win32/deushax.vcxproj index 9f69b0df..aa34a89c 100644 --- a/win32/deushax.vcxproj +++ b/win32/deushax.vcxproj @@ -21,6 +21,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/win32/deushax.vcxproj.filters b/win32/deushax.vcxproj.filters index fd701e11..8befb247 100644 --- a/win32/deushax.vcxproj.filters +++ b/win32/deushax.vcxproj.filters @@ -27,6 +27,9 @@ lolengine + + lolengine + lolengine @@ -106,6 +109,9 @@ lolengine + + lolengine + lolengine diff --git a/win32/monsterz.vcxproj b/win32/monsterz.vcxproj index 1dd468db..95c9fc53 100644 --- a/win32/monsterz.vcxproj +++ b/win32/monsterz.vcxproj @@ -24,6 +24,7 @@ + @@ -56,6 +57,7 @@ + diff --git a/win32/monsterz.vcxproj.filters b/win32/monsterz.vcxproj.filters index 074ca199..e7c91062 100644 --- a/win32/monsterz.vcxproj.filters +++ b/win32/monsterz.vcxproj.filters @@ -27,6 +27,9 @@ lolengine + + lolengine + lolengine @@ -109,6 +112,9 @@ lolengine + + lolengine + lolengine