| Summary: | Code getting duplicate in SDL_UpperBlitScaled | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Nitz <nitin.j4> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | 2.0.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
I think this can be closed because this is fixed with: https://hg.libsdl.org/SDL/diff/5e713281410c/src/video/SDL_surface.c Thanks for the heads up! |
In function: int SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect) { //Some Code /* If the destination rectangle is NULL, use the entire dest surface */ if (dstrect == NULL) { fulldst.x = fulldst.y = 0; dstrect = &fulldst; } //Some Code /* clip the destination rectangle against the clip rectangle */ if (dstrect) { int maxw, maxh; final_dst.x = dstrect->x; final_dst.w = dstrect->w; if (final_dst.x < 0) { final_dst.w += final_dst.x; final_dst.x = 0; } maxw = dst->w - final_dst.x; if (maxw < final_dst.w) final_dst.w = maxw; final_dst.y = dstrect->y; final_dst.h = dstrect->h; if (final_dst.y < 0) { final_dst.h += final_dst.y; final_dst.y = 0; } maxh = dst->h - final_dst.y; if (maxh < final_dst.h) final_dst.h = maxh; } else { final_dst.x = final_dst.y = 0; final_dst.w = dst->w; final_dst.h = dst->h; } //Some Code } In This code there is no need of if-else statement for dstrect, because it's handling has already been done. So remove this if-else statement and remove the else part from the code.