move depthOffset(Tile) to MapTile

This commit is contained in:
Hannes Janetzek 2014-03-20 04:22:51 +01:00
parent ea711aea77
commit 27750ac11e
3 changed files with 6 additions and 7 deletions

View File

@ -266,4 +266,8 @@ public class MapTile extends Tile {
data = td;
}
}
public static int depthOffset(MapTile t) {
return ((t.tileX % 4) + (t.tileY % 4 * 4) + 1);
}
}

View File

@ -255,7 +255,7 @@ public class ExtrusionRenderer extends LayerRenderer {
for (int i = 0; i < mTileCnt; i++) {
MapTile t = tiles[i];
ExtrusionLayer el = t.getLayers().getExtrusionLayers();
int d = MapRenderer.depthOffset(t) * 10;
int d = MapTile.depthOffset(t) * 10;
setMatrix(v, t, d);
v.mvp.setAsUniform(uExtMatrix);
@ -291,7 +291,7 @@ public class ExtrusionRenderer extends LayerRenderer {
}
GL.glDepthFunc(GL20.GL_EQUAL);
int d = MapRenderer.depthOffset(t) * 10;
int d = MapTile.depthOffset(t) * 10;
setMatrix(v, t, d);
v.mvp.setAsUniform(uExtMatrix);

View File

@ -25,7 +25,6 @@ import java.nio.ShortBuffer;
import org.oscim.backend.GL20;
import org.oscim.backend.GLAdapter;
import org.oscim.backend.canvas.Color;
import org.oscim.layers.tile.MapTile;
import org.oscim.map.Map;
import org.oscim.renderer.elements.ElementLayers;
import org.oscim.utils.pool.Inlist;
@ -240,10 +239,6 @@ public class MapRenderer {
}
}
public static int depthOffset(MapTile t) {
return ((t.tileX % 4) + (t.tileY % 4 * 4) + 1);
}
public void onSurfaceChanged(int width, int height) {
log.debug("onSurfaceChanged: new={}, {}x{}",
mNewSurface, width, height);