add BLI_strcpy_rlen, replace strcat, which was used in misleading way.
[blender.git] / intern / cycles / render / particles.cpp
index c3e4b9510ded4ea146bd11b8c0727c5156c1a819..2a1570f7a0d3cb35657a500791a45fafeef705bc 100644 (file)
@@ -57,8 +57,7 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene
 {
        /* count particles.
         * adds one dummy particle at the beginning to avoid invalid lookups,
-        * in case a shader uses particle info without actual particle data.
-        */
+        * 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();
@@ -67,6 +66,10 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene
        
        /* dummy particle */
        particles[0] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+       particles[1] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+       particles[2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+       particles[3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+       particles[4] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
        
        int i = 1;
        foreach(ParticleSystem *psys, scene->particle_systems) {
@@ -96,9 +99,6 @@ void ParticleSystemManager::device_update(Device *device, DeviceScene *dscene, S
        
        device_free(device, dscene);
 
-       if(scene->particle_systems.size() == 0)
-               return;
-
        progress.set_status("Updating Particle Systems", "Copying Particles to device");
        device_update_particles(device, dscene, scene, progress);