Michael Bayne
d618d3c771
Eclipse suggested cleanup.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Michael Bayne
fbd52c2be3
Tone down cache performance reporting; upped image cache size by a meg.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2730 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-28 04:06:14 +00:00
Michael Bayne
28a9441143
Allow the ImageManager to function if we're running in headless mode. It
...
will create all images as 32-bit ARGB.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2674 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-23 17:59:04 +00:00
Michael Bayne
73a4a02aa1
A few substantial changes:
...
- Tiles are initialized after being constructed which makes life simpler
for custom tiles which no longer have to have their own constructor that
passes Tile's stuff down to it.
- Tiles are no longer LRU cached (because we blow through that cache
instantly on all but the smallest of scenes), and are now tracked by
weak references so that we guarantee that only one instance of a tile is
ever in memory.
- Added code to track and report memory usage of weak cached tiles as well
as "stray" tiles which are created through other means than asking a
TileSet for a tile (fringe tiles being the most prolific example).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2628 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-31 00:56:38 +00:00
Michael Bayne
6669e39a8e
Added other forms of getPreparedImage();
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2529 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-02 23:09:28 +00:00
Michael Bayne
c7765a9862
Added getPreparedImage().
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2528 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-02 22:59:20 +00:00
Michael Bayne
72768a3a9e
More synchronization is needed! The dangers of multithreaded programming.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2485 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-28 17:38:06 +00:00
Michael Bayne
5c03adbb72
Added support for temporarily disabling image and tile cache flushing.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2483 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-27 07:33:15 +00:00
Michael Bayne
8973ca0d8c
Make ImageDataProvider responsible for loading the actual image instead of
...
returning an ImageInputStream.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-27 06:33:11 +00:00
Michael Bayne
8bab0bd281
Added useful debug logging.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2463 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-25 22:12:14 +00:00
Michael Bayne
90391aa69d
Synchronize access to the image cache so that we can load images on other
...
threads.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2459 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-25 18:21:28 +00:00
Michael Bayne
ae0376d4ec
Removed a bunch of obsolete stuff.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2455 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-25 15:51:34 +00:00
Michael Bayne
6ea4264eb4
If we fail to load an image, create a blank one in its stead.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2393 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-09 22:02:05 +00:00
Michael Bayne
d7e60e2749
Not to freak out if we can't recolor an image, just log a warning and
...
return the unrecolored version.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2288 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-22 01:48:21 +00:00
Michael Bayne
6a8bee2821
Activate tracking on the image LRU cache; lower the cache size to 1 meg.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2196 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-20 19:38:37 +00:00
Michael Bayne
34144c86de
Configured our LRU image cache to flush images when we reach a certain
...
number of bytes used rather than a certain image count.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2173 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 02:29:32 +00:00
Michael Bayne
c98f45e3a0
Let's get those nots in the right places.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2154 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:50:36 +00:00
Michael Bayne
0558830cff
Had the beans above the frank.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:48:45 +00:00
Michael Bayne
bd943707f3
Add debug toggles for running blank and disabling image preparation.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2152 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:45:37 +00:00
Michael Bayne
01a3630493
Use the adjustment directly rather than going through the prefs.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2150 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:36:18 +00:00
Michael Bayne
43bc29afd8
Static variables go above static constants.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2149 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 02:31:50 +00:00
Michael Bayne
60a60d49ec
Use runtime adjustments for our image and tile cache size.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2145 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-15 00:47:09 +00:00
Michael Bayne
f26cfb322d
Temporary hack to make all images translucent since that works around
...
strange slow rendering problems we see when we allow mixed BITMASK and
TRANSLUCENT images to be rendered.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2140 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 04:05:56 +00:00
Michael Bayne
98c2dd45db
Deal with fucking stupid ass close() behavior from ImageInputStreamImpl.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2128 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 23:55:05 +00:00
Michael Bayne
100aa3ace3
Major media subsystem revamp:
...
- All images are loaded through the image manager
- Architected to allow the use of prepared or unprepared images (and
volatile images when the day comes that they support alpha)
- Tunable caches for images and tiles
- Resource manager caches unpacked resources on the filesystem
- Various and sundry other cleanups
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 22:49:47 +00:00
Ray Greenwell
125a0c4fef
updated to reflect new home of ImageIOLoader
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2102 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-08 05:17:35 +00:00
Michael Bayne
1ce6951cb6
Repackaged a few things in media: sounds stuff went into media.sound and
...
image stuff went into media.image.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2100 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-08 04:09:03 +00:00
Michael Bayne
2807056a44
Close the InputStream instances we get from the resource manager after
...
we're done loading images from them.
Always load through a BufferedInputStream because that seems to fix the
bogosity with ImageIO.load() not working without a cache.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-07 07:55:24 +00:00
Walter Korman
acaf39b070
Estimate memory usage in bytes rather than pixel area, assuming an int per
...
pixel for now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2034 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 02:04:32 +00:00
Walter Korman
ea545bcb66
Log the size of the cache along with its efficiency.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2033 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 01:10:25 +00:00
Walter Korman
be34314e1a
Report image cache performance in all relevant places.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2032 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 01:00:58 +00:00
Walter Korman
8c5d490b53
Use an LRUHashMap to cache images, and limit caching to 30 images.
...
Periodically log cache efficiency and estimated image size.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2031 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-07 00:58:00 +00:00
Michael Bayne
3bfca1d20a
Not to complain if we can't load an image because we'll fall back to the
...
classpath. Removed getImageSource() as calling through to the resource
manager is simpler.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1972 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 03:06:06 +00:00
Michael Bayne
128547b41b
Use the resource managers bundle searching lookup instead of doing things
...
by hand.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1966 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 02:15:05 +00:00
Michael Bayne
5879dee050
Steempy you eeediot! It's t not iae!
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1943 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 06:42:54 +00:00
Michael Bayne
401f609224
Catch any argument when loading an image and report useful things.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1942 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 04:24:51 +00:00
Walter Korman
beca9850aa
Return null in getImageSource() if the specified bundle can't be found, as
...
was documented, so that callers can do things like fall back to trying the
classpath rather than having the previously-thrown IOException circumvent
the rest of their antics.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-25 00:44:16 +00:00
Michael Bayne
8662f12241
Further support for loading images from resource bundles.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1812 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-17 17:42:20 +00:00
Walter Korman
78b0d1eae9
Added loadImage() variant that allows specifying the resource set from
...
which the image is to be loaded. Removed unused imports.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1807 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-16 15:57:12 +00:00
Michael Bayne
9acc27d3f3
Not to freak out if we can't load an image. Log an error and return a fake
...
image instead.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1753 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-25 07:15:16 +00:00
Michael Bayne
d675e3f970
Preserve the transparency characteristics when creating an image optimized
...
for display on screen.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1744 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-23 23:30:23 +00:00
Walter Korman
6260633ec3
Added a variant of createImage() that takes an existing image to be
...
rendered into the optimized image.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1558 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-06 00:38:45 +00:00
Michael Bayne
e00610ecdb
Ensure that we're loading our images through a BufferedInputStream.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1406 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-29 18:45:00 +00:00
Michael Bayne
872e10f11d
Catch IllegalArgumentException if it's thrown while we're loading our
...
images. The PNG loader seems to be kind enough to throw fucking runtime
exceptions when it encounters file format problems instead of throwing
IOException or some other declared exception.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-28 01:19:11 +00:00
Michael Bayne
eee84b9a84
Added loadImage(InputStream).
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1104 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-08 09:34:42 +00:00
Michael Bayne
9e5937ffea
Added mechanism for loading images directly, without converting them to a
...
format optimized for display.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1068 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-24 19:26:26 +00:00
Michael Bayne
4641d00583
Moved ImageUtil into media.util with the rest of the util classes.
...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1067 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-24 02:20:44 +00:00
Walter Korman
8393055218
Changed default transparency of blank images to BITMASK rather than
...
TRANSLUCENT since that's what we prefer. Made ImageManager use ImageUtil
to create blank images.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@871 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 17:55:43 +00:00
Michael Bayne
18b32fff62
Need to catch Throwable rather than Exception because apparently
...
ClassNotFoundException is a runtime exception.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@765 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-13 05:15:16 +00:00
Walter Korman
d4b714fab4
Forgot to make ImageIOLoader implement ImageLoader. Output the exception
...
associated with failure to make use of the ImageIOLoader.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@762 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-13 01:14:30 +00:00