rename Tile.TILE_SIZE to Tile.SIZE, while I'm at refactoring
This commit is contained in:
@@ -190,7 +190,7 @@ public class GLRenderer implements GLSurfaceView.Renderer {
|
||||
|
||||
// tile fill coords
|
||||
short min = 0;
|
||||
short max = (short) ((Tile.TILE_SIZE * COORD_SCALE));
|
||||
short max = (short) ((Tile.SIZE * COORD_SCALE));
|
||||
mFillCoords = new short[8];
|
||||
mFillCoords[0] = min;
|
||||
mFillCoords[1] = max;
|
||||
@@ -318,8 +318,8 @@ public class GLRenderer implements GLSurfaceView.Renderer {
|
||||
|
||||
int z = tiles[0].zoomLevel;
|
||||
|
||||
double curScale = Tile.TILE_SIZE * pos.scale;
|
||||
double tileScale = Tile.TILE_SIZE * (pos.scale / (1 << z));
|
||||
double curScale = Tile.SIZE * pos.scale;
|
||||
double tileScale = Tile.SIZE * (pos.scale / (1 << z));
|
||||
|
||||
for (int i = 0; i < 8; i += 2) {
|
||||
coords[i + 0] = (float) ((pos.x * curScale + coords[i + 0]) / tileScale);
|
||||
@@ -622,8 +622,8 @@ public class GLRenderer implements GLSurfaceView.Renderer {
|
||||
mBufferMemoryUsage = 0;
|
||||
mDrawTiles = null;
|
||||
|
||||
int numTiles = (screenWidth / (Tile.TILE_SIZE / 2) + 2)
|
||||
* (screenHeight / (Tile.TILE_SIZE / 2) + 2);
|
||||
int numTiles = (screenWidth / (Tile.SIZE / 2) + 2)
|
||||
* (screenHeight / (Tile.SIZE / 2) + 2);
|
||||
|
||||
// Set up vertex buffer objects
|
||||
int numVBO = (CACHE_TILES + (numTiles * 2));
|
||||
|
||||
@@ -135,7 +135,7 @@ public class TileManager {
|
||||
|
||||
// set up TileSet large enough to hold current tiles
|
||||
int num = Math.max(width, height);
|
||||
int size = Tile.TILE_SIZE >> 1;
|
||||
int size = Tile.SIZE >> 1;
|
||||
int numTiles = (num * num) / (size * size) * 4;
|
||||
mNewTiles = new TileSet(numTiles);
|
||||
mCurrentTiles = new TileSet(numTiles);
|
||||
@@ -166,7 +166,7 @@ public class TileManager {
|
||||
// scale and translate projection to tile coordinates
|
||||
// load some tiles more than currently visible (* 0.75)
|
||||
// float scale = mapPosition.scale * 0.75f;
|
||||
// float tileScale = scale * Tile.TILE_SIZE;
|
||||
// float tileScale = scale * Tile.SIZE;
|
||||
// double px = mapPosition.x * scale;
|
||||
// double py = mapPosition.y * scale;
|
||||
//
|
||||
@@ -180,10 +180,10 @@ public class TileManager {
|
||||
// scale and translate projection to tile coordinates
|
||||
// load some tiles more than currently visible (* 0.75)
|
||||
double scale = pos.scale * 0.75f;
|
||||
double curScale = Tile.TILE_SIZE * scale;
|
||||
double curScale = Tile.SIZE * scale;
|
||||
int zoomLevel = FastMath.clamp(pos.zoomLevel, MIN_ZOOMLEVEL, MAX_ZOOMLEVEL);
|
||||
|
||||
double tileScale = Tile.TILE_SIZE * (scale / (1 << zoomLevel));
|
||||
double tileScale = Tile.SIZE * (scale / (1 << zoomLevel));
|
||||
|
||||
float[] coords = mTileCoords;
|
||||
mMapViewPosition.getMapViewProjection(coords);
|
||||
|
||||
@@ -125,7 +125,7 @@ public class TileRenderer {
|
||||
|
||||
float div = FastMath.pow(z - pos.zoomLevel);
|
||||
|
||||
double curScale = Tile.TILE_SIZE * pos.scale;
|
||||
double curScale = Tile.SIZE * pos.scale;
|
||||
double scale = (pos.scale / (1 << z));
|
||||
|
||||
float x = (float) ((tile.x - pos.x) * curScale);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ExtrusionLayer extends Layer {
|
||||
for (int i = 0; i < 4; i++)
|
||||
mIndices[i] = mCurIndices[i] = VertexPool.get();
|
||||
|
||||
mClipper = new LineClipper(0, 0, Tile.TILE_SIZE, Tile.TILE_SIZE);
|
||||
mClipper = new LineClipper(0, 0, Tile.SIZE, Tile.SIZE);
|
||||
}
|
||||
|
||||
public void addBuildings(WayData way) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public final class LineLayer extends Layer {
|
||||
float x, y, nextX, nextY;
|
||||
float a, ux, uy, vx, vy, wx, wy;
|
||||
|
||||
int tmax = Tile.TILE_SIZE + 4;
|
||||
int tmax = Tile.SIZE + 4;
|
||||
int tmin = -4;
|
||||
|
||||
boolean rounded = false;
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class PolygonLayer extends Layer {
|
||||
}
|
||||
|
||||
public void addPolygon(float[] points, short[] index) {
|
||||
short center = (short) ((Tile.TILE_SIZE >> 1) * S);
|
||||
short center = (short) ((Tile.SIZE >> 1) * S);
|
||||
|
||||
VertexPoolItem si = curItem;
|
||||
short[] v = si.vertices;
|
||||
|
||||
@@ -326,7 +326,7 @@ public class ExtrusionOverlay extends RenderOverlay {
|
||||
MapTile tile, int delta) {
|
||||
|
||||
int z = tile.zoomLevel;
|
||||
double curScale = Tile.TILE_SIZE * pos.scale;
|
||||
double curScale = Tile.SIZE * pos.scale;
|
||||
float scale = (float)(pos.scale / (1 << z));
|
||||
|
||||
float x = (float) ((tile.x - pos.x) * curScale);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class GridOverlay extends BasicOverlay {
|
||||
public GridOverlay(MapView mapView) {
|
||||
super(mapView);
|
||||
|
||||
int size = Tile.TILE_SIZE;
|
||||
int size = Tile.SIZE;
|
||||
float[] points = new float[64];
|
||||
short[] index = new short[16];
|
||||
|
||||
@@ -71,7 +71,7 @@ public class GridOverlay extends BasicOverlay {
|
||||
}
|
||||
|
||||
private void addLabels(int x, int y, int z) {
|
||||
int size = Tile.TILE_SIZE;
|
||||
int size = Tile.SIZE;
|
||||
|
||||
TextLayer tl = new TextLayer();
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class RenderOverlay {
|
||||
protected void setMatrix(MapPosition curPos, Matrices m, boolean project) {
|
||||
MapPosition oPos = mMapPosition;
|
||||
|
||||
double tileScale = Tile.TILE_SIZE * curPos.scale;
|
||||
double tileScale = Tile.SIZE * curPos.scale;
|
||||
|
||||
double x = oPos.x - curPos.x;
|
||||
double y = oPos.y - curPos.y;
|
||||
|
||||
@@ -113,8 +113,8 @@ public class TestOverlay extends BasicOverlay {
|
||||
// TextItem ti = new TextItem(0, 0, "check one, check two", t);
|
||||
// ti.x1 = 0;
|
||||
// ti.y1 = 0;
|
||||
// ti.x2 = (short) Tile.TILE_SIZE;
|
||||
// ti.y2 = (short) Tile.TILE_SIZE;
|
||||
// ti.x2 = (short) Tile.SIZE;
|
||||
// ti.y2 = (short) Tile.SIZE;
|
||||
//
|
||||
// tl.addText(ti);
|
||||
//
|
||||
|
||||
@@ -306,8 +306,8 @@ public class TextOverlay extends BasicOverlay {
|
||||
mMapViewPosition.getMapViewProjection(coords);
|
||||
//mMapViewPosition.getMatrix(null, null, mMVP);
|
||||
}
|
||||
int mw = (mMapView.getWidth() + Tile.TILE_SIZE) / 2;
|
||||
int mh = (mMapView.getHeight() + Tile.TILE_SIZE) / 2;
|
||||
int mw = (mMapView.getWidth() + Tile.SIZE) / 2;
|
||||
int mh = (mMapView.getHeight() + Tile.SIZE) / 2;
|
||||
mSquareRadius = mw * mw + mh * mh;
|
||||
|
||||
// mTiles might be from another zoomlevel than the current:
|
||||
@@ -328,7 +328,7 @@ public class TextOverlay extends BasicOverlay {
|
||||
float cos = (float) Math.cos(angle);
|
||||
float sin = (float) Math.sin(angle);
|
||||
|
||||
int maxx = Tile.TILE_SIZE << (pos.zoomLevel - 1);
|
||||
int maxx = Tile.SIZE << (pos.zoomLevel - 1);
|
||||
|
||||
Label l = null;
|
||||
|
||||
@@ -337,8 +337,8 @@ public class TextOverlay extends BasicOverlay {
|
||||
|
||||
mRelabelCnt++;
|
||||
|
||||
double tileX = (pos.x * (Tile.TILE_SIZE << pos.zoomLevel));
|
||||
double tileY = (pos.y * (Tile.TILE_SIZE << pos.zoomLevel));
|
||||
double tileX = (pos.x * (Tile.SIZE << pos.zoomLevel));
|
||||
double tileY = (pos.y * (Tile.SIZE << pos.zoomLevel));
|
||||
|
||||
for (l = mPrevLabels; l != null;) {
|
||||
|
||||
@@ -355,8 +355,8 @@ public class TextOverlay extends BasicOverlay {
|
||||
continue;
|
||||
}
|
||||
|
||||
float dx = (float) (l.tile.tileX * Tile.TILE_SIZE - tileX * s);
|
||||
float dy = (float) (l.tile.tileY * Tile.TILE_SIZE - tileY * s);
|
||||
float dx = (float) (l.tile.tileX * Tile.SIZE - tileX * s);
|
||||
float dy = (float) (l.tile.tileY * Tile.SIZE - tileY * s);
|
||||
|
||||
// flip around date-line
|
||||
if (dx > maxx)
|
||||
@@ -412,8 +412,8 @@ public class TextOverlay extends BasicOverlay {
|
||||
if (t.state != JobTile.STATE_READY)
|
||||
continue;
|
||||
|
||||
float dx = (float) (t.tileX * Tile.TILE_SIZE - tileX);
|
||||
float dy = (float) (t.tileY * Tile.TILE_SIZE - tileY);
|
||||
float dx = (float) (t.tileX * Tile.SIZE - tileX);
|
||||
float dy = (float) (t.tileY * Tile.SIZE - tileY);
|
||||
|
||||
// flip around date-line
|
||||
if (dx > maxx)
|
||||
@@ -479,8 +479,8 @@ public class TextOverlay extends BasicOverlay {
|
||||
if (t.state != JobTile.STATE_READY)
|
||||
continue;
|
||||
|
||||
float dx = (float) (t.tileX * Tile.TILE_SIZE - tileX);
|
||||
float dy = (float) (t.tileY * Tile.TILE_SIZE - tileY);
|
||||
float dx = (float) (t.tileX * Tile.SIZE - tileX);
|
||||
float dy = (float) (t.tileY * Tile.SIZE - tileY);
|
||||
|
||||
// flip around date-line
|
||||
if (dx > maxx)
|
||||
@@ -726,7 +726,7 @@ public class TextOverlay extends BasicOverlay {
|
||||
protected void setMatrix(MapPosition curPos, Matrices m) {
|
||||
MapPosition oPos = mMapPosition;
|
||||
|
||||
double tileScale = Tile.TILE_SIZE * curPos.scale;
|
||||
double tileScale = Tile.SIZE * curPos.scale;
|
||||
double scale = (curPos.scale / oPos.scale);
|
||||
|
||||
float x = (float) ((oPos.x - curPos.x) * tileScale);
|
||||
|
||||
Reference in New Issue
Block a user