Commit Graph

50 Commits

Author SHA1 Message Date
Ray Greenwell 2d93950835 stop when we get to the end.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1703 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 21:58:12 +00:00
Michael Bayne fc261655b3 Created an animation that can be used to display a simple sequence of
frames.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1696 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 20:08:21 +00:00
Michael Bayne 2e7fd00214 Added setLocation() and reset().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1694 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 20:06:58 +00:00
Walter Korman 153497686f Added addAnimations(Animation[]).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1662 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-23 23:18:14 +00:00
Walter Korman b4d997a8df Perform actual rectangle intersection to determine whether a chunk is
still visible within the animation bounds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1649 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-19 21:08:51 +00:00
Walter Korman 2ed4b6e0c4 Oops; fixed incorrectly placed try/catch.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1646 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-15 20:56:08 +00:00
Walter Korman ec765c0258 Minor optimization and cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1645 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-15 20:53:50 +00:00
Walter Korman f0113d4916 Catch exceptions while rendering animations so that we can report the
animation at fault.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1644 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-15 20:53:24 +00:00
Walter Korman c4943a40f8 If a time delay is specified, fade out the chunks as time elapses.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1625 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-31 23:33:46 +00:00
Walter Korman 4acd5fcfdd Added convenience class for observing animations and being notified when
each individual animation completes and when all added animations have
completed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1381 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-21 17:59:11 +00:00
Walter Korman bd6146292f Restore the original clip only after we've un-translated the graphics
context.  Minor reformatting and enhanced toString().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1352 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-09 04:42:10 +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 b4d50d0843 Fixed bug where last render time was being used where last scroll time was
needed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1279 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-18 22:38:24 +00:00
Michael Bayne 06f8a68b56 Moved RandomUtil from media.util to util.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 18:18:20 +00:00
Michael Bayne a88799d4a1 Scroll fiddling! We no longer set a desired x and y velocity directly,
instead we say that we want to scroll by a certain amount in a certain
amount of time. This allows the animated panel (who knows about this
stuff) to figure out when to stop scrolling without overshooting by a
pixel or two.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1244 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-15 17:46:41 +00:00
Michael Bayne 20e39601c8 Changed AnimatedPanel to a JComponent from a Canvas because we no longer
need to extend the latter.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1207 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-06 04:49:43 +00:00
Walter Korman b3eebe2081 Added ability to render animations in two distinct layers; added mechanism
whereby animations can clean up after themselves.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1130 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-16 03:11:23 +00:00
Walter Korman 9c54e55fde Fixed typo that broke the build. Egads!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1120 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-14 21:09:01 +00:00
Walter Korman 84c0bd70cd Add a copy of the bounds rectangle when invalidated since it may be
destructively modified by the animation manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1118 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-12 22:54:16 +00:00
Michael Bayne ad5a5c4e6d Added (and commented out) some handy debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-08 01:37:51 +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 2e6c813bd6 Pass the current time stamp to viewWillScroll().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1063 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-21 00:20:22 +00:00
Michael Bayne d869e1168e Let our sprite manager know when we scroll; modified the rendering such
that scrolled views are copied to the display in their entirety instead of
just updating the dirtied regions (because we can't scroll the visible
screen buffer and then paint on top of it because the user will see things
in an intermediate stage).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1046 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 19:56:49 +00:00
Michael Bayne 3e68fd8994 Clear out our back buffer when we're validated (as we probably changed
sizes).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1037 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 07:19:04 +00:00
Michael Bayne 7db44c5ee3 Let the animated panel handle invalidating the regions exposed by
scrolling so that it can do so with the actual dimensions of the panel
(the scene view only knows how big its model wants to be). Changed
scrollView to viewWillScroll to more accurately reflect what's going on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1036 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 05:03:17 +00:00
Michael Bayne f2f6407c1e Need to account for negative scrolling deltas.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1034 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 04:45:14 +00:00
Michael Bayne a6f63ee873 Need to set the absolute value of the velocity.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1030 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 03:57:30 +00:00
Michael Bayne 3125782a15 Modifications to get scrolling working again. It's a bit smoother, but
we can do better.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1026 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 01:42:28 +00:00
Michael Bayne 63a32a6332 Modified rendering to use a hand managed volatile image as a back buffer
instead of using a buffer strategy. This will shortly be extended to
support more efficient scrolling as well.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1021 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-19 01:23:56 +00:00
Michael Bayne 06f9ac0c31 Disable scrolling when speed is set to zero mspp.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1019 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-18 06:05:59 +00:00
Michael Bayne fbc39605e7 Enhancements to support scrolling.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1011 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-17 23:40:43 +00:00
Michael Bayne b1109c8370 The animated view is now passed its invalid rect count in
paintImmediately() so that it can figure out if it's being painted solely
to facilitate scrolling or because there are dirty regions.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1010 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-17 23:39:32 +00:00
Michael Bayne 7c5e5dbce9 Added support for animated views that scroll. The animation manager
attempts to tune its refresh interval to one that allows the animated view
to scroll in even pixel counts each time through the render loop.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1009 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-17 23:38:18 +00:00
Michael Bayne 8db0bce2a7 Removed warning message because this is a normal occurrence.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1003 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-17 07:13:59 +00:00
Michael Bayne a00e7e5214 Automatically create a SpriteManager unless otherwise instructed; added
methods for starting and stopping the animation manager associated with an
animated panel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@995 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-13 18:48:56 +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
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
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 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
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