From 80ef9ca686fb91dff53f4c2e5a6f9cebc510f368 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 23 Aug 2019 12:11:25 +0300 Subject: [PATCH 1/3] - set locale to US English UTF-8 for POSIX targets Locale-dependent standard library functions didn't treat UTF-8 strings correctly, e.g. iswalpha() returns 0 for any non-latin letter The same function from MSVC runtime classifies such characters as alphabetic even with C locale https://forum.zdoom.org/viewtopic.php?t=65641&start=18#p1115930 --- src/posix/cocoa/i_main.mm | 4 ++-- src/posix/sdl/i_main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 5b4ea31b7..a5e7db2f4 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -199,8 +199,8 @@ int OriginalMain(int argc, char** argv) // Set LC_NUMERIC environment variable in case some library decides to // clear the setlocale call at least this will be correct. // Note that the LANG environment variable is overridden by LC_* - setenv("LC_NUMERIC", "C", 1); - setlocale(LC_ALL, "C"); + setenv("LC_NUMERIC", "en_US.UTF-8", 1); + setlocale(LC_ALL, "en_US.UTF-8"); // Set reasonable default values for video settings diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 572094217..c17ed8be7 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -170,9 +170,9 @@ int main (int argc, char **argv) // Set LC_NUMERIC environment variable in case some library decides to // clear the setlocale call at least this will be correct. // Note that the LANG environment variable is overridden by LC_* - setenv ("LC_NUMERIC", "C", 1); + setenv ("LC_NUMERIC", "en_US.UTF-8", 1); - setlocale (LC_ALL, "C"); + setlocale (LC_ALL, "en_US.UTF-8"); if (SDL_Init (0) < 0) { From 179e526981e64fd1d2f2dddabaaf30e183aef649 Mon Sep 17 00:00:00 2001 From: PaulyB <43163391+3saster@users.noreply.github.com> Date: Fri, 23 Aug 2019 01:41:26 -0700 Subject: [PATCH 2/3] Let Hexen Cleric and Mage use unique health chains - (changed slightly by Rachelle) Hexen's characters incorrectly only used the Fighter's health chain previously. --- wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs b/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs index 26794e933..0e7723e21 100644 --- a/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs +++ b/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs @@ -105,13 +105,13 @@ class HexenStatusBar : BaseStatusBar { DrawImage("H2BAR", (0, 134), DI_ITEM_OFFSETS); - String Gem; - if (CPlayer.mo is "ClericPlayer") Gem = "LIFEGMC2"; - else if (CPlayer.mo is "MagePlayer") Gem = "LIFEGMM2"; - else Gem = "LIFEGMF2"; + String Gem, Chain; + if (CPlayer.mo is "ClericPlayer") { Gem = "LIFEGMC2"; Chain = "CHAIN2"; } + else if (CPlayer.mo is "MagePlayer") { Gem = "LIFEGMM2"; Chain = "CHAIN3"; } + else { Gem = "LIFEGMF2"; Chain = "CHAIN"; } int inthealth = mHealthInterpolator2.GetValue(); - DrawGem("CHAIN", "LIFEGMF2", inthealth, CPlayer.mo.GetMaxHealth(true), (30, 193), -23, 49, 15, (multiplayer? DI_TRANSLATABLE : 0) | DI_ITEM_LEFT_TOP); + DrawGem(Chain, Gem, inthealth, CPlayer.mo.GetMaxHealth(true), (30, 193), -23, 49, 15, (multiplayer? DI_TRANSLATABLE : 0) | DI_ITEM_LEFT_TOP); DrawImage("LFEDGE", (0, 192), DI_ITEM_OFFSETS); DrawImage("RTEDGE", (277, 192), DI_ITEM_OFFSETS); From 9456eeb8ecf93717d9654c200fb6b5ca7162cca5 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 23 Aug 2019 05:56:10 -0400 Subject: [PATCH 3/3] - oops, this didn't get through --- .../static/zscript/ui/statusbar/hexen_sbar.zs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs b/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs index 0e7723e21..8286f419f 100644 --- a/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs +++ b/wadsrc/static/zscript/ui/statusbar/hexen_sbar.zs @@ -106,9 +106,21 @@ class HexenStatusBar : BaseStatusBar DrawImage("H2BAR", (0, 134), DI_ITEM_OFFSETS); String Gem, Chain; - if (CPlayer.mo is "ClericPlayer") { Gem = "LIFEGMC2"; Chain = "CHAIN2"; } - else if (CPlayer.mo is "MagePlayer") { Gem = "LIFEGMM2"; Chain = "CHAIN3"; } - else { Gem = "LIFEGMF2"; Chain = "CHAIN"; } + if (CPlayer.mo is "ClericPlayer") + { + Gem = "LIFEGMC2"; + Chain = "CHAIN2"; + } + else if (CPlayer.mo is "MagePlayer") + { + Gem = "LIFEGMM2"; + Chain = "CHAIN3"; + } + else + { + Gem = "LIFEGMF2"; + Chain = "CHAIN"; + } int inthealth = mHealthInterpolator2.GetValue(); DrawGem(Chain, Gem, inthealth, CPlayer.mo.GetMaxHealth(true), (30, 193), -23, 49, 15, (multiplayer? DI_TRANSLATABLE : 0) | DI_ITEM_LEFT_TOP);