cleanup comments

This commit is contained in:
Hannes Janetzek 2014-05-26 20:07:43 +02:00
parent 225613ec28
commit 6eeb21623b

View File

@ -44,13 +44,12 @@ public class GridRenderer extends ElementRenderer {
public GridRenderer(int numLines, LineStyle lineStyle, TextStyle textStyle) { public GridRenderer(int numLines, LineStyle lineStyle, TextStyle textStyle) {
int size = Tile.SIZE; int size = Tile.SIZE;
// not needed to set but we know: /* not needed to set but we know: 16 lines 'a' two points */
// 16 lines 'a' two points
mLines = new GeometryBuffer(2 * 16, 16); mLines = new GeometryBuffer(2 * 16, 16);
float pos = -size * 4; float pos = -size * 4;
// 8 vertical lines /* 8 vertical lines */
for (int i = 0; i < 8 * numLines; i++) { for (int i = 0; i < 8 * numLines; i++) {
float x = pos + i * size / numLines; float x = pos + i * size / numLines;
mLines.startLine(); mLines.startLine();
@ -58,7 +57,7 @@ public class GridRenderer extends ElementRenderer {
mLines.addPoint(x, pos + size * 8); mLines.addPoint(x, pos + size * 8);
} }
// 8 horizontal lines /* 8 horizontal lines */
for (int j = 0; j < 8 * numLines; j++) { for (int j = 0; j < 8 * numLines; j++) {
float y = pos + j * size / numLines; float y = pos + j * size / numLines;
mLines.startLine(); mLines.startLine();
@ -100,28 +99,26 @@ public class GridRenderer extends ElementRenderer {
TextItem ti = TextItem.pool.get(); TextItem ti = TextItem.pool.get();
ti.set(s * xx + s / 2, s * yy + s / 2, sb.toString(), mText); ti.set(s * xx + s / 2, s * yy + s / 2, sb.toString(), mText);
tl.addText(ti); tl.addText(ti);
} }
} }
// render TextItems to a bitmap and prepare vertex buffer data. /* render TextItems to a bitmap and prepare vertex buffer data. */
tl.prepare(); tl.prepare();
// release TextItems /* release TextItems */
tl.clearLabels(); tl.clearLabels();
} }
@Override @Override
protected void update(GLViewport v) { protected void update(GLViewport v) {
/* scale coordinates relative to current 'zoom-level' to
// scale coordinates relative to current 'zoom-level' to * get the position as the nearest tile coordinate */
// get the position as the nearest tile coordinate
int z = 1 << v.pos.zoomLevel; int z = 1 << v.pos.zoomLevel;
int x = (int) (v.pos.x * z); int x = (int) (v.pos.x * z);
int y = (int) (v.pos.y * z); int y = (int) (v.pos.y * z);
// update layers when map moved by at least one tile /* update layers when map moved by at least one tile */
if (x == mCurX && y == mCurY && z == mCurZ) if (x == mCurX && y == mCurY && z == mCurZ)
return; return;