Commit Graph

72 Commits

Author SHA1 Message Date
Ray Greenwell 21181e8ba3 Don't dirty our bounds if setLocation() is called with our current
location. This could possibly break something that depended on the old
behavior, so we'll have to watch for broken things and make them right.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3822 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-01-27 03:28:04 +00:00
Ray Greenwell 0051fcb302 shutdown() is protected in our superclass, let's not widen access.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3566 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-18 01:04:20 +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 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
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 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 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 97a9b91531 Cancel any path on a sprite if it's removed while in the middle of
execution.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2873 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-11-24 21:58:36 +00:00
Michael Bayne 99127e4ce0 Revamped sprite observation and added support for being notified if a path
is cancelled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2504 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-30 00:44:36 +00:00
Michael Bayne 1fc693523d Add constructor that takes bounds. We love the bounds.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2438 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-20 04:52:33 +00:00
Michael Bayne 1d67781bc5 Not to dispatch if we have no observers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2188 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 20:45:23 +00:00
Michael Bayne 18c11e90a7 Sprites now dispatch their events immediately rather than queueing them up
to be dispatched after tick() has been called on all sprites.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2183 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 03:15:14 +00:00
Michael Bayne 0dcb5d67d1 Added Path.wasRemoved(), call it in the Sprite code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2178 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 22:57:08 +00:00
Michael Bayne dfe837a9d8 Jumped the gun. I suppose we want to allow hot swapping of paths and once
the old path is replaced, it will go away quietly and cleanly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2177 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 03:50:10 +00:00
Michael Bayne 08cfd0a9f7 Defensive programming rides again.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2176 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 03:44:20 +00:00
Michael Bayne 0ae21770d0 Don't draw outside the lines.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2126 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 23:53:34 +00:00
Ray Greenwell 822dabef8c added a way to remove observers
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2073 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-18 23:14:23 +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 0f0631f318 Do some jiggery poker to make sure that if a path completes as a result of
our call to Path.init() we don't freak out. Also made a note that paths
will be ticked after being init()ed because that's the way it works.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2011 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-02 20:11:24 +00:00
Michael Bayne c8502d212c Have to initialize our path on the first call to tick() now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1976 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 05:33:20 +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 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 db0c1b59b8 It's not kosher to set a sprite's location until after it is fully
constructed. The reason being that derived classes want to override things
like updateRenderOrigin() which should be called every time the sprite's
location is set, but if we do it in the base class constructor, a derived
class's updateRenderOrigin() will be called before the derived class's
constructor has been called. This is not good. Neither was the existing
code which simply half-assed a location change by updating the sprite's
origin position but not calling updateRenderOrigin(), leaving things
generally confuzzled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-08 21:15:35 +00:00
Michael Bayne 1f80cf9805 Cleaned up some sprite business: better documented various things, changed
local member names to reflect their actual functionality, flipped the sign
of the origin offset so that it's an offset rather than a negative offset.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1512 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 21:42:53 +00:00
Michael Bayne 330767e193 Cleaned up a few things related to render origin. If a derived class wants
the render origin to be other than (_x, _y) it can update (_rxoff, _ryoff)
when it is appropriate to do so, but we don't really need an overridden
method to do that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1500 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 23:30:06 +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 d05d0c8558 Added getPath() to provide access to the path being followed by the
sprite.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1439 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-11 05:56:44 +00:00
Michael Bayne ccbc47a7de Separated path code from sprite code so that we can have other things
follow a path (specifically, I want to allow the media panel to be
"scrolled" along a path).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1409 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-31 03:38:03 +00:00
Michael Bayne 7c4f86e63a pathBeginning() and pathCompleted() need to be public so that we can
create paths outside the media.sprite package.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1407 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-29 23:27:14 +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 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
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 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 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 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 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
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 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
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
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 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 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 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 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
Walter Korman ae5c9ba187 Minor comment edits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@341 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-09-17 23:55:45 +00:00