dolda2000 / hafen-client

Haven & Hearth client
Other
35 stars 185 forks source link

Draw ridges for border tiles #12

Open elsid opened 3 years ago

elsid commented 3 years ago

Before you may see little holes in the ridge that are aligned with map grid image:

before_border_ridges

After there are none:

after_border_ridges

Fix is to check all tiles including 0 and sz - 1. Tile is considered to be absent if gettile returns a negative number.

dolda2000 commented 3 years ago

Sorry, I only just now noticed this pull request. It's generally a nice fix, but I'm not sure I like the whole thing about considering Z==0 as a missing grid. I'll have to think for a bit about how that should be flagged.

elsid commented 3 years ago

I had my own implementation for this feature. That's why I noticed this bug. I store it in my private repo but don't use it anymore. There I used a flag in TileInfo to say does it have valid height map and saved it into a map file. But I wasn't sure about bringing it here. I agree, zero height can be a problem. If there is a ridge in a tile with height zero it will not be shown on the map. Either a flag should point that grid height map is not filled or a specific default value. Also the flag can be implicitly stored via map file version.