1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 09:05:14 +01:00

Use a better data descriptions

This commit is contained in:
Martin Tůma 2020-12-26 14:45:38 +01:00
parent 821790fa91
commit b12eef7366

View File

@ -494,7 +494,7 @@ static bool readColor(SubFile *file, SubFile::Handle &hdl, QColor &color)
return true; return true;
} }
static bool skipLocalization(SubFile *file, SubFile::Handle &hdl) static bool skipLabel(SubFile *file, SubFile::Handle &hdl)
{ {
quint32 len; quint32 len;
@ -674,8 +674,8 @@ bool Style::parseLines(SubFile *file, SubFile::Handle &hdl,
return false; return false;
flags = t8_1 & 0x07; flags = t8_1 & 0x07;
rows = t8_1 >> 3; rows = t8_1 >> 3;
bool localization = t8_2 & 0x01; bool label = t8_2 & 0x01;
bool textColor = t8_2 & 0x04; bool fontInfo = t8_2 & 0x04;
QColor c1, c2, c3, c4; QColor c1, c2, c3, c4;
quint8 w1, w2; quint8 w1, w2;
@ -838,10 +838,10 @@ bool Style::parseLines(SubFile *file, SubFile::Handle &hdl,
l.setTextFontSize(Small); l.setTextFontSize(Small);
} }
if (localization && !skipLocalization(file, hdl)) if (label && !skipLabel(file, hdl))
return false; return false;
if (textColor) { if (fontInfo) {
quint8 labelFlags; quint8 labelFlags;
if (!file->readUInt8(hdl, labelFlags)) if (!file->readUInt8(hdl, labelFlags))
return false; return false;
@ -960,8 +960,8 @@ bool Style::parsePoints(SubFile *file, SubFile::Handle &hdl,
&& file->readUInt8(hdl, imgType))) && file->readUInt8(hdl, imgType)))
return false; return false;
bool localization = t8_1 & 0x04; bool label = t8_1 & 0x04;
bool textColor = t8_1 & 0x08; bool fontInfo = t8_1 & 0x08;
int bpp = colors2bpp(numColors, imgType); int bpp = colors2bpp(numColors, imgType);
if (bpp <= 0) if (bpp <= 0)
@ -993,10 +993,10 @@ bool Style::parsePoints(SubFile *file, SubFile::Handle &hdl,
return false; return false;
} }
if (localization && !skipLocalization(file, hdl)) if (label && !skipLabel(file, hdl))
return false; return false;
if (textColor) { if (fontInfo) {
quint8 labelFlags; quint8 labelFlags;
QColor color; QColor color;
if (!file->readUInt8(hdl, labelFlags)) if (!file->readUInt8(hdl, labelFlags))