diff --git a/Source/i_video.c b/Source/i_video.c index bff52c44..1d2d90ea 100644 --- a/Source/i_video.c +++ b/Source/i_video.c @@ -676,6 +676,9 @@ boolean noblit; static int in_graphics_mode; static int in_page_flip, in_hires; +static void I_DrawDiskIcon(), I_RestoreDiskBackground(); +static boolean disk_to_draw; + void I_FinishUpdate(void) { if (noblit || !in_graphics_mode) @@ -720,6 +723,8 @@ void I_FinishUpdate(void) } } + I_DrawDiskIcon(); + SDL_BlitSurface(sdlscreen, NULL, argbbuffer, NULL); SDL_UpdateTexture(texture, NULL, argbbuffer->pixels, argbbuffer->pitch); @@ -727,6 +732,8 @@ void I_FinishUpdate(void) SDL_RenderClear(renderer); SDL_RenderCopy(renderer, texture, NULL, NULL); SDL_RenderPresent(renderer); + + I_RestoreDiskBackground(); } // @@ -747,30 +754,26 @@ void I_ReadScreen(byte *scr) int disk_icon; -#if 0 -static BITMAP *diskflash, *old_data; -#endif +static byte *diskflash, *old_data; static void I_InitDiskFlash(void) { -#if 0 byte temp[32*32]; if (diskflash) { - destroy_bitmap(diskflash); - destroy_bitmap(old_data); + free(diskflash); + free(old_data); } - diskflash = create_bitmap_ex(8, 16<line[0]); + V_GetBlock(0, 0, 0, 16, 16, diskflash); V_DrawBlock(0, 0, 0, 16, 16, temp); -#endif } // @@ -779,18 +782,19 @@ static void I_InitDiskFlash(void) void I_BeginRead(void) { -#if 0 + disk_to_draw = true; +} + +static void I_DrawDiskIcon(void) +{ if (!disk_icon || !in_graphics_mode) return; - blit(screen, old_data, - (SCREENWIDTH-16) << hires, - scroll_offset + ((SCREENHEIGHT-16)<SCREENWIDTH + || y<0 + || y+height>SCREENHEIGHT + || (unsigned)scrn>4 ) + I_Error ("Bad V_DrawBlock"); +#endif + + if (hires) + y<<=2, x<<=1, width<<=1, height<<=1; + + dest = screens[scrn] + y*SCREENWIDTH+x; + + while (height--) + { + memcpy (dest, src, width); + dest += SCREENWIDTH << hires; + src += width; + } +} + // // V_Init // diff --git a/Source/v_video.h b/Source/v_video.h index 8b3e7ced..3a598015 100644 --- a/Source/v_video.h +++ b/Source/v_video.h @@ -118,6 +118,10 @@ void V_DrawBlock(int x, int y, int scrn, int width, int height, byte *src); void V_GetBlock(int x, int y, int scrn, int width, int height, byte *dest); +// [FG] non hires-scaling variant of V_DrawBlock, used in disk icon drawing + +void V_PutBlock(int x, int y, int scrn, int width, int height, byte *src); + #define V_MarkRect(x,y,width,height) /* killough 11/98: unused */ #endif