@@ -9308,7 +9308,7 @@ uint16_t mode_particleFireworks1D(void) {
93089308 uint8_t *forcecounter;
93099309
93109310 if (SEGMENT.call == 0 ) { // initialization
9311- if (!initParticleSystem1D (PartSys, 4 , 150 , 4 , true )) // init
9311+ if (!initParticleSystem1D (PartSys, 4 , 150 , 4 , true )) // init advanced particle system
93129312 return mode_static (); // allocation failed or is single pixel
93139313 PartSys->setKillOutOfBounds (true );
93149314 PartSys->sources [0 ].sourceFlags .custom1 = 1 ; // set rocket state to standby
@@ -9324,11 +9324,8 @@ uint16_t mode_particleFireworks1D(void) {
93249324 PartSys->setParticleSize (SEGMENT.check3 ); // 1 or 2 pixel rendering
93259325 PartSys->setMotionBlur (SEGMENT.custom2 ); // anable motion blur
93269326
9327- int32_t gravity = (1 + (SEGMENT.speed >> 3 ));
9328- if (!SEGMENT.check1 ) // gravity enabled for sparks
9329- PartSys->setGravity (0 ); // disable
9330- else
9331- PartSys->setGravity (gravity); // set gravity
9327+ int32_t gravity = (1 + (SEGMENT.speed >> 3 )); // gravity value used for rocket speed calculation
9328+ PartSys->setGravity (SEGMENT.speed ? gravity : 0 ); // set gravity
93329329
93339330 if (PartSys->sources [0 ].sourceFlags .custom1 == 1 ) { // rocket is on standby
93349331 PartSys->sources [0 ].source .ttl --;
@@ -9343,8 +9340,8 @@ uint16_t mode_particleFireworks1D(void) {
93439340 PartSys->sources [0 ].source .hue = hw_random16 ();
93449341 PartSys->sources [0 ].var = 10 ; // emit variation
93459342 PartSys->sources [0 ].v = -10 ; // emit speed
9346- PartSys->sources [0 ].minLife = 100 ;
9347- PartSys->sources [0 ].maxLife = 300 ;
9343+ PartSys->sources [0 ].minLife = 30 ;
9344+ PartSys->sources [0 ].maxLife = SEGMENT. check2 ? 400 : 40 ;
93489345 PartSys->sources [0 ].source .x = 0 ; // start from bottom
93499346 uint32_t speed = sqrt ((gravity * ((PartSys->maxX >> 2 ) + hw_random16 (PartSys->maxX >> 1 ))) >> 4 ); // set speed such that rocket explods in frame
93509347 PartSys->sources [0 ].source .vx = min (speed, (uint32_t )127 );
@@ -9383,11 +9380,11 @@ uint16_t mode_particleFireworks1D(void) {
93839380 PartSys->sources [0 ].maxLife = 1300 ;
93849381 PartSys->sources [0 ].source .ttl = 100 + hw_random16 (64 - (SEGMENT.speed >> 2 )); // standby time til next launch
93859382 PartSys->sources [0 ].sat = 7 + (SEGMENT.custom3 << 3 ); // color saturation TODO: replace saturation with something more useful?
9386- PartSys->sources [0 ].size = hw_random16 (64 ); // random particle size in explosion
9383+ PartSys->sources [0 ].size = hw_random16 (SEGMENT. intensity ); // random particle size in explosion
93879384 uint32_t explosionsize = 8 + (PartSys->maxXpixel >> 2 ) + (PartSys->sources [0 ].source .x >> (PS_P_RADIUS_SHIFT_1D - 1 ));
93889385 explosionsize += hw_random16 ((explosionsize * SEGMENT.intensity ) >> 8 );
93899386 for (uint32_t e = 0 ; e < explosionsize; e++) { // emit explosion particles
9390- if (SEGMENT.check2 )
9387+ if (SEGMENT.check1 ) // colorful mode
93919388 PartSys->sources [0 ].source .hue = hw_random16 (); // random color for each particle
93929389 PartSys->sprayEmit (PartSys->sources [0 ]); // emit a particle
93939390 }
@@ -9407,7 +9404,7 @@ uint16_t mode_particleFireworks1D(void) {
94079404
94089405 return FRAMETIME;
94099406}
9410- static const char _data_FX_MODE_PS_FIREWORKS1D[] PROGMEM = " PS Fireworks 1D@Gravity,Explosion,Firing side,Blur,Saturation,, Colorful,Smooth;,!;!;1;sx=150,c2=30,c3=31,o2=1" ;
9407+ static const char _data_FX_MODE_PS_FIREWORKS1D[] PROGMEM = " PS Fireworks 1D@Gravity,Explosion,Firing side,Blur,Saturation,Colorful,Trail, Smooth;,!;!;1;sx=150,c2=30,c3=31,o1=1 ,o2=1" ;
94119408
94129409/*
94139410 Particle based Sparkle effect
0 commit comments