summaryrefslogtreecommitdiff
path: root/src/atimach64render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/atimach64render.c')
-rw-r--r--src/atimach64render.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/atimach64render.c b/src/atimach64render.c
index 8d259fa..39d0c5b 100644
--- a/src/atimach64render.c
+++ b/src/atimach64render.c
@@ -814,8 +814,12 @@ Mach64Composite
float ooa;
CARD32 col;
PictVector v;
- int srcXend, srcYend;
+ struct vertcoords {
+ int x;
+ int y;
+ } srcvert[4];
float dxy = 0.0, dwh = 0.0;
+ int i;
ATIDRISync(pScreenInfo);
@@ -830,22 +834,23 @@ Mach64Composite
}
/* Handle transform */
- srcXend = srcX + w;
- srcYend = srcY + h;
+ srcvert[0].x = srcX;
+ srcvert[0].y = srcY;
+ srcvert[1].x = srcX + w;
+ srcvert[1].y = srcY;
+ srcvert[2].x = srcX + w;
+ srcvert[2].y = srcY + h;
+ srcvert[3].x = srcX;
+ srcvert[3].y = srcY + h;
if (m3d->transform) {
- v.vector[0] = IntToxFixed(srcX);
- v.vector[1] = IntToxFixed(srcY);
- v.vector[2] = xFixed1;
- PictureTransformPoint(m3d->transform, &v);
- srcX = xFixedToInt(v.vector[0]);
- srcY = xFixedToInt(v.vector[1]);
-
- v.vector[0] = IntToxFixed(srcXend);
- v.vector[1] = IntToxFixed(srcYend);
- v.vector[2] = xFixed1;
- PictureTransformPoint(m3d->transform, &v);
- srcXend = xFixedToInt(v.vector[0]);
- srcYend = xFixedToInt(v.vector[1]);
+ for (i = 0; i < 4; i++) {
+ v.vector[0] = IntToxFixed(srcvert[i].x);
+ v.vector[1] = IntToxFixed(srcvert[i].y);
+ v.vector[2] = xFixed1;
+ PictureTransformPoint(m3d->transform, &v);
+ srcvert[i].x = xFixedToInt(v.vector[0]);
+ srcvert[i].y = xFixedToInt(v.vector[1]);
+ }
#if 0
/* Bilinear needs manipulation of texture coordinates */
@@ -857,10 +862,10 @@ Mach64Composite
}
/* Create vertices in clock-wise order */
- VTX_SET(v0, col, dstX, dstY, srcX, dxy, srcY, dxy);
- VTX_SET(v1, col, dstX + w, dstY, srcXend, dwh, srcY, dxy);
- VTX_SET(v2, col, dstX + w, dstY + h, srcXend, dwh, srcYend, dwh);
- VTX_SET(v3, col, dstX, dstY + h, srcX, dxy, srcYend, dwh);
+ VTX_SET(v0, col, dstX, dstY, srcvert[0].x, dxy, srcvert[0].y, dxy);
+ VTX_SET(v1, col, dstX + w, dstY, srcvert[1].x, dwh, srcvert[1].y, dxy);
+ VTX_SET(v2, col, dstX + w, dstY + h, srcvert[2].x, dwh, srcvert[2].y, dwh);
+ VTX_SET(v3, col, dstX, dstY + h, srcvert[3].x, dxy, srcvert[3].y, dwh);
/* Setup upper triangle (v0, v1, v3) */
VTX_OUT(v0, 1);