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

Fix #8647: road catenary did not draw front/back sprites in the front/back as it should. #8843

Merged
merged 2 commits into from Mar 10, 2021

Conversation

frosch123
Copy link
Member

@frosch123 frosch123 commented Mar 10, 2021

Closes #8842 (alternative of)

Motivation / Problem

See #8647.

  • OpenTTD put front and back sprites in the same sprite-order position. So both front and back sprites glitches with vehicles.
  • Some constants in src/table swapped front/back sprites. But this was not noticeable before due to the first issue.

In general road catenary consists of 5 parts:

  • 4 pillars in N, W, E, S corners
  • wires on top.
    But the specs combine them into two sprites, which does not work... west and east pillars are sometimes in front of, sometimes behind vehicles.

Description

The spec seems to be:

  • Back sprite: N, W and E pillars
  • Front sprite: S pillar and wires.

This PR splits the back sprite into 3 sprites accordingly and draws it in 3 separate bounding boxes, so that W and E pillar are drawn correctly.

Limitations

N/A

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

The back sprite is now supposed to contain west, north and east pillars.
The front sprite is supposed to contain the south pillar and the wires.
@frosch123 frosch123 merged commit f580ab4 into OpenTTD:master Mar 10, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants