On 08/12/11 14:39, Minko wrote:
Typ compiler (mkgmap-r2136) still has problems with the draw order of these
(background) polygons: 0x10100 and 0x10101
At the time I wrote this I believed that you could not have a subtype
of 0 for an extended type in the typ format, but I now think that was
wrong.
So patch attached which I will commit.
btw I tried it also with mkgmap-typ-r2129 from the branch but then the
typviewer crashes when trying to read the typ file.
That branch is finished now. I've made one change since to fix bad
output which is probably the problem you saw.
..Steve
Index: src/uk/me/parabola/imgfmt/app/typ/ShapeStacking.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/typ/ShapeStacking.java (revision 2134)
+++ src/uk/me/parabola/imgfmt/app/typ/ShapeStacking.java (revision )
@@ -36,7 +36,7 @@
int levelType = (level << 16) + type;
DrawOrder order = bar.get(levelType);
if (order == null) {
- order = new DrawOrder((byte) type);
+ order = new DrawOrder(type);
bar.put(levelType, order);
}
Index: src/uk/me/parabola/imgfmt/app/typ/DrawOrder.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/typ/DrawOrder.java (revision 2134)
+++ src/uk/me/parabola/imgfmt/app/typ/DrawOrder.java (revision )
@@ -10,20 +10,23 @@
* actually in the item.
*/
public class DrawOrder implements Writeable {
- private final byte typ;
+ private final byte type;
private int subTypes;
+ private boolean hasSubtypes;
- public DrawOrder(int typ) {
- this.typ = (byte) typ;
+ public DrawOrder(int type) {
+ this.type = (byte) (type & 0xff);
+ if (type >= 0x100)
+ hasSubtypes = true;
}
public void write(ImgFileWriter writer) {
- writer.put(typ);
+ writer.put(type);
writer.putInt(subTypes);
}
public void addSubtype(int subtype) {
- if (subtype > 0)
+ if (hasSubtypes)
subTypes |= 1 << subtype;
}
}
Index: src/uk/me/parabola/mkgmap/typ/DrawOrderSection.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/typ/DrawOrderSection.java (revision 2134)
+++ src/uk/me/parabola/mkgmap/typ/DrawOrderSection.java (revision )
@@ -49,7 +49,7 @@
int subtype = 0;
if (fulltype > 0x10000) {
- type = (fulltype >> 8) & 0xff;
+ type = (fulltype >>> 8) & 0x3fff;
subtype = fulltype & 0xff;
} else {
type = fulltype & 0xff;
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev