]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix row order of screen to texture copies
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 14:32:43 +0000 (14:32 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 14:32:43 +0000 (14:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10947 d7cf8633-e32d-0410-b094-e92efae38249

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);
 }