From a9f03544d5bd53bdce906f077d0373a7ab0202ef Mon Sep 17 00:00:00 2001 From: NovaRain Date: Thu, 20 Jan 2022 10:29:00 +0800 Subject: [PATCH] Fixed movie scale pitch size for CPU palette conversion --- artifacts/ddraw.ini | 2 +- sfall/Modules/Graphics.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 34843ba7..482c29f6 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -3,7 +3,7 @@ [Main] ;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash -;The required settings will be read from f2_res.ini configuration file from the original hi-res patch +;The required settings will be read from the f2_res.ini configuration file of the original hi-res patch HiResMode=1 ;Set to 1 if you want to use command line arguments to tell sfall to use another ini file diff --git a/sfall/Modules/Graphics.cpp b/sfall/Modules/Graphics.cpp index 4e7d07fb..f08cc36d 100644 --- a/sfall/Modules/Graphics.cpp +++ b/sfall/Modules/Graphics.cpp @@ -645,6 +645,7 @@ public: fo::func::buf_to_buf(mveSurface, width, mveDesc.dwHeight, width, (BYTE*)dRect.pBits, dRect.Pitch); } } else { + int sPitch = width; int height = mveDesc.dwHeight; if (d != 0) { // scale @@ -653,7 +654,9 @@ public: height = dst->bottom - dst->top; HRP::Image::Scale(mveSurface, mveDesc.lPitch, mveDesc.dwHeight, mveScaleSurface, width, height, ResWidth); + mveSurface = mveScaleSurface; + sPitch = ResWidth; } int pitch = dRect.Pitch / 4; @@ -662,7 +665,7 @@ public: while (height--) { int x = width; while (x--) pBits[x] = palette[mveSurface[x]].xRGB; - mveSurface += width; + mveSurface += sPitch; pBits += pitch; } }