sources/Desktop/videodisplay.cpp
// display any updates to the image out to the screen
display any updates to the image out to the screen
display any updates to the image out to the screen
void VideoDisplay::UpdateScreen()
{
    int poffs = 0;
    if( paletteChooser == kPaletteAmiga )  poffs = 16;
    for( int i=0 ; i < (this->width * this->height) ; i++ )
    {
        int paletteIndex = (videoMemory[i] & 0x0F) + poffs;
        this->gfx[ (i*3)+0 ] = colorPalette[ paletteIndex ].r; 
        this->gfx[ (i*3)+1 ] = colorPalette[ paletteIndex ].g; 
        this->gfx[ (i*3)+2 ] = colorPalette[ paletteIndex ].b; 
    }
    QSize sz( this->ui->GraphicsLabel->size().width(), this->ui->GraphicsLabel->size().height() );
    this->ui->GraphicsLabel->setPixmap( QPixmap::fromImage( *this->imageGfx ).scaled( sz,
                                                                       Qt::IgnoreAspectRatio,
                                                                       Qt::FastTransformation ) );
}
void VideoDisplay :: UpdateScreen ( ) { int poffs = 0 ; if ( paletteChooser == kPaletteAmiga ) poffs = 16 ; for ( int i = 0 ; i < ( this -> width * this -> height ) ; i ++ ) { int paletteIndex = ( videoMemory [ i ] & 0x0F ) + poffs ; this -> gfx [ ( i * 3 ) + 0 ] = colorPalette [ paletteIndex ] . r ; this -> gfx [ ( i * 3 ) + 1 ] = colorPalette [ paletteIndex ] . g ; this -> gfx [ ( i * 3 ) + 2 ] = colorPalette [ paletteIndex ] . b ; } QSize sz ( this -> ui -> GraphicsLabel -> size ( ) . width ( ) , this -> ui -> GraphicsLabel -> size ( ) . height ( ) ) ; this -> ui -> GraphicsLabel -> setPixmap ( QPixmap :: fromImage ( * this -> imageGfx ) . scaled ( sz , Qt :: IgnoreAspectRatio , Qt :: FastTransformation ) ) ; }
display any updates to the image out to the screen
display any updates to the image out to the screen
// 1. convert the indexed buffer to the RGB buffer // r // g // b // 3. Blit the QImage into the label