]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - dpsoftrast.c
fix row order of screen to texture copies
[xonotic/darkplaces.git] / dpsoftrast.c
index 93b42ada091571c92857c36e6d27e58e12ed9ff2..652105bb35319d627d3ab3c11dfed6c4b94090e9 100644 (file)
@@ -1246,8 +1246,9 @@ void DPSOFTRAST_CopyRectangleToTexture(int index, int mip, int tx, int ty, int s
        if (th > sh) th = sh;
        if (tw < 1 || th < 1)
                return;
+       sy1 = sheight - 1 - sy1;
        for (y = 0;y < th;y++)
-               memcpy(tpixels + ((ty1 + y) * twidth + tx1), spixels + ((sy1 + y) * swidth + sx1), tw*4);
+               memcpy(tpixels + ((ty1 + y) * twidth + tx1), spixels + ((sy1 - y) * swidth + sx1), tw*4);
        if (texture->mipmaps > 1)
                DPSOFTRAST_Texture_CalculateMipmaps(index);
 }