From 80cbe0de8acf83ca1e4e92c4430e97fb62283087 Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sun, 2 Dec 2007 00:13:40 +0000 Subject: [PATCH] added workaround for +1 scanline size in 16bit mode --- trunk/src/win32/Direct3D.cpp | 10 +++++++++- trunk/src/win32/DirectDraw.cpp | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/trunk/src/win32/Direct3D.cpp b/trunk/src/win32/Direct3D.cpp index 6fb169a8..88017a63 100644 --- a/trunk/src/win32/Direct3D.cpp +++ b/trunk/src/win32/Direct3D.cpp @@ -484,7 +484,15 @@ void Direct3DDisplay::render() return; } else { if( !theApp.filterFunction ) { - copyImage( pix, lr.pBits, theApp.sizeX, theApp.sizeY, lr.Pitch, systemColorDepth ); + copyImage( + pix, + lr.pBits, + (systemColorDepth == 32) ? theApp.sizeX + : theApp.sizeX + 1, // TODO: workaround results in one pixel black border at right side + theApp.sizeY, + lr.Pitch, + systemColorDepth + ); } else { u32 pitch = theApp.filterWidth * (systemColorDepth>>3) + 4; theApp.filterFunction( pix + pitch, diff --git a/trunk/src/win32/DirectDraw.cpp b/trunk/src/win32/DirectDraw.cpp index b5c0a67f..667926c6 100644 --- a/trunk/src/win32/DirectDraw.cpp +++ b/trunk/src/win32/DirectDraw.cpp @@ -722,6 +722,9 @@ void DirectDrawDisplay::render() copyY = 144; } } + if( systemColorDepth == 16 ) { + copyX++; // TODO: workaround results in one pixel black border at right side + } copyImage( pix, ddsDesc.lpSurface, copyX, copyY, ddsDesc.lPitch, systemColorDepth ); } if(theApp.showSpeed && (theApp.videoOption > VIDEO_4X || theApp.skin != NULL)) {