Backed out changeset 6c59f7c8ec17 - it didn't actually do anything useful
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index 38fb6d0..a4c6027 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -1635,26 +1635,22 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
centerx = center->x;
centery = center->y;
- if ((flip & SDL_FLIP_VERTICAL) && (flip & SDL_FLIP_HORIZONTAL)) {
- miny = dstrect->h - centery;
- maxy = -centery;
- minx = dstrect->w - centerx;
- maxx = -centerx;
- } else if (flip & SDL_FLIP_HORIZONTAL) {
- miny = -centery;
- maxy = dstrect->h - centery;
- minx = dstrect->w - centerx;
- maxx = -centerx;
- } else if (flip & SDL_FLIP_VERTICAL) {
- miny = dstrect->h - centery;
- maxy = -centery;
- minx = -centerx;
- maxx = dstrect->w - centerx;
- } else {
- miny = -centery;
- maxy = dstrect->h - centery;
- minx = -centerx;
- maxx = dstrect->w - centerx;
+ if (flip & SDL_FLIP_HORIZONTAL) {
+ minx = dstrect->w - centerx - 0.5f;
+ maxx = -centerx - 0.5f;
+ }
+ else {
+ minx = -centerx - 0.5f;
+ maxx = dstrect->w - centerx - 0.5f;
+ }
+
+ if (flip & SDL_FLIP_VERTICAL) {
+ miny = dstrect->h - centery - 0.5f;
+ maxy = -centery - 0.5f;
+ }
+ else {
+ miny = -centery - 0.5f;
+ maxy = dstrect->h - centery - 0.5f;
}
minu = (float) srcrect->x / texture->w;
diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index bb789c1..94914ea 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -1250,26 +1250,22 @@ GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
centerx = center->x;
centery = center->y;
- if ((flip & SDL_FLIP_VERTICAL) && (flip & SDL_FLIP_HORIZONTAL)) {
- miny = dstrect->h - centery;
- maxy = -centery;
- minx = dstrect->w - centerx;
- maxx = -centerx;
- } else if (flip & SDL_FLIP_HORIZONTAL) {
- miny = -centery;
- maxy = dstrect->h - centery;
- minx = dstrect->w - centerx;
+ if (flip & SDL_FLIP_HORIZONTAL) {
+ minx = dstrect->w - centerx;
maxx = -centerx;
- } else if (flip & SDL_FLIP_VERTICAL) {
- miny = dstrect->h - centery;
- maxy = -centery;
+ }
+ else {
minx = -centerx;
- maxx = dstrect->w - centerx;
- } else {
+ maxx = dstrect->w - centerx;
+ }
+
+ if (flip & SDL_FLIP_VERTICAL) {
+ miny = dstrect->h - centery;
+ maxy = -centery;
+ }
+ else {
miny = -centery;
- maxy = dstrect->h - centery;
- minx = -centerx;
- maxx = dstrect->w - centerx;
+ maxy = dstrect->h - centery;
}
minu = (GLfloat) srcrect->x / texture->w;