mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Compare commits
No commits in common. "5af380889523c83253d171b625a25d041fd22ffb" and "e35cf68309316e9e2baae636af0c79e736ec774d" have entirely different histories.
5af3808895
...
e35cf68309
@ -1,4 +1,4 @@
|
||||
version: 11.2.{build}
|
||||
version: 11.1.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 11.2
|
||||
VERSION = 11.1
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "11.2"
|
||||
!define VERSION "11.1"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -87,7 +87,7 @@ Map *MapList::loadFile(const QString &path, const Projection &proj, bool *isDir)
|
||||
if (!map) {
|
||||
qWarning("Error loading map file: %s:", qPrintable(path));
|
||||
for (int i = 0; i < errors.size(); i++)
|
||||
qWarning("%s", qPrintable(errors.at(i)));
|
||||
qWarning(qPrintable(errors.at(i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,45 +283,45 @@ bool MapData::readSubFiles()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapData::readZoomInfo(SubFile &hdr)
|
||||
bool MapData::readZoomInfo(SubFile &subfile)
|
||||
{
|
||||
quint8 zooms;
|
||||
|
||||
if (!hdr.readByte(zooms))
|
||||
if (!subfile.readByte(zooms))
|
||||
return false;
|
||||
|
||||
_subFiles.resize(zooms);
|
||||
for (quint8 i = 0; i < zooms; i++) {
|
||||
if (!(hdr.readByte(_subFiles[i].base)
|
||||
&& hdr.readByte(_subFiles[i].min)
|
||||
&& hdr.readByte(_subFiles[i].max)
|
||||
&& hdr.readUInt64(_subFiles[i].offset)
|
||||
&& hdr.readUInt64(_subFiles[i].size)))
|
||||
if (!(subfile.readByte(_subFiles[i].base)
|
||||
&& subfile.readByte(_subFiles[i].min)
|
||||
&& subfile.readByte(_subFiles[i].max)
|
||||
&& subfile.readUInt64(_subFiles[i].offset)
|
||||
&& subfile.readUInt64(_subFiles[i].size)))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapData::readTagInfo(SubFile &hdr)
|
||||
bool MapData::readTagInfo(SubFile &subfile)
|
||||
{
|
||||
quint16 tags;
|
||||
QByteArray tag;
|
||||
|
||||
if (!hdr.readUInt16(tags))
|
||||
if (!subfile.readUInt16(tags))
|
||||
return false;
|
||||
_pointTags.resize(tags);
|
||||
for (quint16 i = 0; i < tags; i++) {
|
||||
if (!hdr.readString(tag))
|
||||
if (!subfile.readString(tag))
|
||||
return false;
|
||||
_pointTags[i] = tag;
|
||||
}
|
||||
|
||||
if (!hdr.readUInt16(tags))
|
||||
if (!subfile.readUInt16(tags))
|
||||
return false;
|
||||
_pathTags.resize(tags);
|
||||
for (quint16 i = 0; i < tags; i++) {
|
||||
if (!hdr.readString(tag))
|
||||
if (!subfile.readString(tag))
|
||||
return false;
|
||||
_pathTags[i] = tag;
|
||||
}
|
||||
@ -329,7 +329,7 @@ bool MapData::readTagInfo(SubFile &hdr)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapData::readMapInfo(SubFile &hdr, QByteArray &projection,
|
||||
bool MapData::readMapInfo(SubFile &subfile, QByteArray &projection,
|
||||
bool &debugMap)
|
||||
{
|
||||
quint64 fileSize, date;
|
||||
@ -337,36 +337,37 @@ bool MapData::readMapInfo(SubFile &hdr, QByteArray &projection,
|
||||
qint32 minLat, minLon, maxLat, maxLon;
|
||||
quint8 flags;
|
||||
|
||||
if (!(hdr.seek(4) && hdr.readUInt32(version) && hdr.readUInt64(fileSize)
|
||||
&& hdr.readUInt64(date) && hdr.readInt32(minLat) && hdr.readInt32(minLon)
|
||||
&& hdr.readInt32(maxLat) && hdr.readInt32(maxLon)
|
||||
&& hdr.readUInt16(_tileSize) && hdr.readString(projection)
|
||||
&& hdr.readByte(flags)))
|
||||
if (!(subfile.seek(MAGIC_SIZE + 4)
|
||||
&& subfile.readUInt32(version) && subfile.readUInt64(fileSize)
|
||||
&& subfile.readUInt64(date) && subfile.readInt32(minLat)
|
||||
&& subfile.readInt32(minLon) && subfile.readInt32(maxLat)
|
||||
&& subfile.readInt32(maxLon) && subfile.readUInt16(_tileSize)
|
||||
&& subfile.readString(projection) && subfile.readByte(flags)))
|
||||
return false;
|
||||
|
||||
if (flags & 0x40) {
|
||||
qint32 startLon, startLat;
|
||||
if (!(hdr.readInt32(startLat) && hdr.readInt32(startLon)))
|
||||
if (!(subfile.readInt32(startLat) && subfile.readInt32(startLon)))
|
||||
return false;
|
||||
}
|
||||
if (flags & 0x20) {
|
||||
quint8 startZoom;
|
||||
if (!hdr.readByte(startZoom))
|
||||
if (!subfile.readByte(startZoom))
|
||||
return false;
|
||||
}
|
||||
if (flags & 0x10) {
|
||||
QByteArray lang;
|
||||
if (!hdr.readString(lang))
|
||||
if (!subfile.readString(lang))
|
||||
return false;
|
||||
}
|
||||
if (flags & 0x08) {
|
||||
QByteArray comment;
|
||||
if (!hdr.readString(comment))
|
||||
if (!subfile.readString(comment))
|
||||
return false;
|
||||
}
|
||||
if (flags & 0x04) {
|
||||
QByteArray createdBy;
|
||||
if (!hdr.readString(createdBy))
|
||||
if (!subfile.readString(createdBy))
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -397,19 +398,19 @@ bool MapData::readHeader()
|
||||
return false;
|
||||
}
|
||||
|
||||
SubFile hdr(_file, MAGIC_SIZE, qFromBigEndian(hdrSize));
|
||||
SubFile subfile(_file, 0, qFromBigEndian(hdrSize));
|
||||
|
||||
if (!readMapInfo(hdr, projection, debugMap)) {
|
||||
if (!readMapInfo(subfile, projection, debugMap)) {
|
||||
_errorString = "Error reading map info";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!readTagInfo(hdr)) {
|
||||
if (!readTagInfo(subfile)) {
|
||||
_errorString = "Error reading tags info";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!readZoomInfo(hdr)) {
|
||||
if (!readZoomInfo(subfile)) {
|
||||
_errorString = "Error reading zooms info";
|
||||
return false;
|
||||
}
|
||||
|
@ -131,9 +131,9 @@ private:
|
||||
|
||||
typedef RTree<VectorTile *, double, 2> TileTree;
|
||||
|
||||
bool readZoomInfo(SubFile &hdr);
|
||||
bool readTagInfo(SubFile &hdr);
|
||||
bool readMapInfo(SubFile &hdr, QByteArray &projection, bool &debugMap);
|
||||
bool readZoomInfo(SubFile &subfile);
|
||||
bool readTagInfo(SubFile &subfile);
|
||||
bool readMapInfo(SubFile &subfile, QByteArray &projection, bool &debugMap);
|
||||
bool readHeader();
|
||||
bool readSubFiles();
|
||||
void clearTiles();
|
||||
|
Loading…
Reference in New Issue
Block a user