Added TFB_Canvas_Lock(), TFB_Canvas_Unlock() and TFB_Canvas_GetStride().

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2836 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-08-10 20:41:21 +00:00
parent a11d3e9238
commit 00780e5378
3 changed files with 29 additions and 2 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.7:
- Added TFB_Canvas_Lock(), TFB_Canvas_Unlock() and TFB_Canvas_GetStride()
- SvdB
- Scaling images with respect to their hotspots: stabilizes compound
Melee objects; re-added bilinear Melee scaler; zooming planet uses
bilinear; fixes bug #685 - Alex
@@ -1527,6 +1527,20 @@ TFB_DrawCanvas_Rescale_Bilinear (TFB_Canvas src_canvas, TFB_Canvas dst_canvas,
SDL_UnlockSurface(src);
}
void
TFB_DrawCanvas_Lock (TFB_Canvas canvas)
{
SDL_Surface *surf = (SDL_Surface *)canvas;
SDL_LockSurface (surf);
}
void
TFB_DrawCanvas_Unlock (TFB_Canvas canvas)
{
SDL_Surface *surf = (SDL_Surface *)canvas;
SDL_UnlockSurface (surf);
}
void
TFB_DrawCanvas_GetScreenFormat (TFB_PixelFormat *fmt)
{
@@ -1553,6 +1567,13 @@ TFB_DrawCanvas_GetScreenFormat (TFB_PixelFormat *fmt)
}
}
int
TFB_DrawCanvas_GetStride (TFB_Canvas canvas)
{
SDL_Surface *surf = (SDL_Surface *)canvas;
return surf->pitch;
}
void*
TFB_DrawCanvas_GetLine (TFB_Canvas canvas, int line)
{
@@ -1618,3 +1639,4 @@ TFB_DrawCanvas_GetRotatedExtent (TFB_Canvas src_canvas, int angle, EXTENT *size)
size->height = dsth;
size->width = dstw;
}
+3
View File
@@ -150,7 +150,10 @@ BOOLEAN TFB_DrawCanvas_GetTransparentColor (TFB_Canvas canvas, int *r, int *g, i
void TFB_DrawCanvas_SetTransparentColor (TFB_Canvas canvas, int r, int g, int b, BOOLEAN rleaccel);
void TFB_DrawCanvas_CopyTransparencyInfo (TFB_Canvas src, TFB_Canvas dst);
void TFB_DrawCanvas_Initialize (void);
void TFB_DrawCanvas_Lock (TFB_Canvas canvas);
void TFB_DrawCanvas_Unlock (TFB_Canvas canvas);
void TFB_DrawCanvas_GetScreenFormat (TFB_PixelFormat *fmt);
int TFB_DrawCanvas_GetStride (TFB_Canvas canvas);
void* TFB_DrawCanvas_GetLine (TFB_Canvas canvas, int line);
void TFB_DrawCanvas_GetPixel (TFB_Canvas canvas, int x, int y, int *r, int *g, int *b);