use half the textures, take from non-visible tiles when needed

This commit is contained in:
Hannes Janetzek 2012-08-28 09:39:17 +02:00
parent 2fccf0f214
commit 14fe4a6892
2 changed files with 11 additions and 3 deletions

View File

@ -345,8 +345,6 @@ public class MapRenderer implements org.mapsforge.android.IMapRenderer {
// Log.d(TAG, "--------------------------------<<");
}
private Object lock = new Object();
private boolean updateVisibleList(double x, double y, int zdir) {
byte zoomLevel = mLastZoom;
float scale = mLastScale;
@ -1144,7 +1142,7 @@ public class MapRenderer implements org.mapsforge.android.IMapRenderer {
mVBOs.add(new VertexBufferObject(mVboIds[i]));
// Set up textures
TextRenderer.init(numTiles * 2);
TextRenderer.init(numTiles);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GLES20.GL_DEPTH_TEST);

View File

@ -188,6 +188,16 @@ public class TextRenderer {
tex = null;
}
if (tex == null) {
for (int i = 0; i < mTextures.length; i++) {
tex = mTextures[i];
if (!tex.tile.isVisible)
break;
tex = null;
}
}
if (tex == null) {
Log.d(TAG, "no textures left");
return false;