direct wchar_t output to PIScreen on Windows works

This commit is contained in:
2025-09-24 18:34:01 +03:00
parent daab41e41e
commit 62c5523127
3 changed files with 79 additions and 393 deletions

View File

@@ -189,8 +189,8 @@ void PIScreen::SystemConsole::print() {
for (int j = 0; j < dh; ++j) {
int k = j * dw + i;
Cell & c(cells[j + dy0][i + dx0]);
PRIVATE->chars[k].Char.UnicodeChar = 0;
PRIVATE->chars[k].Char.AsciiChar = c.symbol.toConsole1Byte();
PRIVATE->chars[k].Char.UnicodeChar = c.symbol.unicode16Code();
// PRIVATE->chars[k].Char.AsciiChar = c.symbol.toConsole1Byte();
PRIVATE->chars[k].Attributes = attributes(c);
}
// piCout << "draw" << dw << dh;
@@ -200,7 +200,7 @@ void PIScreen::SystemConsole::print() {
PRIVATE->srect.Top += dy0;
PRIVATE->srect.Right -= width - dx1 - 1;
PRIVATE->srect.Bottom -= height - dy1 - 1;
WriteConsoleOutput(PRIVATE->hOut, PRIVATE->chars.data(), PRIVATE->bs, PRIVATE->bc, &PRIVATE->srect);
WriteConsoleOutputW(PRIVATE->hOut, PRIVATE->chars.data(), PRIVATE->bs, PRIVATE->bc, &PRIVATE->srect);
#else
PIString s;
int si = 0, sj = 0;