Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing bounding boxes for bridge pillars of height 1 cause graphical glitches #8131

Closed
Andrew350 opened this issue May 10, 2020 · 4 comments

Comments

@Andrew350
Copy link

Version of OpenTTD

Any

Expected result

Pillars are displayed over objects underneath bridge

Actual result

Objects are displayed over pillars

Steps to reproduce

This issue is described with pictures in this post by Quast65: https://www.tt-forums.net/viewtopic.php?p=1231775#p1231775

I'm not sure if there's a reason for this omission or it is simply an oversight/original behavior, but either way it doesn't look right so I wanted to bring it to your attention.

Search history reveals a lot of issues with sprite sorting in the past but I didn't find anything about this particular issue, so hopefully this isn't just a compromise arising from an earlier fix.

@ilayaraja97
Copy link
Contributor

What objects can I place? To recreate the issue?

@Andrew350
Copy link
Author

The city objects set is a good one (available on Bananas)

Just to further highlight the issue, the lack of a bounding box can even cause objects behind the pillars to overlap them (as shown in the image below), so it isn't just an issue of improperly set bounding boxes on the objects.
Binpool Transport, 03_28_19303

@ilayaraja97
Copy link
Contributor

ilayaraja97 commented May 12, 2020

For the pillar of small bridges the code uses the function DrawGroundSpriteAt() and I believe the layering is done by which sprite is called first, by calling the AddChildSpriteToFoundation().

Now that is why the white line is coming over the pillar and the grey foundation is coming below. We need to change this behavior to fix this.

I am thinking if the AddChildSpriteToFoundation() adds like a priority queue so that a higher priority can be given to pillars and the rest will be first call first rendered.

@ilayaraja97
Copy link
Contributor

ilayaraja97 commented May 15, 2020

For the pillar of small bridges the code uses the function DrawGroundSpriteAt() and I believe the layering is done by which sprite is called first, by calling the AddChildSpriteToFoundation().

Now that is why the white line is coming over the pillar and the grey foundation is coming below. We need to change this behavior to fix this.

I am thinking if the AddChildSpriteToFoundation() adds like a priority queue so that a higher priority can be given to pillars and the rest will be first call first rendered.

I figured changing the DrawGroundSpriteAt() is much more tougher than just giving small pillions the same treatment as big pillions. So my PR is treating small and big pillions the same.

ilayaraja97 pushed a commit to ilayaraja97/OpenTTD that referenced this issue May 15, 2020
ilayaraja97 added a commit to ilayaraja97/OpenTTD that referenced this issue May 15, 2020
ilayaraja97 added a commit to ilayaraja97/OpenTTD that referenced this issue May 16, 2020
LordAro pushed a commit to LordAro/OpenTTD that referenced this issue Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants