mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-01 07:43:03 +02:00
Properly display some more marine points with extra images definitions
This commit is contained in:
parent
3e62e1eaf6
commit
b3bb97f4cf
@ -532,6 +532,16 @@ static Light::Color ordinaryLight(const QVector<Light> &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<MapData::Point> &points,
|
||||
QList<TextItem*> &textItems, QList<TextItem*> &lights,
|
||||
QList<const MapData::Point*> §orLights)
|
||||
@ -541,9 +551,7 @@ void RasterTile::processPoints(QList<MapData::Point> &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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user