SIN45 is already defined in <cmath>
----> #define SIN45 M_SQRT1_2
in addTextSplashEffect
three call to rand and three modulos... can be done more efficiently:
instead of
Code: Select all
newParticle->setVelocity(((rand() % 100) - 50) / 200.0f, // X
((rand() % 100) - 50) / 200.0f, // Y
((rand() % 100) / 200.0f) + 4.0f); // Z
Code: Select all
int r=rand()>>4;
newParticle->setVelocity((( r & 127) - 64) / 256.0f, // X
(((r>>8 ) & 127) - 64) / 256.0f, // Y
(((r>>16) & 127) / 256.0f) + 4.0f); // Z