diff --git a/src/common/hash.h b/src/common/hash.h index 5a31ebeb..2e62af9d 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -6,13 +6,13 @@ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #define HASH_T uint + +inline uint qHash(const QPoint &p) +{ + return qHash(QPair(p.x(), p.y())); +} #else // QT6 #define HASH_T size_t #endif // QT6 -inline HASH_T qHash(const QPoint &p) -{ - return ::qHash(p.x()) ^ ::qHash(p.y()); -} - #endif // HASH_H diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index c8dc949a..39f60d53 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -1,5 +1,6 @@ #include "common/rectc.h" #include "common/garmin.h" +#include "common/hash.h" #include "deltastream.h" #include "huffmanstream.h" #include "style.h" @@ -15,10 +16,8 @@ using namespace IMG; static quint64 pointId(const QPoint &pos, quint32 type) { - quint64 id; - - uint hash = (uint)qHash(QPair(pos.x(), pos.y())); - id = ((quint64)type)<<32 | hash; + quint64 hash = qHash(pos); + quint64 id = ((quint64)type)<<40 | (hash & 0xFFFFFFFFFF); // Increase rendering priorities for some special items if (!Style::isCountry(type) && !Style::isMarina(type))