News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

[patch] fix of the clipping in simgraph16.cc

Started by Dwachs, February 26, 2009, 12:23:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

In the graphic module simgraph there is the possibility to use clipping.
There, a pixel at coordinate xp is displayed if
clip. x <= xp < clip.xx
The right-most pixel of an image located at xp with width w is displayed if
clip.x < xp+w <= clip.xx
Their is a slight difference, easy to miss in the code.

The results of this errors can be seen if:

Scrolling such that blue sea (or outside) tiles are on the left of the screen, you will notice some artefact pixels on the left of the screen (only one pixel wide). Preferable with some winter landscape on the right of the screen.

This can be also seen by moving the line-management window slowly to the right of the screen out of the visible area. See the pictures. One of the vertical lines of the graph in the line-manager is shown on the left of the window.

Patch attached.

Linux executable for gcc4 here:

http://simutrans-germany.com/~patches/upload/sim-gcc4-simgraph16.zip
I hope it is executable after extracting  ::)
Parsley, sage, rosemary, and maggikraut.

Dwachs

Parsley, sage, rosemary, and maggikraut.