changeset 226:c2f2d2644304

DrawDialogueUI NPCData
author zipi
date Sun, 17 Feb 2013 11:40:10 +0100
parents e3fd201a58f0
children bcd55744c2f4
files mm7_3.cpp
diffstat 1 files changed, 58 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_3.cpp	Sun Feb 17 14:47:58 2013 +0400
+++ b/mm7_3.cpp	Sun Feb 17 11:40:10 2013 +0100
@@ -5183,24 +5183,24 @@
 {
   char *v4; // eax@4
   char v5; // dl@5
-  char *v6; // ecx@5
-  int v7; // edi@9
+  int v6; // ecx@5
+  char *v7; // edi@9
   char *v9; // eax@21
   char v10; // dl@22
-  char *v11; // ecx@22
-  int v12; // edi@26
+  int v11; // ecx@22
+  char *v12; // edi@26
   char *v14; // eax@39
   char v15; // dl@40
   int v16; // ecx@40
-  int v17; // edi@44
+  char *v17; // edi@44
   char v18; // zf@47
   NPCStats_stru0 *v19; // eax@57
   signed int v20; // edx@57
   signed int v21; // ecx@58
-  char *v22; // [sp+10h] [bp-10h]@4
-  char *v23; // [sp+10h] [bp-10h]@21
-  char *v25; // [sp+14h] [bp-Ch]@4
-  char *v26; // [sp+14h] [bp-Ch]@21
+  int v22; // [sp+10h] [bp-10h]@4
+  int v23; // [sp+10h] [bp-10h]@21
+  int v25; // [sp+14h] [bp-Ch]@4
+  int v26; // [sp+14h] [bp-Ch]@21
   signed int v27; // [sp+14h] [bp-Ch]@39
   //signed int v28; // [sp+18h] [bp-8h]@3
   //signed int v29; // [sp+18h] [bp-8h]@20
@@ -5219,8 +5219,8 @@
   for (uint i = 0; i < 789; ++i)
   {
     v4 = strtok(nullptr, "\r") + 1;
-    v22 = nullptr;
-    v25 = nullptr;
+    v22 = 0;
+    v25 = 0;
     do
     {
       v5 = *v4;
@@ -5232,28 +5232,28 @@
           if ( !v5 )
             break;
           ++v6;
-          v5 = v4[(int)v6];
+          v5 = v4[v6];
         }
         while ( v5 != 9 );
         //v2 = 0;
       }
-      v7 = (int)&v4[(int)v6];
-      if ( !v4[(int)v6] )
-        v25 = (char *)1;
-      *(char *)v7 = 0;
-      if ( v6 == nullptr )
-      {
-        v25 = (char *)1;
-      }
-      else
-      {
-        if ( v22 == (char *)1 )
+      v7 = &v4[v6];
+      if ( !v4[v6] )
+        v25 = 1;
+      *v7 = 0;
+      if ( v6 == 0 )
+      {
+        v25 = 1;
+      }
+      else
+      {
+        if ( v22 == 1 )
           pNPCTopics[i].pText = RemoveQuotes(v4);
       }
       ++v22;
-      v4 = (char *)(v7 + 1);
-    }
-    while ( (signed int)(v22 - 1) <= 1 && v25 == nullptr );
+      v4 = v7 + 1;
+    }
+    while ( (signed int)(v22 - 1) <= 1 && !v25);// == nullptr );
   }
 
   if (pNPCTopicTXT_Raw)
@@ -5266,8 +5266,8 @@
   for (uint i = 0; i < 579; ++i)
   {
     v9 = strtok(nullptr, "\r") + 1;
-    v23 = nullptr;
-    v26 = nullptr;
+    v23 = 0;
+    v26 = 0;
     do
     {
       v10 = *v9;
@@ -5279,28 +5279,28 @@
           if ( !v10 )
             break;
           ++v11;
-          v10 = v9[(int)v11];
+          v10 = v9[v11];
         }
         while ( v10 != 9 );
         //v2 = 0;
       }
-      v12 = (int)&v9[(int)v11];
-      if ( !v9[(int)v11] )
-        v26 = (char *)1;
-      *(char *)v12 = 0;
-      if ( v11 == nullptr )
-      {
-        v26 = (char *)1;
-      }
-      else
-      {
-        if ( v23 == (char *)1 )
+      v12 = &v9[v11];
+      if ( !v9[v11] )
+        v26 = 1;
+      *v12 = 0;
+      if ( v11 == 0 )
+      {
+        v26 = 1;
+      }
+      else
+      {
+        if ( v23 == 1 )
           pNPCTopics[i].pTopic = RemoveQuotes(v9);
       }
       ++v23;
-      v9 = (char *)(v12 + 1);
-    }
-    while ( (signed int)(v23 - 1) <= 1 && v26 == nullptr );
+      v9 = v12 + 1;
+    }
+    while ( (signed int)(v23 - 1) <= 1 && !v26 );
   }
 
   if (pNPCDistTXT_Raw)
@@ -5335,10 +5335,10 @@
         while ( v15 != 9 );
         v2 = v24;
       }
-      v17 = (int)&v14[v16];
+      v17 = &v14[v16];
       if ( !v14[v16] )
         v27 = 1;
-      *(char *)v17 = 0;
+      *v17 = 0;
       if ( !v16 )
       {
         v27 = 1;
@@ -5358,7 +5358,7 @@
         *v31 = 10;
 LABEL_54:
       ++v2;
-      v14 = (char *)(v17 + 1);
+      v14 = v17 + 1;
       v24 = v2;
     }
     while ( (signed int)(v2 - 1) <= 77 && !v27 );
@@ -9665,7 +9665,7 @@
   for (uint i = 0; i < 16384; ++i)
   //do
   {
-    auto v4 = stru_76E5C8 + i;
+    auto v4 = stru_76E5C8[i];
     //band3a = 256;
     //v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
     for (uint j = 0; j < 128; ++j)                  // band3a: 0 -> 128
@@ -9677,17 +9677,17 @@
       if (v7 >= v10)
       {
         if (v7 >= v9)
-          v4->field_0 = ((v7 >= v3) - 1) & 2;
-        else
-          v4->field_0 = 2;
-      }
-      else
-      {
-        v4->field_0 = 1;
+          v4.field_0 = ((v7 >= v3) - 1) & 2;
+        else
+          v4.field_0 = 2;
+      }
+      else
+      {
+        v4.field_0 = 1;
       }
       //band3a += 512;
-      v4->distance = v7;
-      ++v4;
+      v4.distance = v7;
+      //++v4;
     }
     //while ( band3a < 65792 );
   }
@@ -16453,7 +16453,7 @@
   __int16 v54[2]; // [sp+104h] [bp-10h]@2
   unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
   GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
-  char *pInString; // [sp+110h] [bp-4h]@32
+  char *pInString=NULL; // [sp+110h] [bp-4h]@32
 
   if ( !pDialogueWindow )
     return;
@@ -17005,7 +17005,7 @@
       {
         MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
       }
-      return &pNPCStats->pNewNPCData[v1 - 1];
+      return &pNPCStats->pNewNPCData[v1];// - 1];
     }
     return &pNPCStats->array_13EF4[npcid - 5000];
   }