Update changelog
This commit is contained in:
parent
f67c457006
commit
945b84f04f
@ -10,6 +10,7 @@
|
|||||||
- SVG resources scaling in themes [#214](https://github.com/mapsforge/vtm/issues/214)
|
- SVG resources scaling in themes [#214](https://github.com/mapsforge/vtm/issues/214)
|
||||||
- Circle map style [#122](https://github.com/mapsforge/vtm/issues/122)
|
- Circle map style [#122](https://github.com/mapsforge/vtm/issues/122)
|
||||||
- Oneway arrows in themes [#275](https://github.com/mapsforge/vtm/issues/275)
|
- Oneway arrows in themes [#275](https://github.com/mapsforge/vtm/issues/275)
|
||||||
|
- Texture atlas from bitmaps [#283](https://github.com/mapsforge/vtm/pull/283)
|
||||||
- PathLayer (vtm) fix disappearing segments [#108](https://github.com/mapsforge/vtm/issues/108)
|
- PathLayer (vtm) fix disappearing segments [#108](https://github.com/mapsforge/vtm/issues/108)
|
||||||
- House numbers (nodes) fix visibility [#168](https://github.com/mapsforge/vtm/issues/168)
|
- House numbers (nodes) fix visibility [#168](https://github.com/mapsforge/vtm/issues/168)
|
||||||
- Android fix quick scale vs long press [#250](https://github.com/mapsforge/vtm/issues/250)
|
- Android fix quick scale vs long press [#250](https://github.com/mapsforge/vtm/issues/250)
|
||||||
@ -21,7 +22,7 @@
|
|||||||
- Internal render themes new SVG resources [#251](https://github.com/mapsforge/vtm/issues/251)
|
- Internal render themes new SVG resources [#251](https://github.com/mapsforge/vtm/issues/251)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.7.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.7.0)
|
||||||
|
|
||||||
## Version 0.6.0 (2016-10-28) -- VTM revive
|
## Version 0.6.0 (2016-10-28) -- VTM revive
|
||||||
|
|
||||||
@ -58,4 +59,4 @@
|
|||||||
- LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129)
|
- LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129)
|
||||||
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
|
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.6.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0)
|
||||||
|
@ -20,11 +20,14 @@ import org.oscim.backend.canvas.Canvas;
|
|||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Longri on 26.01.2017.
|
|
||||||
*/
|
|
||||||
public class TextureAtlasUtils {
|
public class TextureAtlasUtils {
|
||||||
|
|
||||||
private final static int MAX_ATLAS_SIZE = 1024;
|
private final static int MAX_ATLAS_SIZE = 1024;
|
||||||
@ -36,18 +39,19 @@ public class TextureAtlasUtils {
|
|||||||
* The List<TextureAtlas> contains the generated TextureAtlas object, for disposing if no longer needed!<br/>
|
* The List<TextureAtlas> contains the generated TextureAtlas object, for disposing if no longer needed!<br/>
|
||||||
* With tha param disposeBitmap, all Bitmaps will released!<br/>
|
* With tha param disposeBitmap, all Bitmaps will released!<br/>
|
||||||
* With parameter flipY, the Atlas TextureItem will flipped over Y. (Is needed by iOS)<br/>
|
* With parameter flipY, the Atlas TextureItem will flipped over Y. (Is needed by iOS)<br/>
|
||||||
* @param inputMap Map<Object, Bitmap> input Map with all Bitmaps, from which the regions are to be created
|
*
|
||||||
* @param outputMap Map<Object, TextureRegion> contains all generated TextureRegions
|
* @param inputMap Map<Object, Bitmap> input Map with all Bitmaps, from which the regions are to be created
|
||||||
* @param atlasList List<TextureAtlas> contains all created TextureAtlases
|
* @param outputMap Map<Object, TextureRegion> contains all generated TextureRegions
|
||||||
|
* @param atlasList List<TextureAtlas> contains all created TextureAtlases
|
||||||
* @param disposeBitmaps boolean (will recycle all Bitmap's)
|
* @param disposeBitmaps boolean (will recycle all Bitmap's)
|
||||||
* @param flipY boolean (set True with iOS)
|
* @param flipY boolean (set True with iOS)
|
||||||
*/
|
*/
|
||||||
public static void createTextureRegions(final Map<Object, Bitmap> inputMap, Map<Object, TextureRegion> outputMap,
|
public static void createTextureRegions(final Map<Object, Bitmap> inputMap, Map<Object, TextureRegion> outputMap,
|
||||||
List<TextureAtlas> atlasList, boolean disposeBitmaps, boolean flipY) {
|
List<TextureAtlas> atlasList, boolean disposeBitmaps, boolean flipY) {
|
||||||
|
|
||||||
// step 1: sort inputMap by Bitmap size
|
// step 1: sort inputMap by Bitmap size
|
||||||
List<Map.Entry<Object, Bitmap>> list =
|
List<Map.Entry<Object, Bitmap>> list =
|
||||||
new LinkedList<Map.Entry<Object, Bitmap>>(inputMap.entrySet());
|
new LinkedList<>(inputMap.entrySet());
|
||||||
|
|
||||||
Collections.sort(list, new Comparator<Map.Entry<Object, Bitmap>>() {
|
Collections.sort(list, new Comparator<Map.Entry<Object, Bitmap>>() {
|
||||||
public int compare(Map.Entry<Object, Bitmap> o1, Map.Entry<Object, Bitmap> o2) {
|
public int compare(Map.Entry<Object, Bitmap> o1, Map.Entry<Object, Bitmap> o2) {
|
||||||
@ -59,7 +63,7 @@ public class TextureAtlasUtils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Map<Object, Object> sortedByValues = new LinkedHashMap<Object, Object>();
|
Map<Object, Object> sortedByValues = new LinkedHashMap<>();
|
||||||
for (Map.Entry<Object, Bitmap> entry : list) {
|
for (Map.Entry<Object, Bitmap> entry : list) {
|
||||||
sortedByValues.put(entry.getKey(), entry.getValue());
|
sortedByValues.put(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
@ -88,7 +92,7 @@ public class TextureAtlasUtils {
|
|||||||
|
|
||||||
|
|
||||||
//step 4: calculate Regions(rectangles) and split to atlases
|
//step 4: calculate Regions(rectangles) and split to atlases
|
||||||
List<AtlasElement> atlases = new ArrayList<AtlasElement>();
|
List<AtlasElement> atlases = new ArrayList<>();
|
||||||
atlases.add(new AtlasElement());
|
atlases.add(new AtlasElement());
|
||||||
int atlasIndex = 0;
|
int atlasIndex = 0;
|
||||||
int maxLineHeight = PAD;
|
int maxLineHeight = PAD;
|
||||||
@ -171,6 +175,6 @@ public class TextureAtlasUtils {
|
|||||||
|
|
||||||
private static class AtlasElement {
|
private static class AtlasElement {
|
||||||
int width = 0, height = 0;
|
int width = 0, height = 0;
|
||||||
Map<Object, Object> map = new LinkedHashMap<Object, Object>();
|
Map<Object, Object> map = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user