// // I_FinishUpdate // // Called at the end of drawing a video frame. This unlocks the primary // surface for drawing and blits the contents to the video screen. // void I_FinishUpdate() { if (I_VideoInitialized()) { // Draws frame time and cumulative fps if (vid_displayfps) V_DrawFPSWidget(); // draws little dots on the bottom of the screen if (vid_ticker) V_DrawFPSTicker(); // draws a disk loading icon in the lower right corner if (gametic <= loading_icon_expire) I_BlitLoadingIcon(); // Handle blitting our 8bpp surface to the 32bpp video window surface if (converted_surface) { IWindowSurface* real_primary_surface = I_GetWindow()->getPrimarySurface(); real_primary_surface->blit(converted_surface, 0, 0, converted_surface->getWidth(), converted_surface->getHeight(), 0, 0, real_primary_surface->getWidth(), real_primary_surface->getHeight()); } I_UnlockAllSurfaces(); I_GetWindow()->finishRefresh(); // restores the background underneath the disk loading icon in the lower right corner if (gametic <= loading_icon_expire) I_RestoreLoadingIcon(); } }
void SDLVideo::UpdateScreen(DCanvas *canvas) { // Draws frame time and cumulative fps if (vid_displayfps) V_DrawFPSWidget(); // draws little dots on the bottom of the screen if (vid_ticker) V_DrawFPSTicker(); if (palettechanged) { // m_Private may or may not be the primary surface (sdlScreen) SDL_SetPalette((SDL_Surface*)canvas->m_Private, SDL_LOGPAL|SDL_PHYSPAL, newPalette, 0, 256); SDL_SetPalette(sdlScreen, SDL_LOGPAL|SDL_PHYSPAL, newPalette, 0, 256); palettechanged = false; } // If not writing directly to the screen blit to the primary surface if (canvas->m_Private != sdlScreen) { short w = (screenw - canvas->width) >> 1; short h = (screenh - canvas->height) >> 1; SDL_Rect dstrect = { w, h }; SDL_BlitSurface((SDL_Surface*)canvas->m_Private, NULL, sdlScreen, &dstrect); }