News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Clipping failure

Started by TurfIt, September 02, 2013, 02:27:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

Dings on tiles displayed at the bottom of the screen are not being height clipped correctly.
Three screen shots to illustrate: (from the yoshi game @231,295)
01: What the area looks like with proper clipping.
02: Same area with simple_drawing activated showing buildings/trees through the bridge. As expected for this mode.
03: simple_drawing is off, screen scrolled so tile containing the building/trees is just off the bottom edge. It's now drawing through the bridge incorrectly.
I've had no luck finding the correct parameter tweak to fix.

Dwachs

No idea about this bug.

The clipping of stuff under bridges happens in planquadrat_t::display_dinge, lines 440+. It uses the clipping region from simgraph to clip horizontally. Maybe this clipping region is altered in between if near the screen border?
Parsley, sage, rosemary, and maggikraut.

TurfIt

if(  yh >= p_cr.y   &&  yh < p_cr.y+p_cr.h  ) {
fails when the top of the tile containing the tall building is below the bottom of the clipping rect. Can't quite wrap my head around what the logic is here... Removing the if entirely solves the problem, but surely it's for a reason?

Dwachs

I cannot remember what the purpose of the if-clause is. Maybe to ensure that the clipping region is not enlarged?

I think the second condition was wrong, please check r6670.
Parsley, sage, rosemary, and maggikraut.

TurfIt

Dropping half the if seems to work just fine.