1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2020-02-16 15:59:51 +01:00
parent 29e29591f8
commit 2c114f43c5
2 changed files with 5 additions and 6 deletions

View File

@ -8,12 +8,12 @@
#include "rgnfile.h" #include "rgnfile.h"
static quint64 pointId(qint32 x, qint32 y, quint32 type, quint32 labelPtr) static quint64 pointId(const QPoint &pos, quint32 type, quint32 labelPtr)
{ {
quint64 id; quint64 id;
uint hash = qHash(QPair<uint,uint>(qHash(QPair<qint32, qint32>(x, y)), uint hash = qHash(QPair<uint,uint>(qHash(QPair<int, int>(pos.x(),
labelPtr & 0x3FFFFF)); pos.y())), labelPtr & 0x3FFFFF));
id = ((quint64)type)<<32 | hash; id = ((quint64)type)<<32 | hash;
// Make country labels precedent over city labels // Make country labels precedent over city labels
if (!(type >= 0x1400 && type <= 0x153f)) if (!(type >= 0x1400 && type <= 0x153f))
@ -342,7 +342,7 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
point.type = (quint16)type<<8 | subtype; point.type = (quint16)type<<8 | subtype;
point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y())); point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y()));
point.id = pointId(pos.x(), pos.y(), point.type, labelPtr & 0x3FFFFF); point.id = pointId(pos, point.type, labelPtr & 0x3FFFFF);
point.poi = labelPtr & 0x400000; point.poi = labelPtr & 0x400000;
if (lbl && (labelPtr & 0x3FFFFF)) if (lbl && (labelPtr & 0x3FFFFF))
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi, point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi,
@ -391,7 +391,7 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv, LBLFile *lbl,
continue; continue;
point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y())); point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y()));
point.id = pointId(pos.x(), pos.y(), point.type, labelPtr & 0x3FFFFF); point.id = pointId(pos, point.type, labelPtr & 0x3FFFFF);
point.poi = labelPtr & 0x400000; point.poi = labelPtr & 0x400000;
if (lbl && (labelPtr & 0x3FFFFF)) if (lbl && (labelPtr & 0x3FFFFF))
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi); point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi);

View File

@ -2,7 +2,6 @@
#define SUBFILE_H #define SUBFILE_H
#include <QVector> #include <QVector>
#include <QDebug>
#include <QFile> #include <QFile>
#include "img.h" #include "img.h"