mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
Draw first-pass of H/V warp BGs 3 pixels to the left
There's a noticeable seam in the horizontal and warp backgrounds whenever you enter a new room. Entering a new room triggers the game to re-draw the entire warp background instead of simply scrolling what it already has. This seam is the result of the initial background draw being misaligned with the rest of the scrolling. If you get out your measuring tools, you'll see that it's misaligned by exactly 3 pixels (this applies to both horizontal and vertical warping). If you look at the part of the code where the game draws fresh warping textures after scrolling the existing ones offscreen, you'll see it starts with an offset of 317, which is exactly 320 minus 3. And for vertical, it uses 237, which is exactly 240 minus 3. This is where the misalignment comes from. Since the incoming textures are drawn 3 pixels to the left, but the initial draw isn't, this results in a misalignment and causes the seam. To fix this, draw the initial draw of the horizontal and vertical warp backgrounds 3 pixels to the left.
This commit is contained in:
parent
f444e74550
commit
6e0b267aac
1 changed files with 8 additions and 8 deletions
|
@ -2122,10 +2122,10 @@ void Graphics::drawbackground( int t )
|
|||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
temp = 680 + (rcol * 3);
|
||||
drawtowertile((i * 16) - backoffset, (j * 16), temp+40);
|
||||
drawtowertile((i * 16) - backoffset + 8, (j * 16), temp + 41);
|
||||
drawtowertile((i * 16) - backoffset, (j * 16) + 8, temp + 80);
|
||||
drawtowertile((i * 16) - backoffset + 8, (j * 16) + 8, temp + 81);
|
||||
drawtowertile((i * 16) - backoffset - 3, (j * 16), temp+40);
|
||||
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41);
|
||||
drawtowertile((i * 16) - backoffset - 3, (j * 16) + 8, temp + 80);
|
||||
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16) + 8, temp + 81);
|
||||
}
|
||||
}
|
||||
backgrounddrawn = true;
|
||||
|
@ -2158,10 +2158,10 @@ void Graphics::drawbackground( int t )
|
|||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
temp = 760 + (rcol * 3);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset, temp+40);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset, temp + 41);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset + 8, temp + 80);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8, temp + 81);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset - 3, temp+40);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset - 3, temp + 41);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset + 8 - 3, temp + 80);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8 - 3, temp + 81);
|
||||
}
|
||||
}
|
||||
backgrounddrawn = true;
|
||||
|
|
Loading…
Reference in a new issue