Slay some cyclopian variables.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@927 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2010-06-15 17:27:02 +00:00
parent 2efa35a62d
commit 25ee5e9134
16 changed files with 48 additions and 48 deletions
@@ -100,8 +100,8 @@ public class CharacterDescriptor
public int hashCode () public int hashCode ()
{ {
int code = 0, clength = _components.length; int code = 0, clength = _components.length;
for (int i = 0; i < clength; i++) { for (int ii = 0; ii < clength; ii++) {
code ^= _components[i]; code ^= _components[ii];
} }
return code; return code;
} }
@@ -99,8 +99,8 @@ public class BuilderModel
{ {
int[] values = new int[_selected.size()]; int[] values = new int[_selected.size()];
Iterator<Integer> iter = _selected.values().iterator(); Iterator<Integer> iter = _selected.values().iterator();
for (int i = 0; iter.hasNext(); i++) { for (int ii = 0; iter.hasNext(); ii++) {
values[i] = iter.next().intValue(); values[ii] = iter.next().intValue();
} }
return values; return values;
} }
@@ -196,8 +196,8 @@ public class BundledComponentRepository
if (comps != null) { if (comps != null) {
// scan the list for the named component // scan the list for the named component
int ccount = comps.size(); int ccount = comps.size();
for (int i = 0; i < ccount; i++) { for (int ii = 0; ii < ccount; ii++) {
CharacterComponent comp = comps.get(i); CharacterComponent comp = comps.get(ii);
if (comp.name.equals(compName)) { if (comp.name.equals(compName)) {
return comp; return comp;
} }
@@ -209,9 +209,9 @@ public class MetadataBundlerTask extends Task
Map<String, TileSet> setmap = Maps.newHashMap(); Map<String, TileSet> setmap = Maps.newHashMap();
// create the action map // create the action map
for (int i = 0; i < setlist.size(); i++) { for (int ii = 0; ii < setlist.size(); ii++) {
TileSet set = (TileSet)setlist.get(i); TileSet set = (TileSet)setlist.get(ii);
ActionSequence act = (ActionSequence)actlist.get(i); ActionSequence act = (ActionSequence)actlist.get(ii);
// make sure nothing was missing in the action sequence // make sure nothing was missing in the action sequence
// definition parsed from XML // definition parsed from XML
String errmsg = ActionRuleSet.validate(act); String errmsg = ActionRuleSet.validate(act);
@@ -244,8 +244,8 @@ public class MetadataBundlerTask extends Task
Map<String, ComponentClass> clmap = Maps.newHashMap(); Map<String, ComponentClass> clmap = Maps.newHashMap();
// create the action map // create the action map
for (int i = 0; i < setlist.size(); i++) { for (int ii = 0; ii < setlist.size(); ii++) {
ComponentClass cl = (ComponentClass)setlist.get(i); ComponentClass cl = (ComponentClass)setlist.get(ii);
clmap.put(cl.name, cl); clmap.put(cl.name, cl);
} }
@@ -275,8 +275,8 @@ public class ColorPository implements Serializable
// create the array // create the array
ColorRecord[] crecs = new ColorRecord[record.colors.size()]; ColorRecord[] crecs = new ColorRecord[record.colors.size()];
Iterator<ColorRecord> iter = record.colors.values().iterator(); Iterator<ColorRecord> iter = record.colors.values().iterator();
for (int i = 0; iter.hasNext(); i++) { for (int ii = 0; iter.hasNext(); ii++) {
crecs[i] = iter.next(); crecs[ii] = iter.next();
} }
return crecs; return crecs;
} }
@@ -295,8 +295,8 @@ public class ColorPository implements Serializable
int[] cids = new int[record.colors.size()]; int[] cids = new int[record.colors.size()];
Iterator<ColorRecord> crecs = record.colors.values().iterator(); Iterator<ColorRecord> crecs = record.colors.values().iterator();
for (int i = 0; crecs.hasNext(); i++) { for (int ii = 0; crecs.hasNext(); ii++) {
cids[i] = crecs.next().colorId; cids[ii] = crecs.next().colorId;
} }
return cids; return cids;
} }
@@ -165,9 +165,9 @@ public class Colorization
if (fhsv == null) { if (fhsv == null) {
fhsv = new int[hsv.length]; fhsv = new int[hsv.length];
} }
for (int i = 0; i < hsv.length; i++) { for (int ii = 0; ii < hsv.length; ii++) {
// fhsv[i] = (int)(hsv[i]*Integer.MAX_VALUE); // fhsv[i] = (int)(hsv[i]*Integer.MAX_VALUE);
fhsv[i] = (int)(hsv[i]*Short.MAX_VALUE); fhsv[ii] = (int)(hsv[ii]*Short.MAX_VALUE);
} }
return fhsv; return fhsv;
} }
@@ -133,8 +133,8 @@ public class ImageUtil
// convert the colors to HSV // convert the colors to HSV
float[] hsv = new float[3]; float[] hsv = new float[3];
int[] fhsv = new int[3]; int[] fhsv = new int[3];
for (int i = 0; i < size; i++) { for (int ii = 0; ii < size; ii++) {
int value = rgbs[i]; int value = rgbs[ii];
// don't fiddle with alpha pixels // don't fiddle with alpha pixels
if ((value & 0xFF000000) == 0) { if ((value & 0xFF000000) == 0) {
@@ -154,7 +154,7 @@ public class ImageUtil
Colorization cz = zations[z]; Colorization cz = zations[z];
if (cz != null && cz.matches(hsv, fhsv)) { if (cz != null && cz.matches(hsv, fhsv)) {
// massage the HSV bands and update the RGBs array // massage the HSV bands and update the RGBs array
rgbs[i] = cz.recolorColor(hsv); rgbs[ii] = cz.recolorColor(hsv);
break; break;
} }
} }
@@ -296,13 +296,13 @@ public class Quantize {
static { static {
SQUARES = new int[MAX_RGB + MAX_RGB + 1]; SQUARES = new int[MAX_RGB + MAX_RGB + 1];
for (int i= -MAX_RGB; i <= MAX_RGB; i++) { for (int ii = -MAX_RGB; ii <= MAX_RGB; ii++) {
SQUARES[i + MAX_RGB] = i * i; SQUARES[ii + MAX_RGB] = ii * ii;
} }
SHIFT = new int[MAX_TREE_DEPTH + 1]; SHIFT = new int[MAX_TREE_DEPTH + 1];
for (int i = 0; i < MAX_TREE_DEPTH + 1; ++i) { for (int ii = 0; ii < MAX_TREE_DEPTH + 1; ++ii) {
SHIFT[i] = 1 << (15 - i); SHIFT[ii] = 1 << (15 - ii);
} }
} }
@@ -344,11 +344,11 @@ public class Quantize {
this.pixels = pixels; this.pixels = pixels;
this.max_colors = max_colors; this.max_colors = max_colors;
int i = max_colors; int ii = max_colors;
// tree_depth = log max_colors // tree_depth = log max_colors
// 4 // 4
for (depth = 1; i != 0; depth++) { for (depth = 1; ii != 0; depth++) {
i /= 4; ii /= 4;
} }
if (depth > 1) { if (depth > 1) {
--depth; --depth;
@@ -115,7 +115,7 @@ public class TileSetBundle extends HashIntMap<TileSet>
{ {
int count = in.readInt(); int count = in.readInt();
for (int i = 0; i < count; i++) { for (int ii = 0; ii < count; ii++) {
int tileSetId = in.readInt(); int tileSetId = in.readInt();
TileSet set = (TileSet)in.readObject(); TileSet set = (TileSet)in.readObject();
put(tileSetId, set); put(tileSetId, set);
@@ -165,8 +165,8 @@ public class TileSetBundler
// use the mappings we parsed to configure our actual digester // use the mappings we parsed to configure our actual digester
int msize = mappings.size(); int msize = mappings.size();
for (int i = 0; i < msize; i++) { for (int ii = 0; ii < msize; ii++) {
Mapping map = mappings.get(i); Mapping map = mappings.get(ii);
try { try {
TileSetRuleSet ruleset = (TileSetRuleSet)Class.forName(map.ruleset).newInstance(); TileSetRuleSet ruleset = (TileSetRuleSet)Class.forName(map.ruleset).newInstance();
@@ -256,8 +256,8 @@ public class TileSetBundler
// add all of the parsed tilesets to the tileset bundle // add all of the parsed tilesets to the tileset bundle
try { try {
for (int i = 0; i < sets.size(); i++) { for (int ii = 0; ii < sets.size(); ii++) {
TileSet set = sets.get(i); TileSet set = sets.get(ii);
String name = set.getName(); String name = set.getName();
// let's be robust // let's be robust
@@ -88,8 +88,8 @@ public class TileSetBundlerTask extends Task
new MapFileTileSetIDBroker(_mapfile); new MapFileTileSetIDBroker(_mapfile);
// deal with the filesets // deal with the filesets
for (int i = 0; i < _filesets.size(); i++) { for (int ii = 0; ii < _filesets.size(); ii++) {
FileSet fs = _filesets.get(i); FileSet fs = _filesets.get(ii);
DirectoryScanner ds = fs.getDirectoryScanner(getProject()); DirectoryScanner ds = fs.getDirectoryScanner(getProject());
File fromDir = fs.getDir(getProject()); File fromDir = fs.getDir(getProject());
String[] srcFiles = ds.getIncludedFiles(); String[] srcFiles = ds.getIncludedFiles();
@@ -156,8 +156,8 @@ public class XMLTileSetParser
} }
// stick the tilesets from the list into the hashtable // stick the tilesets from the list into the hashtable
for (int i = 0; i < setlist.size(); i++) { for (int ii = 0; ii < setlist.size(); ii++) {
TileSet set = setlist.get(i); TileSet set = setlist.get(ii);
if (set.getName() == null) { if (set.getName() == null) {
log.warning("Tileset did not receive name during " + log.warning("Tileset did not receive name during " +
"parsing process [set=" + set + "]."); "parsing process [set=" + set + "].");
@@ -64,11 +64,11 @@ public class BackgroundTiler
_tiles = new BufferedImage[9]; _tiles = new BufferedImage[9];
int[] sy = { 0, _h3, _h3+_ch3 }; int[] sy = { 0, _h3, _h3+_ch3 };
int[] thei = { _h3, _ch3, _h3 }; int[] thei = { _h3, _ch3, _h3 };
for (int i = 0; i < 3; i++) { for (int ii = 0; ii < 3; ii++) {
_tiles[3*i] = src.getSubimage(0, sy[i], _w3, thei[i]); _tiles[3*ii] = src.getSubimage(0, sy[ii], _w3, thei[ii]);
_tiles[3*i+1] = src.getSubimage(_w3, sy[i], _cw3, thei[i]); _tiles[3*ii+1] = src.getSubimage(_w3, sy[ii], _cw3, thei[ii]);
_tiles[3*i+2] = _tiles[3*ii+2] =
src.getSubimage(width-_w3, sy[i], _w3, thei[i]); src.getSubimage(width-_w3, sy[ii], _w3, thei[ii]);
} }
} }
@@ -590,8 +590,8 @@ public class MisoScenePanel extends VirtualMediaPanel
// start with the sprites that contain the point // start with the sprites that contain the point
_spritemgr.getHitSprites(_hitSprites, x, y); _spritemgr.getHitSprites(_hitSprites, x, y);
int hslen = _hitSprites.size(); int hslen = _hitSprites.size();
for (int i = 0; i < hslen; i++) { for (int ii = 0; ii < hslen; ii++) {
Sprite sprite = _hitSprites.get(i); Sprite sprite = _hitSprites.get(ii);
appendDirtySprite(_hitList, sprite); appendDirtySprite(_hitList, sprite);
} }
@@ -52,8 +52,8 @@ public class BaseTileSetRuleSet extends SwissArmyTileSetRuleSet
public void parseAndSet (String bodyText, Object target) { public void parseAndSet (String bodyText, Object target) {
int[] values = StringUtil.parseIntArray(bodyText); int[] values = StringUtil.parseIntArray(bodyText);
boolean[] passable = new boolean[values.length]; boolean[] passable = new boolean[values.length];
for (int i = 0; i < values.length; i++) { for (int ii = 0; ii < values.length; ii++) {
passable[i] = (values[i] != 0); passable[ii] = (values[ii] != 0);
} }
BaseTileSet starget = (BaseTileSet)target; BaseTileSet starget = (BaseTileSet)target;
starget.setPassability(passable); starget.setPassability(passable);
@@ -94,11 +94,11 @@ public class DirectionUtil implements DirectionCodes
public static String toString (int[] directions) public static String toString (int[] directions)
{ {
StringBuilder buf = new StringBuilder("{"); StringBuilder buf = new StringBuilder("{");
for (int i = 0; i < directions.length; i++) { for (int ii = 0; ii < directions.length; ii++) {
if (i > 0) { if (ii > 0) {
buf.append(", "); buf.append(", ");
} }
buf.append(toShortString(directions[i])); buf.append(toShortString(directions[ii]));
} }
return buf.append("}").toString(); return buf.append("}").toString();
} }