Commit Graph

82 Commits

Author SHA1 Message Date
Michael Bayne 612166a572 Created an Icon implementation that can be used to render sprites anywhere
that icons can be rendered.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1365 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-16 02:58:59 +00:00
Michael Bayne 47e38b4fa8 Changed MultiFrameImage around so that it retains total control over its
internal images and doesn't necessarily need to decode them into multiple
images or even have actual images at all. This cleans things up and paves
the way for our "trimmed" image support which is forthcoming.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1335 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-04 19:35:31 +00:00
Michael Bayne 23d170c83e Added support for pausing a media panel which pauses all sprites and
animations currently operating therein. (It doesn't pause scrolling which
I suppose I'll have to fix at some point if we ever need it.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1292 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-25 16:23:31 +00:00
Michael Bayne cc6a9d00ef Major low-level rendering rethink. There will be much follow-on cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1286 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-23 01:16:28 +00:00
Michael Bayne 42dc17a474 Started refactoring code to allow derived classes to expand the bounds of
the sprite to contain more than just the image. I didn't go all the way
though because I started looking at the stuff to handle render origin and
render offset and couldn't bring myself to add another offset into the mix
so it'll have to wait until I can give it some more serious thought and
perhaps simplify what we've got.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1264 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-17 15:52:49 +00:00
Michael Bayne f458a84d9e Translation needs to go the other way.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1255 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-16 02:29:05 +00:00
Michael Bayne a814589499 Get the sprites involved in scrolling; they now either scroll with the
view or remain fixed relative to the scrolling view (the default and also
the old behavior).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1253 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 23:10:24 +00:00
Michael Bayne be1ef2c1a2 Allow specification of fps in floating point.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1162 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-27 21:51:15 +00:00
Walter Korman 76cff072be Split Sprite into Sprite and ImageSprite. Added LabelSprite. Cleaned up
directional constant usage.  Added ability to render sprites in two
distinct layers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1132 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-16 03:15:06 +00:00
Michael Bayne 22d0839b72 Not to freak out if we have no frames.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1083 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-04 22:47:06 +00:00
Michael Bayne 3dbf935e3a Render all sprites that intersect the repaint bounds, not just the ones
that are contained within the bounds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1081 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-28 23:25:15 +00:00
Michael Bayne 137e9e9ea8 Revampola! Moved the code that handles viewport offset into the animated
panel; restructured things so everyone deals with "view" coordinates
rather than screen coordinates and the animated panel takes care of doing
the final translation before rendering.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1065 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-21 06:01:29 +00:00
Michael Bayne fec59f61a8 Dirty the old frame bounds and the new frame bounds when our frame image
is replaced.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1061 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-20 03:13:57 +00:00
Michael Bayne ee3532f6f1 Added mechanism by which the sprite manager can be informed that the view
on which its sprites are rendered was scrolled so that it can generate the
appropriate dirty rectangles or update its sprite's positions.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1045 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 19:55:14 +00:00
Michael Bayne 958cb213d5 Blarg. Have to tell the sprite manager about the viewport offset when
we're using it to render sprites into a view that is being displayed in a
viewport that is smaller than the actual size of the view. Oh the
jockeying.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1041 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 07:41:36 +00:00
Michael Bayne fc58eec429 Whoops, missed a change.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1032 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 03:58:37 +00:00
Michael Bayne 9b9211de16 Use a SortableArrayList instead of going for object creation mania every
time we sort the sprite list.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1031 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 03:57:53 +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 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
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 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 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
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
Walter Korman d102a47f13 Abstracted character-sprite-related activity to the cast package in
preparation for character component compositing and other
character-related antics.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@575 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-26 01:17:22 +00:00
Michael Bayne 976e219f56 Moved PerformanceMonitor and PerformanceObserver into media.util to remove
dependencies of media on miso.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@562 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 22:08:29 +00:00
Walter Korman 6ff80f8a92 Don't merge dirty rectangles when moving a sprite if the rectangles
don't overlap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@555 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 03:01:13 +00:00
Walter Korman 4b1f7af899 Merge any overlapping dirty rectangles before making them available to
outsiders.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@553 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 01:40:26 +00:00
Walter Korman 1dcad7f6b0 Create only a single dirty rectangle when a sprite moves. Cleaned up
bounds and rendered bounds discrepancies.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@552 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-25 01:39:38 +00:00
Walter Korman c839b61548 More polishing work on scene rendering.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-24 00:55:08 +00:00
Walter Korman e4a101cfc2 On path completion, clear the path before observers are notified so
that they can assign a new path to the sprite should they choose to do
so.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@523 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-23 01:59:50 +00:00
Walter Korman 841f732174 Pass the dirty rectangle for a dirty item to its paint() method so
that we can join multiple dirty rectangles for an item into a single
larger item but still rely on the dirty item to know how to paint
itself.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@515 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-22 18:14:57 +00:00
Walter Korman 7d667778b1 We only need the dimensions for creating the offscreen image.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@514 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-22 18:13:51 +00:00
Walter Korman 1c6e066444 Allow sprite sub-classes to modify their render offset more easily.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@513 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-22 18:13:09 +00:00
Walter Korman ef97b42acd Revamped iso scene rendering yet again to remove unnecessary dirty
rectangle propagation and to only render the dirty portions of dirty
objects and sprites.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-19 23:26:31 +00:00
Walter Korman 336d99d0e9 Add sprites and objects to the dirty item list separately since the
latter have a bounds associated with them.  Dirty items can now paint
themselves to simplify scene-specific code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@476 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-17 22:13:53 +00:00
Walter Korman c3229055e2 Basic implementation of an AnimatedView built on top of a JPanel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-17 22:12:20 +00:00
Walter Korman 3773da79a6 More work on object tiles. Revamped isometric scene rendering to
gather dirty sprites and objects and render after base and fringe tile
layers.  Add shadow tiles in the footprint of objects to make them
impassable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@460 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-13 01:08:59 +00:00
Walter Korman 1cd07dc217 Notify sprites when a new path is begun. Made time-based animation
work.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@445 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-12 00:36:03 +00:00