add base layer 'faded' option for MapLens
This commit is contained in:
parent
54035374bd
commit
b92d939dfb
@ -37,6 +37,12 @@ public class TileRenderLayer extends RenderOverlay {
|
|||||||
mBoxCoords = new float[8];
|
mBoxCoords = new float[8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean mFaded;
|
||||||
|
|
||||||
|
public void setFaded(boolean faded){
|
||||||
|
mFaded = faded;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(MapPosition curPos, boolean positionChanged, boolean tilesChanged,
|
public void update(MapPosition curPos, boolean positionChanged, boolean tilesChanged,
|
||||||
Matrices matrices) {
|
Matrices matrices) {
|
||||||
@ -81,7 +87,7 @@ public class TileRenderLayer extends RenderOverlay {
|
|||||||
|
|
||||||
tilesChanged |= (uploadCnt > 0);
|
tilesChanged |= (uploadCnt > 0);
|
||||||
|
|
||||||
TileRenderer.draw(tiles, tileCnt, curPos, matrices);
|
TileRenderer.draw(tiles, tileCnt, curPos, matrices, mFaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -50,12 +50,14 @@ public class TileRenderer {
|
|||||||
private static int mDrawSerial = 0;
|
private static int mDrawSerial = 0;
|
||||||
|
|
||||||
private static Matrices mMatrices;
|
private static Matrices mMatrices;
|
||||||
|
private static boolean mFaded;
|
||||||
|
|
||||||
private static final Matrix4 mProjMatrix = new Matrix4();
|
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;
|
mDrawCnt = 0;
|
||||||
mMatrices = m;
|
mMatrices = m;
|
||||||
|
mFaded = fade;
|
||||||
|
|
||||||
mProjMatrix.copy(m.viewproj);
|
mProjMatrix.copy(m.viewproj);
|
||||||
// discard z projection from tilt
|
// discard z projection from tilt
|
||||||
@ -108,7 +110,6 @@ public class TileRenderer {
|
|||||||
mMatrices = null;
|
mMatrices = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void drawTile(MapTile tile, MapPosition pos) {
|
private static void drawTile(MapTile tile, MapPosition pos) {
|
||||||
// draw parents only once
|
// draw parents only once
|
||||||
if (tile.lastDraw == mDrawSerial)
|
if (tile.lastDraw == mDrawSerial)
|
||||||
@ -185,7 +186,9 @@ public class TileRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clear clip-region and could also draw 'fade-effect'
|
// 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);
|
PolygonRenderer.drawOver(m, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +209,8 @@ public class TileRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// just FIXME!
|
// 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;
|
QuadTree<MapTile> r = tile.rel;
|
||||||
MapTile proxy;
|
MapTile proxy;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user