Introduces a new DrawCommand to be used for res/driver changes

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1478 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2005-01-21 19:27:27 +00:00
parent c92033fe37
commit 837dbd7892
4 changed files with 25 additions and 1 deletions
+7
View File
@@ -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;
@@ -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)
+13
View File
@@ -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)
{
+1
View File
@@ -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);