change parameter order to be more consistent

This commit is contained in:
Hannes Janetzek 2014-01-31 02:03:48 +01:00
parent 67d1813665
commit c5de7d6051
8 changed files with 34 additions and 34 deletions

View File

@ -86,7 +86,7 @@ class TextRenderer extends ElementRenderer {
setMatrix(pos, m, false); setMatrix(pos, m, false);
for (RenderElement l = layers.getTextureLayers(); l != null;) for (RenderElement l = layers.getTextureLayers(); l != null;)
l = TextureLayer.Renderer.draw(l, scale, m); l = TextureLayer.Renderer.draw(l, m, scale);
} }
} }

View File

@ -94,19 +94,19 @@ public abstract class ElementRenderer extends LayerRenderer {
while (l != null) { while (l != null) {
if (l.type == POLYGON) { if (l.type == POLYGON) {
l = PolygonLayer.Renderer.draw(pos, l, m, true, 1, 0); l = PolygonLayer.Renderer.draw(l, m, pos, 1, true, 0);
continue; continue;
} }
if (l.type == LINE) { if (l.type == LINE) {
l = LineLayer.Renderer.draw(layers, l, pos, m, div); l = LineLayer.Renderer.draw(l, m, pos, div, layers);
continue; continue;
} }
if (l.type == TEXLINE) { if (l.type == TEXLINE) {
l = LineTexLayer.Renderer.draw(layers, l, pos, m, div); l = LineTexLayer.Renderer.draw(l, m, pos, div, layers);
continue; continue;
} }
if (l.type == MESH) { if (l.type == MESH) {
l = MeshLayer.Renderer.draw(pos, l, m); l = MeshLayer.Renderer.draw(l, m, pos);
continue; continue;
} }
log.debug("invalid layer {}", l.type); log.debug("invalid layer {}", l.type);
@ -122,7 +122,7 @@ public abstract class ElementRenderer extends LayerRenderer {
continue; continue;
} }
if (l.type == SYMBOL) { if (l.type == SYMBOL) {
l = TextureLayer.Renderer.draw(l, 1 / div, m); l = TextureLayer.Renderer.draw(l, m, 1 / div);
continue; continue;
} }
log.debug("invalid layer {}", l.type); log.debug("invalid layer {}", l.type);

View File

@ -628,8 +628,8 @@ public final class LineLayer extends RenderElement {
return true; return true;
} }
public static RenderElement draw(ElementLayers layers, RenderElement curLayer, public static RenderElement draw(RenderElement curLayer, Matrices m,
MapPosition pos, Matrices m, float scale) { MapPosition pos, float scale, ElementLayers layers) {
if (curLayer == null) if (curLayer == null)
return null; return null;

View File

@ -329,8 +329,8 @@ public final class LineTexLayer extends RenderElement {
private final static int STRIDE = 12; private final static int STRIDE = 12;
private final static int LEN_OFFSET = 8; private final static int LEN_OFFSET = 8;
public static RenderElement draw(ElementLayers layers, RenderElement curLayer, public static RenderElement draw(RenderElement curLayer, Matrices m,
MapPosition pos, Matrices m, float div) { MapPosition pos, float div, ElementLayers layers) {
// shader failed to compile // shader failed to compile
if (shader == 0) if (shader == 0)

View File

@ -119,8 +119,8 @@ public class MeshLayer extends RenderElement {
return true; return true;
} }
public static RenderElement draw(MapPosition pos, RenderElement l, public static RenderElement draw(RenderElement l, Matrices m,
Matrices m) { MapPosition pos) {
GLState.blend(true); GLState.blend(true);

View File

@ -261,25 +261,25 @@ public final class PolygonLayer extends RenderElement {
/** /**
* draw polygon layers (unil layer.next is not polygon layer) * draw polygon layers (unil layer.next is not polygon layer)
* using stencil buffer method * using stencil buffer method
*
* @param pos
* used to fade layers accorind to 'fade'
* in layer.area.
* @param renderElement * @param renderElement
* layer to draw (referencing vertices in current vbo) * layer to draw (referencing vertices in current vbo)
* @param m * @param m
* current Matrices * current Matrices
* @param first * @param pos
* pass true to clear stencil buffer region * used to fade layers according to 'fade' in
* layer.area style
* @param div * @param div
* scale relative to 'base scale' of the tile * scale relative to 'base scale' of the tile
* @param clip * @param first
* pass true to clear stencil buffer region
* @param clipMode
* clip to first quad in current vbo * clip to first quad in current vbo
*
* @return * @return
* next layer * next layer
*/ */
public static RenderElement draw(MapPosition pos, RenderElement renderElement, public static RenderElement draw(RenderElement renderElement, Matrices m,
Matrices m, boolean first, float div, int clip) { MapPosition pos, float div, boolean first, int clipMode) {
GLState.test(false, true); GLState.test(false, true);
@ -305,7 +305,7 @@ public final class PolygonLayer extends RenderElement {
continue; continue;
if (cur == start) { if (cur == start) {
drawStencilRegion(first, clip); drawStencilRegion(first, clipMode);
first = false; first = false;
// op for stencil method polygon drawing // op for stencil method polygon drawing
@ -329,9 +329,9 @@ public final class PolygonLayer extends RenderElement {
if (cur > 0) if (cur > 0)
fillPolygons(m, start, cur, zoom, scale, div); fillPolygons(m, start, cur, zoom, scale, div);
if (clip > 0) { if (clipMode > 0) {
if (first) { if (first) {
drawStencilRegion(first, clip); drawStencilRegion(first, clipMode);
// disable writes to stencil buffer // disable writes to stencil buffer
GL.glStencilMask(0x00); GL.glStencilMask(0x00);
// enable writes to color buffer // enable writes to color buffer
@ -364,7 +364,7 @@ public final class PolygonLayer extends RenderElement {
* @param first in the first run the clip region is set based on * @param first in the first run the clip region is set based on
* depth buffer and depth buffer is updated * depth buffer and depth buffer is updated
*/ */
static void drawStencilRegion(boolean first, int mode) { static void drawStencilRegion(boolean first, int clipMode) {
// disable drawing to color buffer // disable drawing to color buffer
GL.glColorMask(false, false, false, false); GL.glColorMask(false, false, false, false);
@ -382,7 +382,7 @@ public final class PolygonLayer extends RenderElement {
// with depth test (GL_LESS) this ensures to only // with depth test (GL_LESS) this ensures to only
// draw where no other tile has drawn yet. // draw where no other tile has drawn yet.
//GL.glEnable(GL20.GL_POLYGON_OFFSET_FILL); //GL.glEnable(GL20.GL_POLYGON_OFFSET_FILL);
if (mode > 1) { if (clipMode > 1) {
// test GL_LESS and write to depth buffer // test GL_LESS and write to depth buffer
GLState.test(true, true); GLState.test(true, true);
GL.glDepthMask(true); GL.glDepthMask(true);
@ -403,7 +403,7 @@ public final class PolygonLayer extends RenderElement {
GL.glDrawArrays(GL20.GL_TRIANGLE_STRIP, 0, 4); GL.glDrawArrays(GL20.GL_TRIANGLE_STRIP, 0, 4);
if (first) { if (first) {
if (mode > 1) { if (clipMode > 1) {
// dont modify depth buffer // dont modify depth buffer
GL.glDepthMask(false); GL.glDepthMask(false);
// test only stencil // test only stencil

View File

@ -140,7 +140,7 @@ public abstract class TextureLayer extends RenderElement {
pool.init(0); pool.init(0);
} }
public static RenderElement draw(RenderElement l, float scale, Matrices m) { public static RenderElement draw(RenderElement l, Matrices m, float scale) {
GLState.test(false, false); GLState.test(false, false);
GLState.blend(true); GLState.blend(true);

View File

@ -473,25 +473,25 @@ public class TileRenderer extends LayerRenderer {
while (l != null) { while (l != null) {
if (l.type == POLYGON) { if (l.type == POLYGON) {
l = PolygonLayer.Renderer.draw(pos, l, m, !clipped, div, mode); l = PolygonLayer.Renderer.draw(l, m, pos, div, !clipped, mode);
clipped = true; clipped = true;
continue; continue;
} }
if (!clipped) { if (!clipped) {
// draw stencil buffer clip region // draw stencil buffer clip region
PolygonLayer.Renderer.draw(pos, null, m, true, div, mode); PolygonLayer.Renderer.draw(null, m, pos, div, true, mode);
clipped = true; clipped = true;
} }
if (l.type == LINE) { if (l.type == LINE) {
l = LineLayer.Renderer.draw(t.layers, l, pos, m, scale); l = LineLayer.Renderer.draw(l, m, pos, scale, t.layers);
continue; continue;
} }
if (l.type == TEXLINE) { if (l.type == TEXLINE) {
l = LineTexLayer.Renderer.draw(t.layers, l, pos, m, div); l = LineTexLayer.Renderer.draw(l, m, pos, div, t.layers);
continue; continue;
} }
if (l.type == MESH) { if (l.type == MESH) {
l = MeshLayer.Renderer.draw(pos, l, m); l = MeshLayer.Renderer.draw(l, m, pos);
continue; continue;
} }
// just in case // just in case
@ -501,7 +501,7 @@ public class TileRenderer extends LayerRenderer {
l = t.layers.getTextureLayers(); l = t.layers.getTextureLayers();
while (l != null) { while (l != null) {
if (!clipped) { if (!clipped) {
PolygonLayer.Renderer.draw(pos, null, m, true, div, mode); PolygonLayer.Renderer.draw(null, m, pos, div, true, mode);
clipped = true; clipped = true;
} }
if (l.type == BITMAP) { if (l.type == BITMAP) {