Symbol rotation #294 improvements

This commit is contained in:
Emux
2017-02-27 20:18:31 +02:00
parent 981536595f
commit f7e5544238
9 changed files with 78 additions and 291 deletions

View File

@@ -2,6 +2,7 @@
* Copyright 2013 Hannes Janetzek
* Copyright 2016 Izumi Kawashima
* Copyright 2017 Longri
* Copyright 2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -164,12 +165,11 @@ public class MarkerRenderer extends BucketRenderer {
SymbolItem s = SymbolItem.pool.get();
if (marker.isBitmap()) {
s.set(it.x, it.y, marker.getBitmap(), marker.rotation, true);
s.set(it.x, it.y, marker.getBitmap(), marker.rotation, marker.isBillboard());
} else {
s.set(it.x, it.y, marker.getTextureRegion(), marker.rotation, true);
s.set(it.x, it.y, marker.getTextureRegion(), marker.rotation, marker.isBillboard());
}
s.offset = marker.getHotspot();
s.billboard = marker.isBillboard();
mSymbolLayer.pushSymbol(s);
}

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2012 Hannes Janetzek
* Copyright 2017 Longri
* Copyright 2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -52,30 +53,27 @@ public class SymbolItem extends Inlist<SymbolItem> {
public PointF offset;
public float rotation;
public void set(float x, float y, TextureRegion texture, float rotation, boolean billboard) {
set(x, y, texture, billboard);
this.rotation = rotation;
public void set(float x, float y, TextureRegion texture, boolean billboard) {
set(x, y, texture, 0, billboard);
}
public void set(float x, float y, TextureRegion texture, boolean billboard) {
public void set(float x, float y, TextureRegion texture, float rotation, boolean billboard) {
this.x = x;
this.y = y;
this.texRegion = texture;
this.billboard = billboard;
this.rotation = 0;
}
public void set(float x, float y, Bitmap bitmap, float rotation, boolean billboard) {
set(x, y, bitmap, billboard);
this.rotation = rotation;
this.billboard = billboard;
}
public void set(float x, float y, Bitmap bitmap, boolean billboard) {
set(x, y, bitmap, 0, billboard);
}
public void set(float x, float y, Bitmap bitmap, float rotation, boolean billboard) {
this.x = x;
this.y = y;
this.bitmap = bitmap;
this.rotation = rotation;
this.billboard = billboard;
this.rotation = 0;
}
}