comparison 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
comparison
equal deleted inserted replaced
1642:f1211a4b7380 1643:51038e80ae59
261 } 261 }
262 262
263 overlay->hwdata->locked = 0; 263 overlay->hwdata->locked = 0;
264 } 264 }
265 265
266 int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* dstrect) 266 int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect *dst)
267 { 267 {
268 if ((overlay == NULL) || (overlay->hwdata==NULL) 268 if ((overlay == NULL) || (overlay->hwdata==NULL)
269 || (overlay->hwdata->bview==NULL) || (SDL_Win->View() == NULL)) 269 || (overlay->hwdata->bview==NULL) || (SDL_Win->View() == NULL))
270 { 270 {
271 return -1; 271 return -1;
275 } 275 }
276 BView * bview = overlay->hwdata->bview; 276 BView * bview = overlay->hwdata->bview;
277 if (SDL_Win->IsFullScreen()) { 277 if (SDL_Win->IsFullScreen()) {
278 int left,top; 278 int left,top;
279 SDL_Win->GetXYOffset(left,top); 279 SDL_Win->GetXYOffset(left,top);
280 bview->MoveTo(left+dstrect->x,top+dstrect->y); 280 bview->MoveTo(left+dst->x,top+dst->y);
281 } else { 281 } else {
282 bview->MoveTo(dstrect->x,dstrect->y); 282 bview->MoveTo(dst->x,dst->y);
283 } 283 }
284 bview->ResizeTo(dstrect->w,dstrect->h); 284 bview->ResizeTo(dst->w,dst->h);
285 bview->Flush(); 285 bview->Flush();
286 if (overlay->hwdata->first_display) { 286 if (overlay->hwdata->first_display) {
287 bview->Show(); 287 bview->Show();
288 overlay->hwdata->first_display = false; 288 overlay->hwdata->first_display = false;
289 } 289 }