diff src/video/bwindow/SDL_sysyuv.cc @ 1643:51038e80ae59

More general fix for bug #189 The clipping is done at a higher level, and the low level functions are passed clipped rectangles. Drivers which don't support source clipping have not been changed, so the image will be squished instead of clipped, but at least they will no longer crash when the destination rect was out of bounds.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 17 Apr 2006 06:47:23 +0000
parents 376665398b25
children 782fd950bd46 c121d94672cb 2b5c30359c1d
line wrap: on
line diff
--- a/src/video/bwindow/SDL_sysyuv.cc	Mon Apr 17 05:38:33 2006 +0000
+++ b/src/video/bwindow/SDL_sysyuv.cc	Mon Apr 17 06:47:23 2006 +0000
@@ -263,7 +263,7 @@
     overlay->hwdata->locked = 0;
 }
 
-int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* dstrect)
+int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect *dst)
 {
     if ((overlay == NULL) || (overlay->hwdata==NULL)
         || (overlay->hwdata->bview==NULL) || (SDL_Win->View() == NULL))
@@ -277,11 +277,11 @@
     if (SDL_Win->IsFullScreen()) {
     	int left,top;
     	SDL_Win->GetXYOffset(left,top);
-	    bview->MoveTo(left+dstrect->x,top+dstrect->y);
+	    bview->MoveTo(left+dst->x,top+dst->y);
     } else {
-	    bview->MoveTo(dstrect->x,dstrect->y);
+	    bview->MoveTo(dst->x,dst->y);
     }
-    bview->ResizeTo(dstrect->w,dstrect->h);
+    bview->ResizeTo(dst->w,dst->h);
     bview->Flush();
 	if (overlay->hwdata->first_display) {
 		bview->Show();