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

The client clips the output values for tileset at 9 #345

Closed
psampathkumar opened this issue Mar 20, 2021 · 2 comments · Fixed by #424
Closed

The client clips the output values for tileset at 9 #345

psampathkumar opened this issue Mar 20, 2021 · 2 comments · Fixed by #424
Assignees
Labels
enhancement New feature or request

Comments

@psampathkumar
Copy link
Contributor

We need to fix this because in LTT we go beyond 9 in some cases.

@lmoureaux
Copy link
Contributor

I think you had a link to the problematic line? cazfi's granularity project might lead to improvements in the area.

@psampathkumar
Copy link
Contributor Author

psampathkumar commented Mar 20, 2021

Ya. It is this constant value.
#define NUM_TILES_DIGITS 10
https://github.com/freeciv/freeciv/blob/0b29e0ff39ed0aef887f3222ca37d281b71b8b9b/client/tilespec.c#L112

It is clipped at that value to ignore higher values gracefully.
food = CLIP(0, food / game.info.granularity, NUM_TILES_DIGITS - 1);
https://github.com/freeciv/freeciv/blob/0b29e0ff39ed0aef887f3222ca37d281b71b8b9b/client/tilespec.c#L4818

The proper way to do this is probably to allow the tileset to decide on the max value.

@lmoureaux lmoureaux added the enhancement New feature or request label Mar 20, 2021
@lmoureaux lmoureaux self-assigned this Apr 12, 2021
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Apr 12, 2021
Some rulesets (eg LTT) go above the hard-coded maximum of 10. Let the artist
specify as many sprites as he wants.

Closes longturn#345.
lmoureaux added a commit that referenced this issue Apr 12, 2021
Some rulesets (eg LTT) go above the hard-coded maximum of 10. Let the artist
specify as many sprites as he wants.

Closes #345.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants