#include "particles.h"
#include "constants.h"
#include "debug.h"
-#include "main.h" // For g_profiler and g_settings
#include "settings.h"
-#include "tile.h"
+#include "client/tile.h"
#include "gamedef.h"
#include "collision.h"
#include <stdlib.h>
}
else
{
- i++;
+ ++i;
}
}
}
*(m_maxsize-m_minsize)
+m_minsize;
- new Particle(
+ Particle* toadd = new Particle(
m_gamedef,
m_smgr,
m_player,
m_texture,
v2f(0.0, 0.0),
v2f(1.0, 1.0));
+ m_particlemanager->addParticle(toadd);
}
}
}
void ParticleManager::stepSpawners (float dtime)
{
- JMutexAutoLock lock(m_spawner_list_lock);
+ MutexAutoLock lock(m_spawner_list_lock);
for(std::map<u32, ParticleSpawner*>::iterator i =
m_particle_spawners.begin();
i != m_particle_spawners.end();)
else
{
i->second->step(dtime, m_env);
- i++;
+ ++i;
}
}
}
void ParticleManager::stepParticles (float dtime)
{
- JMutexAutoLock lock(m_particle_list_lock);
+ MutexAutoLock lock(m_particle_list_lock);
for(std::vector<Particle*>::iterator i = m_particles.begin();
i != m_particles.end();)
{
else
{
(*i)->step(dtime);
- i++;
+ ++i;
}
}
}
void ParticleManager::clearAll ()
{
- JMutexAutoLock lock(m_spawner_list_lock);
- JMutexAutoLock lock2(m_particle_list_lock);
+ MutexAutoLock lock(m_spawner_list_lock);
+ MutexAutoLock lock2(m_particle_list_lock);
for(std::map<u32, ParticleSpawner*>::iterator i =
m_particle_spawners.begin();
i != m_particle_spawners.end();)
scene::ISceneManager* smgr, LocalPlayer *player)
{
if (event->type == CE_DELETE_PARTICLESPAWNER) {
- JMutexAutoLock lock(m_spawner_list_lock);
+ MutexAutoLock lock(m_spawner_list_lock);
if (m_particle_spawners.find(event->delete_particlespawner.id) !=
m_particle_spawners.end())
{
if (event->type == CE_ADD_PARTICLESPAWNER) {
{
- JMutexAutoLock lock(m_spawner_list_lock);
+ MutexAutoLock lock(m_spawner_list_lock);
if (m_particle_spawners.find(event->add_particlespawner.id) !=
m_particle_spawners.end())
{
}
}
video::ITexture *texture =
- gamedef->tsrc()->getTexture(*(event->add_particlespawner.texture));
+ gamedef->tsrc()->getTextureForMesh(*(event->add_particlespawner.texture));
ParticleSpawner* toadd = new ParticleSpawner(gamedef, smgr, player,
event->add_particlespawner.amount,
delete event->add_particlespawner.maxacc;
{
- JMutexAutoLock lock(m_spawner_list_lock);
+ MutexAutoLock lock(m_spawner_list_lock);
m_particle_spawners.insert(
std::pair<u32, ParticleSpawner*>(
event->add_particlespawner.id,
if (event->type == CE_SPAWN_PARTICLE) {
video::ITexture *texture =
- gamedef->tsrc()->getTexture(*(event->spawn_particle.texture));
+ gamedef->tsrc()->getTextureForMesh(*(event->spawn_particle.texture));
Particle* toadd = new Particle(gamedef, smgr, player, m_env,
*event->spawn_particle.pos,
void ParticleManager::addParticle(Particle* toadd)
{
- JMutexAutoLock lock(m_particle_list_lock);
+ MutexAutoLock lock(m_particle_list_lock);
m_particles.push_back(toadd);
}