diff --git a/src/map/IMG/mapdata.h b/src/map/IMG/mapdata.h index 1ad4443b..a9fc0eac 100644 --- a/src/map/IMG/mapdata.h +++ b/src/map/IMG/mapdata.h @@ -34,7 +34,8 @@ public: enum Flags { OneWay = 1, Invert = 2, - Direction = 4 + Direction = 4, + Dashed = 8 }; /* QPointF insted of Coordinates for performance reasons (no need to diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index cd840aa6..15e50332 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -188,9 +188,12 @@ void RasterTile::drawPolygons(QPainter *painter, static quint32 lineType(quint32 type, quint32 flags) { - if (Style::isMiscLine(type)) - return type | (flags & 0xFF000000); - else if (flags & MapData::Poly::Direction) + if (Style::isMiscLine(type)) { + if (flags & MapData::Poly::Dashed) + return type | (flags & 0xFF000000) | 1<<20; + else + return type | (flags & 0xFF000000); + } else if (flags & MapData::Poly::Direction) return type | 1<<20; else return type; diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index ab7599d2..bf5859fb 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -255,14 +255,19 @@ bool RGNFile::readLineInfo(Handle &hdl, quint8 flags, quint32 size, if (!readUInt8(hdl, val)) return false; + if (val & 3) + line->flags |= MapData::Poly::Dashed; if ((val >> 3) & 3) line->flags |= MapData::Poly::Direction; if ((val >> 3) & 2) line->flags |= MapData::Poly::Invert; return true; - } else + } else { + if ((flags >> 4) & 3) + line->flags |= MapData::Poly::Dashed; return (!size); + } } bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType, diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index a92d3070..8d01ce84 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -530,21 +530,37 @@ void Style::defaultLineStyle(qreal ratio) _lines[0x110508] = Line(QImage(":/marine/minefield-line.png")); _lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1)); + _lines[0x110601] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine)); _lines[0x10601 | 1<<24] = Line(QPen(QColor(0, 0x90, 0xfc), 1)); + _lines[0x110601 | 1<<24] = Line(QPen(QColor(0, 0x90, 0xfc), 1, Qt::DashLine)); _lines[0x10601 | 2<<24] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1)); + _lines[0x110601 | 2<<24] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine)); _lines[0x10601 | 3<<24] = Line(QPen(QColor(0xa7, 0xf1, 0xfc), 1)); + _lines[0x110601 | 3<<24] = Line(QPen(QColor(0xa7, 0xf1, 0xfc), 1, Qt::DashLine)); _lines[0x10601 | 4<<24] = Line(QPen(QColor(0xff, 0x40, 0x40), 1)); + _lines[0x110601 | 4<<24] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine)); _lines[0x10601 | 5<<24] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1)); + _lines[0x110601 | 5<<24] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); _lines[0x10601 | 6<<24] = Line(QPen(QColor(0xfc, 0xe0, 0x1f), 1)); + _lines[0x110601 | 6<<24] = Line(QPen(QColor(0xfc, 0xe0, 0x1f), 1, Qt::DashLine)); _lines[0x10601 | 7<<24] = Line(QPen(QColor(0xfc, 0x79, 0x1e), 1)); + _lines[0x110601 | 7<<24] = Line(QPen(QColor(0xfc, 0x79, 0x1e), 1, Qt::DashLine)); _lines[0x10601 | 8<<24] = Line(QPen(QColor(0x40, 0x40, 0x40), 1)); + _lines[0x110601 | 8<<24] = Line(QPen(QColor(0x40, 0x40, 0x40), 1, Qt::DashLine)); _lines[0x10601 | 9<<24] = Line(QPen(QColor(0x84, 0xe6, 0xfc), 1)); + _lines[0x110601 | 9<<24] = Line(QPen(QColor(0x84, 0xe6, 0xfc), 1, Qt::DashLine)); _lines[0x10601 | 10<<24] = Line(QPen(QColor(0x83, 0x53, 0x15), 1)); + _lines[0x110601 | 10<<24] = Line(QPen(QColor(0x83, 0x53, 0x15), 1, Qt::DashLine)); _lines[0x10601 | 11<<24] = Line(QPen(QColor(0xd2, 0xfc, 0xfc), 1)); + _lines[0x110601 | 11<<24] = Line(QPen(QColor(0xd2, 0xfc, 0xfc), 1, Qt::DashLine)); _lines[0x10601 | 12<<24] = Line(QPen(QColor(0xc5, 0xf1, 0xc2), 1)); + _lines[0x110601 | 12<<24] = Line(QPen(QColor(0xc5, 0xf1, 0xc2), 1, Qt::DashLine)); _lines[0x10601 | 13<<24] = Line(QPen(QColor(0xfc, 0xc6, 0xfc), 1)); + _lines[0x110601 | 13<<24] = Line(QPen(QColor(0xfc, 0xc6, 0xfc), 1, Qt::DashLine)); _lines[0x10601 | 14<<24] = Line(QPen(QColor(0xe2, 0xdc, 0xa9), 1)); + _lines[0x110601 | 14<<24] = Line(QPen(QColor(0xe2, 0xdc, 0xa9), 1, Qt::DashLine)); _lines[0x10601 | 15<<24] = Line(QPen(QColor(0xcd, 0xcd, 0xcd), 1)); + _lines[0x110601 | 15<<24] = Line(QPen(QColor(0xcd, 0xcd, 0xcd), 1, Qt::DashLine)); _lines[0x10602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2)); _lines[0x10603] = Line(QImage(":/marine/international-maritime-boundary.png")); _lines[0x110603] = Line(QImage(":/marine/international-maritime-boundary.png"));