From 604d15326870598f71154ed546b73ccfc190ab19 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Tue, 4 Jul 2017 18:13:03 +0300 Subject: [PATCH] Merge with upstream 5475c482989eb60b7ef92d7c2ae80ec78eba7fc2 # Conflicts: # Source/Atomic/Core/ProcessUtils.h # Source/CMakeLists.txt # Source/Urho3D/CMakeLists.txt --- Source/Atomic/Core/ProcessUtils.cpp | 16 ++++++++-------- Source/Atomic/Core/ProcessUtils.h | 8 ++++---- Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Atomic/Core/ProcessUtils.cpp b/Source/Atomic/Core/ProcessUtils.cpp index 2a92b1c09e..9a41c720c3 100644 --- a/Source/Atomic/Core/ProcessUtils.cpp +++ b/Source/Atomic/Core/ProcessUtils.cpp @@ -421,7 +421,7 @@ String GetPlatform() #elif defined(__linux__) return "Linux"; #else - return String::EMPTY; + return "(?)"; #endif } @@ -557,7 +557,7 @@ String GetLoginName() { #if defined(__linux__) && !defined(__ANDROID__) struct passwd *p = getpwuid(getuid()); - if (p) + if (p != NULL) return p->pw_name; #elif defined(_WIN32) char name[UNLEN + 1]; @@ -582,7 +582,7 @@ String GetLoginName() } } #endif - return "(?)"; + return "(?)"; } String GetHostName() @@ -597,11 +597,11 @@ String GetHostName() if (GetComputerName(buffer, &len)) return buffer; #endif - return String::EMPTY; + return "(?)"; } // Disable Windows OS version functionality when compiling mini version for Web, see https://github.com/urho3d/Urho3D/issues/1998 -#if defined(_WIN32) && !defined(MINI_URHO) +#if defined(_WIN32) && defined(HAVE_RTL_OSVERSIONINFOW) && !defined(MINI_URHO) typedef NTSTATUS (WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW); static void GetOS(RTL_OSVERSIONINFOW *r) @@ -622,7 +622,7 @@ String GetOSVersion() struct utsname u; if (uname(&u) == 0) return String(u.sysname) + " " + u.release; -#elif defined(_WIN32) && !defined(MINI_URHO) +#elif defined(_WIN32) && defined(HAVE_RTL_OSVERSIONINFOW) && !defined(MINI_URHO) RTL_OSVERSIONINFOW r; GetOS(&r); // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx @@ -643,7 +643,7 @@ String GetOSVersion() else if (r.dwMajorVersion == 10 && r.dwMinorVersion == 0) return "Windows 10/Windows Server 2016"; else - return "Windows Unidentified"; + return "Windows Unknown"; #elif defined(__APPLE__) char kernel_r[256]; size_t size = sizeof(kernel_r); @@ -719,7 +719,7 @@ String GetOSVersion() return version + " (Darwin kernel " + kernel_version[0] + "." + kernel_version[1] + "." + kernel_version[2] + ")"; } #endif - return String::EMPTY; + return "(?)"; } } diff --git a/Source/Atomic/Core/ProcessUtils.h b/Source/Atomic/Core/ProcessUtils.h index 8321fd83e9..16e74e1107 100644 --- a/Source/Atomic/Core/ProcessUtils.h +++ b/Source/Atomic/Core/ProcessUtils.h @@ -59,7 +59,7 @@ ATOMIC_API const Vector& ParseArguments(int argc, char** argv); ATOMIC_API const Vector& GetArguments(); /// Read input from the console window. Return empty if no input. ATOMIC_API String GetConsoleInput(); -/// Return the runtime platform identifier. +/// Return the runtime platform identifier, or (?) if not identified. ATOMIC_API String GetPlatform(); /// Return the number of physical CPU cores. ATOMIC_API unsigned GetNumPhysicalCPUs(); @@ -69,13 +69,13 @@ ATOMIC_API unsigned GetNumLogicalCPUs(); ATOMIC_API void SetMiniDumpDir(const String& pathName); /// Return minidump write location. ATOMIC_API String GetMiniDumpDir(); -/// Return the total amount of useable memory. +/// Return the total amount of usable memory in bytes. ATOMIC_API unsigned long long GetTotalMemory(); -/// Return the name of the currently logged in user. +/// Return the name of the currently logged in user, or (?) if not identified. ATOMIC_API String GetLoginName(); /// Return the name of the running machine. ATOMIC_API String GetHostName(); -/// Return the version of the currently running OS. +/// Return the version of the currently running OS, or (?) if not identified. ATOMIC_API String GetOSVersion(); // ATOMIC BEGIN diff --git a/Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp b/Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp index 48c48f9c6e..7021900a72 100644 --- a/Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp +++ b/Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp @@ -269,8 +269,8 @@ bool Text3DFreeType::Load(const unsigned char* fontData, unsigned fontDataSize, unsigned rightIndex = deserializer.ReadUShort(); short amount = FixedToFloat(deserializer.ReadShort()); - unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex] : 0; - unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex] : 0; + unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex + 1] : 0; + unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex + 1] : 0; if (leftCharCode != 0 && rightCharCode != 0) { unsigned value = (leftCharCode << 16) + rightCharCode;