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

Codechange: [Linkgraph GUI] Replace line visibility detection algorithm #7083

Merged

Conversation

JGRennison
Copy link
Contributor

Use an implementation of the Cohen–Sutherland line-clipping algorithm.
The previous algorithm had an excessive false-positive rate.
Line-rendering is sufficiently expensive that using a line-clipping
algorithm with a much lower false-positive rate is a net performance
benefit.

@JGRennison JGRennison force-pushed the link-graph-gui-line-visibility-algorithm branch 3 times, most recently from f2ea03b to f23deca Compare January 22, 2019 21:49
Use an implementation of the Cohen-Sutherland line-clipping algorithm.
The previous algorithm had an excessive false-positive rate.
Line-rendering is sufficiently expensive that using a line-clipping
algorithm with a much lower false-positive rate is a net performance
benefit.
@JGRennison JGRennison force-pushed the link-graph-gui-line-visibility-algorithm branch from f23deca to e0db3b5 Compare January 24, 2019 17:38
@nielsmh
Copy link
Contributor

nielsmh commented Jan 28, 2019

Any suggested savegames and configurations to test this with? I'm not seeing any particular improvements with what I've tried.

Of course, it's not wrong either.

Copy link
Contributor

@nielsmh nielsmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was given a hint :) Tried using the 32bpp-anim blitter, this showed about 6% improvement in one test case.

@nielsmh nielsmh merged commit 64f1847 into OpenTTD:master Jan 28, 2019
@JGRennison JGRennison deleted the link-graph-gui-line-visibility-algorithm branch January 9, 2024 19:17
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

3 participants