-Issue 31 fixed. Land and tokens don't use the stack anymore. Taking control of a card in opponent's battlefield doesn't trigger "spell cast" triggers either
- Fix issue #16 (testsuite segfaults if file does not exist)
- Fix issue #37 (Normal Combat Damage is not dealt to creatures when the AI attacks)
- TestSuite now has an "AI" mode (see test/manual/p2_attacks.txt)
* Decks now support naming and renaming. Also added a "Switch decks without saving" option.
* Removed unused static const char * menuTexts, from old 6-deck limited system
* Keypad didn't display correctly when not given a title, and was never destructed. Fixed.
* profileFile() default behavior was to fall back to RESPATH/player. Fixed.
* New iconspsp.png, updated look to seem like PSP buttons, added some extra (unused) button icons.
* Yeah, it's kinda gratuitous. I was playing with various overlays, and this is really the only thing I could think of, given the limited space. Blood and rust just look wrong, fading in like that... and the area for text is really limited the card, from the Wagic logo down. Feature notes like "Single and multiplayer! Over 3000 cards!" just look cramped there, and detract from the overall image.
Exception handling in the cache means that Wagic runs slightly, but noticeably slower. However, it also means that the cache works the way it was intended to, and should prevent all sorts of awkward errors I introduced because things were half-allocated or worse.
I've learned my lesson from tonight, and once I get this stuff put back together without exception handling I think I'll self-impose a manditory 24 hours debugging time before any commits. Sorry for the inconvenience.
If for some reason you can't compile with exceptions, r862 should be completely without them. Again, wow, this was stupid-- I hadn't even realized exceptions were off for like 24 hours, as the compiler wasn't producing warnings.
Apologies,
—Jeck
* Restored OptionItem saving fix.
* Booster duplicate replacement was picking random cards from the wrong set. My fault, but I've fixed it :)
* The problem with cache had nothing to do with memory fragmentation, but I've switched to an array rather than map<> just in case. The actual issue was that in GameStateDeckViewer, I'd given the cache unlimited space, thinking that AttemptNew would recover from any bad_allocs. Unfortunately, the image loading routines and similar stuff called by various implementations of WResource::Attempt() could fail halfway through, leaking memory.
The temporary solution is to set a proper limit (8000000 px, more or less) and (in case we still run out of memory) test to make certain CACHE_SPACE_RESERVED can be malloc'd/free'd. The proper solution would be to keep byte-perfect records of memory used (right now we're kinda fuzzy-- we track pixels per image and bytes per sound, but not the space for jquads or other incidentals) instead of testing a malloc, and potentially cleaning up all calls inside of Attempt() so they fail without leaks. That's what I'm working on now.
Still, it's nice to have identified the problem. This version of the cache should be fully functional, it's just a bit inelegant.
* mtgid now defaults to 0.
* TextScroller will not update when empty.
* Cache now moves WCachedResources we're finished with to a garbage pool for later use (to reduce memory fragmentation).
* Demo still crashes... but I'm thinking that has to do with fragmentation, not a leak?