summaryrefslogtreecommitdiffstats
path: root/lightmaps
diff options
context:
space:
mode:
authorAriya Hidayat <ariya.hidayat@nokia.com>2009-09-22 15:39:47 +0200
committerAriya Hidayat <ariya.hidayat@nokia.com>2009-09-22 15:39:47 +0200
commit80fd32a99dc0dfd94611852b0fc6d1523a6e6885 (patch)
tree95de4395fd9f8028d2558b55fd985a5c0a0769ab /lightmaps
parentc8fce20166e3c987d9740a87554b5d9f0656b8f6 (diff)
various devdays tweak
Diffstat (limited to 'lightmaps')
-rw-r--r--lightmaps/lightmaps.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lightmaps/lightmaps.cpp b/lightmaps/lightmaps.cpp
index bc9798c..d3ac1fa 100644
--- a/lightmaps/lightmaps.cpp
+++ b/lightmaps/lightmaps.cpp
@@ -145,13 +145,16 @@ public:
}
void render(QPainter *p, const QRect &rect) {
+ p->setPen(QPen(Qt::red, 2));
for (int x = 0; x <= m_tilesRect.width(); ++x)
for (int y = 0; y <= m_tilesRect.height(); ++y) {
QPoint tp(x + m_tilesRect.left(), y + m_tilesRect.top());
QRect box = tileRect(tp);
if (rect.intersects(box)) {
- if (m_tilePixmaps.contains(tp))
+ if (m_tilePixmaps.contains(tp)) {
p->drawPixmap(box, m_tilePixmaps.value(tp));
+ p->drawRect(box.adjusted(0, 0, -2, -2));
+ }
else
p->drawPixmap(box, m_emptyTile);
}
@@ -176,6 +179,17 @@ private slots:
if (!img.load(reply, 0))
img = QImage();
reply->deleteLater();
+#if 0
+ QPainter p(&img);
+ p.setPen(QPen(Qt::white, 1));
+ p.setBrush(Qt::NoBrush);
+ p.drawRect(img.rect().adjusted(0, 0, -1, -1));
+ p.fillRect(10, 10, 20, 20, Qt::red);
+ p.end();
+ img.fill(qRgba(255, 0, 0, 255));
+ img.save("bla.png");
+#endif
+
m_tilePixmaps[tp] = QPixmap::fromImage(img);
if (img.isNull())
m_tilePixmaps[tp] = m_emptyTile;