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

Redo the text buffer implementation. #642

Open
NQNStudios opened this issue Feb 20, 2025 · 0 comments
Open

Redo the text buffer implementation. #642

NQNStudios opened this issue Feb 20, 2025 · 0 comments
Labels
bug game Affects the game, as opposed to the editors

Comments

@NQNStudios
Copy link
Collaborator

The code storing the text for the text buffer is pretty scary to me. Each line is stored as a fixed-width C-string--which simply can't be safe, even if we do want each line to have a max character count.

There are other problems -- there's no wrapping when we try to draw a line that won't fit in the screen space. It just overflows. We need to call string_length so we can wrap text lines not just by character count but by actual width.

I strongly suspect that some bizarre bug is causing the text buffer to try to render invalid characters, and this is breaking our sf::Font object somehow, leading to #454. Possibly storing the buffer lines as std::strings could fix this without us every having to understand an ungodly C-string encoding bug.

@NQNStudios NQNStudios added bug game Affects the game, as opposed to the editors labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug game Affects the game, as opposed to the editors
Projects
None yet
Development

No branches or pull requests

1 participant