OSDN Git Service

[Qt][OSD][DRAW] Clear image surface when allocating.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 18 Jan 2016 05:54:30 +0000 (14:54 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 18 Jan 2016 05:54:30 +0000 (14:54 +0900)
source/src/qt/osd_screen.cpp
source/src/vm/babbage2nd/display.cpp
source/src/vm/ys6464a/display.cpp

index 5dc2e8f..723e740 100644 (file)
@@ -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;
index 8d1e1e6..a0a5864 100644 (file)
@@ -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;
index b68f35b..66bed94 100644 (file)
@@ -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;