Commit Graph

50 Commits

Author SHA1 Message Date
wagic.jeck
b4d261de2f Jeck - Fix for set loading / unloading.
* This is a little dirty, as it's loading the profile multiple times. The proper way to do it would be to add any line starting with "unlocked_" to an array for deferred loading. This would also allow us to write those lines back even without the associated set being loaded. The clean solution is on my todo-list now :)
2009-09-23 20:36:10 +00:00
wagic.jeck
db8247ddd7 Jeck - Bugfix: repaired set unlocking.
* Checks for unlocked sets /after/ they've finished loading.
2009-09-23 20:03:19 +00:00
wagic.jeck
e577f3e378 Jeck - Resolved issue 44 and issue 45.
* Options can now use specialized loading functions. OptionEnum should work now.
 * Options are now stored in memory as a map<integer,GameOption>.
2009-09-23 00:24:43 +00:00
wagic.jeck
7510ee165f Jeck - Daily build, deck renaming, small keypad bugfix, profileFile() fix, proposed new iconspsp.png.
* 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.
2009-09-22 02:47:48 +00:00
wagic.jeck
8c9374fe1f Jeck - GameStateMenu releases background image from cache, minor cache fixes. 2009-09-20 23:56:08 +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.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.jeck
91a9387e33 Jeck - Profile loading fix, minor options menu improvements, minor cleanup. 2009-09-09 11:11:17 +00:00
wagic.jeck
ad7006e2de Jeck - Profile and cache improvements, booster duplicate likelihood reduced.
* Cache now tracks missing textures for RetrieveQuad, not just RetrieveCard/RetrieveTexture.
* Profile options are no longer overwritten when switching profiles.
* Main menu notifies of alternate profile- "Database: X" becomes "Profile: Y of X cards."
* Boosters iterates through cards, replacing duplicates. Stops after 15 tries to prevent infinite loops on small sets.
* Very simplistic theme switcher, only displays when alternate themes are present.
2009-09-08 03:23:19 +00:00
wagic.jeck
8340fdbd5b Jeck - It wasn't emptying the cache properly, so this is a step in the right direction. I'll keep looking for more issues, though. 2009-09-03 18:21:57 +00:00
wagic.jeck
f220d2e9b9 Jeck - Cache and resource manager merged, streamlined.
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.
2009-09-03 09:28:16 +00:00
wagic.jeck
d1f6cdcd96 Jeck - Some warnings cleanup. 2009-08-28 05:40:10 +00:00
wagic.jeck
807eea7ddb Jeck - As prior, but for sounds and music as well. Use CommonRes->ssLoadMusic / CommonRes->ssLoadSample. 2009-08-27 06:31:38 +00:00
wagic.jeck
5e14efed3c Jeck - CommonRes transparently finds themed versions of files. Use JRenderer::LoadTexture for unthemed files, and CommonRes::LoadTexture for themed files. Res/graphics/back.jpg renamed to Res/graphics/backdrop.jpg due to collision with sets/back.jpg. 2009-08-27 05:58:26 +00:00
wagic.jeck
355ee7a271 Jeck - Support for user profiles, preliminary theme support, virtual keypad, options GUI update. Still a bit unorganized, but it works. 2009-08-26 20:13:09 +00:00
wagic.the.homebrew@gmail.com
34126f2393 Erwan
- a few graphical fixes in shop and DeckViewer
2009-08-22 10:42:15 +00:00
jean.chalard
3349f974f1 J :
* 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.
2009-08-22 05:59:43 +00:00
wagic.the.homebrew@gmail.com
bf4262c0a0 Erwan
- New shop GUI. (don't mind the back image, it will change soon)
2009-08-22 00:46:45 +00:00
wagic.the.homebrew@gmail.com
c757a791c2 Erwan
- removed viridian shaman
- small bug fixes
2009-08-11 13:23:14 +00:00
wagic.the.homebrew@gmail.com
bb4cb3be7d Erwan
- fix soul warden
- fix counters (chainbreaker)
- removed cards that do not work
- updated version
2009-07-27 10:33:11 +00:00
wagic.the.homebrew@gmail.com
328aa1c9f4 Erwan
- reduced price of boosters
- Sets need to be unlocked in order to be accessed from the shop
- Added a "refresh" option in the shop
2009-07-23 13:44:50 +00:00
wagic.the.homebrew@gmail.com
01c62d04bf Erwan
-removing useless code
-fixed a few cards (incorrect set)
2009-07-18 14:26:58 +00:00
wagic.the.homebrew@gmail.com
3e7ecb3016 Erwan
- fixed a bug (crash if a card that had an ability until end of turn would be put into the graveyard before the end of the turn)
- Added a new game Mode : Random 1 or 2 color.
2009-07-18 08:50:14 +00:00
wagic.the.homebrew@gmail.com
d8ac4a49b1 Erwan
-translation updates (including fr.txt)
2009-07-05 09:06:51 +00:00
wagic.the.homebrew@gmail.com
26f8ac8801 Erwan
- Added some french translations
- Up to 0.7.1
2009-06-11 15:11:40 +00:00
wagic.the.homebrew@gmail.com
8a467da18f Erwan
- Fix: cards in graveyard had shroud
- Fix :shop item "quantity" increased if bought in a booster
- Test for Recover -> no problem found, but there's a GUI issue, which will be fixed later
2009-06-11 11:48:02 +00:00
wagic.the.homebrew@gmail.com
c5d13e7cac Erwan
- fixed a bug introduced in Momir with previous revision
- Added som french translations
2009-06-06 05:57:48 +00:00
wagic.the.homebrew@gmail.com
ab42e5db06 Erwan
- fixed card id collisions in Legends, Ravnica, Portal
- Changed Deck and Database structures with better design (a bit faster, hopefully a lot cleaner)
- updated Windows project file
2009-06-06 04:46:54 +00:00
wagic.the.homebrew@gmail.com
19b0b306fe Erwan
- stats are computed only at startup now, to avoid useless computation ingame
2009-05-31 09:42:08 +00:00
jean.chalard
dd054c4963 J :
* ostream printing of JGui objects.
2009-05-23 08:34:50 +00:00
wagic.the.homebrew@gmail.com
f50d7e30d4 Erwan
- Added a few "stats" to the main menu. This might slow down loading times on the PSP (needs testing). In that case I'll move it to the options, or optimize it if needed
2009-05-19 13:45:53 +00:00
wagic.the.homebrew@gmail.com
f94df3862b Erwan
- Added translation mechanism, and basic french translation as an example
2009-05-16 15:23:26 +00:00
wagic.the.homebrew@gmail.com
62f6b92332 Erwan
- Zip file support for card pictures
- TODO : linux, update JGFX.cpp for zip support
- TODO : make sure there is no leak in the PSP version
2009-05-10 11:10:53 +00:00
wagic.the.homebrew@gmail.com
041b3e16bb Erwan
- Added "lord until end of turn" (see titanic ultimatum in ALA)
2009-04-30 12:45:16 +00:00
wagic.the.homebrew@gmail.com
33e79e234e Erwan
- Cache size is now an option
2009-04-19 06:02:29 +00:00
wagic.the.homebrew@gmail.com
a8942331eb Erwan
- Fix a bug with Nevinyrrals Disk
2009-04-05 13:22:37 +00:00
wagic.the.homebrew@gmail.com
6582a1972a Erwan
- Added Momir Basic mode :)
2009-04-04 12:52:36 +00:00
wagic.the.homebrew
a3c3006043 Erwan
- AI bugfixes (manaburn with ankh of mishra...)
- small tweaks
2009-03-18 11:29:23 +00:00
wagic.the.homebrew
415061642d Erwan
- Added splash screen management
- fixed a ruling bug (putting sorcery, enchantments, etc.. into play while interrupting)
2009-03-17 11:46:39 +00:00
wagic.the.homebrew
6d1d5d751a Erwan
- new Ability : ALifeGiver (bottle gnomes)
- Added a few cards from Tempest
- Hybrid mana fix for hybrid mana involving uncolored mana costs (see tests/generic/hybridmana2.txt - spectral possession)
- Fixed bugs with targetting for TargetAbilities
- Fixed multiple sacrifice abilities cost (Siege gang commander, see tests)
- Fixed a small font issue
2009-02-11 09:38:20 +00:00
wagic.the.homebrew
0de5993836 Erwan
- Add documentation and change version number
2009-02-01 07:22:52 +00:00
wagic.the.homebrew
b14e6c318e Erwan
- Updated options system
2009-01-29 13:35:19 +00:00
wagic.the.homebrew
e831a8e400 Erwan
- a few card updates
- back to original font for menus
2009-01-20 13:15:52 +00:00
jean.chalard
5466a7004c J :
* Fix a number of warnings
2009-01-18 14:13:13 +00:00
wagic.the.homebrew
0b03dc6d40 Erwan
- font adjustments
2009-01-18 13:49:02 +00:00
wagic.the.homebrew
027e1b9bba Erwan
- Updated alternate render
- Display hybrid mana cost on alternate Render
- Display big card in graveyard
- gray out alternate render when targetChooser is active
- Non-copyrighted avatars for the AI. They suck...
2009-01-17 10:16:10 +00:00
jean.chalard
3bb2c431c9 J :
* Split constants file to have them in a single place.
2009-01-06 13:07:28 +00:00
jean.chalard
0d14207247 J :
* A number of adjustments about fonts.
2009-01-04 02:49:08 +00:00
jean.chalard
64d80e119e J :
* Split the GameStateMenu.h that contained the code into a header file
  and a source file.
2008-12-30 05:47:45 +00:00