From 744cfde08f7aa7abdb4eccf6eb6d86218bc1d5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 18 May 2025 21:50:56 +0200 Subject: [PATCH] Refactoring --- src/map/IMG/rastertile.cpp | 2 +- src/map/IMG/rgnfile.cpp | 2 +- src/map/IMG/style.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 15e50332..55b04082 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -188,7 +188,7 @@ void RasterTile::drawPolygons(QPainter *painter, static quint32 lineType(quint32 type, quint32 flags) { - if (Style::isMiscLine(type)) { + if (Style::isCartographicLine(type)) { if (flags & MapData::Poly::Dashed) return type | (flags & 0xFF000000) | 1<<20; else diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index bf5859fb..76b58ac7 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -319,7 +319,7 @@ bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType, if (point && Style::isLabelPoint(point->type)) point->flags |= (flags & 0xf)<<20; - if (line && Style::isMarineLine(line->type)) + if (line && Style::isStyledLine(line->type)) readLineInfo(hdl, flags, rs, line); return seek(hdl, off + rs); diff --git a/src/map/IMG/style.h b/src/map/IMG/style.h index 755133c3..5f4955fc 100644 --- a/src/map/IMG/style.h +++ b/src/map/IMG/style.h @@ -142,6 +142,8 @@ public: {return (type >= 0x1400 && type <= 0x153f);} static bool isState(quint32 type) {return (type == TYPE(0x1e));} + static bool isMarina(quint32 type) + {return type == 0x10703;} static bool isRaster(quint32 type) {return (type == 0x10613);} static bool isDepthPoint(quint32 type) @@ -156,12 +158,10 @@ public: {return type == 0x10500;} static bool isMarinePoint(quint32 type) {return type >= 0x10100 && type < 0x10a00;} - static bool isMarineLine(quint32 type) + static bool isStyledLine(quint32 type) {return type >= 0x10400 && type < 0x10700;} - static bool isMiscLine(quint32 type) + static bool isCartographicLine(quint32 type) {return type == 0x10601;} - static bool isMarina(quint32 type) - {return type == 0x10703;} static bool hasColorset(quint32 type) {return (isBuoy(type) && !(type == 0x1020d || type >= 0x10216));}