Smoothly scale first background image section on left based on the first visible 3D pixel.
The current implementation does integer multiple scaling based on bgIndexStep.
- This fails if the background image width is smaller than the initial width because
bgIndexStep is truncated to 0.
- This "works" if the background image is an integer multiple of the initial width, because
bgIndexStep will be an integer multiple
- The background image is clipped because
bgIndexStep is floored to an int value.
The solution should involve making bgIndexStep a float value.
// Skip initial consecutive places that reference negative-indexed pixels.
initialWidth := 0
for ; sourceIndexes[initialWidth] < 0; initialWidth++ {
}
// TODO: Make bgIndexStep a float value so that
bgIndexStep := bgWidth / initialWidth
// Map background onto the first section on left.
var bgIndexes = make([]int, dmWidth)
for x := 0; x < initialWidth; x++ {
bgIndexes[x] = x * bgIndexStep
}
Smoothly scale first background image section on left based on the first visible 3D pixel.
The current implementation does integer multiple scaling based on
bgIndexStep.bgIndexStepis truncated to 0.bgIndexStepwill be an integer multiplebgIndexStepis floored to an int value.The solution should involve making
bgIndexStepa float value.