// // V_InitScreenVBuffer // static void V_InitScreenVBuffer(void) { if(vbscreenneedsfree) { V_FreeVBuffer(&vbscreen); V_FreeVBuffer(&backscreen1); V_FreeVBuffer(&backscreen2); V_FreeVBuffer(&backscreen3); V_FreeVBuffer(&subscreen43); } else vbscreenneedsfree = true; V_InitVBufferFrom(&vbscreen, video.width, video.height, video.pitch, video.bitdepth, video.screens[0]); V_SetScaling(&vbscreen, SCREENWIDTH, SCREENHEIGHT); V_InitVBufferFrom(&backscreen1, video.width, video.height, video.width, video.bitdepth, video.screens[1]); V_SetScaling(&backscreen1, SCREENWIDTH, SCREENHEIGHT); // Only vbscreen and backscreen1 need scaling set. V_InitVBufferFrom(&backscreen2, video.width, video.height, video.width, video.bitdepth, video.screens[2]); V_InitVBufferFrom(&backscreen3, video.width, video.height, video.width, video.bitdepth, video.screens[3]); // Init subscreen43 V_initSubScreen43(); }
// // SDLVideoDriver::ReadScreen // // Get the current screen contents. // void SDLVideoDriver::ReadScreen(byte *scr) { VBuffer temp; V_InitVBufferFrom(&temp, vbscreen.width, vbscreen.height, vbscreen.width, video.bitdepth, scr); V_BlitVBuffer(&temp, 0, 0, &vbscreen, 0, 0, vbscreen.width, vbscreen.height); V_FreeVBuffer(&temp); }
// // SDLVideoDriver::InitDiskFlash // // killough 10/98: init disk icon // void SDLVideoDriver::InitDiskFlash() { SDL_Surface *disktmp = NULL; VBuffer diskvb; if(disk) { SDL_FreeSurface(disk); SDL_FreeSurface(disk_bg); } if(vbscreen.scaled) { drect.x = vbscreen.x1lookup[vbscreen.unscaledw - 16]; drect.y = vbscreen.y1lookup[vbscreen.unscaledh - 15]; drect.w = vbscreen.x2lookup[vbscreen.unscaledw - 1] - drect.x + 1; drect.h = vbscreen.y2lookup[vbscreen.unscaledh - 1] - drect.y + 1; } else { drect.x = vbscreen.width - 16; drect.y = vbscreen.height - 15; drect.w = 16; drect.h = 15; } // haleyjd 12/26/09: create disk in a temporary 8-bit surface, unconditionally disktmp = SDL_CreateRGBSurface(0, drect.w, drect.h, 8, 0, 0, 0, 0); SDL_SetPalette(disktmp, SDL_LOGPAL, colors, 0, 256); // setup VBuffer and point it into the SDL_Surface V_InitVBufferFrom(&diskvb, drect.w, drect.h, disktmp->pitch, 8, (byte *)(disktmp->pixels)); V_SetScaling(&diskvb, 16, 15); // draw the disk graphic into the VBuffer V_DrawPatch(0, -1, &diskvb, PatchLoader::CacheName(wGlobalDir, /*cdrom_mode ? "STCDROM" :*/ "STDISK", PU_CACHE)); // Done with VBuffer object V_FreeVBuffer(&diskvb); // Convert 8-bit disk into a surface-format surface - let SDL handle the // specifics of the process, as it's designed for it. disk = SDL_DisplayFormat(disktmp); disk_bg = SDL_DisplayFormat(disktmp); // Done with the temporary 8-bit disk. SDL_FreeSurface(disktmp); }