Bläddra i källkod

Merge with upstream 5475c482989eb60b7ef92d7c2ae80ec78eba7fc2

# Conflicts:
#	Source/Atomic/Core/ProcessUtils.h
#	Source/CMakeLists.txt
#	Source/Urho3D/CMakeLists.txt
Rokas Kupstys 8 år sedan
förälder
incheckning
604d153268

+ 8 - 8
Source/Atomic/Core/ProcessUtils.cpp

@@ -421,7 +421,7 @@ String GetPlatform()
 #elif defined(__linux__)
 #elif defined(__linux__)
     return "Linux";
     return "Linux";
 #else
 #else
-    return String::EMPTY;
+    return "(?)";
 #endif
 #endif
 }
 }
 
 
@@ -557,7 +557,7 @@ String GetLoginName()
 {
 {
 #if defined(__linux__) && !defined(__ANDROID__)
 #if defined(__linux__) && !defined(__ANDROID__)
     struct passwd *p = getpwuid(getuid());
     struct passwd *p = getpwuid(getuid());
-    if (p) 
+    if (p != NULL) 
         return p->pw_name;
         return p->pw_name;
 #elif defined(_WIN32)
 #elif defined(_WIN32)
     char name[UNLEN + 1];
     char name[UNLEN + 1];
@@ -582,7 +582,7 @@ String GetLoginName()
         }
         }
     }
     }
 #endif
 #endif
-    return "(?)"; 
+    return "(?)";
 }
 }
 
 
 String GetHostName() 
 String GetHostName() 
@@ -597,11 +597,11 @@ String GetHostName()
     if (GetComputerName(buffer, &len))
     if (GetComputerName(buffer, &len))
         return buffer;
         return buffer;
 #endif
 #endif
-    return String::EMPTY; 
+    return "(?)";
 }
 }
 
 
 // Disable Windows OS version functionality when compiling mini version for Web, see https://github.com/urho3d/Urho3D/issues/1998
 // 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);
 typedef NTSTATUS (WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
 
 
 static void GetOS(RTL_OSVERSIONINFOW *r)
 static void GetOS(RTL_OSVERSIONINFOW *r)
@@ -622,7 +622,7 @@ String GetOSVersion()
     struct utsname u;
     struct utsname u;
     if (uname(&u) == 0)
     if (uname(&u) == 0)
         return String(u.sysname) + " " + u.release; 
         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;
     RTL_OSVERSIONINFOW r;
     GetOS(&r); 
     GetOS(&r); 
     // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
     // 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) 
     else if (r.dwMajorVersion == 10 && r.dwMinorVersion == 0) 
         return "Windows 10/Windows Server 2016"; 
         return "Windows 10/Windows Server 2016"; 
     else 
     else 
-        return "Windows Unidentified";
+        return "Windows Unknown";
 #elif defined(__APPLE__)
 #elif defined(__APPLE__)
     char kernel_r[256]; 
     char kernel_r[256]; 
     size_t size = sizeof(kernel_r); 
     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] + ")"; 
         return version + " (Darwin kernel " + kernel_version[0] + "." + kernel_version[1] + "." + kernel_version[2] + ")"; 
     }
     }
 #endif
 #endif
-    return String::EMPTY; 
+    return "(?)";
 }
 }
 
 
 }
 }

+ 4 - 4
Source/Atomic/Core/ProcessUtils.h

@@ -59,7 +59,7 @@ ATOMIC_API const Vector<String>& ParseArguments(int argc, char** argv);
 ATOMIC_API const Vector<String>& GetArguments();
 ATOMIC_API const Vector<String>& GetArguments();
 /// Read input from the console window. Return empty if no input.
 /// Read input from the console window. Return empty if no input.
 ATOMIC_API String GetConsoleInput();
 ATOMIC_API String GetConsoleInput();
-/// Return the runtime platform identifier.
+/// Return the runtime platform identifier, or (?) if not identified.
 ATOMIC_API String GetPlatform();
 ATOMIC_API String GetPlatform();
 /// Return the number of physical CPU cores.
 /// Return the number of physical CPU cores.
 ATOMIC_API unsigned GetNumPhysicalCPUs();
 ATOMIC_API unsigned GetNumPhysicalCPUs();
@@ -69,13 +69,13 @@ ATOMIC_API unsigned GetNumLogicalCPUs();
 ATOMIC_API void SetMiniDumpDir(const String& pathName);
 ATOMIC_API void SetMiniDumpDir(const String& pathName);
 /// Return minidump write location.
 /// Return minidump write location.
 ATOMIC_API String GetMiniDumpDir();
 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(); 
 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(); 
 ATOMIC_API String GetLoginName(); 
 /// Return the name of the running machine. 
 /// Return the name of the running machine. 
 ATOMIC_API String GetHostName();
 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_API String GetOSVersion(); 
 
 
 // ATOMIC BEGIN
 // ATOMIC BEGIN

+ 2 - 2
Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp

@@ -269,8 +269,8 @@ bool Text3DFreeType::Load(const unsigned char* fontData, unsigned fontDataSize,
                         unsigned rightIndex = deserializer.ReadUShort();
                         unsigned rightIndex = deserializer.ReadUShort();
                         short amount = FixedToFloat(deserializer.ReadShort());
                         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)
                         if (leftCharCode != 0 && rightCharCode != 0)
                         {
                         {
                             unsigned value = (leftCharCode << 16) + rightCharCode;
                             unsigned value = (leftCharCode << 16) + rightCharCode;