If scaling isn't supported, do an unscaled copy instead of not showing anything.
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Dec 2008 11:09:58 +0000
changeset 2827 aec4399c507a
parent 2826 cd4a49d5c1ba
child 2828 7e5ff6cd05bf
If scaling isn't supported, do an unscaled copy instead of not showing anything.
src/video/x11/SDL_x11render.c
--- a/src/video/x11/SDL_x11render.c	Wed Dec 03 06:32:04 2008 +0000
+++ b/src/video/x11/SDL_x11render.c	Wed Dec 03 11:09:58 2008 +0000
@@ -646,28 +646,21 @@
     if (data->makedirty) {
         SDL_AddDirtyRect(&data->dirty, dstrect);
     }
-
-    if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
 #ifndef NO_SHARED_MEMORY
-        if (texturedata->shminfo.shmaddr) {
-            XShmPutImage(data->display, data->drawable, data->gc,
-                         texturedata->image, srcrect->x, srcrect->y,
-                         dstrect->x, dstrect->y, dstrect->w, dstrect->h,
-                         False);
-        } else
+    if (texturedata->shminfo.shmaddr) {
+        XShmPutImage(data->display, data->drawable, data->gc,
+                     texturedata->image, srcrect->x, srcrect->y, dstrect->x,
+                     dstrect->y, srcrect->w, srcrect->h, False);
+    } else
 #endif
-        if (texturedata->pixels) {
-            XPutImage(data->display, data->drawable, data->gc,
-                      texturedata->image, srcrect->x, srcrect->y, dstrect->x,
-                      dstrect->y, dstrect->w, dstrect->h);
-        } else {
-            XCopyArea(data->display, texturedata->pixmap, data->drawable,
-                      data->gc, srcrect->x, srcrect->y, dstrect->w,
-                      dstrect->h, dstrect->x, dstrect->y);
-        }
+    if (texturedata->pixels) {
+        XPutImage(data->display, data->drawable, data->gc, texturedata->image,
+                  srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w,
+                  srcrect->h);
     } else {
-        SDL_SetError("Scaling not supported in the X11 renderer");
-        return -1;
+        XCopyArea(data->display, texturedata->pixmap, data->drawable,
+                  data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
+                  srcrect->x, srcrect->y);
     }
     return 0;
 }