From: eihrul Date: Sun, 20 Mar 2011 14:32:43 +0000 (+0000) Subject: fix row order of screen to texture copies X-Git-Tag: xonotic-v0.6.0~163^2~599 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=000bd32af362b81bce1f9c2abf9a122ceb4b29dd;p=xonotic%2Fdarkplaces.git fix row order of screen to texture copies git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10947 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/dpsoftrast.c b/dpsoftrast.c index 93b42ada..652105bb 100644 --- a/dpsoftrast.c +++ b/dpsoftrast.c @@ -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); }