comparison src/video/win32/SDL_d3drender.c @ 3279:fd207dce9f94

I think this fixes the texture pixel alignment
author Sam Lantinga <slouken@libsdl.org>
date Sat, 19 Sep 2009 12:48:52 +0000
parents 7690aa2f5b74
children 36cf454ba065
comparison
equal deleted inserted replaced
3278:b2a3cbb9ec08 3279:fd207dce9f94
1058 if (data->beginScene) { 1058 if (data->beginScene) {
1059 IDirect3DDevice9_BeginScene(data->device); 1059 IDirect3DDevice9_BeginScene(data->device);
1060 data->beginScene = SDL_FALSE; 1060 data->beginScene = SDL_FALSE;
1061 } 1061 }
1062 1062
1063 minx = (float) dstrect->x; 1063 minx = (float) dstrect->x - 0.5f;
1064 miny = (float) dstrect->y; 1064 miny = (float) dstrect->y - 0.5f;
1065 maxx = (float) dstrect->x + dstrect->w; 1065 maxx = (float) dstrect->x + dstrect->w - 0.5f;
1066 maxy = (float) dstrect->y + dstrect->h; 1066 maxy = (float) dstrect->y + dstrect->h - 0.5f;
1067 1067
1068 minu = (float) srcrect->x / texture->w; 1068 minu = (float) srcrect->x / texture->w;
1069 maxu = (float) (srcrect->x + srcrect->w) / texture->w; 1069 maxu = (float) (srcrect->x + srcrect->w) / texture->w;
1070 minv = (float) srcrect->y / texture->h; 1070 minv = (float) srcrect->y / texture->h;
1071 maxv = (float) (srcrect->y + srcrect->h) / texture->h; 1071 maxv = (float) (srcrect->y + srcrect->h) / texture->h;