summaryrefslogtreecommitdiff
path: root/src/particles.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2016-12-23 13:48:32 +0100
committersfan5 <sfan5@live.de>2017-01-02 15:28:06 +0100
commit523f0e8c5bce0cb58215dc1f9d027cf32394e3c3 (patch)
treeba8cbd3e60947573fcb6065f4caf5b3152cccb93 /src/particles.cpp
parente2e8da5ee44f71c22996a780caff67e48e79fae4 (diff)
downloadminetest-523f0e8c5bce0cb58215dc1f9d027cf32394e3c3.tar.gz
minetest-523f0e8c5bce0cb58215dc1f9d027cf32394e3c3.tar.bz2
minetest-523f0e8c5bce0cb58215dc1f9d027cf32394e3c3.zip
Move TileAnimation code to seperate file
Diffstat (limited to 'src/particles.cpp')
-rw-r--r--src/particles.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/particles.cpp b/src/particles.cpp
index acf9cc815..e9ddba986 100644
--- a/src/particles.cpp
+++ b/src/particles.cpp
@@ -567,19 +567,20 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef, scene::ISceneManager* s
{
// Texture
u8 texid = myrand_range(0, 5);
- video::ITexture *texture = tiles[texid].texture;
+ video::ITexture *texture;
// Only use first frame of animated texture
- f32 ymax = 1;
- if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
- ymax /= tiles[texid].animation_frame_count;
+ if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION)
+ texture = tiles[texid].frames[0].texture;
+ else
+ texture = tiles[texid].texture;
float size = rand() % 64 / 512.;
float visual_size = BS * size;
- v2f texsize(size * 2, ymax * size * 2);
+ v2f texsize(size * 2, size * 2);
v2f texpos;
texpos.X = ((rand() % 64) / 64. - texsize.X);
- texpos.Y = ymax * ((rand() % 64) / 64. - texsize.Y);
+ texpos.Y = ((rand() % 64) / 64. - texsize.Y);
// Physics
v3f velocity((rand() % 100 / 50. - 1) / 1.5,