From c3e772e863357d3e585a6c473edc55a53cd4993b Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 17 Oct 2017 23:30:17 +0200 Subject: [PATCH] Add different explosion effect for Android. It gives much better performance while it still looks similar. --- data/gfx/explosion_low.xml | 30 ++++++++++++++++++++++++++++++ src/graphics/explosion.cpp | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 data/gfx/explosion_low.xml diff --git a/data/gfx/explosion_low.xml b/data/gfx/explosion_low.xml new file mode 100644 index 000000000..d534eb557 --- /dev/null +++ b/data/gfx/explosion_low.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/graphics/explosion.cpp b/src/graphics/explosion.cpp index 2d300ef67..53f6f9a83 100644 --- a/src/graphics/explosion.cpp +++ b/src/graphics/explosion.cpp @@ -42,8 +42,14 @@ Explosion::Explosion(const Vec3& coord, const char* explosion_sound, const char m_emission_frames = 0; #ifndef SERVER_ONLY + std::string filename = particle_file; + +#ifdef ANDROID + filename = "explosion_low.xml"; +#endif + ParticleKindManager* pkm = ParticleKindManager::get(); - ParticleKind* particles = pkm->getParticles(particle_file); + ParticleKind* particles = pkm->getParticles(filename); m_emitter = NULL; if (UserConfigParams::m_graphical_effects > 1)