Official continuation of Destination Sol, the great fun little arcade space shooter from http://sourceforge.net/projects/destinationsol/ Modules live at https://github.com/DestinationSol/
Apache License 2.0
326
stars
123
forks
source link
fix(map): fix incorrect object culling when panning map #677
The map culling logic was never adapted to cope with a panned map. It only appeared to work because another bug accidentally offset the in-game camera position by the pan offset, rather than calculating the map camera position.
This pull request fixes the bug that caused the panned map position to become the in-game camera position. It then adapts MapDrawer to correctly use the panned map position instead.
Testing
Start a new game or continue an existing one.
Open the map.
Zoom out and have a look at the general contents of the map.
Zoom in a bit and pan around to find the objects you saw before at the new zoom level.
Pan at varying zoom levels and ensure that no planets randomly disappear from the map.
Close the map and fly to any planet.
Ensure that the planet's sprite on the map changes when near the planet.
Description
The map culling logic was never adapted to cope with a panned map. It only appeared to work because another bug accidentally offset the in-game camera position by the pan offset, rather than calculating the map camera position.
This pull request fixes the bug that caused the panned map position to become the in-game camera position. It then adapts
MapDrawer
to correctly use the panned map position instead.Testing
Notes
This fixes #564.