From 08f0a76fe2b4db9da1289cdde7e7d9c7ddd6b963 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 11 Jan 2009 01:19:26 +0000 Subject: [PATCH] fix bug in 3d h-scrolling which was introduced by new 3d compositing --- desmume/src/GPU.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index a0723e14c..e047ff341 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -2515,12 +2515,11 @@ static void GPU_ligne_layer(NDS_Screen * screen, u16 l) else if(hofs<0) { start = -hofs; end=255; ofs=0; } else { start = 0; end=255-hofs; ofs=hofs; } - //gpu3D->NDS_3D_GetLine (l, start, end, (u16*)dst+ofs); - gpu3D->NDS_3D_GetLine(l, start, end, line3Dcolor + ofs, line3Dalpha + ofs); + gpu3D->NDS_3D_GetLine(l, start, end, line3Dcolor, line3Dalpha); - for(int k = start; k <= end; k++) - if(line3Dcolor[k] & 0x8000) - gpu->setFinalColor3D(gpu, (k << 1), dst, line3Dcolor[k], line3Dalpha[k], k); + for(int k = start, q=0; k <= end; ++k, ++q) + if(line3Dcolor[q] & 0x8000) + gpu->setFinalColor3D(gpu, (q+ofs)<<1, dst, line3Dcolor[q], line3Dalpha[q], 0); continue; }