Commit Graph

469 Commits

Author SHA1 Message Date
Michael Bayne d4126e3514 Not to log dropped frames.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1955 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-16 00:15:57 +00:00
Ray Greenwell 125ef04e87 cleanup, figured out what's needed to loop midis consistently. More soon.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1954 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-16 00:13:47 +00:00
Michael Bayne d9838206c1 Use Java's timer to invoke our frame tick. Drop frames instead of queueing
up repeats when the previous tick takes too long.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1953 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 23:58:34 +00:00
Ray Greenwell 1d602849f0 - removed verbose logging.
- when stopping a midi, remove the meta listener first so that we
  don't get the event after we've tossed the sequencer.
- changed some variable names for clarity.
- added code to shutdown the midi system when we shutdown the rest.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1952 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 21:38:31 +00:00
Ray Greenwell 9e881810a9 - now only two volume levels: music and clips.
- clip types are turned on or off, individually.
- wired up volume for music, and it worked, but then I angered some norse god
  and now it doesn't work anymore despite repeated poking.
- fixed up clip volume formula (copied simplified/better code from Sun example)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1951 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 20:52:31 +00:00
Walter Korman 275d35ce07 Added traceImage(), which will doubtless be further optimized, and it
would sure be nice to have a variant that traces the supplied image rather
than always creating a new one, and more flexibility with respect to the
alpha gradient steps might be nice, but all of that sort of thing will
just have to come later.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1950 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 09:29:40 +00:00
Ray Greenwell 0c1c441288 First pass at midi/rmf support. Mostly works, but songs aren't looping more
than twice.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1949 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 05:34:43 +00:00
Ray Greenwell 51194278ca Store the largest Clip building blocks we can in the cache (rather than just
the byte[] data) so that subsequent plays can happen faster.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1948 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 02:06:41 +00:00
Ray Greenwell 6b68cb5530 The same sound file can be played multiple times simultaneously.
Sounds can be "locked" so that they don't expire from the LRU cache until
they are unlocked.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1947 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-15 01:49:47 +00:00
Ray Greenwell 2837e8789f Rectangle is a Rectangle2D.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1946 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-14 00:07:35 +00:00
Michael Bayne 8f276c0a38 Have AbstractMedia implement Shape so that it can be treated generically
by code that operates on shapes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1945 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 23:59:11 +00:00
Ray Greenwell fe0a5f545d Allow setting the volume independantly for any SoundType.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1944 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-13 07:12:40 +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
Michael Bayne d50852ebb1 Use Java-provided mechanism for sanity checking.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1926 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-07 22:42:51 +00:00
Michael Bayne 628b82294a Add sanity check to catch circumstances where dirty regions are posted on
threads other than the AWT thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1925 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-07 21:45:20 +00:00
Walter Korman 573fe5504b Fixed time-based animations to fire at the appropriate time.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-06 07:40:05 +00:00
Michael Bayne be6645db40 Have the sprite animation start the sprite along its desired path the
first time the animation is ticked so that we don't get apparently physics
defying behavior if someone creates a sprite and sprite animation but then
doesn't activate the animation immediately.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1919 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-06 01:40:39 +00:00
Michael Bayne 1f44f241c3 Logging cleanups.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1918 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-06 01:39:32 +00:00
Walter Korman 7acc400904 Added toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1917 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-06 00:05:16 +00:00
Michael Bayne 10c2251bdb This is tricky business; we need to be more careful about how we handle
animations triggered on the completion of previous animations so as not to
booch things if a triggered animation is queued up after all previous
animations have already been started.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1916 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 23:56:35 +00:00
Michael Bayne 562111a95d Better debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1915 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:53:56 +00:00
Michael Bayne 07ee41afef Whoops! Didn't finish the job prior to that last checkin.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1914 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:29:00 +00:00
Michael Bayne b24800922a Changed addAnimation() to startAnimation(), made it protected. Removed
getAnimationCount() because it's no longer valid.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1913 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:27:49 +00:00
Michael Bayne 913264c225 Documentation cleanup; removed vestigal _lastidx.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1912 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:23:55 +00:00
Michael Bayne f3fd0744ec Further clean up. We love helper classes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1911 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:17:32 +00:00
Michael Bayne da1119b61a Cleaned up and robustified. There were issues.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1910 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:12:55 +00:00
Michael Bayne a1fb4647a5 Removed vestigal test logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1909 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:03:31 +00:00
Ray Greenwell 2ab8861dba - Set the resource freeing timer to operate in non-repeating mode, since I
previously stopped it every time it fired anyway.
- Enforce a maximum queue size for played sounds so that things don't get
  out of hand.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1908 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 21:02:03 +00:00
Michael Bayne 3eba0dcf13 Animation sequencer revamp: animations can be added incrementally;
animations can be cued on the completion of the previous animation;
runnables can be provided for invocation upon animation completion or
in place of an animation in the chain.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1907 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:53:53 +00:00
Michael Bayne d5dbc514ca Use observer lists.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1906 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:52:39 +00:00
Michael Bayne 400b8ca638 Use ObserverList; provide timestamp to animation events.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1905 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:51:50 +00:00
Michael Bayne 144cf2299a Provide a timestamp with animation events.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1904 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:51:13 +00:00
Michael Bayne ece79bc86c Use observer lists for our observers instead of array lists.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1903 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:50:42 +00:00
Ray Greenwell 6a2cc6a16f optimize common case of having no dirty rectangles
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1902 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 18:52:11 +00:00
Michael Bayne e05341f035 When the JViewport scrolls its components, it simply calls setLocation()
which results in the component (and every other component in between that
component and the Sun) becoming invalid. Unfortunately, it isn't kind
enough to also let the RepaintManager know about its jokey business, and
so things simply remain invalid until some other joker comes along and
invalidates everything on God's green earth (like the JTextField). We hack
in a call to revalidate() on our poor unsuspecting scrolled component so
that everything will work properly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1901 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 05:51:18 +00:00
Michael Bayne b69e92c992 The joy of Swing. We have to refuse to acknowlege JScrollPane instances as
validate roots because when their children are invalidated, it causes the
entire hierarchy to be invalidated, which we then must revalidate lest
they live the rest of their mortal lives as invalids.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1900 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 05:49:31 +00:00
Michael Bayne 0608a27c67 Set the sprite's location to exactly what it needs to be in order for its
image to render in the upper left of where we want it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1897 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 03:40:06 +00:00
Michael Bayne 118f6b2363 Provide access to the x and y origin offsets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1896 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 03:38:59 +00:00
Ray Greenwell 271d0ffb85 a timorous transition from listening to stop events to just calculating
the time at which the sound will stop. Stop events are flawed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1886 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-02 01:49:20 +00:00
Ray Greenwell 4cbca95044 Sound manager revamp.
- let the AudioSystem figure out the file format from the sound data.
- LRU cache for clip data
- Don't free system resources from clips until at least 4 seconds after
  they're finished playing. Reuse clips (and their resources) when possible.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1883 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-02 00:26:55 +00:00
Walter Korman d9f7ebc792 Busted a cap in the accidentally-left-in verbose logging that pissed me
off so much while I was sailing around.  Take that you little fucker!  How
do you like that, huh?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1867 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-30 09:34:08 +00:00
Michael Bayne 6b651c2f9c Don't request to dirty an invalid region if we scroll more than an entire
screen vertically, instead request to dirty one with zero height.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1862 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-30 00:27:37 +00:00
Michael Bayne 92c6a8a564 Complain about invalid dirty regions; ignore useless regions.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1861 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-30 00:26:53 +00:00
Walter Korman af5b530b4c Fixed log message formatting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1859 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-29 23:44:23 +00:00
Walter Korman 6334b6d690 Sanity-check dirty rectangles when painting the media panel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1858 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-29 20:33:51 +00:00
Walter Korman 092e0f110c Sanity-check for null dirty rectangles.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1857 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-29 20:33:26 +00:00
Michael Bayne 14a313486b Documentation repairs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1842 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-27 18:49:51 +00:00
Michael Bayne c3eb45bbed Remove crack pipe; insert correct code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1834 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-26 23:21:19 +00:00
Michael Bayne 2c2a9f819d Documented SafeScrollPane requirement.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1833 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-26 20:31:15 +00:00