Generics.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@563 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -23,8 +23,9 @@ package com.threerings.media;
|
|||||||
|
|
||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.ArrayList;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
import static com.threerings.resource.Log.log;
|
import static com.threerings.resource.Log.log;
|
||||||
@@ -124,15 +125,15 @@ public class RegionManager
|
|||||||
*/
|
*/
|
||||||
public Rectangle[] getDirtyRegions ()
|
public Rectangle[] getDirtyRegions ()
|
||||||
{
|
{
|
||||||
ArrayList merged = new ArrayList();
|
List<Rectangle> merged = Lists.newArrayList();
|
||||||
|
|
||||||
for (int ii = _dirty.size() - 1; ii >= 0; ii--) {
|
for (int ii = _dirty.size() - 1; ii >= 0; ii--) {
|
||||||
// pop the next rectangle from the dirty list
|
// pop the next rectangle from the dirty list
|
||||||
Rectangle mr = (Rectangle)_dirty.remove(ii);
|
Rectangle mr = _dirty.remove(ii);
|
||||||
|
|
||||||
// merge in any overlapping rectangles
|
// merge in any overlapping rectangles
|
||||||
for (int jj = ii - 1; jj >= 0; jj--) {
|
for (int jj = ii - 1; jj >= 0; jj--) {
|
||||||
Rectangle r = (Rectangle)_dirty.get(jj);
|
Rectangle r = _dirty.get(jj);
|
||||||
if (mr.intersects(r)) {
|
if (mr.intersects(r)) {
|
||||||
// remove the overlapping rectangle from the list
|
// remove the overlapping rectangle from the list
|
||||||
_dirty.remove(jj);
|
_dirty.remove(jj);
|
||||||
@@ -152,5 +153,5 @@ public class RegionManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** A list of dirty rectangles. */
|
/** A list of dirty rectangles. */
|
||||||
protected ArrayList _dirty = new ArrayList();
|
protected List<Rectangle> _dirty = Lists.newArrayList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user