This commit is contained in:
Hannes Janetzek 2013-06-17 05:35:45 +02:00
parent 05dc5cc4a5
commit 7fc6ab209a

View File

@ -85,6 +85,7 @@ public class Layers {
public LineLayer getLineLayer(int level) { public LineLayer getLineLayer(int level) {
return (LineLayer) getLayer(level, Layer.LINE); return (LineLayer) getLayer(level, Layer.LINE);
} }
/** /**
* Get or add the PolygonLayer for a level. Levels are ordered from * Get or add the PolygonLayer for a level. Levels are ordered from
* bottom (0) to top * bottom (0) to top
@ -93,6 +94,7 @@ public class Layers {
public PolygonLayer getPolygonLayer(int level) { public PolygonLayer getPolygonLayer(int level) {
return (PolygonLayer) getLayer(level, Layer.POLYGON); return (PolygonLayer) getLayer(level, Layer.POLYGON);
} }
/** /**
* Get or add the TexLineLayer for a level. Levels are ordered from * Get or add the TexLineLayer for a level. Levels are ordered from
* bottom (0) to top * bottom (0) to top
@ -160,7 +162,8 @@ public class Layers {
if (layer.type != type) { if (layer.type != type) {
// check if found layer matches requested type // check if found layer matches requested type
Log.d(TAG, "BUG wrong layer " + layer.type + " " + type); Log.d(TAG, "BUG wrong layer " + layer.type + " " + type +
" on layer " + layer.level);
// TODO throw exception // TODO throw exception
return null; return null;
} }
@ -288,22 +291,20 @@ public class Layers {
public void clear() { public void clear() {
// clear line and polygon layers directly // clear line and polygon layers directly
Layer l = baseLayers; for (Layer l = baseLayers; l != null; l = l.next) {
while (l != null) {
if (l.vertexItems != null) { if (l.vertexItems != null) {
VertexItem.pool.releaseAll(l.vertexItems); VertexItem.pool.releaseAll(l.vertexItems);
l.vertexItems = null; l.vertexItems = null;
l.curItem = null; l.curItem = null;
} }
l.verticesCnt = 0; l.verticesCnt = 0;
l = l.next;
} }
for (l = textureLayers; l != null; l = l.next) { for (Layer l = textureLayers; l != null; l = l.next) {
l.clear(); l.clear();
} }
for (l = extrusionLayers; l != null; l = l.next) { for (Layer l = extrusionLayers; l != null; l = l.next) {
l.clear(); l.clear();
} }
baseLayers = null; baseLayers = null;