Fix regression: Warp BG lerps in reverse direction

This fixes a regression caused by PR #923 (the PR that moved rendering
to be GPU-based) where the interpolation of the horizontal and vertical
warp backgrounds (in over-30-FPS mode) was in the wrong direction, which
makes them look blurry.

This happens because the arguments to the `lerp` function were in the
wrong, reverse order.

On the VVVVVV Discord server, Ally raised the argument that they were in
the same order before she made the changes; therefore the previous code
was also incorrect and it wasn't her fault. However, this argument is
incorrect, because in that case, the reverse order _is_ the correct
order.

The reason that it's now the wrong order is because the output of `lerp`
is now being used as the argument to a source rectangle. Previously, the
output of `lerp` was being used as the offset argument to
`ScrollSurface`, which is analogous to being a destination rectangle.

Fixes #1038.
This commit is contained in:
Misa 2023-11-27 13:29:06 -08:00
parent 8426e0930d
commit 70357a65bf
1 changed files with 2 additions and 2 deletions

View File

@ -2443,7 +2443,7 @@ void Graphics::drawbackground( int t )
{
clear();
const int offset = (int) lerp(0, -3);
const int offset = (int) lerp(-3, 0);
const SDL_Rect srcRect = {8 + offset, 0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
copy_texture(backgroundTexture, &srcRect, NULL);
@ -2453,7 +2453,7 @@ void Graphics::drawbackground( int t )
{
clear();
const int offset = (int) lerp(0, -3);
const int offset = (int) lerp(-3, 0);
const SDL_Rect srcRect = {0, 8 + offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
copy_texture(backgroundTexture, &srcRect, NULL);