diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 732d7cd4..564cdf5f 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -532,6 +532,16 @@ static Light::Color ordinaryLight(const QVector &lights) return Light::None; } +static quint32 pointType(quint32 type, quint32 flags) +{ + if (Style::hasColorset(type)) + return type | (flags & 0xFF000000); + else if (Style::isLabelPoint(type)) + return type | (flags & 0xFFF00000); + else + return type; +} + void RasterTile::processPoints(QList &points, QList &textItems, QList &lights, QList §orLights) @@ -541,9 +551,7 @@ void RasterTile::processPoints(QList &points, for (int i = 0; i < points.size(); i++) { const MapData::Point &point = points.at(i); const Style *style = _data->style(); - const Style::Point &ps = style->point(Style::hasColorset(point.type) - ? point.type | (point.flags & 0xFF000000) - : point.type | (point.flags & 0x00F00000)); + const Style::Point &ps = style->point(pointType(point.type, point.flags)); bool poi = Style::isPOI(point.type); bool sl = sectorLight(point.lights); diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 829b99c0..cf339aa8 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -120,7 +120,7 @@ bool RGNFile::readBuoyInfo(Handle &hdl, quint8 flags, quint32 size, if (!(size >= 2 && readUInt16(hdl, val))) return false; - point->flags = (val & 0x3f)<<24; + point->flags |= (val & 0x3f)<<24; lc = (val >> 10) & 0x0f; if (!lc) @@ -563,6 +563,25 @@ bool RGNFile::readLclNavaid(Handle &hdl, quint32 size, return (size == 0); } +bool RGNFile::readLclImg(Handle &hdl, quint32 size, + MapData::Point *point) const +{ + quint32 img; + + if (size == 1) { + if (!readUInt8(hdl, img)) + return false; + } else if (size == 2) { + if (!readUInt16(hdl, img)) + return false; + } else + return false; + + point->flags |= img<<24; + + return true; +} + bool RGNFile::readLclFields(Handle &hdl, const quint32 flags[3], SegmentType segmentType, void *object) const { @@ -589,6 +608,9 @@ bool RGNFile::readLclFields(Handle &hdl, const quint32 flags[3], if (i == 2 && point) { if (!readLclNavaid(hdl, size, point)) return false; + } else if (i == 3 && point) { + if (!readLclImg(hdl, size, point)) + return false; } else { if (!seek(hdl, pos(hdl) + size)) return false; diff --git a/src/map/IMG/rgnfile.h b/src/map/IMG/rgnfile.h index 5016e098..3b4517b5 100644 --- a/src/map/IMG/rgnfile.h +++ b/src/map/IMG/rgnfile.h @@ -75,12 +75,12 @@ private: MapData::Poly *line) const; bool readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl, quint8 flags, quint32 size, MapData::Point *point) const; - bool readLclNavaid(Handle &hdl, quint32 size, - MapData::Point *point) const; + bool readLclNavaid(Handle &hdl, quint32 size, MapData::Point *point) const; bool readLclSectors(Handle &hdl, quint32 &size, quint32 flags, Light &light) const; bool readLclLights(Handle &hdl, quint32 &size, quint32 lights, MapData::Point *point) const; + bool readLclImg(Handle &hdl, quint32 size, MapData::Point *point) const; HuffmanTable *_huffmanTable; Section _base, _dict, _polygons, _lines, _points; diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index 0c492014..3c6c869a 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -903,6 +903,8 @@ void Style::defaultPointStyle(qreal ratio) _points[0x10500 | 13<<20] = Point(Small, QColor(0xfc, 0xc6, 0xfc)); _points[0x10500 | 14<<20] = Point(Small, QColor(0xe2, 0xdc, 0xa9)); _points[0x10500 | 15<<20] = Point(Small, QColor(0xcd, 0xcd, 0xcd)); + _points[0x10500 | 5<<24] = Point(QImage(":/marine/eddies.png")); + _points[0x10500 | 6<<24] = Point(QImage(":/marine/overfalls.png")); _points[0x10701] = Point(QImage(":/marine/anchorage.png")); _points[0x10702] = Point(QImage(":/marine/boarding-place.png"));