mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-22 10:20:47 +01:00
Compare commits
No commits in common. "ae3d190e08cd6f6eb7da5b9a0188a58274a2b2b1" and "aea8402016baaecf173c10de10991349a99fb79a" have entirely different histories.
ae3d190e08
...
aea8402016
@ -329,3 +329,13 @@ QList<SubDiv*> TREFile::subdivs(const RectC &rect, int bits,
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
|
QDebug IMG::operator<<(QDebug dbg, const TREFile::MapLevel &level)
|
||||||
|
{
|
||||||
|
dbg.nospace() << "MapLevel(" << level.level << "," << level.bits << ", "
|
||||||
|
<< level.subdivs << ")";
|
||||||
|
|
||||||
|
return dbg.space();
|
||||||
|
}
|
||||||
|
#endif // QT_NO_DEBUG
|
||||||
|
@ -42,6 +42,8 @@ private:
|
|||||||
};
|
};
|
||||||
typedef RTree<SubDiv*, double, 2> SubDivTree;
|
typedef RTree<SubDiv*, double, 2> SubDivTree;
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug dbg, const MapLevel &level);
|
||||||
|
|
||||||
bool load(int idx);
|
bool load(int idx);
|
||||||
int level(int bits, const Range &baseMap);
|
int level(int bits, const Range &baseMap);
|
||||||
int readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
|
int readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
|
||||||
@ -57,6 +59,9 @@ private:
|
|||||||
QMap<int, SubDivTree*> _subdivs;
|
QMap<int, SubDivTree*> _subdivs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
|
QDebug operator<<(QDebug dbg, const TREFile::MapLevel &level);
|
||||||
|
#endif // QT_NO_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // IMG_TREFILE_H
|
#endif // IMG_TREFILE_H
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
|
||||||
|
|
||||||
#define TILE_SIZE 256
|
#define TILE_SIZE 256
|
||||||
|
|
||||||
void Image::draw(QPainter *painter, const QRectF &rect, Map::Flags flags)
|
void Image::draw(QPainter *painter, const QRectF &rect, Map::Flags flags)
|
||||||
@ -16,9 +17,9 @@ void Image::draw(QPainter *painter, const QRectF &rect, Map::Flags flags)
|
|||||||
for (int j = sr.top()/TILE_SIZE; j <= sr.bottom()/TILE_SIZE; j++) {
|
for (int j = sr.top()/TILE_SIZE; j <= sr.bottom()/TILE_SIZE; j++) {
|
||||||
QPoint tl(i * TILE_SIZE, j * TILE_SIZE);
|
QPoint tl(i * TILE_SIZE, j * TILE_SIZE);
|
||||||
QRect tile(tl, QSize(TILE_SIZE, TILE_SIZE));
|
QRect tile(tl, QSize(TILE_SIZE, TILE_SIZE));
|
||||||
QImage img(_img.copy(tile));
|
QPixmap pm(QPixmap::fromImage(_img.copy(tile)));
|
||||||
img.setDevicePixelRatio(ratio);
|
pm.setDevicePixelRatio(ratio);
|
||||||
painter->drawImage(tl/ratio, img);
|
painter->drawPixmap(tl/ratio, pm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user