Minor fixes to make initializing the terminal more consistent and to remove a magic number for wall limits.

This commit is contained in:
Zed A. Shaw 2024-12-04 08:19:04 -05:00
parent 2d5490131d
commit ae43dad499
12 changed files with 47 additions and 42 deletions

View file

@ -6,6 +6,12 @@
#include "map.hpp"
#include <iostream>
#include "color.hpp"
#if defined(_WIN64) || defined(_WIN32)
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#endif
using namespace fmt;
@ -220,3 +226,12 @@ void SFMLRender::draw(Panel &panel, float x_offset, float y_offset) {
render_text(panelout, panel.default_fg, panel.default_bg, panel.x + x_offset, panel.y + y_offset);
}
}
void SFMLRender::init_terminal() {
#if defined(_WIN64) || defined(_WIN32)
_setmode(_fileno(stdout), _O_U16TEXT);
#endif
// the parser only handles full color so force it
ftxui::Terminal::SetColorSupport(ftxui::Terminal::Color::TrueColor);
}