|
This thread is locked; no one can reply to it. |
1
2
|
A Simple Particle Explosion |
yohosuff
Member #10,022
July 2008
|
Thanks for the explanations. I understand memory leaks now. |
Neil Black
Member #7,867
October 2006
|
I managed to make a little explosion too. I'm quite proud of it. I'd probably use it in combination with an animation of an explosion in the center.
I get this warning whenever I compile, I know it's because I'm passing doubles to putpixel() but I don't know how to fix it. [Warning] passing 'double' for converting 2 of 'void putpixel(BITMAP*, int, int, int)'
|
yohosuff
Member #10,022
July 2008
|
That is an awesome particle explosion! Also, the code is easy to understand even without the blue little helpy helpers. |
Neil Black
Member #7,867
October 2006
|
I make my code easy to understand because the more compleximacated stuff makes me think. And I'm too damn tired to think right now.
|
Thomas Fjellstrom
Member #476
June 2000
|
Neil: It runs too fast on my q6600 quad core. It seems even if you didn't program it for multi core systems, X gets its own core as well -- |
Neil Black
Member #7,867
October 2006
|
SILENCE! I was too lazy to implement real timing... would it work right if I used timing instead of rest()? If I had it in a game I'd do it properly.
|
Thomas Fjellstrom
Member #476
June 2000
|
Heh, I'm just bugging you. -- |
Tobias Dammers
Member #2,604
August 2002
|
Quote: I get this warning whenever I compile, I know it's because I'm passing doubles to putpixel() but I don't know how to fix it. [Warning] passing 'double' for converting 2 of 'void putpixel(BITMAP*, int, int, int)'
C++ uses strong static typing, which means that you need to pass arguments with the correct types. Note that this produces a sub-pixel inaccuracy around 0, because the default cast rounds towards 0 (negative numbers round up, positive ones round down). Objects crossing the x or y axis will experience a tiny glitch. You can use libm's floor() function to avoid this:
--- |
axilmar
Member #1,204
April 2001
|
Quote: C++ uses strong static typing Type system war!!!! :-) C++ has a weak static type system, due to static_cast, reinterpret_cast and C-style casts. |
imaxcs
Member #4,036
November 2003
|
And what if those casts didn't exist? I figure much worse...
|
|
1
2
|