Commit Graph

36 Commits

Author SHA1 Message Date
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
Michael Bayne 940154d7e3 The image manager now falls back to loading images via the Toolkit if it
can't load the ImageIO classes. This unfortunately means that we're back
to passing a Component instance to the ImageManager at construct time.
Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@749 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-07 01:33:29 +00:00
Michael Bayne 783e3d9799 Obtain the information for our display device and create images optimized
for display on it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@717 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-30 02:33:34 +00:00
Michael Bayne ae1052a371 Oh the vast sweeping changes, and they're not even close to complete, but
things compile and most things run so this is a good time to checkpoint.
Let me recall:

- Refactored the whole scene deal.
- Revamped the XML parser stuff (now uses Digester).
- Rethought the tile management.
- Started tile bundle stuff.
- Wrote some tests.
- Did a bit of Mike-ification.

Onward and moreward.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@621 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-18 04:09:23 +00:00
Walter Korman 182306a5e4 Commented out verbose logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@582 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-02 01:09:08 +00:00
Michael Bayne 0b181954df ImageManager was referencing miso.Log rather than media.Log.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@563 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 22:10:32 +00:00
Walter Korman 627896ce59 Renamed Graphics2D variable to conform to naming elsewhere.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@332 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-09-06 01:35:05 +00:00
Walter Korman 2572535f95 General updating per initial code review. Created EditableSceneView
to separate scene display from editing functionality.  Load and
initialize managers in a fashion that more appropriately hides the
implementation details.  Tidied comments up a bit.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@103 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-23 18:52:51 +00:00
Walter Korman f91e1b41d1 Fixed up image loading to use the now-non-static ImageManager class.
Modified TileManager to store the height of a tile in the Tile
object's member data when the tile is initially created since we
would like to be able to reference it speedily.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@63 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-18 22:45:35 +00:00
Walter Korman c4654e2a11 Repackage classes from com.threerings.cocktail.miso to
com.threerings.miso.  Moved ImageManager to com.threerings.media.
Removed unused StripImage.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@62 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-18 21:45:42 +00:00