add base layer 'faded' option for MapLens

This commit is contained in:
Hannes Janetzek 2013-04-23 22:39:41 +02:00
parent 54035374bd
commit b92d939dfb
2 changed files with 19 additions and 9 deletions

View File

@ -37,6 +37,12 @@ public class TileRenderLayer extends RenderOverlay {
mBoxCoords = new float[8];
}
boolean mFaded;
public void setFaded(boolean faded){
mFaded = faded;
}
@Override
public void update(MapPosition curPos, boolean positionChanged, boolean tilesChanged,
Matrices matrices) {
@ -81,7 +87,7 @@ public class TileRenderLayer extends RenderOverlay {
tilesChanged |= (uploadCnt > 0);
TileRenderer.draw(tiles, tileCnt, curPos, matrices);
TileRenderer.draw(tiles, tileCnt, curPos, matrices, mFaded);
}
@Override

View File

@ -50,12 +50,14 @@ public class TileRenderer {
private static int mDrawSerial = 0;
private static Matrices mMatrices;
private static boolean mFaded;
private static final Matrix4 mProjMatrix = new Matrix4();
static void draw(MapTile[] tiles, int tileCnt, MapPosition pos, Matrices m) {
static void draw(MapTile[] tiles, int tileCnt, MapPosition pos, Matrices m, boolean fade) {
mDrawCnt = 0;
mMatrices = m;
mFaded = fade;
mProjMatrix.copy(m.viewproj);
// discard z projection from tilt
@ -108,7 +110,6 @@ public class TileRenderer {
mMatrices = null;
}
private static void drawTile(MapTile tile, MapPosition pos) {
// draw parents only once
if (tile.lastDraw == mDrawSerial)
@ -185,7 +186,9 @@ public class TileRenderer {
}
// clear clip-region and could also draw 'fade-effect'
//PolygonRenderer.drawOver(m, true, 0x22000000);
if (mFaded)
PolygonRenderer.drawOver(m, true, 0x22000000);
else
PolygonRenderer.drawOver(m, false, 0);
}
@ -206,7 +209,8 @@ public class TileRenderer {
}
// just FIXME!
private static void drawProxyTile(MapTile tile, MapPosition pos, boolean parent, boolean preferParent) {
private static void drawProxyTile(MapTile tile, MapPosition pos, boolean parent,
boolean preferParent) {
QuadTree<MapTile> r = tile.rel;
MapTile proxy;