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

Show unicode box drawing characters with bitmap fonts #36536

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Dec 29, 2019

Summary

SUMMARY: Bugfixes "Fix roads not drawn in the overmap when using bitmap font without SDL line drawing"

Purpose of change

The symbols for overmap road tiles are unicode box drawing characters, so if SDL line drawing is disabled, and bitmap font is used (such as when using the Graphical Overmap mod), roads will not be correctly drawn.

Describe the solution

Check if the character being drawn is a unicode box drawing character in BitmapFont::OutputChar, and use BitmapFont::draw_ascii_lines in such case.

Describe alternatives you've considered

I considered converting the bitmap font of Graphical Overmap to a ttf font, but that would probably be harder to maintain if someone wants to add more characters to the font in the future.

Testing

Roads in the overmap are now correctly drawn with this change.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON <Bugfix> This is a fix for a bug (or closes open issue) SDL: Tiles / Sound Tiles visual interface and sounds. and removed [JSON] Changes (can be) made in JSON labels Dec 30, 2019
@ZhilkinSerg ZhilkinSerg merged commit 3f950bf into CleverRaven:master Dec 30, 2019
@Qrox Qrox deleted the bitmap-font-box-drawing branch December 31, 2019 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants