mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Prefer loading speed over "NT maps not supported" reporting
This commit is contained in:
parent
33e3471ca3
commit
c2abf2c146
@ -99,17 +99,19 @@ bool RGNFile::init()
|
||||
&& readUInt32(hdl, _pointsOffset) && readUInt32(hdl, _pointsSize)))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hdrLen >= 0x7D) {
|
||||
quint32 dictOffset, dictSize;
|
||||
if (!(seek(hdl, _gmpOffset + 0x71) && readUInt32(hdl, dictOffset)
|
||||
&& readUInt32(hdl, dictSize)))
|
||||
return false;
|
||||
|
||||
if (dictSize || dictOffset) {
|
||||
qWarning("%s: NT compression not supported", qPrintable(fileName()));
|
||||
// NT maps
|
||||
if (dictSize || dictOffset)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
_init = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -418,6 +420,9 @@ void RGNFile::objects(const RectC &rect, const SubDiv *subdiv, LBLFile *lbl,
|
||||
{
|
||||
Handle rgnHdl, lblHdl, netHdl;
|
||||
|
||||
if (!_init && !init())
|
||||
return;
|
||||
|
||||
QVector<RGNFile::Segment> seg(segments(rgnHdl, subdiv));
|
||||
for (int i = 0; i < seg.size(); i++) {
|
||||
switch (seg.at(i).type()) {
|
||||
@ -447,6 +452,9 @@ void RGNFile::extObjects(const RectC &rect, const SubDiv *subdiv, LBLFile *lbl,
|
||||
{
|
||||
Handle rgnHdl, lblHdl;
|
||||
|
||||
if (!_init && !init())
|
||||
return;
|
||||
|
||||
if (polygons && subdiv->polygonsOffset() != subdiv->polygonsEnd()) {
|
||||
quint32 start = _polygonsOffset + subdiv->polygonsOffset();
|
||||
quint32 end = subdiv->polygonsEnd()
|
||||
|
@ -14,12 +14,10 @@ public:
|
||||
RGNFile(IMG *img)
|
||||
: SubFile(img), _offset(0), _size(0), _polygonsOffset(0),
|
||||
_polygonsSize(0), _linesOffset(0), _linesSize(0), _pointsOffset(0),
|
||||
_pointsSize(0) {}
|
||||
_pointsSize(0), _init(false) {}
|
||||
RGNFile(SubFile *gmp, quint32 offset) : SubFile(gmp, offset), _offset(0),
|
||||
_size(0), _polygonsOffset(0), _polygonsSize(0), _linesOffset(0),
|
||||
_linesSize(0), _pointsOffset(0), _pointsSize(0) {}
|
||||
|
||||
bool init();
|
||||
_linesSize(0), _pointsOffset(0), _pointsSize(0), _init(false) {}
|
||||
|
||||
void objects(const RectC &rect, const SubDiv *subdiv, LBLFile *lbl,
|
||||
NETFile *net, QList<IMG::Poly> *polygons, QList<IMG::Poly> *lines,
|
||||
@ -75,6 +73,8 @@ private:
|
||||
quint8 _data;
|
||||
};
|
||||
|
||||
bool init();
|
||||
|
||||
static bool sign(BitStream &bs, int &val);
|
||||
static int bitSize(quint8 baseSize, bool variableSign, bool extraBit);
|
||||
|
||||
@ -103,6 +103,8 @@ private:
|
||||
quint32 _linesSize;
|
||||
quint32 _pointsOffset;
|
||||
quint32 _pointsSize;
|
||||
|
||||
bool _init;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
|
@ -46,7 +46,7 @@ bool VectorTile::init()
|
||||
if (_gmp && !initGMP())
|
||||
return false;
|
||||
|
||||
if (!(_tre && _tre->init() && _rgn && _rgn->init()))
|
||||
if (!(_tre && _tre->init() && _rgn))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user