Added getScreenCoords(), invalidateRect().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@785 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: IsoSceneView.java,v 1.77 2001/12/14 23:31:04 shaper Exp $
|
||||
// $Id: IsoSceneView.java,v 1.78 2001/12/15 04:20:55 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -404,22 +404,26 @@ public class IsoSceneView implements SceneView
|
||||
int size = rects.size();
|
||||
for (int ii = 0; ii < size; ii++) {
|
||||
Rectangle r = (Rectangle)rects.get(ii);
|
||||
|
||||
// dirty the tiles impacted by this rectangle
|
||||
Rectangle tileBounds = invalidateScreenRect(r);
|
||||
|
||||
// dirty any sprites or objects impacted by this rectangle
|
||||
invalidateItems(tileBounds);
|
||||
|
||||
// save the rectangle for potential display later
|
||||
_dirtyRects.add(r);
|
||||
invalidateRect(r);
|
||||
}
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void invalidateRect (Rectangle rect)
|
||||
{
|
||||
// dirty the tiles impacted by this rectangle
|
||||
Rectangle tileBounds = invalidateScreenRect(rect);
|
||||
|
||||
// dirty any sprites or objects impacted by this rectangle
|
||||
invalidateItems(tileBounds);
|
||||
|
||||
// save the rectangle for potential display later
|
||||
_dirtyRects.add(rect);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the given rectangle in screen pixel coordinates in
|
||||
* the view. Returns a rectangle that bounds all tiles that were
|
||||
* dirtied.
|
||||
* Invalidates the given rectangle in screen pixel coordinates in the
|
||||
* view. Returns a rectangle that bounds all tiles that were dirtied.
|
||||
*
|
||||
* @param rect the dirty rectangle.
|
||||
*/
|
||||
@@ -611,6 +615,14 @@ public class IsoSceneView implements SceneView
|
||||
new TilePath(_model, sprite, points, x, y);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public Point getScreenCoords (int x, int y)
|
||||
{
|
||||
Point coords = new Point();
|
||||
IsoUtil.fullToScreen(_model, x, y, coords);
|
||||
return coords;
|
||||
}
|
||||
|
||||
/** The stroke used to draw dirty rectangles. */
|
||||
protected static final Stroke DIRTY_RECT_STROKE = new BasicStroke(2);
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
//
|
||||
// $Id: SceneView.java,v 1.19 2001/11/18 04:09:22 mdb Exp $
|
||||
// $Id: SceneView.java,v 1.20 2001/12/15 04:20:55 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.util.List;
|
||||
|
||||
import com.threerings.media.sprite.DirtyRectList;
|
||||
@@ -17,8 +18,8 @@ import com.threerings.media.sprite.Path;
|
||||
public interface SceneView
|
||||
{
|
||||
/**
|
||||
* Invalidates a list of rectangles in screen pixel coordinates in
|
||||
* the scene view for later repainting.
|
||||
* Invalidate a list of rectangles in screen pixel coordinates in the
|
||||
* scene view for later repainting.
|
||||
*
|
||||
* @param rects the list of {@link java.awt.Rectangle} objects.
|
||||
*/
|
||||
@@ -50,4 +51,9 @@ public interface SceneView
|
||||
* @return the sprite's path, or null if no valid path exists.
|
||||
*/
|
||||
public Path getPath (MisoCharacterSprite sprite, int x, int y);
|
||||
|
||||
/**
|
||||
* Returns screen coordinates given the specified full coordinates.
|
||||
*/
|
||||
public Point getScreenCoords (int x, int y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user