// Draw the buffer memory onto the screen using the overlay static int DispDrawOverlay() { if (DispBack!=NULL) { MemToSurf(DispBack); DispOver->Flip(NULL,DDFLIP_WAIT); } else { MemToSurf(DispOver); } // Resize the overlay if needed OverlayPut(); return 0; }
// Paint the BlitFX surface onto the primary surface static int Paint(int bValidate) { SDL_Rect sdlrDest = { 0, 0, nGameWidth * nSize, nGameHeight * nSize }; if (bValidate & 2) { MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting } if (nVidFullscreen) { // Double bufferring sdlrDest.x = (nVidScrnWidth - nGameWidth * nSize) / 2; sdlrDest.y = (nVidScrnHeight - nGameHeight * nSize) / 2; if (SDL_BlitSurface(sdlsBlitFX[nUseSys], NULL, sdlsFramebuf, &sdlrDest)) { return 1; } SDL_Flip(sdlsFramebuf); } else { // Normal if (SDL_BlitSurface(sdlsBlitFX[nUseSys], NULL, sdlsFramebuf, &sdlrDest)) { return 1; } SDL_UpdateRect(sdlsFramebuf, 0, 0, 0, 0); } return 0; }
// Run one frame and render the screen static int Frame(bool bRedraw) // bRedraw = 0 { //if (pVidImage == NULL) { if( sdlFramebuf == NULL ) { printf("sdlFramebuf==NULL"); return 1; } if (bDrvOkay) { if (bRedraw) { // Redraw current frame if (BurnDrvRedraw()) { BurnDrvFrame(); // No redraw function provided, advance one frame } } else { BurnDrvFrame(); // Run one frame and draw the screen } } else { printf("bDrvOkay != TRUE"); return 1; } MemToSurf(); // Copy the memory buffer to the directdraw buffer for later blitting return 0; }
// Draw the buffer memory onto the primary surface int DispDraw() { int Ret=0; if (DispPrim==NULL) return 1; if (DispPrim->IsLost()) { DispPrim->Restore(); } // Restore surface if lost if (DispOver!=NULL) { return DispDrawOverlay(); } // Use overlay if present // Else use normal Buffer if (DispBuff==NULL) return 1; if (DispBuff->IsLost()) { DispBuff->Restore(); } // Restore surface if lost // buffer memory --> buffer surface Ret=MemToSurf(DispBuff); if (Ret!=0) return 1; return NormalPut(); }