diff --git a/sc2/src/sc2code/libs/graphics/drawcmd.h b/sc2/src/sc2code/libs/graphics/drawcmd.h index 49f7466fd..47295fe7d 100644 --- a/sc2/src/sc2code/libs/graphics/drawcmd.h +++ b/sc2/src/sc2code/libs/graphics/drawcmd.h @@ -38,6 +38,7 @@ enum TFB_DRAWCOMMANDTYPE_SETMIPMAP, TFB_DRAWCOMMANDTYPE_DELETEIMAGE, TFB_DRAWCOMMANDTYPE_SENDSIGNAL, + TFB_DRAWCOMMANDTYPE_REINITVIDEO, }; typedef struct tfb_dc_line @@ -112,6 +113,11 @@ typedef struct tfb_dc_signal Semaphore sem; } TFB_DrawCommand_SendSignal; +typedef struct tfb_dc_reinit_video +{ + int driver, flags, width, height, bpp; +} TFB_DrawCommand_ReinitVideo; + typedef struct tfb_drawcommand { int Type; @@ -127,6 +133,7 @@ typedef struct tfb_drawcommand TFB_DrawCommand_SetMipmap setmipmap; TFB_DrawCommand_DeleteImage deleteimage; TFB_DrawCommand_SendSignal sendsignal; + TFB_DrawCommand_ReinitVideo reinitvideo; } data; } TFB_DrawCommand; diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index 07a50dac3..8f8d2f699 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -677,7 +677,10 @@ TFB_FlushGraphics () // Only call from main thread!! case TFB_DRAWCOMMANDTYPE_SENDSIGNAL: ClearSemaphore (DC.data.sendsignal.sem); break; - } + case TFB_DRAWCOMMANDTYPE_REINITVIDEO: + fprintf (stderr, "TODO: REINITVIDEO command set. Not yet implemented.\n"); + break; + } } if (livelock_deterrence) diff --git a/sc2/src/sc2code/libs/graphics/tfb_draw.c b/sc2/src/sc2code/libs/graphics/tfb_draw.c index 777958fbe..f2437f06f 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_draw.c +++ b/sc2/src/sc2code/libs/graphics/tfb_draw.c @@ -208,6 +208,19 @@ TFB_DrawScreen_WaitForSignal (void) SetSemaphore (s); } +void +TFB_DrawScreen_ReinitVideo (int driver, int flags, int width, int height, int bpp) +{ + TFB_DrawCommand DrawCommand; + DrawCommand.Type = TFB_DRAWCOMMANDTYPE_REINITVIDEO; + DrawCommand.data.reinitvideo.driver = driver; + DrawCommand.data.reinitvideo.flags = flags; + DrawCommand.data.reinitvideo.width = width; + DrawCommand.data.reinitvideo.height = height; + DrawCommand.data.reinitvideo.bpp = bpp; + TFB_EnqueueDrawCommand(&DrawCommand); +} + void TFB_DrawImage_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Image *dest) { diff --git a/sc2/src/sc2code/libs/graphics/tfb_draw.h b/sc2/src/sc2code/libs/graphics/tfb_draw.h index bd2a302dc..9154f1d04 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_draw.h +++ b/sc2/src/sc2code/libs/graphics/tfb_draw.h @@ -77,6 +77,7 @@ void TFB_DrawScreen_FilledImage (TFB_Image *img, int x, int y, int scale, int r, void TFB_DrawScreen_CopyToImage (TFB_Image *img, PRECT lpRect, SCREEN src); void TFB_DrawScreen_DeleteImage (TFB_Image *img); void TFB_DrawScreen_WaitForSignal (void); +void TFB_DrawScreen_ReinitVideo (int driver, int flags, int width, int height, int bpp); void TFB_DrawScreen_SetPalette (int paletteIndex, int r, int g, int b); void TFB_FlushPaletteCache (void);