diff options
Diffstat (limited to 'intern/cycles/render/particles.cpp')
-rw-r--r-- | intern/cycles/render/particles.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/intern/cycles/render/particles.cpp b/intern/cycles/render/particles.cpp index 50726bb4574..1a35d60fb4b 100644 --- a/intern/cycles/render/particles.cpp +++ b/intern/cycles/render/particles.cpp @@ -58,8 +58,8 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene * adds one dummy particle at the beginning to avoid invalid lookups, * in case a shader uses particle info without actual particle data. */ int num_particles = 1; - foreach(ParticleSystem *psys, scene->particle_systems) - num_particles += psys->particles.size(); + for(size_t j = 0; j < scene->particle_systems.size(); j++) + num_particles += scene->particle_systems[j]->particles.size(); float4 *particles = dscene->particles.resize(PARTICLE_SIZE*num_particles); @@ -71,9 +71,12 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene particles[4] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); int i = 1; - foreach(ParticleSystem *psys, scene->particle_systems) { - foreach(Particle &pa, psys->particles) { + for(size_t j = 0; j < scene->particle_systems.size(); j++) { + ParticleSystem *psys = scene->particle_systems[j]; + + for(size_t k = 0; k < psys->particles.size(); k++) { /* pack in texture */ + Particle& pa = psys->particles[k]; int offset = i*PARTICLE_SIZE; particles[offset] = make_float4(pa.index, pa.age, pa.lifetime, pa.size); |