Commit Graph

854 Commits

Author SHA1 Message Date
Ray Greenwell bb83bacdab Rather than keep a reference to an instance of a custom anonymous class
for an error icon, just whip one up on the fly when needed (almost never).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3389 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-09 23:20:37 +00:00
Ray Greenwell b07d3821fd Use an LRU cache for our config properties files.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3388 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-09 23:19:01 +00:00
Michael Bayne 44502d01e8 We need to do the property file inheritance processing when loading the
sounds.properties lest we lose the needed info specified in the parent
properties files.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3384 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-07 20:06:55 +00:00
Andrzej Kapolka e75e1918b1 Disarm buttons on mouse-release to avoid sticky buttons in spades.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3383 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-04 22:25:27 +00:00
Michael Bayne bc837ca289 The plot thickens. The resource manager prepends "rsrc/" to anything it
loads, but the sound manager wants to load things directly from the
classpath, so we need to allow it to use the classpath that the resource
manager was configured with to ensure that it did the right thing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3379 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:35:43 +00:00
Michael Bayne 91f936d147 Need to tack the .properties on by hand when we're loading in this manner.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3378 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:28:41 +00:00
Michael Bayne f4343be20d Load the sound properties via the ResourceManager which will do the right
classpath magic to work with Game Gardens.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3377 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:11:51 +00:00
Ray Greenwell ce0db63b27 Added a constructor to not specify a default sound.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3376 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:10:01 +00:00
Ray Greenwell 9733fc2303 Added support for looping sounds.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3371 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-28 19:29:44 +00:00
Ray Greenwell 7ec0eeca56 Added a bevy of interfaces that Sprites can implement to be recognized
by the MediaPanel as sprites that interact in some standard way with the
mouse.
Modified existing ButtonSprite to work this new way, and it now implements
CommandSprite, ArmingSprite, and DisableableSprite. One method name changed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3362 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-22 04:14:44 +00:00
Ted V ebf4d7cfa2 Now throws the proper type of exception when a color name lookup fails.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3354 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-16 22:21:01 +00:00
Ted V 785259a4a8 Quite obviously the parsing should check for integers, not bytes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3353 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-15 21:44:35 +00:00
Ted V d618c12c93 Added accessor function that handles color name -> id lookups.
Could be made faster with some sort of reverse string lookup table,
but it doesn't seem worth the overhead right now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3352 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-15 20:53:49 +00:00
Michael Bayne 7cf98ba971 Automatically lay out our label if it has not already been.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3349 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-14 03:01:28 +00:00
Michael Bayne 99d382fdbf Updated the constructor.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3348 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-14 03:01:14 +00:00
Michael Bayne 459d677a2f Provide the AbstractMediaManager with a reference to the panel it's
working with rather than just the RegionManager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3347 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-14 03:00:58 +00:00
Ray Greenwell 10e84f9471 Gee wally, now that sound is fixed, let's go back to expiring late sounds
at a reasonable time again.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3344 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-10 04:00:12 +00:00
Ray Greenwell 5ff24097a7 Tested and verified: the bug is fixed. Removed extra debugging, found
another instance of append() that needed to be changed to appendLoud().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3343 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 23:02:39 +00:00
Ray Greenwell 2ff14aa456 Well then! That last bit of debugging has finally shown me the light!
Queue.append() only does a notify() if the queue was previously empty.
So when the dobj thread was requesting two sounds one after another, it
only woke up one player thread, which played the first sound and then
came back 'round to play the next sound after it was done. The next sound
was usually expired by that time.

Use queue.appendLoud(), which always wakes up a waiter thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3342 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 22:34:55 +00:00
Ray Greenwell 67521e973d Even more logging, to ensure that two different threads are indeed playing
these two different sounds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3341 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 22:02:22 +00:00
Ray Greenwell 86757cb55e Even more verbose logging to figure out why the sound manager is being so
slow.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3340 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 20:59:14 +00:00
Ray Greenwell f027797120 Added some more info to some logging, cleaned up formatting of logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3339 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-09 19:55:31 +00:00
Ray Greenwell 60c5f60a23 Added additional verbose logging to figure out why some clips take
so long to get played.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3338 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-08 07:09:05 +00:00
Ray Greenwell cb6da9d5bc Playing with the sound under windows, it seems that a lot of sounds are
getting dropped because they're taking too long to play. Extended the
max delay to 1000ms, which will surely help more sounds play, but may
not be worth it. Hey, we've got a test server to test on...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3337 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-08 06:26:27 +00:00
Michael Bayne 53c3435854 Handle cases where one or the other direction does not scroll for lack of need.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3335 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-07 03:53:54 +00:00
Michael Bayne ff4f9d4a9c A helper that makes it easy to wire up scrollbars or a scrollbox to a
virtual media panel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3334 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-07 03:37:39 +00:00
Ted V f7109f64bf Was doing some debugging; opted to leave the log import checked in.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3326 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 23:11:42 +00:00
Ted V 66321690e6 Animation now accounts for X acceleration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3325 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 20:42:21 +00:00
Ted V 6206d9f71b Added construction interface for X axis acceleration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3324 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 20:22:09 +00:00
Ted V bf463e46e9 Left logging import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3323 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 22:52:53 +00:00
Ted V 42fb1f095b Needed some debug information from this class; figured I'd leave the
Log import in there.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3322 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 21:13:27 +00:00
Ted V 81487748dc Scale animations now report when they've finished.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3319 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 00:07:56 +00:00
Ted V d8749a8b41 Bunch of updates to handle actual drawing of the image. Some bug fixes too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3318 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 23:59:39 +00:00
Ted V 4033d08113 Most of the class has been rewritten.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3317 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 21:17:59 +00:00
Ted V cdb7284ea2 Skeleton of a scaling animation stolen from GleamAnimation. Nothing
has been changed, except the names to protect the innocent.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3316 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 20:49:34 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Ray Greenwell 05d72fb406 In the fix for the macintosh copy area bug, it's pointless to compute the
rectangle of the area that would have been copied, as we know that the
_entire_ visible area is now dirty due to the failed copy. Replace the
list of dirty rectangles with one rectangle encompassing everything, it will
cut down on the iterations in the paint() method and should improve
performance on the JVM that exhibits the copyArea bug.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3307 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-21 23:59:04 +00:00
Ray Greenwell 8f40cfa2e3 Be sure to mark all the sound playing threads as daemon.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3305 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-20 00:07:27 +00:00
Michael Bayne 64b5b856ca We need to translate mouse wheel events as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3304 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-19 16:09:17 +00:00
Ray Greenwell 2b085bd8c2 Finished a weekend project: rewrote the SoundManager.
The SoundManager used to keep the AudioSystem's Line open for up to 30
seconds after a sound was played, maybe because I thought that opening
the line was expensive, or because it makes an audible 'tick' in linux
if no other sounds are playing. Well, it turns out that the sound looping
bug is the result of some internal befuckery of Sun's caused by keeping
the line open. Restructed the sound manager so that lines are opened
every time a sound is to be played and then closed immediately after.

This also allowed me to simplify a thing or two, and sounds should actually
be more responsive, in a tiny way, since previously the dobj thread asked
to play a sound, the sound manager thread would load the clip data and
finally a data spooling thread would play the actual sound. Now there is
no sound manager thread- so the dobj thread adds a sound to the queue and
one of the playing threads wakes up, reads the data and plays the sound.

Factored out all the music stuff into a new MusicManager. There was almost
nothing shared between the two, and it was just annoying to have one
monolithic manager that had all the logic and variables for both of these
distinct functions. The music manager also no longer has a processing
queue, everything takes place on the dobj thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3303 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-17 23:30:38 +00:00
Ray Greenwell f9f3d784cf My laptop repeatedly gets the sound looping bug, and I noticed that it goes for about 30 seconds before stopping. We keep the line open for 30 seconds, waiting for another sound, and there must be a bug in the Java libraries that sometimes loops the end of the sound. Expire LineSpoolers after 1 second. If this works I may restructure things so that the threads stay around longer but the lines get closed immediately after the drain delay.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3290 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-29 21:56:58 +00:00
Michael Bayne 1fde5f69c0 Added a getter for the frame's manager.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3285 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-28 03:48:40 +00:00
Ray Greenwell bd80c348eb The great Interval revamp.
There is no more SafeInterval, instead Intervals can be constructed with a RunQueue to use for expiring.
PresentsDObjectMgr implements RunQueue.
Client has a getRunQueue() method to get the client side RunQueue.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3283 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-22 19:23:00 +00:00
Ted V 7ea2b45d39 Changed tabs to spaces since not everyone has the same tab stops.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3259 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-03 21:38:22 +00:00
Ray Greenwell 226fe41e7c And I may as well keep the commented-out code up to date.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3233 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-24 00:57:05 +00:00
Ray Greenwell 6acbd15c2f Small fix: if we're bypassing the copyArea scrolling on a macintosh
and just dirtying the entire panel, we don't want to set _dx and _dy, as
that will trigger the actual use of copyArea and so forth during painting.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3232 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-23 23:38:43 +00:00
Landon Fuller 660ff94fc1 On Mac OS X, mark the entire panel as dirty when scrolling to fix artifact issues.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3229 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-23 20:09:23 +00:00
Andrzej Kapolka 4294134954 Moved ButtonSprite up to com.threerings.media.sprite.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3222 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-18 23:39:12 +00:00
Michael Bayne 57d8d7a703 Sprites should not be initialized with coordinates, so I changed the
constructor to reflect that rather than requiring coordinates that are
then not really valid.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3214 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-12 02:16:04 +00:00
Michael Bayne 7caf2ee610 Do the right thing if we're holding onto animations while the view scrolls.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3210 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-11 23:53:06 +00:00