Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
If scaling isn't supported, do an unscaled copy instead of not showin…
Browse files Browse the repository at this point in the history
…g anything.
  • Loading branch information
slouken committed Dec 3, 2008
1 parent 9f495a3 commit c073839
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/video/x11/SDL_x11render.c
Expand Up @@ -646,28 +646,21 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
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;
}
Expand Down

0 comments on commit c073839

Please sign in to comment.