changeset 335:4e63b7396b24

Слияние
author Ritor1
date Thu, 21 Feb 2013 01:42:16 +0600
parents 0cafbae201c8 (current diff) f76027321087 (diff)
children d27e30e0158a 90017057667f
files
diffstat 2 files changed, 36 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/StorylineTextTable.cpp	Thu Feb 21 01:42:03 2013 +0600
+++ b/StorylineTextTable.cpp	Thu Feb 21 01:42:16 2013 +0600
@@ -50,13 +50,13 @@
 				switch (decode_step)
 					{
 				case 1: 
-					StoreLine[i].pText=RemoveQuotes(test_string);
+					StoreLine[i+1].pText=RemoveQuotes(test_string);
 					break;
 				case 2:
-					StoreLine[i].uTime=atoi(test_string);  //strange but in text here string not digit
+					StoreLine[i+1].uTime=atoi(test_string);  //strange but in text here string not digit
 					break;
 				case 3:
-					StoreLine[i].pPageTitle=RemoveQuotes(test_string);
+					StoreLine[i+1].pPageTitle=RemoveQuotes(test_string);
 					break;
 					}
 				}
--- a/mm7_3.cpp	Thu Feb 21 01:42:03 2013 +0600
+++ b/mm7_3.cpp	Thu Feb 21 01:42:16 2013 +0600
@@ -14156,59 +14156,47 @@
 //----- (00443E31) --------------------------------------------------------
 void __cdecl LoadLevel_InitializeLevelStr()
 {
-  signed __int16 v0; // si@1
-  //unsigned int v1; // ecx@1
-  signed int v2; // edi@1
-  int v3; // edx@1
-  //int v4; // eax@2
-  int v5; // ebx@4
-  int v6; // ebx@11
-  int v7; // eax@12
-  unsigned int *v8; // edi@13
-  char Args[100]; // [sp+Ch] [bp-68h]@9
-  int v10; // [sp+70h] [bp-4h]@1
-
-  if (sizeof(pLevelStrOffsets) != 0x7D0)
+  
+  char Args[100]; 
+  int string_num;
+  int max_string_length;
+  int current_string_length;
+  int prev_string_offset;
+
+  if (sizeof(pLevelStrOffsets) != 2000)
     Log::Warning(L"pLevelStrOffsets: deserialization warning");
-  memset(pLevelStrOffsets, 0, 0x7D0u);
+  memset(pLevelStrOffsets, 0, 2000);
   
-  v0 = 0;
-  //v1 = uLevelStrFileSize;
-  v2 = 1;
-  v3 = 0;
-  v10 = 0;
-    //v4 = 0;
+  max_string_length = 0;
+  string_num = 1;
+  prev_string_offset = 0;
+
   for (uint i = 0; i < uLevelStrFileSize; ++i)
   {
       if ( !pLevelStr[i] )
       {
-        v5 = (signed __int16)v2++;
-        pLevelStrOffsets[v5] = i + 1;
-        if ( (signed __int16)(i - (short)v10) > v0 )
-          v0 = i - v10;
-        v10 = i;
-      }
-  }
-
-  uLevelStrNumStrings = (signed __int16)v2 - 1;
-  if ( v0 > 800 )
-  {
-    sprintf(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
+        pLevelStrOffsets[string_num] = i + 1;
+		++string_num;
+        if ( i - prev_string_offset > max_string_length )
+          max_string_length = i - prev_string_offset;
+        prev_string_offset = i;
+      }
+  }
+
+  uLevelStrNumStrings = string_num - 1;
+  if ( max_string_length > 800 )
+  {
+    sprintf(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", max_string_length+1);
     Abortf(Args);
   }
-  v6 = 0;
-  if ( (signed __int16)v2 - 1 > 0 )
-  {
-    v7 = 0;
-    do
-    {
-      v8 = &pLevelStrOffsets[v7];
-      if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
-        ++*v8;
-      ++v6;
-      v7 = (signed __int16)v6;
-    }
-    while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
+
+  if ( uLevelStrNumStrings > 0 )
+  {
+    for(uint i = 1; i <uLevelStrNumStrings ; ++i) 
+    {
+      if ( RemoveQuotes(&pLevelStr[pLevelStrOffsets[i]]) != &pLevelStr[pLevelStrOffsets[i]] )
+        ++pLevelStrOffsets[i]; 
+    }
   }
 }