From a3371f7bc57fda5901df3c99ccaabf281ccb460c Mon Sep 17 00:00:00 2001 From: jsalmon3 <> Date: Sun, 28 Mar 2004 16:05:47 +0000 Subject: [PATCH] Cleaned up DisplayPicture --- src/video/video.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/video/video.cpp b/src/video/video.cpp index 5fe9086dd..d71c5603f 100644 --- a/src/video/video.cpp +++ b/src/video/video.cpp @@ -387,21 +387,18 @@ global void VideoPaletteListRemove(SDL_Surface* surface) */ global void DisplayPicture(const char* name) { - Graphic* picture; + Graphic* g; - picture = LoadGraphic(name); - ResizeGraphic(picture, VideoWidth, VideoHeight); + g = LoadGraphic(name); + // FIXME: make resizing optional? + // FIXME: keep aspect ratio? + ResizeGraphic(g, VideoWidth, VideoHeight); -#ifndef USE_OPENGL - // Unset the alpha color key, not needed - SDL_SetColorKey(picture->Surface, 0, 0); - SDL_BlitSurface(picture->Surface, NULL, TheScreen, NULL); -#else - VideoDrawSubClip(picture, 0, 0, picture->Width, picture->Height, - (VideoWidth - picture->Width) / 2, (VideoHeight - picture->Height) / 2); -#endif + // FIXME: should be able to specify a location + VideoDrawSubClip(g, 0, 0, g->Width, g->Height, + (VideoWidth - g->Width) / 2, (VideoHeight - g->Height) / 2); - VideoFree(picture); + VideoFree(g); } /**