diff --git a/src/java/com/threerings/media/sprite/ImageSprite.java b/src/java/com/threerings/media/sprite/ImageSprite.java index 34981a6fc..12ccf1804 100644 --- a/src/java/com/threerings/media/sprite/ImageSprite.java +++ b/src/java/com/threerings/media/sprite/ImageSprite.java @@ -1,5 +1,5 @@ // -// $Id: ImageSprite.java,v 1.9 2002/06/20 21:42:53 mdb Exp $ +// $Id: ImageSprite.java,v 1.10 2002/07/08 21:15:35 mdb Exp $ package com.threerings.media.sprite; @@ -39,28 +39,15 @@ public class ImageSprite extends Sprite public static final int TIME_BASED = 2; /** - * Constructs an image sprite without any associated frames and with a - * default initial location of (0, 0). The sprite should - * be populated with a set of frames used to display it via a - * subsequent call to {@link #setFrames}, and its location updated - * with {@link #setLocation}. + * Constructs an image sprite without any associated frames and with + * an invalid default initial location. The sprite should be populated + * with a set of frames used to display it via a subsequent call to + * {@link #setFrames}, and its location updated with {@link + * #setLocation}. */ public ImageSprite () { - this(0, 0, null); - } - - /** - * Constructs an image sprite without any associated frames. The - * sprite should be populated with a set of frames used to display it - * via a subsequent call to {@link #setFrames}. - * - * @param x the sprite x-position in pixels. - * @param y the sprite y-position in pixels. - */ - public ImageSprite (int x, int y) - { - this(x, y, null); + this(null); } /** @@ -70,10 +57,8 @@ public class ImageSprite extends Sprite * @param y the sprite y-position in pixels. * @param frames the multi-frame image used to display the sprite. */ - public ImageSprite (int x, int y, MultiFrameImage frames) + public ImageSprite (MultiFrameImage frames) { - super(x, y); - // initialize frame animation member data _frames = frames; _frameIdx = 0; diff --git a/src/java/com/threerings/media/sprite/LabelSprite.java b/src/java/com/threerings/media/sprite/LabelSprite.java index 8da700c2b..722406f57 100644 --- a/src/java/com/threerings/media/sprite/LabelSprite.java +++ b/src/java/com/threerings/media/sprite/LabelSprite.java @@ -1,5 +1,5 @@ // -// $Id: LabelSprite.java,v 1.2 2002/06/20 09:01:28 shaper Exp $ +// $Id: LabelSprite.java,v 1.3 2002/07/08 21:15:35 mdb Exp $ package com.threerings.media.sprite; @@ -23,17 +23,6 @@ public class LabelSprite extends Sprite */ public LabelSprite (Label label) { - this(0, 0, label); - } - - /** - * Constructs a label sprite with the given initial position that - * renders itself with the specified label. - */ - public LabelSprite (int x, int y, Label label) - { - super(x, y); - _label = label; } diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java index 2a7e93e70..e811ace5c 100644 --- a/src/java/com/threerings/media/sprite/Sprite.java +++ b/src/java/com/threerings/media/sprite/Sprite.java @@ -1,5 +1,5 @@ // -// $Id: Sprite.java,v 1.49 2002/06/20 21:42:53 mdb Exp $ +// $Id: Sprite.java,v 1.50 2002/07/08 21:15:35 mdb Exp $ package com.threerings.media.sprite; @@ -24,24 +24,15 @@ public abstract class Sprite implements DirectionCodes, Pathable { /** - * Constructs a sprite with a default initial location of (0, - * 0). + * Constructs a sprite with an initially invalid location. Because + * sprite derived classes generally want to get in on the business + * when a sprite's location is set, it is not safe to do so in the + * constructor because their derived methods will be called before + * their constructor has been called. Thus a sprite should be fully + * constructed and then its location should be set. */ public Sprite () { - this(0, 0); - } - - /** - * Constructs a sprite initially positioned at the specified location. - * - * @param x the sprite x-position in pixels. - * @param y the sprite y-position in pixels. - */ - public Sprite (int x, int y) - { - _ox = x; - _oy = y; } /** @@ -430,7 +421,7 @@ public abstract class Sprite * sprite positions itself via a hotspot that is not the upper left * coordinate of the sprite's bounds, the offset to the hotspot should * be maintained in {@link #_oxoff} and {@link #_oyoff}. */ - protected int _ox, _oy; + protected int _ox = Integer.MIN_VALUE, _oy = Integer.MIN_VALUE; /** The offsets from our upper left coordinate to our origin (or hot * spot). Derived classes will need to update these values if the