foxygit / doom Log in
commit fcf16607c728e2ea2129f541cfbf6fd73d30761e
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sat Jan 21 16:22:53 2017 +0000
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Sat Jan 21 16:22:53 2017 +0000

    setup: Use UTF-8 for textscreen strings.

    This shouldn't make a huge difference but is consistent with the other
    changes in libtextscreen.
---
 src/setup/txt_joyaxis.c    | 5 +++--
 src/setup/txt_joybinput.c  | 5 +++--
 src/setup/txt_mouseinput.c | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/setup/txt_joyaxis.c b/src/setup/txt_joyaxis.c
index f2861c28..c08768d7 100644
--- a/src/setup/txt_joyaxis.c
+++ b/src/setup/txt_joyaxis.c
@@ -28,6 +28,7 @@
 #include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_joyaxis.h"
+#include "txt_utf8.h"

 #define JOYSTICK_AXIS_WIDTH 20

@@ -458,9 +459,9 @@ static void TXT_JoystickAxisDrawer(TXT_UNCAST_ARG(joystick_axis))
     TXT_SetWidgetBG(joystick_axis);
     TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);

-    TXT_DrawString(buf);
+    TXT_DrawUTF8String(buf);

-    for (i = strlen(buf); i < joystick_axis->widget.w; ++i)
+    for (i = TXT_UTF8_Strlen(buf); i < joystick_axis->widget.w; ++i)
     {
         TXT_DrawString(" ");
     }
diff --git a/src/setup/txt_joybinput.c b/src/setup/txt_joybinput.c
index d0c3926b..ca23e4f0 100644
--- a/src/setup/txt_joybinput.c
+++ b/src/setup/txt_joybinput.c
@@ -30,6 +30,7 @@
 #include "txt_io.h"
 #include "txt_label.h"
 #include "txt_sdl.h"
+#include "txt_utf8.h"
 #include "txt_window.h"

 #define JOYSTICK_INPUT_WIDTH 10
@@ -264,9 +265,9 @@ static void TXT_JoystickInputDrawer(TXT_UNCAST_ARG(joystick_input))
     TXT_SetWidgetBG(joystick_input);
     TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);

-    TXT_DrawString(buf);
+    TXT_DrawUTF8String(buf);

-    for (i=strlen(buf); i<JOYSTICK_INPUT_WIDTH; ++i)
+    for (i = TXT_UTF8_Strlen(buf); i < JOYSTICK_INPUT_WIDTH; ++i)
     {
         TXT_DrawString(" ");
     }
diff --git a/src/setup/txt_mouseinput.c b/src/setup/txt_mouseinput.c
index b893c2e0..b3891b52 100644
--- a/src/setup/txt_mouseinput.c
+++ b/src/setup/txt_mouseinput.c
@@ -23,6 +23,7 @@
 #include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_label.h"
+#include "txt_utf8.h"
 #include "txt_window.h"

 #define MOUSE_INPUT_WIDTH 8
@@ -106,9 +107,9 @@ static void TXT_MouseInputDrawer(TXT_UNCAST_ARG(mouse_input))
     TXT_SetWidgetBG(mouse_input);
     TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);

-    TXT_DrawString(buf);
+    TXT_DrawUTF8String(buf);

-    for (i=strlen(buf); i<MOUSE_INPUT_WIDTH; ++i)
+    for (i = TXT_UTF8_Strlen(buf); i < MOUSE_INPUT_WIDTH; ++i)
     {
         TXT_DrawString(" ");
     }