From: K.Ohta Date: Mon, 18 Jan 2016 05:54:30 +0000 (+0900) Subject: [Qt][OSD][DRAW] Clear image surface when allocating. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8aa8a69c5a6af4da4d25a32b8c64395b108b5cfd;p=csp-qt%2Fcommon_source_project-fm7.git [Qt][OSD][DRAW] Clear image surface when allocating. --- diff --git a/source/src/qt/osd_screen.cpp b/source/src/qt/osd_screen.cpp index 5dc2e8f0b..723e7402b 100644 --- a/source/src/qt/osd_screen.cpp +++ b/source/src/qt/osd_screen.cpp @@ -32,11 +32,12 @@ void OSD::initialize_screen() vm_screen_width_aspect = SCREEN_WIDTH_ASPECT; vm_screen_height_aspect = SCREEN_HEIGHT_ASPECT; + QColor col(0, 0, 0, 255); //memset(&vm_screen_buffer, 0, sizeof(bitmap_t)); vm_screen_buffer.width = SCREEN_WIDTH; vm_screen_buffer.height = SCREEN_HEIGHT; vm_screen_buffer.pImage = QImage(SCREEN_WIDTH, SCREEN_HEIGHT, QImage::Format_ARGB32); - + vm_screen_buffer.pImage.fill(col); now_rec_video = false; //pAVIStream = NULL; //pAVICompressed = NULL; @@ -176,7 +177,9 @@ void OSD::initialize_screen_buffer(bitmap_t *buffer, int width, int height, int buffer->width = width; buffer->height = height; if((width > buffer->pImage.width()) || (height > buffer->pImage.height())) { + QColor col(0, 0, 0, 255); buffer->pImage = QImage(width, height, QImage::Format_ARGB32); + buffer->pImage.fill(col); } //printf("%dx%d NULL=%d\n", buffer->pImage.width(), buffer->pImage.height(), buffer->pImage.isNull() ? 1 : 0); QColor fillcolor; diff --git a/source/src/vm/babbage2nd/display.cpp b/source/src/vm/babbage2nd/display.cpp index 8d1e1e6b6..a0a5864e8 100644 --- a/source/src/vm/babbage2nd/display.cpp +++ b/source/src/vm/babbage2nd/display.cpp @@ -133,11 +133,10 @@ void DISPLAY::draw_screen() // draw 7-seg LEDs scrntype col_h, col_l; scrntype col[8]; - + col_h = RGB_COLOR(255, 0, 0); col_l = RGB_COLOR(107, 0, 0); col[0] = RGB_COLOR(82, 8, 16); - for(int i = 0; i < 6; i++) { for(int j = 0; j < 7; j++) { col[j + 1] = (seg[i][j] > 8) ? col_h : col_l; diff --git a/source/src/vm/ys6464a/display.cpp b/source/src/vm/ys6464a/display.cpp index b68f35b6b..66bed9444 100644 --- a/source/src/vm/ys6464a/display.cpp +++ b/source/src/vm/ys6464a/display.cpp @@ -100,7 +100,7 @@ void DISPLAY::draw_screen() col_h = RGB_COLOR(255, 0, 0); col_l = RGB_COLOR(107, 0, 0); col[0] = RGB_COLOR(38, 8, 0); - + for(int i = 0; i < 6; i++) { for(int j = 0; j < 8; j++) { col[j + 1] = (seg[i][j] > 8) ? col_h : col_l;