Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_d3drender.c @ 3267:7690aa2f5b74
testsprite2 should be pixel correct on Direct3D now.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 19 Sep 2009 05:47:54 +0000 |
parents | 434ce3242e1c |
children | fd207dce9f94 |
comparison
equal
deleted
inserted
replaced
3266:7856dfe3a44f | 3267:7690aa2f5b74 |
---|---|
892 data->beginScene = SDL_FALSE; | 892 data->beginScene = SDL_FALSE; |
893 } | 893 } |
894 | 894 |
895 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); | 895 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); |
896 | 896 |
897 vertices[0].x = (float) x - 0.5f; | 897 vertices[0].x = (float) x; |
898 vertices[0].y = (float) y - 0.5f; | 898 vertices[0].y = (float) y; |
899 vertices[0].z = 0.0f; | 899 vertices[0].z = 0.0f; |
900 vertices[0].rhw = 1.0f; | 900 vertices[0].rhw = 1.0f; |
901 vertices[0].color = color; | 901 vertices[0].color = color; |
902 vertices[0].u = 0.0f; | 902 vertices[0].u = 0.0f; |
903 vertices[0].v = 0.0f; | 903 vertices[0].v = 0.0f; |
934 data->beginScene = SDL_FALSE; | 934 data->beginScene = SDL_FALSE; |
935 } | 935 } |
936 | 936 |
937 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); | 937 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); |
938 | 938 |
939 vertices[0].x = (float) x1 - 0.5f; | 939 vertices[0].x = (float) x1; |
940 vertices[0].y = (float) y1 - 0.5f; | 940 vertices[0].y = (float) y1; |
941 vertices[0].z = 0.0f; | 941 vertices[0].z = 0.0f; |
942 vertices[0].rhw = 1.0f; | 942 vertices[0].rhw = 1.0f; |
943 vertices[0].color = color; | 943 vertices[0].color = color; |
944 vertices[0].u = 0.0f; | 944 vertices[0].u = 0.0f; |
945 vertices[0].v = 0.0f; | 945 vertices[0].v = 0.0f; |
946 | 946 |
947 vertices[1].x = (float) x2 - 0.5f; | 947 vertices[1].x = (float) x2; |
948 vertices[1].y = (float) y2 - 0.5f; | 948 vertices[1].y = (float) y2; |
949 vertices[1].z = 0.0f; | 949 vertices[1].z = 0.0f; |
950 vertices[1].rhw = 1.0f; | 950 vertices[1].rhw = 1.0f; |
951 vertices[1].color = color; | 951 vertices[1].color = color; |
952 vertices[1].u = 0.0f; | 952 vertices[1].u = 0.0f; |
953 vertices[1].v = 0.0f; | 953 vertices[1].v = 0.0f; |
983 if (data->beginScene) { | 983 if (data->beginScene) { |
984 IDirect3DDevice9_BeginScene(data->device); | 984 IDirect3DDevice9_BeginScene(data->device); |
985 data->beginScene = SDL_FALSE; | 985 data->beginScene = SDL_FALSE; |
986 } | 986 } |
987 | 987 |
988 minx = (float) rect->x - 0.5f; | 988 minx = (float) rect->x; |
989 miny = (float) rect->y - 0.5f; | 989 miny = (float) rect->y; |
990 maxx = (float) rect->x + rect->w - 0.5f; | 990 maxx = (float) rect->x + rect->w; |
991 maxy = (float) rect->y + rect->h - 0.5f; | 991 maxy = (float) rect->y + rect->h; |
992 | 992 |
993 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); | 993 color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); |
994 | 994 |
995 vertices[0].x = minx; | 995 vertices[0].x = minx; |
996 vertices[0].y = miny; | 996 vertices[0].y = miny; |
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 - 0.5f; | 1063 minx = (float) dstrect->x; |
1064 miny = (float) dstrect->y - 0.5f; | 1064 miny = (float) dstrect->y; |
1065 maxx = (float) dstrect->x + dstrect->w - 0.5f; | 1065 maxx = (float) dstrect->x + dstrect->w; |
1066 maxy = (float) dstrect->y + dstrect->h - 0.5f; | 1066 maxy = (float) dstrect->y + dstrect->h; |
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; |