Commit Graph

212 Commits

Author SHA1 Message Date
Michael Bayne 9b17dafd03 Created an icon manager for loading icons from tilesets using a
configuration file to map icon set identifiers to tileset images and
metrics.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@924 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-03 22:43:54 +00:00
Walter Korman ffdff82b42 Added setStartTime() to allow synchronizing multiple fade animations to
the same starting time.  Constrain the alpha to a valid range before
getting the composite object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@908 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-31 17:35:41 +00:00
Walter Korman 04ab7fe8c1 Added support for expiring an explode animation after a set time delay.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@907 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-31 17:34:20 +00:00
Michael Bayne f1f4e9c59a Added hitTest() which determines whether or not a point touches a
non-transparent pixel in an object's image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@901 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-31 02:08:52 +00:00
Michael Bayne 65900ecefa Added getHitSprites() which populates a list with the sprites that are
"hit" by a particular pixel as determined by Sprite.hitTest().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@898 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-31 01:04:13 +00:00
Michael Bayne c80ddcee22 Added hit test which checks first to see if a pixel is in a sprite's
bounding box and then checks to see that the pixel in question is occupied
by a non-transparent pixel in the sprite's image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@897 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-31 01:03:45 +00:00
Walter Korman 5510400f45 Pass a Graphics2D to AnimatedPanel.render() so that sub-classes needn't
explicitly typecast it on their own, as they are almost invariably wont to
do.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@890 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-23 17:10:41 +00:00
Walter Korman d6b17cd36c Reduced the specificity of the object detailing the bounds within which to
render sprites to a Shape rather than a Polygon.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@889 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-22 20:09:02 +00:00
Walter Korman 651ff37b66 Javadoc edits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@888 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-22 18:58:52 +00:00
Michael Bayne ec192b88d3 Added back overridden update() because Canvas.update() clears its whole
self when update is called which is seriously undesirable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@885 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 07:09:55 +00:00
Michael Bayne c03126153d Automatically create an animation manager for the animated panel; modified
the code that interacts with AWT repaint mechanisms to play nicely and
communicate AWT's repaint desires to the animation manager to be queued up
with our normal repainting.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@883 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 07:04:28 +00:00
Michael Bayne 408b3b6cb4 Make sure we have a sprite manager before talking to it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@882 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 07:01:19 +00:00
Michael Bayne df0ec942bd Added ability to construct animation manager without sprite manager and
then provide the reference later.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@881 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 07:00:40 +00:00
Walter Korman 5366ae4ca3 Allow rendering explosion chunks with either image portions or rectangles
of a specified color.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@879 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-19 06:06:05 +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
Walter Korman d6aa41396b Added ImageUtil.createImage() to create blank images that are compatible
with the destination screen device.  Updated existing code that previously
created buffered images directly to reference ImageUtil.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@870 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 17:48:11 +00:00
Walter Korman ea88a4dd68 Simple animation that renders rain drops for a specified period of time.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@869 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-18 16:22:23 +00:00
Michael Bayne c6e4b73851 Added comments to some code that needs to be fixed later.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@868 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-17 23:43:14 +00:00
Michael Bayne b9f77beded Construct resource manager according to new method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@866 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-16 03:01:45 +00:00
Walter Korman f70fc3aa60 Each image chunk has its own velocity and follows a trajectory path
impacted by a specifiable y-axis acceleration.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@856 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-15 18:10:25 +00:00
Walter Korman c25c66493e Pass the starting time for the animation in the constructor to allow
application code to make sure all animations are in sync, and to avoid
repeated calls to System.currentTimeMillis().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@854 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-15 02:20:02 +00:00
Walter Korman 70ac159095 Rotate the image chunks as they fly away. Made chunk count configurable.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@851 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-11 19:37:49 +00:00
Walter Korman e78607da60 Commented out verbose logging. Minor clean-up.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@850 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-11 16:53:34 +00:00
Walter Korman aa574a8182 Added support for animations to the animation manager. Moved animation
classes into their own package.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@849 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-11 16:17:34 +00:00
Walter Korman e3c4fd02b7 Initial work on making use of full-screen exclusive mode and additional
rendering optimizations available in JDK 1.4.  Use a BufferStrategy, and
changed AnimatedPanel to extend Canvas rather than JPanel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@847 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-08 22:16:59 +00:00
Walter Korman df14615e11 Initialize the path before saving it off so that the animation manager
can't attempt to move a sprite along a path that isn't fully prepared.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@846 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-07 23:51:52 +00:00
Walter Korman b13cdabeb0 Improved error handling when creating offscreen image for
double-buffering.  Don't paint the panel if it's not yet been laid out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@845 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-07 23:05:39 +00:00
Michael Bayne 6d350588c2 Added contains() and isMoving().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@836 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-19 07:43:09 +00:00
Michael Bayne c6b7212e57 Automatically start up the animation manager, regardless of whether or not
we're showing (the animated panel doesn't choke any more if it's asked to
render when not showing). Also leave the animation manager running until
it is explicitly shut down.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@833 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-18 09:46:07 +00:00
Michael Bayne 861e8ffb98 Added support for explicitly specifying the offset into the object tile
image that should be centered at the origin when the tile is rendered.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-18 08:37:54 +00:00
Michael Bayne 7d079a2bec Switch to new unified direction constants.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@818 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-17 03:34:04 +00:00
Michael Bayne 75c9c55dc4 Moved setVelocity() into the Path interface.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@799 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-16 08:05:46 +00:00
Michael Bayne 64a5b78526 Added toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@798 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-16 08:05:20 +00:00
Michael Bayne 60c9a91c20 Pulled starting and stopping code out into start() and stop().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@797 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-16 08:05:06 +00:00
Michael Bayne 2a3b329f41 Catch a case where getGraphics() returns null.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@796 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-16 08:04:25 +00:00
Walter Korman 36a3283bb7 Minor syntax edits, added comment.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@793 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-16 05:43:00 +00:00
Michael Bayne c60c0a557b Added invalidateRect().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@784 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-15 04:20:26 +00:00
Walter Korman af4b1175d7 Use AncestorAdapter.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@779 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-14 16:08:00 +00:00
Michael Bayne 2c1e5c1ba5 Bollocks! I forgot that using the memory cache with the ImageIO stuff
somehow borks the zip decompressor and all hell breaks loose. What a PITA.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@772 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-13 07:31:53 +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
Michael Bayne 279b3b07c0 Need to reference ImageIO in the constructor to ensure that the
classloading is attempting at construct time. So we do so by disabling
disk caching which will hopefully allow ImageIO stuff to work in the
applet.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@764 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-12-13 05:14:53 +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 9a02d456e5 Obtain our images through the image manager. We may be back later to have
the image manager cache them as well.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@718 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-30 02:34:58 +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 0905d5c0ce Added ability to dump tiles in addition to tilesets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@710 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-29 23:07:38 +00:00
Michael Bayne 70f6e9091d Was assigning object tile dimensions incorrectly.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@709 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-29 23:07:12 +00:00
Michael Bayne 8d30af6db4 Added bundle dumper.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@708 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-29 22:10:54 +00:00
Michael Bayne be165a5c12 Added toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@707 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-29 22:10:42 +00:00
Michael Bayne fef4803767 Extended the wrong class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@706 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-29 22:10:28 +00:00