From 22ed62d9030c0151cba9d4310e3fca6bfe08e784 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Mon, 13 Aug 2007 21:04:34 +0000 Subject: [PATCH] Move TFB_DrawCanvas_GetScreenCanvas() to sdl_common.c as TFB_GetScreenCanvas(). git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2839 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/canvas.c | 8 -------- sc2/src/sc2code/libs/graphics/sdl/sdl_common.c | 8 ++++++++ sc2/src/sc2code/libs/graphics/tfb_draw.h | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/canvas.c b/sc2/src/sc2code/libs/graphics/sdl/canvas.c index 4a9f29d12..6059b2265 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/canvas.c +++ b/sc2/src/sc2code/libs/graphics/sdl/canvas.c @@ -1541,14 +1541,6 @@ TFB_DrawCanvas_Unlock (TFB_Canvas canvas) SDL_UnlockSurface (surf); } -// This function should only be called from the graphics thread, -// like from a TFB_DrawCommand_Callback command. -TFB_Canvas -TFB_DrawCanvas_GetScreenCanvas (SCREEN screen) -{ - return (TFB_Canvas) SDL_Screens[screen]; -} - void TFB_DrawCanvas_GetScreenFormat (TFB_PixelFormat *fmt) { diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index 25f38ada6..af5af7fd8 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -341,6 +341,14 @@ TFB_DisplayFormatAlpha (SDL_Surface *surface) return newsurf; } +// This function should only be called from the graphics thread, +// like from a TFB_DrawCommand_Callback command. +TFB_Canvas +TFB_GetScreenCanvas (SCREEN screen) +{ + return (TFB_Canvas) SDL_Screens[screen]; +} + void TFB_BlitSurface (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, int blend_numer, int blend_denom) { diff --git a/sc2/src/sc2code/libs/graphics/tfb_draw.h b/sc2/src/sc2code/libs/graphics/tfb_draw.h index be97f3c53..92171a510 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_draw.h +++ b/sc2/src/sc2code/libs/graphics/tfb_draw.h @@ -153,10 +153,11 @@ 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); -TFB_Canvas TFB_DrawCanvas_GetScreenCanvas (SCREEN screen); 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); +TFB_Canvas TFB_GetScreenCanvas (SCREEN screen); + #endif