Commit Graph

86 Commits

Author SHA1 Message Date
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
jean.chalard
44738399dc J :
* Make the SAFE_DELETE syntactically safe.
2009-09-05 11:34:51 +00:00
jean.chalard
1e42fc65d1 J :
* Fix a leak on opening a non-existing file.
2009-09-03 16:05:37 +00:00
wagic.the.homebrew@gmail.com
e004bd3939 - hge distortion leak fix
- windows project update to take into account Jecks changes
2009-09-03 11:00:21 +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
jean.chalard
22c7f02fe9 J :
* Make the GetTime() function behave under Linux the same way it
  behaves under other OSes.
2009-07-28 12:43:04 +00:00
jean.chalard
3639ac291f J :
* Make it so that we do not crash trying to play an MP3 that failed
  to load.
2009-06-11 14:47:21 +00:00
jean.chalard
c1565450e5 J :
* Add ostream op
2009-06-11 13:55:03 +00:00
jean.chalard
ff848d260f J :
* Fix the buggy charset
2009-06-11 13:17:03 +00:00
wagic.laurent
31d9f87554 Applying Orine Patch - Works perfect. Great addition. 2009-06-08 22:34:54 +00:00
wagic.the.homebrew@gmail.com
0e88d03c04 Erwan
- Zip file Directory cache for faster access
- Preload card images in player's hand before the game starts
2009-05-26 11:32:17 +00:00
wagic.the.homebrew@gmail.com
ee58109449 Erwan
- Added a way to name and describe AI Decks. Let's find cool names and descriptions :)
2009-05-25 12:43:58 +00:00
jean.chalard
215e23a975 J :
* Add some printing capability.
2009-05-23 08:33:28 +00:00
jean.chalard
10aa8e32d9 J :
* Write preliminary thread creation functions for Linux.
* Debug the Makefile
2009-05-23 04:44:44 +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
f32f5f3793 Erwan
- Crude networking functions:
+ Basic message works on Windows
+ Compiles on PSP but doesn't work yet
+ Nothing done for Linux -> TODO!
2009-05-18 11:22:53 +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
8b008a4bda Erwan
- boosters in shop 100 cards -> 80 cards
- 2 new cards in SHM
- Added Ram checking methods for the PSP
2009-04-30 12:10:09 +00:00
jean.chalard
789ad60723 J :
* Update for interface change.
  - The new arguments, being PSP-specific, are ignored (same as windows
    version). It might be surprising and not very readable, but it does
    what makes the most sense in our case.
2009-04-29 10:00:56 +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
e7678522ee Erwan
- fixed a few memory leaks (but Wagic still crashes on the PSP after a few games :( )
2009-04-12 12:39:44 +00:00
wagic.the.homebrew@gmail.com
c6b1027762 Erwan
- put Swizzling back!
2009-04-10 11:25:22 +00:00
wagic.the.homebrew@gmail.com
387c75e16d Erwan
-Improved JGE texture loading, improved Wagic cache
- Jge small changes in mp3 methods
2009-04-09 13:31:07 +00:00
jean.chalard
1cbf9c32e9 J :
* Fix a macro that was missing parentheses.
2009-01-18 14:12:09 +00:00
wagic.the.homebrew
8378042a79 Erwan - put back standard left,up,right,down keys for windows control 2009-01-18 12:38:45 +00:00
jean.chalard
e978a7d168 J :
* Fix some errors in the string width computation.
2009-01-17 11:00:26 +00:00
jean.chalard
a00f92e008 J :
* Bugfix version again. This should work much better. Waiting for test
  under windows before calling it final.
2009-01-05 09:47:45 +00:00
jean.chalard
09ff8e21f3 J :
* Blind attempt (PSP SDK not installed here, can't tell, will test tonight) at
  fixing the 1xx/3xx mismatch build bug.
2009-01-05 04:28:12 +00:00
jean.chalard
a85b6f69e8 J :
* Fix PSP compilation.
2009-01-04 08:19:36 +00:00
jean.chalard
ad42a91f96 J :
* Fix un warning.
2009-01-04 07:18:11 +00:00
jean.chalard
a85da61604 J :
* A few bugfixes, a few pixel-precise adjustments.
2009-01-04 06:34:29 +00:00
jean.chalard
45e143dd0c J :
* Clean carriage returns.
2009-01-01 23:27:32 +00:00
jean.chalard
3185e51b32 J :
* Align font on pixel.
2009-01-01 23:26:57 +00:00
jean.chalard
7c0c199175 J :
* Some resource path cleaning.
* A little bugfix.
2009-01-01 23:26:36 +00:00
jean.chalard
64c7bdf42d J :
* Some cleaning about the resource path.
2009-01-01 23:26:15 +00:00
jean.chalard
f452bf89f1 J :
* Make it so that the binary can be run from anywhere.
2009-01-01 23:25:47 +00:00
jean.chalard
ec8900dd5c J :
* Fix a graphical bug and a memory bug.
2009-01-01 23:25:00 +00:00
jean.chalard
2d72f1eeac J :
* Add a dependency of linux -> hge.
2008-12-20 10:43:37 +00:00
jean.chalard
104df0afa6 J :
* Remove useless (and confusing) files.
2008-12-13 05:23:58 +00:00
jean.chalard
3626fe74da J :
* Fix an improbable bug.
2008-12-02 14:34:02 +00:00
wagic.the.homebrew
b9a9ab6bfa Erwan
- small tweak with input frequency
2008-12-02 13:56:55 +00:00
wagic.the.homebrew
1ca143abd7 Erwan
- Fixed a bug with royal Assassin
2008-11-28 15:38:05 +00:00
jean.chalard
4196103a03 J :
* Another bugfix.
2008-11-28 15:13:54 +00:00
jean.chalard
eef151cac5 J :
* Little bugfix
2008-11-28 15:06:50 +00:00
jean.chalard
ec77debc62 J :
* Release holds when key is released.
* Fix a bug that would mark the key pressed instead of released when it's
  read.
2008-11-28 14:52:12 +00:00
jean.chalard
46669050ee J :
* Implement holds for PSP.
2008-11-28 14:33:51 +00:00
jean.chalard
3488d3a498 J :
* Crank up repeat rate to 60 times a second.
2008-11-27 14:37:11 +00:00
jean.chalard
5fec3d4a3d J :
* Use readbutton in the JGuiController.
2008-11-27 14:17:15 +00:00
jean.chalard
9b04331415 J :
* Take the "PeekBuffer returning -1" case into account
2008-11-26 14:07:19 +00:00
jean.chalard
41c45766ad J :
* Fix an inversion.
* Switch an initialization at the beginning rather than at each message >.>
2008-11-26 13:06:08 +00:00