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:
@@ -38,6 +38,7 @@ enum
|
|||||||
TFB_DRAWCOMMANDTYPE_SETMIPMAP,
|
TFB_DRAWCOMMANDTYPE_SETMIPMAP,
|
||||||
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
|
TFB_DRAWCOMMANDTYPE_DELETEIMAGE,
|
||||||
TFB_DRAWCOMMANDTYPE_SENDSIGNAL,
|
TFB_DRAWCOMMANDTYPE_SENDSIGNAL,
|
||||||
|
TFB_DRAWCOMMANDTYPE_REINITVIDEO,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct tfb_dc_line
|
typedef struct tfb_dc_line
|
||||||
@@ -112,6 +113,11 @@ typedef struct tfb_dc_signal
|
|||||||
Semaphore sem;
|
Semaphore sem;
|
||||||
} TFB_DrawCommand_SendSignal;
|
} TFB_DrawCommand_SendSignal;
|
||||||
|
|
||||||
|
typedef struct tfb_dc_reinit_video
|
||||||
|
{
|
||||||
|
int driver, flags, width, height, bpp;
|
||||||
|
} TFB_DrawCommand_ReinitVideo;
|
||||||
|
|
||||||
typedef struct tfb_drawcommand
|
typedef struct tfb_drawcommand
|
||||||
{
|
{
|
||||||
int Type;
|
int Type;
|
||||||
@@ -127,6 +133,7 @@ typedef struct tfb_drawcommand
|
|||||||
TFB_DrawCommand_SetMipmap setmipmap;
|
TFB_DrawCommand_SetMipmap setmipmap;
|
||||||
TFB_DrawCommand_DeleteImage deleteimage;
|
TFB_DrawCommand_DeleteImage deleteimage;
|
||||||
TFB_DrawCommand_SendSignal sendsignal;
|
TFB_DrawCommand_SendSignal sendsignal;
|
||||||
|
TFB_DrawCommand_ReinitVideo reinitvideo;
|
||||||
} data;
|
} data;
|
||||||
} TFB_DrawCommand;
|
} TFB_DrawCommand;
|
||||||
|
|
||||||
|
|||||||
@@ -677,6 +677,9 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
case TFB_DRAWCOMMANDTYPE_SENDSIGNAL:
|
case TFB_DRAWCOMMANDTYPE_SENDSIGNAL:
|
||||||
ClearSemaphore (DC.data.sendsignal.sem);
|
ClearSemaphore (DC.data.sendsignal.sem);
|
||||||
break;
|
break;
|
||||||
|
case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
|
||||||
|
fprintf (stderr, "TODO: REINITVIDEO command set. Not yet implemented.\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,6 +208,19 @@ TFB_DrawScreen_WaitForSignal (void)
|
|||||||
SetSemaphore (s);
|
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
|
void
|
||||||
TFB_DrawImage_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Image *dest)
|
TFB_DrawImage_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Image *dest)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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_CopyToImage (TFB_Image *img, PRECT lpRect, SCREEN src);
|
||||||
void TFB_DrawScreen_DeleteImage (TFB_Image *img);
|
void TFB_DrawScreen_DeleteImage (TFB_Image *img);
|
||||||
void TFB_DrawScreen_WaitForSignal (void);
|
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_DrawScreen_SetPalette (int paletteIndex, int r, int g, int b);
|
||||||
void TFB_FlushPaletteCache (void);
|
void TFB_FlushPaletteCache (void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user