1) Consolidated the Loggers so that we only have one in JGE. Added a helper constructor/destructor to the JLogger class so that you can instantiate one at the top of a function, it'll trace out a 'start' and 'end' message when it goes in & out of scope.
2) Fixed the crash part of a bug I've been chasing down where, on the psp, after saturating the cache, the game dies when trying to reload the background PNG image of the deck menu. We still need to fix the root cause of the failure (not enough memory to allocate a temporary buffer for the swizzle operation), but at least the psp doesn't lock up anymore. I've also left behind all the log traces I inserted into the LoadPNG code, since we'll probably need them again.
- fixed the debug framerate calculation / drawing code (consolidated duplicated functions & variables mDelta vs a win-only mDeltaTime, no reason to have two), repositioned it to draw on the bottom left (it was colliding with other debug text for the cache info).
- for debug testing purposes, added a #define override to force the image cache to work with less memory (I've picked 8 megs, which is what the psp seems to use - the normal default on win/linux is 20 megs).
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.
- Added a possibility to put a file "Res.txt" instead of the folder "Res". The file Res.txt is a simple 1 line text file, telling where to find the Res folder, terminated by "/". For example: "../../wagic_res".
This addresses issue 428 . This could also help us in the future, to develop mods.
I'm also noticing that the GetQuad(int) variant never seems to get hit, so I suspect that the ID lookup map is redundant. I left it alone as the JResourceManager base class forces the need for the function; I need to spend more time looking at just how much of JResourceManager we actually use at this point.
Also renamed WindowRect to windowRect & PixelFormat to pixelFormat for consistency with other locally declared variables. (Uppercase should be reserved for class names, ie WindowRect is the class/struct, windowRect is an local object in your code.)
- bug fix in JGE++ audio (improve HBL compatibility)
- Added new rewards in story mode: random card, card (either by "name" or id), specific set
- Story mode: added possibility to choose music, and bg for duel.
-- See "01. Where it all begins" for examples of new features
- JGE updates : main accepts argv/argc. Compilation variables for MP3 and Network support
- Minor fix in Wagic (potentially fixes crashes when using activated abilities several times in onr turn. Couldn't reproduce the issue)
- fixed bugs introduced in revision 2034 (Giant Growth)
- Extended Story mode xml: much easier to write basic thing, font selection, possibility to position answers, answers now in correct order
- moved story in the menu because it is not major for now
- fix issue 392 (broken tests)
- Fix a bunch of memory leaks (guys please be careful!)
- Added Logging facility in JGE
- HBL Compatibility (cleaned up some code with MP3 in JGE)
- Added "winGame" ability. Currently used mostly by the story mode, but some cards could probably need it too
- Improved story mode and uncommented it from the source.
-- The current campaign is of course very basic, anybody who wants to improve it or create other ones feel free to do so
-- TODO (short term): save progress, rewards system, improve tutorial campaign
-- I'll talk a bit more about this on the forums/email after a night of sleep
* Make the FULLSCREEN function bindable on platforms that support it.
* Linux has F as default binding.
* Windows support is not implemented, but is there ; applications will
just not suggest it under windows for the moment.
* Fix issue 340 for good.
* On X systems this still depends on a working X detectable repeat,
which is not the case in stable releases of some popular linux
distributons at this time. This is expected to be fixed soon.
I haven't chosen yet whether I wait for the fix on X side or if
I work around the bug.
* Mostly fix issue 340.
* There are still detail problems :
- There are still problems when two keys are pressed at the same time.
This is not a release blocker ; what happens exactly is :
while maintaining two keys, when one is released, the enqueued
autorepeat keypresses for the others are flushed too. I don't
think anyone will notice but for the sake of correctness I'll fix
it.
- A bug in xorg prevents the linux version to work correctly at the
moment. The bug is current as of 2009/08 and fixed as of 2010/01,
but major releases still include the bug at this time, so I'll
have to work around it somehow.
- I expect the windows version to work, but I can't test it.
- I'll test on mac later today.
* Some cosmetic cleanup.
* Have the unix version report analog control the same way the
windows version does.
* Move back Run() into JGE::Run(). The code for ::Run() is still
inside main.cpp.
- This fixes the "blinking screen problem", issue 341. I think.
- I have no idea WHY it does, but it's better than not fixing it.
- Run() would be better in ::Run() in main.cpp than in JGE, should
be moved back when we know more about the problem.