@@ -22,7 +22,7 @@ struct Pointf
22
22
Pointf p{ x * f, y * f };
23
23
return p;
24
24
}
25
- float getAngle () const
25
+ [[nodiscard]] float getAngle () const
26
26
{
27
27
return atan2f (y, x);
28
28
}
@@ -150,13 +150,13 @@ class ParticleSystem
150
150
*
151
151
* @return True if the system is full.
152
152
*/
153
- bool isFull () const ;
153
+ [[nodiscard]] bool isFull () const ;
154
154
155
155
/* * Whether or not the particle system removed self on finish.
156
156
*
157
157
* @return True if the particle system removed self on finish.
158
158
*/
159
- virtual bool isAutoRemoveOnFinish () const ;
159
+ [[nodiscard]] virtual bool isAutoRemoveOnFinish () const ;
160
160
161
161
/* * Set the particle system auto removed it self on finish.
162
162
*
@@ -179,7 +179,7 @@ class ParticleSystem
179
179
*
180
180
* @return The speed.
181
181
*/
182
- virtual float getSpeed () const ;
182
+ [[nodiscard]] virtual float getSpeed () const ;
183
183
/* * Sets the speed.
184
184
*
185
185
* @param speed The speed.
@@ -189,7 +189,7 @@ class ParticleSystem
189
189
*
190
190
* @return The speed variance.
191
191
*/
192
- virtual float getSpeedVar () const ;
192
+ [[nodiscard]] virtual float getSpeedVar () const ;
193
193
/* * Sets the speed variance.
194
194
*
195
195
* @param speed The speed variance.
@@ -199,7 +199,7 @@ class ParticleSystem
199
199
*
200
200
* @return The tangential acceleration.
201
201
*/
202
- virtual float getTangentialAccel () const ;
202
+ [[nodiscard]] virtual float getTangentialAccel () const ;
203
203
/* * Sets the tangential acceleration.
204
204
*
205
205
* @param t The tangential acceleration.
@@ -209,7 +209,7 @@ class ParticleSystem
209
209
*
210
210
* @return The tangential acceleration variance.
211
211
*/
212
- virtual float getTangentialAccelVar () const ;
212
+ [[nodiscard]] virtual float getTangentialAccelVar () const ;
213
213
/* * Sets the tangential acceleration variance.
214
214
*
215
215
* @param t The tangential acceleration variance.
@@ -219,7 +219,7 @@ class ParticleSystem
219
219
*
220
220
* @return The radial acceleration.
221
221
*/
222
- virtual float getRadialAccel () const ;
222
+ [[nodiscard]] virtual float getRadialAccel () const ;
223
223
/* * Sets the radial acceleration.
224
224
*
225
225
* @param t The radial acceleration.
@@ -229,7 +229,7 @@ class ParticleSystem
229
229
*
230
230
* @return The radial acceleration variance.
231
231
*/
232
- virtual float getRadialAccelVar () const ;
232
+ [[nodiscard]] virtual float getRadialAccelVar () const ;
233
233
/* * Sets the radial acceleration variance.
234
234
*
235
235
* @param t The radial acceleration variance.
@@ -239,7 +239,7 @@ class ParticleSystem
239
239
*
240
240
* @return True if the rotation is the direction.
241
241
*/
242
- virtual bool getRotationIsDir () const ;
242
+ [[nodiscard]] virtual bool getRotationIsDir () const ;
243
243
/* * Sets the rotation of each particle to its direction.
244
244
*
245
245
* @param t True if the rotation is the direction.
@@ -250,7 +250,7 @@ class ParticleSystem
250
250
*
251
251
* @return The start radius.
252
252
*/
253
- virtual float getStartRadius () const ;
253
+ [[nodiscard]] virtual float getStartRadius () const ;
254
254
/* * Sets the start radius.
255
255
*
256
256
* @param startRadius The start radius.
@@ -260,7 +260,7 @@ class ParticleSystem
260
260
*
261
261
* @return The start radius variance.
262
262
*/
263
- virtual float getStartRadiusVar () const ;
263
+ [[nodiscard]] virtual float getStartRadiusVar () const ;
264
264
/* * Sets the start radius variance.
265
265
*
266
266
* @param startRadiusVar The start radius variance.
@@ -270,7 +270,7 @@ class ParticleSystem
270
270
*
271
271
* @return The end radius.
272
272
*/
273
- virtual float getEndRadius () const ;
273
+ [[nodiscard]] virtual float getEndRadius () const ;
274
274
/* * Sets the end radius.
275
275
*
276
276
* @param endRadius The end radius.
@@ -280,7 +280,7 @@ class ParticleSystem
280
280
*
281
281
* @return The end radius variance.
282
282
*/
283
- virtual float getEndRadiusVar () const ;
283
+ [[nodiscard]] virtual float getEndRadiusVar () const ;
284
284
/* * Sets the end radius variance.
285
285
*
286
286
* @param endRadiusVar The end radius variance.
@@ -290,7 +290,7 @@ class ParticleSystem
290
290
*
291
291
* @return The number of degrees to rotate a particle around the source pos per second.
292
292
*/
293
- virtual float getRotatePerSecond () const ;
293
+ [[nodiscard]] virtual float getRotatePerSecond () const ;
294
294
/* * Sets the number of degrees to rotate a particle around the source pos per second.
295
295
*
296
296
* @param degrees The number of degrees to rotate a particle around the source pos per second.
@@ -300,7 +300,7 @@ class ParticleSystem
300
300
*
301
301
* @return The rotate per second variance.
302
302
*/
303
- virtual float getRotatePerSecondVar () const ;
303
+ [[nodiscard]] virtual float getRotatePerSecondVar () const ;
304
304
/* * Sets the rotate per second variance.
305
305
*
306
306
* @param degrees The rotate per second variance.
@@ -316,13 +316,13 @@ class ParticleSystem
316
316
*
317
317
* @return True if the particle system is active.
318
318
*/
319
- virtual bool isActive () const ;
319
+ [[nodiscard]] virtual bool isActive () const ;
320
320
321
321
/* * Gets the index of system in batch node array.
322
322
*
323
323
* @return The index of system in batch node array.
324
324
*/
325
- int getAtlasIndex () const { return _atlasIndex; }
325
+ [[nodiscard]] int getAtlasIndex () const { return _atlasIndex; }
326
326
/* * Sets the index of system in batch node array.
327
327
*
328
328
* @param index The index of system in batch node array.
@@ -333,13 +333,13 @@ class ParticleSystem
333
333
*
334
334
* @return The Quantity of particles that are being simulated at the moment.
335
335
*/
336
- unsigned int getParticleCount () const { return _particleCount; }
336
+ [[nodiscard]] unsigned int getParticleCount () const { return _particleCount; }
337
337
338
338
/* * Gets how many seconds the emitter will run. -1 means 'forever'.
339
339
*
340
340
* @return The seconds that the emitter will run. -1 means 'forever'.
341
341
*/
342
- float getDuration () const { return _duration; }
342
+ [[nodiscard]] float getDuration () const { return _duration; }
343
343
/* * Sets how many seconds the emitter will run. -1 means 'forever'.
344
344
*
345
345
* @param duration The seconds that the emitter will run. -1 means 'forever'.
@@ -350,7 +350,7 @@ class ParticleSystem
350
350
*
351
351
* @return The source position of the emitter.
352
352
*/
353
- const Vec2& getSourcePosition () const { return _sourcePosition; }
353
+ [[nodiscard]] const Vec2& getSourcePosition () const { return _sourcePosition; }
354
354
/* * Sets the source position of the emitter.
355
355
*
356
356
* @param pos The source position of the emitter.
@@ -361,7 +361,7 @@ class ParticleSystem
361
361
*
362
362
* @return The position variance of the emitter.
363
363
*/
364
- const Vec2& getPosVar () const { return _posVar; }
364
+ [[nodiscard]] const Vec2& getPosVar () const { return _posVar; }
365
365
/* * Sets the position variance of the emitter.
366
366
*
367
367
* @param pos The position variance of the emitter.
@@ -372,7 +372,7 @@ class ParticleSystem
372
372
*
373
373
* @return The life of each particle.
374
374
*/
375
- float getLife () const { return _life; }
375
+ [[nodiscard]] float getLife () const { return _life; }
376
376
/* * Sets the life of each particle.
377
377
*
378
378
* @param life The life of each particle.
@@ -383,7 +383,7 @@ class ParticleSystem
383
383
*
384
384
* @return The life variance of each particle.
385
385
*/
386
- float getLifeVar () const { return _lifeVar; }
386
+ [[nodiscard]] float getLifeVar () const { return _lifeVar; }
387
387
/* * Sets the life variance of each particle.
388
388
*
389
389
* @param lifeVar The life variance of each particle.
@@ -394,7 +394,7 @@ class ParticleSystem
394
394
*
395
395
* @return The angle of each particle.
396
396
*/
397
- float getAngle () const { return _angle; }
397
+ [[nodiscard]] float getAngle () const { return _angle; }
398
398
/* * Sets the angle of each particle.
399
399
*
400
400
* @param angle The angle of each particle.
@@ -405,7 +405,7 @@ class ParticleSystem
405
405
*
406
406
* @return The angle variance of each particle.
407
407
*/
408
- float getAngleVar () const { return _angleVar; }
408
+ [[nodiscard]] float getAngleVar () const { return _angleVar; }
409
409
/* * Sets the angle variance of each particle.
410
410
*
411
411
* @param angleVar The angle variance of each particle.
@@ -418,7 +418,7 @@ class ParticleSystem
418
418
*
419
419
* @return The mode of the emitter.
420
420
*/
421
- Mode getEmitterMode () const { return _emitterMode; }
421
+ [[nodiscard]] Mode getEmitterMode () const { return _emitterMode; }
422
422
/* * Sets the mode of the emitter.
423
423
*
424
424
* @param mode The mode of the emitter.
@@ -429,7 +429,7 @@ class ParticleSystem
429
429
*
430
430
* @return The start size in pixels of each particle.
431
431
*/
432
- float getStartSize () const { return _startSize; }
432
+ [[nodiscard]] float getStartSize () const { return _startSize; }
433
433
/* * Sets the start size in pixels of each particle.
434
434
*
435
435
* @param startSize The start size in pixels of each particle.
@@ -440,7 +440,7 @@ class ParticleSystem
440
440
*
441
441
* @return The start size variance in pixels of each particle.
442
442
*/
443
- float getStartSizeVar () const { return _startSizeVar; }
443
+ [[nodiscard]] float getStartSizeVar () const { return _startSizeVar; }
444
444
/* * Sets the start size variance in pixels of each particle.
445
445
*
446
446
* @param sizeVar The start size variance in pixels of each particle.
@@ -451,7 +451,7 @@ class ParticleSystem
451
451
*
452
452
* @return The end size in pixels of each particle.
453
453
*/
454
- float getEndSize () const { return _endSize; }
454
+ [[nodiscard]] float getEndSize () const { return _endSize; }
455
455
/* * Sets the end size in pixels of each particle.
456
456
*
457
457
* @param endSize The end size in pixels of each particle.
@@ -462,7 +462,7 @@ class ParticleSystem
462
462
*
463
463
* @return The end size variance in pixels of each particle.
464
464
*/
465
- float getEndSizeVar () const { return _endSizeVar; }
465
+ [[nodiscard]] float getEndSizeVar () const { return _endSizeVar; }
466
466
/* * Sets the end size variance in pixels of each particle.
467
467
*
468
468
* @param sizeVar The end size variance in pixels of each particle.
@@ -473,7 +473,7 @@ class ParticleSystem
473
473
*
474
474
* @return The start color of each particle.
475
475
*/
476
- const Color4F& getStartColor () const { return _startColor; }
476
+ [[nodiscard]] const Color4F& getStartColor () const { return _startColor; }
477
477
/* * Sets the start color of each particle.
478
478
*
479
479
* @param color The start color of each particle.
@@ -484,7 +484,7 @@ class ParticleSystem
484
484
*
485
485
* @return The start color variance of each particle.
486
486
*/
487
- const Color4F& getStartColorVar () const { return _startColorVar; }
487
+ [[nodiscard]] const Color4F& getStartColorVar () const { return _startColorVar; }
488
488
/* * Sets the start color variance of each particle.
489
489
*
490
490
* @param color The start color variance of each particle.
@@ -495,7 +495,7 @@ class ParticleSystem
495
495
*
496
496
* @return The end color and end color variation of each particle.
497
497
*/
498
- const Color4F& getEndColor () const { return _endColor; }
498
+ [[nodiscard]] const Color4F& getEndColor () const { return _endColor; }
499
499
/* * Sets the end color and end color variation of each particle.
500
500
*
501
501
* @param color The end color and end color variation of each particle.
@@ -506,7 +506,7 @@ class ParticleSystem
506
506
*
507
507
* @return The end color variance of each particle.
508
508
*/
509
- const Color4F& getEndColorVar () const { return _endColorVar; }
509
+ [[nodiscard]] const Color4F& getEndColorVar () const { return _endColorVar; }
510
510
/* * Sets the end color variance of each particle.
511
511
*
512
512
* @param color The end color variance of each particle.
@@ -517,7 +517,7 @@ class ParticleSystem
517
517
*
518
518
* @return The start spin of each particle.
519
519
*/
520
- float getStartSpin () const { return _startSpin; }
520
+ [[nodiscard]] float getStartSpin () const { return _startSpin; }
521
521
/* * Sets the start spin of each particle.
522
522
*
523
523
* @param spin The start spin of each particle.
@@ -528,7 +528,7 @@ class ParticleSystem
528
528
*
529
529
* @return The start spin variance of each particle.
530
530
*/
531
- float getStartSpinVar () const { return _startSpinVar; }
531
+ [[nodiscard]] float getStartSpinVar () const { return _startSpinVar; }
532
532
/* * Sets the start spin variance of each particle.
533
533
*
534
534
* @param pinVar The start spin variance of each particle.
@@ -539,7 +539,7 @@ class ParticleSystem
539
539
*
540
540
* @return The end spin of each particle.
541
541
*/
542
- float getEndSpin () const { return _endSpin; }
542
+ [[nodiscard]] float getEndSpin () const { return _endSpin; }
543
543
/* * Sets the end spin of each particle.
544
544
*
545
545
* @param endSpin The end spin of each particle.
@@ -550,7 +550,7 @@ class ParticleSystem
550
550
*
551
551
* @return The end spin variance of each particle.
552
552
*/
553
- float getEndSpinVar () const { return _endSpinVar; }
553
+ [[nodiscard]] float getEndSpinVar () const { return _endSpinVar; }
554
554
/* * Sets the end spin variance of each particle.
555
555
*
556
556
* @param endSpinVar The end spin variance of each particle.
@@ -561,7 +561,7 @@ class ParticleSystem
561
561
*
562
562
* @return The emission rate of the particles.
563
563
*/
564
- float getEmissionRate () const { return _emissionRate; }
564
+ [[nodiscard]] float getEmissionRate () const { return _emissionRate; }
565
565
/* * Sets the emission rate of the particles.
566
566
*
567
567
* @param rate The emission rate of the particles.
@@ -572,7 +572,7 @@ class ParticleSystem
572
572
*
573
573
* @return The maximum particles of the system.
574
574
*/
575
- virtual int getTotalParticles () const ;
575
+ [[nodiscard]] virtual int getTotalParticles () const ;
576
576
/* * Sets the maximum particles of the system.
577
577
*
578
578
* @param totalParticles The maximum particles of the system.
@@ -581,7 +581,7 @@ class ParticleSystem
581
581
582
582
/* * does the alpha value modify color */
583
583
void setOpacityModifyRgb (bool opacityModifyRgb) { _opacityModifyRGB = opacityModifyRgb; }
584
- bool isOpacityModifyRgb () const { return _opacityModifyRGB; }
584
+ [[nodiscard]] bool isOpacityModifyRgb () const { return _opacityModifyRGB; }
585
585
586
586
void update ();
587
587
@@ -591,7 +591,7 @@ class ParticleSystem
591
591
/* * initializes a ParticleSystem*/
592
592
virtual bool initWithTotalParticles (int numberOfParticles);
593
593
virtual void resetTotalParticles (int numberOfParticles);
594
- virtual bool isPaused () const ;
594
+ [[nodiscard]] virtual bool isPaused () const ;
595
595
virtual void pauseEmissions ();
596
596
virtual void resumeEmissions ();
597
597
0 commit comments