Commit Graph

105 Commits

Author SHA1 Message Date
wagic.the.homebrew@gmail.com
74accec275 Erwan
- Fix issue 144 (Sound is either 0 or 100%), for PSP ONLY. The methods are now here for linux/windows, but only the music volume method will work currently, and it sets the volume globally. Patch by Yeshua with some cleanup by myself.
2009-12-12 15:10:32 +00:00
wagic.jeck
61c9772a66 Jeck - Included missing file for r1460, updated trophy room. Trophies now render from bottom left, so any size png can be used. 2009-12-12 11:24:23 +00:00
wagic.jeck
70411f025f Jeck - Trophy room added, triangle is now dedicated alt-render toggle. Hopefully I'm not forgetting anything... 2009-12-12 10:23:28 +00:00
wagic.the.homebrew@gmail.com
66a505969e Erwan
- fix issue 215
- added test for purple screen (this is the small white square on top of the loading screen)
2009-11-23 08:25:27 +00:00
wagic.the.homebrew@gmail.com
da9a82cff4 Erwan
- removed some unused code. Please review!
- Added protection from() auto keyword. It is still possible to use protection from [color] in abilities, but when it is not possible, please use protection from([target]) in auto=
2009-11-21 07:26:26 +00:00
wagic.jeck
101854af77 Jeck - Small fix to r1305. This still leaves card text untranslated, but at least clears the translated text out of memory.
The thing complicating a "100% functionality" fix for this is that all translation changes are destructive- they overwrite the original text. We want this behavior, as it prevents having two sets of strings in memory (the untranslated and translated sets) when card text currently takes hundreds of kb... however, to switch languages we'd want the original text available, which means reloading all the set files. That's not optimal either...

As it is, the player must reset their PSP for translated card text. Again, not optimal. I'm submitting an issue on this topic.
2009-11-19 09:27:11 +00:00
wagic.jeck
e27fbac7be Jeck - Language is now a per-profile option settable in the options menu. Also, game no longer crashes when no language files are present. 2009-11-19 03:13:55 +00:00
wagic.jeck
37ad16d90e Jeck - Basic set metadata support. Also a minor improvement to WGuiImage.
* 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.
2009-11-18 09:27:24 +00:00
wagic.jeck
e10130b718 Jeck - Whoops. Forgot to make invisible cheats unselectable. Fixed. 2009-11-02 06:25:03 +00:00
wagic.jeck
6946544a2a Jeck - Minor language support fiddling, gui decorator for cheat-profile only options. 2009-11-02 06:15:37 +00:00
wagic.jeck
a4a19a1c9a Jeck - Fix to r1220. Apparently, _() doesn't like \n. 2009-11-01 23:13:30 +00:00
wagic.jeck
29219be4df Jeck - Added "# of unlocked sets" info to profile switcher, ran profile stats through _(). 2009-11-01 23:01:19 +00:00
wagic.the.homebrew@gmail.com
01c949f881 Erwan
- Fixed a few tranlsation issues in the code
- Updated French translation
2009-10-31 07:58:21 +00:00
wagic.jeck
0efb205469 Jeck - Final theme updates. Reverted backdrop.jpg to 255H, expanded wood.png to 32H, though only 28 are used (to prevent gray box issue). Also minor change to OptionItem.cpp so that themeinfo.txt loads on Default theme. 2009-10-25 01:37:23 +00:00
wagic.jeck
f117b04dea Jeck - And this is why I shouldn't code at 3 AM. Fix to r1152, which potentially closed a non-existent file descriptor. Not a major bug, but it's better to do it this way. 2009-10-23 07:29:21 +00:00
wagic.jeck
c552a47087 Jeck - Fix to r1151, which left an open file descriptor. 2009-10-23 07:26:12 +00:00
wagic.jeck
c87343a7f2 Jeck - Simplistic solution to issue 131. Reads only the first line of themeinfo.txt and uses the first 16 characters as the author name, if present. The rest of the file is completely ignored. Not exactly the most elegant solution, but I don't think we really need much metadata beyond who the theme's author is. My suggestion would be to let the authors use the rest of the file as a "Readme.txt" with whatever details they want to put in it. (Art credits, etc.).
The next version of Wagic will use XML-like themes, so I think it's alright to use such a non-extensible format.
2009-10-23 07:16:58 +00:00
wagic.jeck
6d62c013df Jeck - Fix for two obscure edge case bugs in the options menu.
* Confirmable options used to only check for confirmation when selecting another option. They now autoconfirm when saving & exiting. This bug could possibly result in loading the wrong theme. Fixed.
 * Changing profiles, canceling, then changing to the profile again could also result in improper theme loading. Fixed.
2009-10-21 02:34:29 +00:00
wagic.jeck
63ddbd52ad Jeck - Hopefully fixes issue 114.
* Options before the desired optionID were not using the correct option class.
 * Enums were expected to be lower-case.
2009-10-20 16:54:53 +00:00
wagic.jeck
8c4c3f2418 Jeck - Final fix to r1109. It was reloading the old options halfway through saving the new ones. 2009-10-20 04:33:43 +00:00
wagic.jeck
3a4dd403e2 Jeck - Quick fix to r1109. 2009-10-20 04:14:13 +00:00
wagic.jeck
7f7320f904 Jeck - Some basic options handling rewrites, main menu update, example alternate theme (for testing). I'm closing issues 44 and 45, as hopefully this resolves them satisfactorily.
* The alternate theme is just useful for testing themes, but please comment on the changes to the main theme.
 * Options reading and initializing separated from UI.
 * Options UI abstracted a bit, made more easily extensible.
 * With some extension, the options UI could be used as the basis for more complicated themes, if we load a file and use it to do stuff like GameStateOptions::Start()
2009-10-20 03:46:18 +00:00
wagic.the.homebrew@gmail.com
620ea034b8 Erwan
-Issue 26: added an option for Mana Display. This needs a bit testing, but it should also lower the priority of "manapool slowness" as this mode probably fixes performance issue as well.
-I can't seem to be able to "save" some options (hand position, mana display) ion the windows version, does this change break something ?
2009-10-04 06:01:00 +00:00
wagic.the.homebrew@gmail.com
888edfd5b8 Erwan
-more JGE cleanup
-removed calls to BindTexture that were made out of the Render methods. Please let me know if this has side effects (and let's discuss it in that case)
-Still no luck with the purple screen bug :(
2009-10-03 08:50:44 +00:00
wagic.jeck
2020dce4fd Jeck - unsigned/signed fix, options fixes
* Abstracted out option calls to "f3" behind Constants::OPTION_FONT
 * Added option to disable card image loading.
2009-09-24 23:26:32 +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
jean.chalard
f6aba5c5cb J :
* Hand option.
2009-09-22 07:39:24 +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.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
5467fd379f Jeck - Signed/unsigned fix in resource manager, options save fix. 2009-09-14 18:30:47 +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
62be1e1c72 Jeck — Cache refresh functionality, forcing in situ reload of textures.
* Changing profiles will now reload graphics, in case the profile has a different theme/mode/whatever.
2009-09-04 22:33:39 +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
jean.chalard
e5bbbb358f J :
* Fix a few compilation issues.
2009-08-28 01:58:57 +00:00
wagic.jeck
62e12380a4 Jeck - Stopgap update fixing WResourceManager slowdown until complete rewrite. 2009-08-27 23:24:55 +00:00
wagic.jeck
db1730ee7f Jeck - Fixed issue with destructor not being called on OptionProfile, split settings into tabs. 2009-08-27 14:08:38 +00:00
wagic.the.homebrew@gmail.com
99aa284431 Erwan
-code cleanup
-memory leaks fixes
2009-08-27 13:32:12 +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
6728794ce9 Jeck - Quick crashfix when loading without a profiles directory, slight keypad modifications. 2009-08-27 03:17:25 +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
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
01c62d04bf Erwan
-removing useless code
-fixed a few cards (incorrect set)
2009-07-18 14:26:58 +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
b1e35a6bcb Erwan
- Moved "extraPayment" cancel verification into ActionLayer (was in GuiLayers)
- added "HUDDisplay" MTGAbility (displays damage/graveyard info)
- Added option to NOT interrupt own's spells and abilities. Allows smoother gameplay. We should add a "quick options" menu ingame to change those options on the fly
2009-07-04 14:10:21 +00:00
jean.chalard
dd054c4963 J :
* ostream printing of JGui objects.
2009-05-23 08:34:50 +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
2d37fafe53 Erwan
-fixed psp compilation
2009-01-29 13:49:00 +00:00