When I scroll the sky but don't bend the road, that also works, I get a straight road and a scrolling sky.
The problem is, when I do both, for no reason the road portion is shifted quite a few tiles to the right and if I look really closely I can see random lines being scrolled every so slightly.
It makes no sense. All of the function parameters are correct.
Here is the code for the bend road function:
Code: Select all
void BendRoad(u16 ScrollValuesLength, fix32* ScrollValuesFloats, s16* ScrollValues, u16 iVertLine, u16 iLinesToScroll)
{
u16 uOffset = 0;
u16 i = 0;
// ADJUST EACH LINE'S OFFSET (BEND ROAD)
for (i = ScrollValuesLength - 1; i > 0; i--)
{
uOffset += 15;
ScrollValuesFloats[i] = ScrollValuesFloats[i + 1] + uOffset;
ScrollValues[i] = fix32ToInt(ScrollValuesFloats[i]);
}
// PERFORM LINE SCROLLING FOR ROAD
VDP_setHorizontalScrollLine(PLAN_B, iVertLine, ScrollValues, iLinesToScroll, FALSE);
}
Code: Select all
void ScrollSky(u16 skyScrollValuesLength, s16* skyScrollValues, u16 iSkyVertLine, u16 iSkyLinesToScroll)
{
u16 i = 0;
// SCROLL SKY
for (i = 0; i < skyScrollValuesLength; i++)
{
skyScrollValues[i] -= 1; // TODO - CHANGE TO MATCH SPEED
}
// PERFORM LINE SCROLLING FOR SKY
VDP_setHorizontalScrollLine(PLAN_A, iSkyVertLine, skyScrollValues, iSkyLinesToScroll, FALSE);
}
What could be causing this? Any help would be greatly appreciated as I'm really stuck!