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 GabdaZM commented Feb 7, 2019

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

Copy link
Member

@LordAro 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
Copy link
Contributor Author

@GabdaZM 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 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);
Copy link
Member

@LordAro LordAro Feb 8, 2019

Choose a reason for hiding this comment

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

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
@GabdaZM GabdaZM deleted the void branch Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants