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: making the style of MakeVoid calls uniform #7192

Merged
merged 1 commit into from Feb 8, 2019

Conversation

@GabdaZM
Copy link
Contributor

GabdaZM commented Feb 7, 2019

Started form making sizex * y + x into TileXY(x, y).

@GabdaZM GabdaZM force-pushed the GabdaZM:void branch from 87eacea to 7497d58 Feb 7, 2019
Copy link
Member

LordAro left a comment

Good in principle, though I'm not a fan of the const uint maxX/Y additions. No point making a constant that's only used in one place. Probably not worth it for the other places either - any half decent compiler will optimise them out (is the function itself marked inline?)

I'd recommend looking for other potential uses of TileXY as well, I have no doubt there are many others

Oh, and the commit should be Codechange: ... when no user visible changes are made

@GabdaZM

This comment has been minimized.

Copy link
Contributor Author

GabdaZM commented Feb 7, 2019

@LordAro: Can you have a look at the first version, 87eacea? That was without the extra variables.
I'll change the commit message.

@GabdaZM GabdaZM force-pushed the GabdaZM:void branch from 7497d58 to 3db2970 Feb 8, 2019
@GabdaZM GabdaZM changed the title Change: making the style of MakeVoid calls uniform Codechange: making the style of MakeVoid calls uniform Feb 8, 2019
@LordAro
LordAro approved these changes Feb 8, 2019
@@ -995,8 +995,8 @@ void GenerateTerrainPerlin()

/* First make sure the tiles at the north border are void tiles if needed. */
if (_settings_game.construction.freeform_edges) {
for (int y = 0; y < _height_map.size_y - 1; y++) MakeVoid(_height_map.size_x * y);
for (int x = 0; x < _height_map.size_x; x++) MakeVoid(x);

This comment has been minimized.

Copy link
@LordAro

LordAro Feb 8, 2019

Member

seems to me like _height_map could go away entirely, but that's for another time :)

@LordAro LordAro merged commit 37bb2c9 into OpenTTD:master Feb 8, 2019
1 check passed
1 check passed
OpenTTD CI Build #20190208.8 succeeded
Details
@GabdaZM GabdaZM deleted the GabdaZM:void branch Feb 11, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.