Commit Graph

879 Commits

Author SHA1 Message Date
wagic.laurent
8da116a4da Laurent - Small addition FUT tested and working. Nimbus maze works great sure there is some other cards like this one that could be coded. 2009-09-20 12:18:08 +00:00
wagic.laurent
4284e685e6 Laurent - Small addition CFX tested and working. Blood Tyrant is not technically 100% but in current wagic is 100% correct since there is no real "loose life" protection and no multiplayer option. 2009-09-20 12:15:50 +00:00
wagic.jeck
be723369ba Jeck - Restore proper deck stat save/loading. 2009-09-20 05:42:06 +00:00
wagic.jeck
e0b225bad9 Jeck - TEMPORARY enabling of exceptions. (~6hrs) Sorry, I've been an idiot lately and coded myself into a corner with stuff that "should only take a minute" to fine tune. I honestly shouldn't have committed r871+, but I'd sworn to high heaven that the damn thing was fixed. In reality getting the cache 100% needs a bit more time, so I'm committing this in the hopes that it'll prevent sloppy cache work from interrupting other people's coding.
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
2009-09-20 03:10:34 +00:00
wagic.jeck
00c5b8cd7d Jeck - CACHESIZE option does something again. 2009-09-20 00:39:55 +00:00
wagic.jeck
1689edc69b Jeck - Cleanup some debug messages, cache now clears unlocked items between states. 2009-09-20 00:05:23 +00:00
wagic.jeck
1ba7f108b0 Jeck - Cache is using map<> again. The implementation is cleaner and seems a little faster. 2009-09-19 23:20:43 +00:00
wagic.jeck
8cc9bff484 Jeck - Stricter cache limits. 2009-09-19 22:34:48 +00:00
wagic.jeck
0d3686e65a Jeck - Cache fix, booster duplicate fix.
* 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.
2009-09-19 21:11:35 +00:00
wagic.the.homebrew@gmail.com
e0f5a81dad Erwan
- Minor cleanup
2009-09-19 10:51:45 +00:00
wagic.jeck
f1670f2394 Jeck - Revert to r867. r868 logic sucks. 2009-09-19 04:17:42 +00:00
wagic.jeck
a5ded3e836 Jeck - Cleaned up logic a little in Cache::Get() 2009-09-19 04:11:07 +00:00
wagic.jeck
3ea5ab9b88 Jeck - Minor fix to r866, quads are now invalidated before being recycled. 2009-09-19 02:03:49 +00:00
wagic.jeck
4b8d344bcd Jeck - Card ID collisions, cache fixes, cache deleted pooling.
* 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?
2009-09-19 01:48:42 +00:00
wagic.the.homebrew
5d57693d31 Erwan
-adding dissension cards
2009-09-18 10:26:13 +00:00
wagic.the.homebrew
265d82c136 Erwan
- card fix Stronghold
2009-09-18 09:21:46 +00:00
wagic.the.homebrew
8cb3daa3ad Erwan
-Adding a few sets, please add/correct/remove cards, have fun :)
2009-09-18 08:13:16 +00:00
wagic.jeck
8ba34dafca Jeck - WResourceManager / Cache should now be leak free. Demo mode still crashes around EnstackBlocker. 2009-09-18 01:20:46 +00:00
solo81@web.de
6abd3cc160 Fixed Kindle (TMP) 2009-09-17 17:32:20 +00:00
leungclj
074b7fc391 J0N4TH4N - minor fix 2009-09-17 16:21:44 +00:00
leungclj
09ed6d149d J0N4TH4N - few updates 2009-09-17 03:33:55 +00:00
leungclj
626e13f1ed J0N4TH4N - few fixes 2009-09-16 01:40:02 +00:00
leungclj
63504a00c4 JON4TH4N - sets update, "ueot" added to a few cards 2009-09-16 01:14:15 +00:00
jean.chalard
5fe68bc8a2 J :
* Un-revert compiling fixes
2009-09-15 16:15:46 +00:00
wagic.the.homebrew@gmail.com
11ffebf29f Erwan
-bug fix (credits cheat with empty deck evil twin mode)
-bug fix ("combat ends" message instead of "Combat Damage(2)" in stack)
2009-09-15 13:35:08 +00:00
jean.chalard
ce39961d78 J :
* Fix the filename
2009-09-15 12:28:19 +00:00
leungclj
3d5a9caeca JON4TH4N - (ALA) updated, tested 100% working 2009-09-15 10:26:42 +00:00
wagic.jeck
505ee8d1eb Jeck - I somehow managed to break the test suite. Rolled back my changes to r843, won't commit until they're properly debugged. 2009-09-15 01:53:02 +00:00
wagic.jeck
1b468bde14 Jeck - Replaced ok_quad with ok_tex, which won't expire until the duel is over. 2009-09-14 21:09:58 +00:00
wagic.jeck
a84ed94954 Jeck - Cache Leakfix. Quads now individually lock/unlock. Demo still crashes PSP. 2009-09-14 20:54:49 +00:00
wagic.jeck
5467fd379f Jeck - Signed/unsigned fix in resource manager, options save fix. 2009-09-14 18:30:47 +00:00
solo81@web.de
0eb79c23b9 Fixes, Clean Up, Reordering (LRW) 2009-09-14 17:55:46 +00:00
solo81@web.de
124354125e Removed Wall of Blood (MRD) 2009-09-14 16:42:36 +00:00
solo81@web.de
1f20520420 Fixes, Clean Up, Reordering (MRD) 2009-09-14 16:41:13 +00:00
wagic.the.homebrew@gmail.com
c80245b3e8 Erwan - daily build template.exe 2009-09-14 14:09:01 +00:00
wagic.the.homebrew@gmail.com
67755a4428 Erwan
- fix prowess of the fair
- add "other " keyword to all targets. ex: @movedTo(other elf|graveyard)
2009-09-14 14:07:30 +00:00
wagic.jeck
ce31194358 Jeck - Daily build recompile as release version. Is this or the debug version preferred? 2009-09-14 09:10:54 +00:00
wagic.jeck
0a38623746 Jeck - Minor fixes to cache: Splash.jpg releases properly, pspicons no longer use the same quad. 2009-09-14 08:46:18 +00:00
wagic.jeck
d55fc91112 Jeck - [Requires JGE rebuild] Extensive cache improvements.
* 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.
2009-09-14 08:28:49 +00:00
wagic.the.homebrew@gmail.com
a696b65ffb Erwan
- fix compilation issues
2009-09-13 12:52:24 +00:00
wagic.the.homebrew@gmail.com
7ce2c563e1 Erwan
- Fixed empty ActionStack "interrupt" messages
- If no attackers are declared, go straight to Combat end phase
- Once First strike damage is declared, attacking player needs to "actively" request a next phase event to go to the next damage step
- Second Damage step is called "Combat Damage (2)"
- UserRequestNextPhase is to be used knowing that it might not succeed
- Step change for GuiCombat is now computed at GameObserver::nextGamePhase

Note: Combat damage to creatures is not assigned when AI attacks. As this seems to be a problem with the previous SVN version, I4m still committing this change
2009-09-13 12:42:18 +00:00
jean.chalard
1f67998d7a J :
* Some interface updates.
2009-09-13 10:57:55 +00:00
wagic.the.homebrew@gmail.com
7c4fbde7d3 Erwan
-Fix farhaven elf
2009-09-12 14:03:22 +00:00
jean.chalard
34d973c60d J :
* Create selection zones to remember the last card the cursor was on.
2009-09-12 12:57:50 +00:00
wagic.the.homebrew@gmail.com
23fb17e58e Erwan
- Added deathtouch (TODO: update Combat rules for damage on multiple blockers)
- Added intimidate (untested)
2009-09-12 12:40:14 +00:00
wagic.the.homebrew@gmail.com
baf49c9ebf Erwan
-fixed problem with lifelink+wither, although combat damages are not entirely correct. Once combat damages actually deal the correct amount of damage, let's put test "armadillo_cloak" back in the suite
2009-09-12 11:40:48 +00:00
wagic.the.homebrew@gmail.com
5bbf9137ad Erwan
-add missing file
2009-09-12 10:16:06 +00:00
wagic.the.homebrew@gmail.com
f34ba20478 Erwan
-fix Seedcradle Witch
2009-09-12 09:13:17 +00:00
solo81@web.de
8a8ab2f2c1 Fixed Survival of the Fittest (EXO) 2009-09-12 06:57:25 +00:00
wagic.the.homebrew@gmail.com
40f2fab205 Erwan
- Reverted Rockslide Elemental to fix test issue
- Removed old gatherer scripts
- Added "daily_build" directory for people who can't compile
2009-09-12 06:44:36 +00:00