Skip to content

Commit

Permalink
Add basic draw support for table characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed Jan 13, 2020
1 parent 163d1a4 commit ad96cec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion OpenKh.Tools.Common/Controls/KingdomTextArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ private void DrawText(DrawContext context, MessageCommandModel command)

private void DrawText(DrawContext context, byte[] data)
{
foreach (var ch in data)
for (int i = 0; i < data.Length; i++)
{
byte ch = data[i];
int spacing;

if (ch >= 0x20)
Expand All @@ -226,6 +227,13 @@ private void DrawText(DrawContext context, byte[] data)
DrawChar(context, chIndex);
spacing = _fontSpacing?[chIndex] ?? Context.FontWidth;
}
else if (ch >= 0x19 && ch <= 0x1f)
{
int chIndex = data[++i] + (ch - 0x19) * 0x100 + 0xE0;
if (!context.IgnoreDraw)
DrawChar(context, chIndex);
spacing = _fontSpacing?[chIndex] ?? Context.FontWidth;
}
else if (ch == 1)
{
spacing = 6;
Expand Down

0 comments on commit ad96cec

Please sign in to comment.