Skip to main content
Topic: [Bug] Nothing drawn in the lower part of the main view (Read 3048 times) previous topic - next topic

[Bug] Nothing drawn in the lower part of the main view

I have just encountered a bug which I thought was introduced by my viewport patch, but is actually an existing bug. I can reproduce it in r3122, the release candidate. (Please see the attached image.)

The problem is that no tiles are displayed in the lower part of the main view, creating hollow row(s) of afterimages. This happens when
(1) the main window's size is small, and
(2) zoom-in level is set to the highest, and
(3) the altitude of the grounds displayed is high (e.g. at height level = 12), and
(4) may need to drag the map around a bit to start seeing this phenomenon

I will see if I can fix it too in the viewport patch.

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #1
This must be a very old bug then. Does this also happen with very low altitude of land (e.g. z=-12)?
Parsley, sage, rosemary, and maggikraut.

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #2
yes it does

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #3
I remember this problem. I had capped the mountain height to avoid the problem. Must have been revealed again with more changes lately ...

Basically it's a question how much effort the program will put into determining which tiles must be drawn and which can be left out. I made there a pretty simple and hard cut for the mountains. Seems it worked good enough for many years ;D

Ameleks problem is new, though. Although related (upper bound, instead of lower screen bound). Upper bounds was easy, since the water covers the eeper parts of the map and always provides a "filler".

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #4
I think Amelek's problem is the same in nature as mine.

The root problem is like this : when we first position the main view on a highland tile via minimap, static viewports or other links, centre position (karte_t::ij_off) is set to the tile position of that highland tile, while karte_t::yoff is set to the screen height of that tile's height, which is fine. But once you start dragging, the height offset is absorbed into the centre position. This means that the position of the centre tile shown on the screen is not the centre position stored in ij_off.

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #5
This bug is there for ages. Usually it show only up with planes, because nobody does a mountain 14 tiles hight. I found no easy way out without much more calculation efforts.

Re: [Bug] Nothing drawn in the lower part of the main view

Reply #6
I finally think of a way to solve this problem without incurring heavy calculations or numerous checks as in karte_t::bewege_zeiger(). I will post the viewport patch again after some more checking and testing.