Commit Graph

59 Commits

Author SHA1 Message Date
Michael Bayne 5a2583470c Brought code in line with changes to Samskivert. I have not started to
genericize Narya data structures, nor make the existing code type safe. That's
going to be an extremely large project.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4007 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-10 08:59:30 +00:00
Ray Greenwell 9faa866dba Added a method that exists in VirtualMediaPanel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3853 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-14 22:15:55 +00:00
Ray Greenwell bb5e7fed19 Treasure Drop depended on the previous behavior, where if the hover sprite
was still hitting it didn't check for a new one. Let's keep the
check but instead let's just make sure that we ignore sprites
that are non-action or non-hover or are disabled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3731 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-13 08:54:25 +00:00
Michael Bayne c442ce3023 Allow the sprite action handler to be customized.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3722 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-05 05:59:53 +00:00
Michael Bayne a9d72cf9c4 My change didn't properly "unhover" the old hover sprite when an overlapping
but higher priority hover sprite was entered. Noted a refinement that would
make getHit() more correct in the overlapping case.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3718 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-02 01:32:05 +00:00
Michael Bayne d556c79088 Removed the optimization of not recalculating the hover sprite when we were
still over a hover sprite as that prevents things from working properly if
hover sprites overlap. This isn't much of a tradeoff as most of the time the
mouse is not over a hover sprite in which case it does the full hit testing
anyway.

Also fixed a bug wherein the active sprite was not actually configured unless
it implemented HoverSprite which the rest of the code takes pains not to
require (it should be and is now possible to have action sprites that do not
implement HoverSprite but still work).

By the way, this whole action/hover/etc. sprite business is goddamned handy.
It's *so* much nicer than having to implement mouse listeners and do a bunch of
crap by hand.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3717 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-02 01:27:24 +00:00
Ray Greenwell 898a3bf5d5 Not sure if this is a big deal, but it can't hurt: our media panels
shouldn't be transparent so that repaints don't travel up past them.
(Some were, but I think our repaint manager was keeping paints out of
the parents anyway, somehow).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3663 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-28 21:08:47 +00:00
Andrzej Kapolka 67d1ca90c4 Moved the calls to the various layer-painting methods to their own independent method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3660 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-23 01:30:35 +00:00
Michael Bayne 0f4fe33c75 Preserve the event timestamp and modifiers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3544 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-06 22:50:45 +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
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
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
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 b3de84c918 Render animations behind sprites in the back layer and in front of sprites
in the front layer which is generally what we want.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3190 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-29 17:10:46 +00:00
Michael Bayne 2db2248bc4 Make the media panel's animation and sprite managers available.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3124 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-09-18 23:50:20 +00:00
Michael Bayne 1f8c4578b7 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:12:55 +00:00
Michael Bayne 1311dafb1f Don't let freaky derived classes ruffle our feathers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3096 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-24 22:37:47 +00:00
Michael Bayne 1dc8070910 Checking these in for Ray so that things will compile.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2990 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-04-06 03:53:26 +00:00
Michael Bayne d618d3c771 Eclipse suggested cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Michael Bayne 6cf90dcddd Not so fast, we need to jigger this differently.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2753 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 21:43:05 +00:00
Michael Bayne cfe7f19669 Was clearing out the wrong business.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2749 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 21:39:29 +00:00
Michael Bayne fac7c3cb75 The frame manager may decide not to paint us if needsPaint() returns
false, but we still need to call willPaint() after *every* tick, so we
have to do that in needsPaint() where we can be sure it will get called.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2554 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-08 05:46:45 +00:00
Michael Bayne baf4873fa6 Not to freak out if we can't get a graphics to lay out our FPS label.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-04 23:28:18 +00:00
Michael Bayne 9454a1e35a Commented out avg. dirty regions per tick display and modified FPS display
to facilitate efficient checking of whether it's activated or not.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2520 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-02 15:11:12 +00:00
Michael Bayne 357e17d7c7 Because we cleverly do nothing in paint() if there are no dirty regions,
we have to go out of our way to let the abstract media managers know when
tick() is all done and paint() *may* be called. This way they can properly
clear out their tick stamps because they know that no more media fooling
around will happen between the call to willPaint() and the call to paint()
(which used to be called renderMedia() but is now paint() to remain in
line with all the other places were we tick() and then paint()).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-30 20:48:38 +00:00
Michael Bayne 9372df6ff0 Render the additional performance metrics when such are activated.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2506 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-30 06:34:55 +00:00
Michael Bayne b2cbd63be2 Display FPS in the media panel where we have tight control over dirtying
and repainting.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2501 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-29 18:15:10 +00:00
Michael Bayne 7aeae0d4c3 Change removeAnimation() to abortAnimation(); that's what is happening.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2410 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-15 00:39:20 +00:00
Michael Bayne cb6d73e98c needsPaint() will only be called by the FrameManager *after* it has just
called tick(), therefore we don't need to incorporate _tickPaintPending
into our determinations. Additionally, we need to clear _tickPaintPending
if we return false from this method because we won't get painted in that
case and won't clear it in paint().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-01 03:38:03 +00:00
Michael Bayne 0b0757b98c Fixed up the goddamned repaint fuckola. Fucking pain in the ass, all this
Swing, AWT and frame manager interaction.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2325 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-03-25 23:05:58 +00:00
Michael Bayne b66e0d2584 Keep track of whether or not anything was painted each frame and avoid the
extra effort of copying the back buffer to the screen if nothing actually
changed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2322 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-03-25 19:06:54 +00:00
Michael Bayne 998e4cada4 IntListUtil.sum() replaced total().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2233 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-04 03:11:43 +00:00
Walter Korman 3807953a55 Added MediaPanel.clearAnimations(), fixed up comments and removed
unnecessary SpriteManager.clearSprites().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2069 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-15 23:12:37 +00:00
Michael Bayne 5e81502af3 Track and report our average number of dirty regions per tick.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2042 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-08 02:49:53 +00:00
Walter Korman fc14518506 Removed verbose logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2022 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-04 03:01:12 +00:00
Walter Korman 6552b5bd8b Include the timestamp associated with sprite events in the event.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2020 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-04 02:45:09 +00:00
Michael Bayne 10523980c6 Provide ability to get timestamps from a media panel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1973 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 03:11:43 +00:00
Michael Bayne c4591a92ef System.currentTimeMillis() begone! We use our own pluggable timer system
now (which uses System.currentTimeMillis() at the moment but eventually
won't).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1968 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 02:18:49 +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
Michael Bayne 286892639e Removed the vestigal return as it confused the comment.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-25 21:15:27 +00:00
Michael Bayne a8e6c46f70 No more flashy flashy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1795 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-09 06:33:00 +00:00
Ray Greenwell a0730067ec Pulled out gobs of Sprite/Animation functionality into AbstractMedia.
Pulled out gobs of SpriteManager/AnimationManager functionality into
  AbstractMediaManager.
The big change: sprites can have their render order fine-tuned like
animations.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1787 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-08 21:03:37 +00:00
Michael Bayne a930ae0f0c Added clearSprites() for clearing all sprites in one fell swoop.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-25 17:31:17 +00:00
Michael Bayne 5d7decd03b Whoops, invalidate() means mark the component as needing to be relaid out.
We don't want to do that when we mean simply to repaint the whole
component.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1536 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-25 01:00:22 +00:00
Michael Bayne 8ca5fc3857 We need to ensure that dirty regions are constrained to the bounds of the
component in MediaPanel as well as VirtualMediaPanel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1482 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 07:41:37 +00:00
Michael Bayne 7253a68c7c Death, taxes and refactoring: seriously revamped the low-level media code
to handle scrolling in a much cleaner and happier way. There's now a
VirtualMediaPanel which operates in virtual coordinates and can be made to
"view" any location in those virtual coordinates. By changing the view,
the view can be scrolled and the view can be made to center on a pathable
(generally a sprite) which will cause it to scroll around as the pathable
moves around in the virtual coordinate space.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-18 22:25:33 +00:00
Michael Bayne cfb8c77d2f If we're using a path to drive the view, we need to let it know when we
scroll.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1442 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-12 00:51:24 +00:00
Michael Bayne 1a3ad13d6e Various and sundry revampage to make life easier when scrolling the media
panel to follow a path.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1440 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-11 21:40:52 +00:00
Michael Bayne c1ccaac10d Javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1437 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-11 00:52:37 +00:00
Michael Bayne 916513f306 Modified code that makes view follow path to not require an origin point
which was a wacky hack in the first place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1436 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-11 00:05:31 +00:00