testsprite2 should be pixel correct on Direct3D now.
authorSam Lantinga <slouken@libsdl.org>
Sat, 19 Sep 2009 05:47:54 +0000
changeset 3267 7690aa2f5b74
parent 3266 7856dfe3a44f
child 3268 82ce350be859
testsprite2 should be pixel correct on Direct3D now.
src/video/win32/SDL_d3drender.c
--- a/src/video/win32/SDL_d3drender.c	Sat Sep 19 05:45:49 2009 +0000
+++ b/src/video/win32/SDL_d3drender.c	Sat Sep 19 05:47:54 2009 +0000
@@ -894,8 +894,8 @@
 
     color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
 
-    vertices[0].x = (float) x - 0.5f;
-    vertices[0].y = (float) y - 0.5f;
+    vertices[0].x = (float) x;
+    vertices[0].y = (float) y;
     vertices[0].z = 0.0f;
     vertices[0].rhw = 1.0f;
     vertices[0].color = color;
@@ -936,16 +936,16 @@
 
     color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
 
-    vertices[0].x = (float) x1 - 0.5f;
-    vertices[0].y = (float) y1 - 0.5f;
+    vertices[0].x = (float) x1;
+    vertices[0].y = (float) y1;
     vertices[0].z = 0.0f;
     vertices[0].rhw = 1.0f;
     vertices[0].color = color;
     vertices[0].u = 0.0f;
     vertices[0].v = 0.0f;
 
-    vertices[1].x = (float) x2 - 0.5f;
-    vertices[1].y = (float) y2 - 0.5f;
+    vertices[1].x = (float) x2;
+    vertices[1].y = (float) y2;
     vertices[1].z = 0.0f;
     vertices[1].rhw = 1.0f;
     vertices[1].color = color;
@@ -985,10 +985,10 @@
         data->beginScene = SDL_FALSE;
     }
 
-    minx = (float) rect->x - 0.5f;
-    miny = (float) rect->y - 0.5f;
-    maxx = (float) rect->x + rect->w - 0.5f;
-    maxy = (float) rect->y + rect->h - 0.5f;
+    minx = (float) rect->x;
+    miny = (float) rect->y;
+    maxx = (float) rect->x + rect->w;
+    maxy = (float) rect->y + rect->h;
 
     color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
 
@@ -1060,10 +1060,10 @@
         data->beginScene = SDL_FALSE;
     }
 
-    minx = (float) dstrect->x - 0.5f;
-    miny = (float) dstrect->y - 0.5f;
-    maxx = (float) dstrect->x + dstrect->w - 0.5f;
-    maxy = (float) dstrect->y + dstrect->h - 0.5f;
+    minx = (float) dstrect->x;
+    miny = (float) dstrect->y;
+    maxx = (float) dstrect->x + dstrect->w;
+    maxy = (float) dstrect->y + dstrect->h;
 
     minu = (float) srcrect->x / texture->w;
     maxu = (float) (srcrect->x + srcrect->w) / texture->w;