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

rework of GetBridgeHeight proc #6542

Closed
DorpsGek opened this issue Mar 13, 2017 · 6 comments
Closed

rework of GetBridgeHeight proc #6542

DorpsGek opened this issue Mar 13, 2017 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

hackalittlebit opened the ticket and wrote:

a Try to make the function "GetBridgeHeight" faster.

I tested max() for integers and it worked on my machine.

Not sure though.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6542
@DorpsGek
Copy link
Member Author

hackalittlebit wrote:

Note that with a ramp in diag direction DIAGDIR_NE and DIAGDIR_NW a MP_VOID can be tested on the edge of the map.
I don't think that is a problem.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542#comment14368

@DorpsGek
Copy link
Member Author

frosch wrote:

What does "faster" mean?
Do you have some specific savegame where GetBridgeHeight takes a considerable amount of time?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542#comment14369

@DorpsGek
Copy link
Member Author

hackalittlebit wrote:

No I don't
I was looking in that area and I know the proc is used for drawing a lot.

Users of GetBridgeHeight are:
DrawRoadCatenary
DrawRoadBits
GetBridgePixelHeight
MarkBridgeDirty
DrawRailCatenaryRailway

GetBridgePixelHeight uses GetBridgeHeight

GetBridgePixelHeight is used by:
ViewportAddLandscape
DrawRailCatenaryOnBridge

I just thought you would be interested in some code to speed up things.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542#comment14371

@DorpsGek
Copy link
Member Author

frosch wrote:

In that case I prefer readable/consistent code over fast code.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542#comment14372

@DorpsGek
Copy link
Member Author

hackalittlebit wrote:

You can close it!

rofl


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542#comment14376

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Won't implement


This comment was imported from FlySpray: https://bugs.openttd.org/task/6542

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant