]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robomon: Problem with map scale solved. Map repainting is realtively fast now.
authorMichal Vokac <vokac.m@gmail.com>
Mon, 31 Jan 2011 22:56:05 +0000 (23:56 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 11 Feb 2011 16:31:55 +0000 (17:31 +0100)
Conflicts:

src/robomon/PlaygroundScene.cpp

src/robomon/Map.cpp
src/robomon/PlaygroundScene.cpp

index 9a93b7c84de76b84c5828c47097489f0ff17e311..ece6b6bad91aa8d22d2679953778a4a8a4e26290 100644 (file)
@@ -46,14 +46,20 @@ void Map::paint(QPainter *painter,
 
        painter->setPen(pen);
        painter->setBrush(brush);
-       painter->drawImage(QPointF(0,0),mapImage) ;
+
+       QTransform resize, mirror;
+       mirror.scale(1,-1);
+       resize.scale(MAP_WIDTH, MAP_HEIGHT);
+
+       painter->setTransform(mirror, true);
+       painter->setTransform(resize, true);
+
+       painter->drawImage(QPointF(0, -MAP_HEIGHT),mapImage);
+
+
 }
 
 void Map::setPixelColor(int x, int y, QColor color)
 {
-       QRgb value;
-
-       value = color.rgb();
-
-       mapImage.setPixel(x, y, value);
+       mapImage.setPixel(x, y, color.rgb());
 }
\ No newline at end of file
index 8d3e4695a6bafd5103d0cb3c7d203eeccb64e013..c74f49976ec1aa6df4af038d01fce0858f4b6809 100644 (file)
@@ -31,9 +31,6 @@ using namespace Qt;
 #define BORDER_COLOR   black
 
 //playground
-/*FIXME update accordingly to playground dimmensions in robodim.h
-Why robomon playground do not accept defined values from robodim.h?
-*/
 #define PLAYGROUND_WIDTH       PLAYGROUND_WIDTH_MM
 #define PLAYGROUND_HEIGHT      PLAYGROUND_HEIGHT_MM
 #define PLAYGROUND_COLOR       green