Skip to content

Commit 72c8073

Browse files
committed
Fix unicode drawing in graphic mode
1 parent e11f708 commit 72c8073

File tree

7 files changed

+15
-19
lines changed

7 files changed

+15
-19
lines changed

Aura Operating System/Aura_OS/Properties/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Aura_OS
22
{
33
public class VersionInfo
44
{
5-
public static string revision = "261220211114";
5+
public static string revision = "261220211247";
66
}
77
}

Aura Operating System/Aura_OS/System/AConsole/Console.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ namespace Aura_OS.System.AConsole
1616
[Plug(Target = typeof(Cosmos.System.Console))]
1717
public abstract class Console
1818
{
19+
internal const char LineFeed = '\n';
20+
internal const char CarriageReturn = '\r';
21+
internal const char Tab = '\t';
22+
internal const char Space = ' ';
23+
1924
public Console()
2025
{
2126

@@ -42,7 +47,7 @@ public Console()
4247

4348
public abstract void Clear(uint color);
4449

45-
public abstract void Write(byte[] aText);
50+
public abstract void Write(char[] aText);
4651

4752
public abstract void UpdateCursor();
4853

Aura Operating System/Aura_OS/System/AConsole/GraphicConsole.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ public class GraphicalConsole : Console
1616
{
1717

1818
public Graphics.Graphics graphics;
19-
private const byte LineFeed = (byte)'\n';
20-
private const byte CarriageReturn = (byte)'\r';
21-
private const byte Tab = (byte)'\t';
22-
private const byte Space = (byte)' ';
19+
2320

2421
public GraphicalConsole()
2522
{
@@ -156,7 +153,7 @@ private void DoCarriageReturn()
156153
/// Write char to the console.
157154
/// </summary>
158155
/// <param name="aChar">A char to write</param>
159-
public void Write(byte aChar)
156+
public void Write(char aChar)
160157
{
161158
if (aChar == 0)
162159
return;
@@ -170,7 +167,7 @@ public void Write(byte aChar)
170167
UpdateCursor();
171168
}
172169

173-
public override void Write(byte[] aText)
170+
public override void Write(char[] aText)
174171
{
175172
for (int i = 0; i < aText.Length; i++)
176173
{

Aura Operating System/Aura_OS/System/AConsole/TextConsole.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ namespace Aura_OS.System.AConsole
1515

1616
public class VGAConsole : Console
1717
{
18-
private const byte LineFeed = (byte)'\n';
19-
private const byte CarriageReturn = (byte)'\r';
20-
private const byte Tab = (byte)'\t';
21-
private const byte Space = (byte)' ';
22-
2318
protected int mX = 0;
2419
public override int X
2520
{
@@ -120,9 +115,9 @@ private void DoTab()
120115
Write(Space);
121116
}
122117

123-
public void Write(byte aChar)
118+
public void Write(char aChar)
124119
{
125-
mText[mX, mY] = aChar;
120+
mText[mX, mY] = (byte)aChar;
126121
mX++;
127122
if (mX == mText.Cols)
128123
{
@@ -133,7 +128,7 @@ public void Write(byte aChar)
133128

134129
//TODO: Optimize this
135130
[MethodImpl(MethodImplOptions.AggressiveInlining)]
136-
public override void Write(byte[] aText)
131+
public override void Write(char[] aText)
137132
{
138133
if (aText == null)
139134
{

Aura Operating System/Aura_OS/System/Graphics/Graphics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void DrawFilledRectangle(Pen pen, int x_start, int y_start, int width, in
6969
}
7070
}
7171

72-
public void WriteByte(byte ch)
72+
public void WriteByte(char ch)
7373
{
7474
DrawFilledRectangle(backpen, Kernel.AConsole.X * font.Width + 1, Kernel.AConsole.Y * font.Height, font.Width - 1, font.Height);
7575

Aura Operating System/Aura_Plugs/System/ConsoleImpl.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,7 @@ public static void Write(string aText)
852852
return;
853853
}
854854

855-
byte[] aTextEncoded = ConsoleOutputEncoding.GetBytes(aText);
856-
GetConsole().Write(aTextEncoded);
855+
GetConsole().Write(aText.ToCharArray());
857856
}
858857

859858
public static void Write(uint aInt) => Write(aInt.ToString());
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)