Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile selection is being drawn outside the map. #6208

Closed
DorpsGek opened this issue Jan 16, 2015 · 1 comment
Closed

Tile selection is being drawn outside the map. #6208

DorpsGek opened this issue Jan 16, 2015 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

adf88 opened the ticket and wrote:

  1. start scenario editor
  2. select "lower/raise land" tool
  3. increase tool size
  4. move cursor toward SE or SW map border
  5. notice that selection "dots" are being drawn outside the map leaving artifacts behind

Bug introduced by "(svn r26899) -Codechange: reduce the amount of tiles that needs to be drawn by taking the height of tiles into account instead of drawing way too many (ic111)"

There is also a small issue that doesn't cause problems currently, but is dangerous and may cause bugs. ViewportAddLandscape fills in a TileInfo struct with the information of the tile that is being drawn currently. Before r26899, the TileInfo::tile for MP_VOID tiles was being set correctly (index of the MP_VOID tile). After r26899 TileInfo::tile is set to INVALID_TILE for booth MP_VOID tiles and non-existent tiles. It may cause problems e.g. the DrawPointSelection procedure when drawing MP_VOID tiles at SE and SW edges gets INVALID_TILE in the given TileInfo::tile. Fortunately, it doesn't refer to the TileInfo::tile field...

For sanity, the TileInfo::tile should be set correctly for every existing tile.

I'm attaching a fix (-p0), it requires #6206.

The fix changes the code in a way that tile selection is not being drawn for non-existent tiles. Also TileInfo::tile is being set correctly for every existent tile.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6208
@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27162. Thanks for the patch!


This comment was imported from FlySpray: https://bugs.openttd.org/task/6208

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant