diff -r e9d67ac0c6f8 src/render/direct3d/SDL_render_d3d.c --- a/src/render/direct3d/SDL_render_d3d.c Wed Jul 30 17:45:52 2014 -0700 +++ b/src/render/direct3d/SDL_render_d3d.c Fri Aug 01 00:10:36 2014 +0430 @@ -1671,29 +1671,27 @@ centerx = center->x; centery = center->y; - 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; - } + minx = -centerx; + maxx = dstrect->w - centerx; + miny = -centery; + maxy = dstrect->h - centery; minu = (float) srcrect->x / texture->w; maxu = (float) (srcrect->x + srcrect->w) / texture->w; minv = (float) srcrect->y / texture->h; maxv = (float) (srcrect->y + srcrect->h) / texture->h; + if (flip & SDL_FLIP_HORIZONTAL) { + float tmp = maxu; + maxu = minu; + minu = tmp; + } + if (flip & SDL_FLIP_VERTICAL) { + float tmp = maxv; + maxv = minv; + minv = tmp; + } + color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b); vertices[0].x = minx; @@ -1729,8 +1727,7 @@ /* Rotate and translate */ modelMatrix = MatrixMultiply( MatrixRotationZ((float)(M_PI * (float) angle / 180.0f)), - MatrixTranslation(dstrect->x + center->x, dstrect->y + center->y, 0) -); + MatrixTranslation(dstrect->x + center->x - 0.5f, dstrect->y + center->y - 0.5f, 0)); IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix); D3D_UpdateTextureScaleMode(data, texturedata, 0); diff -r e9d67ac0c6f8 src/render/direct3d11/SDL_render_d3d11.c --- a/src/render/direct3d11/SDL_render_d3d11.c Wed Jul 30 17:45:52 2014 -0700 +++ b/src/render/direct3d11/SDL_render_d3d11.c Fri Aug 01 00:10:36 2014 +0430 @@ -2471,7 +2471,7 @@ vertices = SDL_stack_alloc(VertexPositionColor, count); for (i = 0; i < min(count, 128); ++i) { - const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } }; + const VertexPositionColor v = { { points[i].x + 0.5f, points[i].y + 0.5f, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } }; vertices[i] = v; } @@ -2510,7 +2510,7 @@ vertices = SDL_stack_alloc(VertexPositionColor, count); for (i = 0; i < count; ++i) { - const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } }; + const VertexPositionColor v = { { points[i].x + 0.5f, points[i].y + 0.5f, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } }; vertices[i] = v; } @@ -2529,6 +2529,7 @@ NULL); D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, count); + D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, count); SDL_stack_free(vertices); return 0; }