From 2bde41f09e7aa89d78da01a5fa3b0ab31439f247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 14 May 2025 00:01:45 +0200 Subject: [PATCH] Only use the image-lines when there is direction info present for the lines --- gpxsee.qrc | 1 + icons/map/marine/anchor-line.png | Bin 170 -> 295 bytes icons/map/marine/cable-area-line.png | Bin 130 -> 225 bytes icons/map/marine/fishing-line.png | Bin 336 -> 348 bytes icons/map/marine/minefield-line.png | Bin 0 -> 200 bytes icons/map/marine/pipeline-area-line.png | Bin 137 -> 235 bytes src/map/IMG/mapdata.h | 3 +- src/map/IMG/rastertile.cpp | 4 ++- src/map/IMG/rgnfile.cpp | 4 ++- src/map/IMG/style.cpp | 35 +++++++++++++++++------- 10 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 icons/map/marine/minefield-line.png diff --git a/gpxsee.qrc b/gpxsee.qrc index 34783f32..4848fef1 100644 --- a/gpxsee.qrc +++ b/gpxsee.qrc @@ -313,6 +313,7 @@ icons/map/marine/degaussing-line.png icons/map/marine/nofishing-line.png icons/map/marine/fishing-line.png + icons/map/marine/minefield-line.png diff --git a/icons/map/marine/anchor-line.png b/icons/map/marine/anchor-line.png index 43067ec8acd661f56b4d47362759db9e257a11e8..27dfaabb7cc8337f04893bc9bdc0c51521d963b1 100644 GIT binary patch delta 263 zcmZ3*xST1gGr-TCmrII^fq{Y7)59eQNXq~*I|mz(l$Oyw1Eg5e9eo`c7&i8E|4C#8 z@)?VR+?^P2p46!aaukw1f_xbms?-=58d?|_egTCVUNA6}8Za=tN?>5Hn!&&zUNC1@ zpv^=@t@=7o7sn8d^J^y^pA`)C}Uei48vAU@!P15;XsuyWyutjX{o<&DNFL)1WS5c{{|%Jnj=S(2)$Du6{1- HoD!MRk-pkX)F+}5ha)JUw zT=l+x|8IT%TF+K=Ap87vpC3H7#-HttSF#m7EaKg`E=47D@{6)Sw@EsR*IU=y#vAYb nR&&-dCt!lS;SU~VwIGISVapf(y94I|O=s|Q^>bP0l+XkKmx?eE diff --git a/icons/map/marine/cable-area-line.png b/icons/map/marine/cable-area-line.png index f8ed6111072ce346e4f4b12af2ab75f3c901fee0..775eed1f13c3ea91398d3ca064b573b22ec18d68 100644 GIT binary patch delta 192 zcmZo-e8`y98Q|y6%O%Cdz`(%k>ERLtq{V=kor4WX^4RTV1yU^Oj=qiz3>*8o|0II= zjKx9jPK-BC>eK@{3dtTpz6=aiY77hwEes65fI2&uZ5?JV~EE2l!?X)Wf$Ck@6yjiazz#bIh12mn%)78&qol`;+0G&uTp8x;= delta 97 zcmaFJ*u<#V8Q|y6%O%Cdz`(%k>ERLtr1^oEor4WXUT+mwpO~d(uH@bce~VGr-TCmrII^fq{Y7)59eQNUH!bI|mz(Ot5$lBpF!J9eo`c7&i8E|4C#8 z@)?VR+?^P2p46$IXlKd^Qo-=kd3XK98j1SNo-U3d8t1nL8}c18;Mv2%6l`u(e%}92 zr`@^vFZ_QT>E!He2tp?Hosx4 z(Ic|UO)o3Jd!eRB+0Je3)021cGsH3Y7`}MoZqL}@WX({{FdZ}@ f<6V3Cbk29o%)8qg5B93)f;{5s>gTe~DWM4f#v^J$ delta 260 zcmV+f0sH>k0?-03iBL{Q4GJ0x0000DNk~Le0000S000072nGNE02>@F%m4rY0drDE zLIK&yEPs(96OlnO2`~Vl02>Q`mvxbR7=NcpL_t(2&!tka5yK!1eA%&GrAk!Ovx%1Q za4f+l=~FA2z!#GS=Qy3ondBQdA)fyiq@oGHl_Ni45PTqUvf6sQ$8o;R3x0))CKVla zYANrj6j7eF;*{4OzzYBsL?cIDvLgbJf)BkoSvfLoqRPG_AmiXe){;(nXU};d@I4IM zxW%QSQ{{o~8~I_CmAR(iLuY0<{4+zck(gh45hssYM2)71Bd0fQZ*(WBNO?8@0000< KMNUMnLSTaM7G$6R diff --git a/icons/map/marine/minefield-line.png b/icons/map/marine/minefield-line.png new file mode 100644 index 0000000000000000000000000000000000000000..91deabb4dc675c4139469b6794a109309b71b7b8 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^{6Ngg!3HE}`EJtzQY`6?zK#qG8~eHcB(ehejKx9j zPK-BC>eK@{3dtTpz6=aiY77hwEes65fIDz@Y5t idPM5P5eG&Ii?a+%UD?{I>StU6nd9l|=d#Wzp$P!uOES6u literal 0 HcmV?d00001 diff --git a/icons/map/marine/pipeline-area-line.png b/icons/map/marine/pipeline-area-line.png index ac80ec25403399d10e6eba5154308556e2072903..021516e9638ff6bec84502124e4c20fd1597cef9 100644 GIT binary patch delta 202 zcmeBVe9f5E8Q|y6%O%Cdz`(%k>ERLtq@{tFor4WX{ybo|6-cq9JNh~@Fl_AS{*%ZG zdB8k`i`e~;&=9wFVdQ&MBb@0OM6a)&Kwi delta 104 zcmaFO*vY8a8Q|y6%O%Cdz`(%k>ERLtq=kT(g@X-9Haq5DoS3C$r|Ie97$R{wx#I25 zU;neuU;i(u!P3*hBY0Qult+)F&XHRkr=51VUil=&Q0pgBSD4&49jKYX)78&qol`;+ E05S9;-~a#s diff --git a/src/map/IMG/mapdata.h b/src/map/IMG/mapdata.h index 668b474f..1ad4443b 100644 --- a/src/map/IMG/mapdata.h +++ b/src/map/IMG/mapdata.h @@ -33,7 +33,8 @@ public: enum Flags { OneWay = 1, - Invert = 2 + Invert = 2, + Direction = 4 }; /* QPointF insted of Coordinates for performance reasons (no need to diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 527cbfe2..d4f616be 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -204,7 +204,9 @@ void RasterTile::drawLines(QPainter *painter, for (int i = 0; i < lines.size(); i++) { const MapData::Poly &poly = lines.at(i); - const Style::Line &style = _data->style()->line(poly.type); + const Style::Line &style = _data->style()->line( + (poly.flags & MapData::Poly::Direction) + ? poly.type | 1<<20 : poly.type); if (!style.img().isNull()) { if (poly.flags & MapData::Poly::Invert) diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 399d1db8..4b3cfd41 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -252,7 +252,9 @@ bool RGNFile::readLineInfo(Handle &hdl, quint32 size, MapData::Poly *line) const if (!readUInt8(hdl, val)) return false; - if (((val >> 3) & 3) & 2) + if ((val >> 3) & 3) + line->flags |= MapData::Poly::Direction; + if ((val >> 3) & 2) line->flags |= MapData::Poly::Invert; return true; diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index 310d33df..b3ba0c46 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -495,26 +495,41 @@ void Style::defaultLineStyle(qreal ratio) _lines[0x10309] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine)); _lines[0x10401] = Line(QImage(":/marine/cable.png")); _lines[0x10402] = Line(QImage(":/marine/pipeline.png")); + _lines[0x10403] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 2, Qt::DotLine)); _lines[0x10404] = Line(QImage(":/marine/fishing-farm-line.png")); - _lines[0x10405] = Line(QImage(":/marine/pipeline-area-line.png")); - _lines[0x10406] = Line(QImage(":/marine/cable-area-line.png")); + _lines[0x10405] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110405] = Line(QImage(":/marine/pipeline-area-line.png")); + _lines[0x10406] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110406] = Line(QImage(":/marine/cable-area-line.png")); _lines[0x10407] = Line(QPen(QColor(0xa3, 0xa3, 0xa3), 1, Qt::DashLine)); _lines[0x10408] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine)); _lines[0x10409] = Line(QPen(QColor(0, 0, 0), 1, Qt::DotLine)); + _lines[0x1040b] = Line(QPen(QColor(0, 0, 0), 2, Qt::DashLine)); _lines[0x1040c] = Line(QPen(QColor(0, 0, 0), 2)); - _lines[0x10501] = Line(QImage(":/marine/noanchor-line.png")); - _lines[0x10502] = Line(QImage(":/marine/nofishing-line.png")); - _lines[0x10503] = Line(QImage(":/marine/entry-prohibited-line.png")); + _lines[0x10501] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110501] = Line(QImage(":/marine/noanchor-line.png")); + _lines[0x10502] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110502] = Line(QImage(":/marine/nofishing-line.png")); + _lines[0x10503] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110503] = Line(QImage(":/marine/entry-prohibited-line.png")); _lines[0x10504] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); - _lines[0x10505] = Line(QImage(":/marine/noanchor-line.png")); - _lines[0x10506] = Line(QImage(":/marine/nature-reserve-line.png")); - _lines[0x10507] = Line(QImage(":/marine/safety-zone-line.png")); + _lines[0x10505] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110505] = Line(QImage(":/marine/noanchor-line.png")); + _lines[0x10506] = Line(QPen(QColor(0x30, 0xa0, 0x1b), 1, Qt::DashLine)); + _lines[0x110506] = Line(QImage(":/marine/nature-reserve-line.png")); + _lines[0x10507] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110507] = Line(QImage(":/marine/safety-zone-line.png")); + _lines[0x10508] = Line(QPen(QColor(0xff, 0x40, 0x40), 1, Qt::DashLine)); + _lines[0x110508] = Line(QImage(":/marine/minefield-line.png")); _lines[0x10601] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine)); _lines[0x10602] = Line(QPen(QColor(0xfc, 0xb4, 0xfc), 2)); _lines[0x10603] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1.5, Qt::DashDotLine)); _lines[0x10604] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotLine)); - _lines[0x10606] = Line(QImage(":/marine/anchor-line.png")); - _lines[0x10608] = Line(QImage(":/marine/fishing-line.png")); + _lines[0x10606] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110606] = Line(QImage(":/marine/anchor-line.png")); + _lines[0x10608] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashLine)); + _lines[0x110608] = Line(QImage(":/marine/fishing-line.png")); + _lines[0x1060b] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::DashDotDotLine)); _lines[0x1060c] = Line(QPen(QColor(0xe7, 0x28, 0xe7), 1, Qt::SolidLine)); _lines[0x1060d] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine)); _lines[0x10611] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));