- Added remove/add counters as a cost, patch by Salmelo, thanks man!. See primitives/mtg.txt -> Thallid to see how it works
- added test for i286 by salmelo
- added basic display for counters (this needs improvement) by salmelo
* Fixes for compilation on 64-bit architectures :
string position-returning functions return size_t, not uint.
Fix that.
* Fixes warnings with new gcc about non-fixed string AND no arguments.
NOTE : 64-bit architectures still do not compile. There are 2 different places
where printf is used with a specifier that is not large enough on 64-bit because
size_t is now a ulong and not a uint. The solution on GNU systems is the %zu
specifier, but as I'm not sure it is supported on windows I don't want to
introduce a huge hard-to-notice bug, so I'll do it at a time when I got a
windowser to back me up.
- Card Primitives system. Check Royal Assassin in RV, 10E, M10
- Please review, is sets/primitives a good directory? Should we rename MTGCard into "CardPrint"?
- Unfortunately for now it is not possible to "override" a Primitive. A card that links to a primitive but also defines new "values" will create its own data and ignore the data in the "linked" primitive for the time being. I hope to solve that at some point...
* Metadata is currently only used in exactly one place: the set's "Pretty Name" is displayed when the set is first unlocked.
* WGuiImage now has a function to set scaling.
Please note that I don't plan to update this file for future Wagic versions, so if anybody wants to take over, please do. :)
Some files were updated in the process:
- CardGui.cpp - exposed the card rarity info on the alternate render cards to the translation engine. Also switched the color of said info to white on green and blue cards, imho they are much easier to read now.
- GameStateDeckViewer.cpp - exposed the term "Collection" (shown under the scrollbar) to the translation engine.
- GuiPhaseBar.cpp - exposed the strings denoting "your turn", "opponent's turn", "you play", "opponent plays", to the translation engine.
- SimplePad.cpp - exposed the special keys ("Spacebar", "Confirm" etc.) to the translation engine. Had to increase the keypad width to make room for "Abbrechen" (Cancel). I couldn't translate it differently because there's also a *spell* called cancel, and to have a different translation in SimplePad, I would have had to change the official German name of the Cancel spell, which wasn't an option.
- MTGAbility.cpp - exposed the words from which the text of mana-producing abilities is constructed to the translation engine. Please review this one and suggest a better solution - the one I chose is somewhat awkward. The translation works, but when the whole translated sentence is constructed and gets returned, the calling procedure tries to translate it again (all other ability descriptions work this way, translation takes place *after* the string has been returned). However, for mana producing abilities this doesn't work, since the costructed string can take an infinite number of diffeent forms, depending on the mana produced, and we can't translate that. Hence I chose to translate the individual words during construction, with the described side effect that the engine now tries to translate them again later in the process (and the sentence ends up in missing.txt).
- Also, cheat mode menu items now aren't denoted by the ugly "(cheat)" appended to them, instead they are enclosed by asterisks. Uses less space.
- fix for issue 108 (mana icon disappears)
- potential fix for issue 110 (victory bonus texts). Need to check
- Fix for issue 100. A better solution would be to "stretch" the cards in hand the way it is done for the rest of the game, but this will do for now as it is a border case
- Fix for issue 55. We'll remove 2 players mode for now, and put it back when/if we get network play
- fix issue 69 (Shadow.png load issue) - I put it back to a black 16x16 image. If you need more alpha, use the facilities provided by JGE rather than touching the file, thanks ;)
* Moved shop text ("press square for other cards") etc, to ShopItems, so they rendered properly (all in one place, after AA)
* The AA is really more a proof of concept than anything else. To do it properly I'd need a double-resolution copy of shop.jpg.
* The real multicolored card has a greenish tint, and is darker. What do you think of gold.jpg? Should we tint it more that way?
* Displays card set and rarity where artist info would go on a real card. This makes the shop a little more user friendly, and also helps prevent "Card X, possibly from MRQ" confusion.
* Land.jpg contrast in lower left corner modified to work better with white text in that space. I might also modify the green card a bit if others feel it's necessary.
- fix issue 52 (valid target notification problem) and issue 21 (duplicate)
- fix issue 28 (P/T Position)
- put back shadow for currently selected Card
- Armadillo cloak test is failing, I assume this is related to the Trample fix earlier, and I'll try to fix the test later on
- fix issue 20 (triangle button usage inplay)
- close issue 27 (gold effect on the gold bar). Please feel free to change the gold glow if you come up with something better, but I consider this perfectly releasable now
- code cleanup
* Numerous cache fixes, reduced filesystem access.
* Cache fails very gracefully.
* Cache is now a templated class, with individual caches per data-type.
* Much easier to extend.
* Extensively debugged. Try compiling with -DDEBUG_CACHE.
* Caches limits can be set on a per-item basis.
* hgeParticleSystemInfo are now cached, mana particles now fall back to defaults.
* Samples are not cached, but track filesystem misses using the cache backbone.
* Avatars are cached. Default baka avatar is now baka.jpg, to prevent collision with player.
A note on the retrieval types:
RETRIEVE_MANAGE puts a resource into a seperate, managed resource list.
Managed resources are guarenteed valid for the lifetime of the program.
Retrieving a managed quad promotes the associated texture to managed. Don't do that by mistake.
Calls to Resources.Refresh() will attempt to reload managed resources in place.
RETRIVE_LOCK (and by extension, RETRIEVE_VRAM), returns a resource after locking it.
A resource may have many locks, and remains in cache until they are all released.
If the resource is managed, it returns it unmodified.
A note on quads:
Unlike all other RetrieveWhatever() functions, the default behavior for RetrieveQuad is RETRIEVE_LOCK. Worse, Release(JQuad*) is slow, and will /always/ release one lock from the associated texture.
There's a long and complicated explanation for this, involving support for live relinking of textures to existing quads, but basically what it means is that we only use RetrieveQuad for quads we intend to store and later Release(). If a temporary quad is needed, the preferred method is to use NEW JQuad* and SAFE_DELETE with RetrieveTexture(). RetrieveTempQuad is also provided, but is only guaranteed until the next call to the cache.
Note that RetrieveCard has none of these problems.
* Add the Trash facility and use it for CardViews.
* Fix a graphical bug with card shadows.
* Fix a graphical bug with limitors.
* Enhance the graphical appearance of cards going to graveyard.
This is pretty major, so there'll probably be something wrong with it... even though I did spend a few hours looking.
NOTES:
* If you've Retrieved it, don't delete it--- Use resources.Release(Whatever).
Textures automatically release subordinate quads.
* Most of the time, use resources.RetrieveQuad to grab a quad. Should handle everything for you.
RetrieveQuad will load the required texture, if needed.
Only managed resources have a resource name ("back", "simon", etc).
Managed resources can be retrieved with GetTexture/GetQuad/GetWhatever.
Non managed quads lookup by position/dimensions, defaulting to the whole texture.
* Use resources.RetrieveTexture only when you need to do something special to it.
Calling retrieve texture with RETRIEVE_MANAGE will permanently add a texture to the manager
RETRIEVE_LOCK and RETRIEVE_VRAM will lock a texture. It will not leave the cache until
Release(JTexture*) is called, or as a last resort during cache overflow.
* Try to only store (as a class member) pointers to textures retrieved with RETRIEVE_MANAGE.
All others may become invalid, although locked textures do have a high degree of stability. It's
pretty safe to store a locked texture if you're not going to load much between uses.
There's a lot going on here, so I might have missed something... but it runs through the test suite alright.
TODO:
* When called without any arguments, RetrieveQuad sometimes leaves a thin border around the image.
This can be bypassed by specifying a quad one or two pixels less than the image size. Why?
* I've had a crash while runing the Demo mode, something to do with receiveEventMinus?
This hasn't exactly reproduced on a clean SVN copy, (being a hang, rather than a crash) so
I've probably done something to worsen the problem somehow? I'll look into it tomorrow.
* Clean up lock/unlock system, memory usage. Streamline interface, consider phasing out calls using GetWhatever() format.
* New interface.
* This breaks a lot of things. It is not feature-equivalent. It
probably doesn't compile under windows and doesn't work on PSP.
* Damage is not resolved any more. This will have to be fixed.
* Blockers can't be ordered any more. This will have to be fixed.
* A lot of new art is included.