The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: TurfIt on September 02, 2013, 02:27:23 AM

Title: Clipping failure
Post by: TurfIt on September 02, 2013, 02:27:23 AM
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.
Title: Re: Clipping failure
Post by: Dwachs on September 02, 2013, 06:00:17 AM
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?
Title: Re: Clipping failure
Post by: TurfIt on September 02, 2013, 06:10:32 PM
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?
Title: Re: Clipping failure
Post by: Dwachs on September 02, 2013, 08:12:09 PM
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.
Title: Re: Clipping failure
Post by: TurfIt on September 03, 2013, 12:31:02 AM
Dropping half the if seems to work just fine.