Implemented backlight for simulat0r

This commit is contained in:
bernd 2011-07-26 05:23:19 +02:00
parent 515c39c0a8
commit 86d3e031ac
1 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,7 @@ using namespace std;
extern "C" { extern "C" {
#include "basic/basic.h" #include "basic/basic.h"
#include "lcd/backlight.h"
#define lcdGetPixel __hideaway_lcdGetPixel #define lcdGetPixel __hideaway_lcdGetPixel
#include "lcd/display.h" #include "lcd/display.h"
@ -86,7 +87,12 @@ public:
painter.scale(1,1); painter.scale(1,1);
QPoint pts[dimx*dimy]; QPoint pts[dimx*dimy];
pixmap.fill(0); // draw backlight
const int backlight=backlightGetBrightness()*255/100;
pixmap.setPixel(1,1,(QColor(backlight,backlight,backlight).rgb()));
pixmap.fill(pixmap.pixel(1,1));
// draw lcd array
for (int x = 0; x < dimx; ++x) { for (int x = 0; x < dimx; ++x) {
for(int y=0; y<dimy; ++y) { for(int y=0; y<dimy; ++y) {
int color; int color;
@ -103,6 +109,7 @@ public:
} }
} }
// draw leds
const int x1=dimx*rasterx-1-ledsize; const int x1=dimx*rasterx-1-ledsize;
const int y1=dimy*rastery-1+2*ledsep+ledsize; const int y1=dimy*rastery-1+2*ledsep+ledsize;
drawLED(pixmap,0,x1,y1,colorGreenLED); drawLED(pixmap,0,x1,y1,colorGreenLED);
@ -110,6 +117,7 @@ public:
drawLED(pixmap,2,0,y1,colorGreenLED); drawLED(pixmap,2,0,y1,colorGreenLED);
drawLED(pixmap,3,x1,0,colorRedLED); drawLED(pixmap,3,x1,0,colorRedLED);
// finally output pixmap
painter.drawImage(0,0,pixmap); painter.drawImage(0,0,pixmap);
} }