diff GUIFont.cpp @ 24:352b15291822

18.01.13 (PlaySound work)
author Ritor1
date Fri, 18 Jan 2013 17:30:54 +0600
parents 9c0607679772
children 5629105aa178
line wrap: on
line diff
--- a/GUIFont.cpp	Fri Jan 18 09:44:49 2013 +0600
+++ b/GUIFont.cpp	Fri Jan 18 17:30:54 2013 +0600
@@ -624,37 +624,43 @@
 //----- (0044C51E) --------------------------------------------------------
 int GUIFont::GetLineWidth(const char *pString)
 {
-  GUIFont *v2; // edi@1
-  size_t v4; // ebp@3
+  GUIFont *pFont; // edi@1
+  size_t pNumLen; // ebp@3
   int v5; // esi@3
   signed int i; // ebx@3
   unsigned __int8 v7; // cl@4
-  const char *v8; // [sp+0h] [bp-4h]@1
+  const char *pStr; // [sp+0h] [bp-4h]@1
 
-  v8 = pString;
-  v2 = this;
-  if ( !pString )
+  pStr = pString;
+  pFont = this;
+  if ( !pString ) // == 0
     return 0;
-  v4 = strlen(pString);
+  pNumLen = strlen(pString);
   v5 = 0;
-  for ( i = 0; i < (signed int)v4; ++i )
+  for ( i = 0; i < (signed int)pNumLen; ++i )
   {
-    if ( IsCharValid(v7 = v8[i]) )
+    if ( IsCharValid(v7 = pStr[i]) )
     {
       if ( v7 < 9u )
-        goto LABEL_9;
+      {
+        if ( i > 0 )
+          v5 += pFont->pMetrics[v7].uLeftSpacing;
+        v5 += *((int *)&pFont->cFirstChar + 3 * v7 + 9);
+        if ( i < (signed int)pNumLen )
+          v5 += pFont->pMetrics[v7].uRightSpacing;
+        continue;
+      }
       if ( v7 <= 0xAu )
         return v5;
       if ( v7 != '\f' )
       {
         if ( v7 == '\r' )
           return v5;
-LABEL_9:
         if ( i > 0 )
-          v5 += v2->pMetrics[v7].uLeftSpacing;
-        v5 += *((int *)&v2->cFirstChar + 3 * v7 + 9);
-        if ( i < (signed int)v4 )
-          v5 += v2->pMetrics[v7].uRightSpacing;
+          v5 += pFont->pMetrics[v7].uLeftSpacing;
+        v5 += *((int *)&pFont->cFirstChar + 3 * v7 + 9);
+        if ( i < (signed int)pNumLen )
+          v5 += pFont->pMetrics[v7].uRightSpacing;
         continue;
       }
       i += 5;