Files
wagic/JGE/lib
wrenczes@gmail.com 6d8e7edcbf Improvements against http://code.google.com/p/wagic/issues/detail?id=50, Mana animation slows PSP down.
Two things: 1) there was an extremely inefficient implementation in the particle system of a queue where, when particles expired, each expired element would be copied over(replaced) by one at the rear of the container. Depending on the performance of the update, this could range anywhere from 100 to 500 (the max particle count) memcpy operations per update loop.  I replaced the flat array with a std::list, and simply pop the unneeded elements when they expire now.  This seems to shave ~30% off the time spent in the Update() call.

2) Hardcoded the number of emitters for the mana particles to 60 (the default in the psi file seems to be around 114).  This reduces the amount of iterations per tapped mana by just over half, which also helps the performance, and it's not really noticeable - the glow effect is a *tiny* bit more muted, but chances are, if you didn't read this comment, you probably wouldn't have noticed.

I've gone from having my psp start lagging noticeably at 8 tapped mana to about 12 - at this point, I think the bigger remaining lag is the fact that when there's a cache miss for a card image, we're doing synchronous i/o on the main thread - the framerate drop this causes is far more noticable than the mana particle lag.
2010-11-08 07:27:19 +00:00
..
2010-11-07 09:26:29 +00:00