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

@JGRennison JGRennison commented Jan 22, 2019

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 JGRennison:link-graph-gui-line-visibility-algorithm branch 3 times, most recently from f2ea03b to f23deca Jan 22, 2019
src/linkgraph/linkgraph_gui.cpp Outdated Show resolved Hide resolved
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 JGRennison:link-graph-gui-line-visibility-algorithm branch from f23deca to e0db3b5 Jan 24, 2019
@nielsmh
Copy link
Contributor

@nielsmh 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

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
1 check passed
1 check passed
OpenTTD CI Build #20190124.7 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.