diff mm7_3.cpp @ 770:02bfc82f429c

Слияние
author Ritor1
date Sat, 23 Mar 2013 09:26:07 +0600
parents 2f40f4b35ce0 e0914a9bc424
children fbae3100f991
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Mar 23 09:25:31 2013 +0600
+++ b/mm7_3.cpp	Sat Mar 23 09:26:07 2013 +0600
@@ -6824,7 +6824,7 @@
   v18 = a2;
   if ( pParty->armageddon_timer )
     return PaletteManager::Get(a2);
-  if ( !pWeather->field_FA0 )
+  if ( !pWeather->bNight )
   {
     if ( day_attrib & 1 )
     {
@@ -6873,7 +6873,7 @@
     return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
   }
   v6 = 0;
-  if ( pWeather->field_FA0 == 1 )
+  if (pWeather->bNight)
   {
     v8 = 67108864;
     if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
@@ -6954,7 +6954,7 @@
     v26 = v8->field_34 << 16;
     v9 = v8->field_34 << 16;
   }
-  v10 = pWeather->field_FA0;
+  v10 = pWeather->bNight;
   if ( bUnderwater == 1 )
     v10 = 0;
   if ( !v10 )
@@ -7240,9 +7240,10 @@
   {
     if ( day_attrib & 1 )
     {
-      if ( pWeather->field_FA0 )
-      {
-        v2 = -(pWeather->field_FA0 != 1);
+      if ( pWeather->bNight )
+      {
+        __debugbreak(); // decompilation can be inaccurate, please  send savegame to Nomad
+        v2 = -(pWeather->bNight != 1);
         result = (v2 & 0xE0E0E1) - 0xE0E0E1;
       }
       else
@@ -7274,15 +7275,13 @@
   float v11; // ST14_4@17
   double v12; // ST08_8@17
 
-  v3 = pWeather->field_FA0;
+  v3 = pWeather->bNight;
   if ( bUnderwater == 1 )
     v3 = 0;
   if ( pParty->armageddon_timer || !(day_attrib & 1) && !bUnderwater )
     return 0xFF000000;
   if ( v3 )
   {
-    if ( v3 != 1 )
-      return 0;
     v5 = (double)day_fogrange_1;
     v6 = 216;
     if ( a3 < v5 )
@@ -7337,7 +7336,7 @@
   //signed int result; // eax@2
   int v8; // eax@3
   double v9; // st7@12
-  double v10; // ST0C_8@18
+  //double v10; // ST0C_8@18
   int v11; // ecx@28
   //signed int v12; // edi@28
   //double v13; // ST0C_8@33
@@ -7352,7 +7351,7 @@
   //float a3b; // [sp+1Ch] [bp+8h]@34
   float a3c; // [sp+1Ch] [bp+8h]@44
   //float a3d; // [sp+1Ch] [bp+8h]@44
-  float a4b; // [sp+20h] [bp+Ch]@18
+  //float a4b; // [sp+20h] [bp+Ch]@18
   //int a4a; // [sp+20h] [bp+Ch]@33
   //float a4c; // [sp+20h] [bp+Ch]@44
   //float a4d; // [sp+20h] [bp+Ch]@44
@@ -7367,14 +7366,11 @@
   if (pParty->armageddon_timer)
     return 0xFFFF0000;
 
-  v8 = pWeather->field_FA0;
+  v8 = pWeather->bNight;
   if (bUnderwater)
     v8 = 0;
   if ( v8 )
   {
-    //__debugbreak(); // doubt that weather-related stuff will ever trigger, but if it suddenly does - find out what it is
-    if ( v8 != 1 )
-      return 0;
     v20 = 1;
     if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0 )
       v20 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower;
@@ -7385,10 +7381,11 @@
     {
       if ( distance > 0.0 )
       {
-        a4b = distance * 216.0 / v9;
-        v10 = a4b + 6.7553994e15;
-        v6 = LODWORD(v10);
-        if ( SLODWORD(v10) > 216 )
+        //a4b = distance * 216.0 / v9;
+        //v10 = a4b + 6.7553994e15;
+        //v6 = LODWORD(v10);
+        v6 = floorf(0.5f + distance * 216.0 / v9);
+        if (v6 > 216 )
           goto LABEL_19;
       }
     }
@@ -10650,20 +10647,20 @@
   {
     v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
     v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
-    this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
+    this->field_0_party_dir_x = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
                   + ((unsigned __int64)(-65536
                                       * pIndoorCamera->pos.z
                                       * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
-    this->field_4 = v15;
+    this->field_4_party_dir_y = v15;
     v12 = v25;
     v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
         - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
   }
   else
   {
-    this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
+    this->field_4_party_dir_y = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
     v12 = v25;
-    this->field_0 = v11;
+    this->field_0_party_dir_x = v11;
     v13 = v26 << 16;
   }
   this->field_8 = v13;
@@ -10707,14 +10704,14 @@
   this->field_20 = v18;
   v20 = this->field_C;
   this->field_20 = -this->field_20;
-  v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
-      + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
+  v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0_party_dir_x) >> 16)
+      + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4_party_dir_y) >> 16)
       + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
   v28 = this->field_18;
-  v22 = this->field_0;
+  v22 = this->field_0_party_dir_x;
   this->field_24 = v21;
   v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
-  result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
+  result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4_party_dir_y) >> 16;
   this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
   return result;
 }
@@ -10725,8 +10722,8 @@
   stru149 *v7; // esi@1
   int v8; // edi@1
   int v9; // eax@1
-  int v10; // edx@1
-  int v11; // ecx@1
+  //int v10; // edx@1
+  //int v11; // ecx@1
   int v12; // eax@1
   int v13; // ebx@2
   int v14; // ecx@2
@@ -10741,7 +10738,7 @@
   int v23; // ecx@10
   int v24; // eax@10
   int result; // eax@10
-  int v26; // [sp+14h] [bp-14h]@1
+  //int v26; // [sp+14h] [bp-14h]@1
   int v27; // [sp+18h] [bp-10h]@1
   int v28; // [sp+1Ch] [bp-Ch]@1
   int v29; // [sp+24h] [bp-4h]@1
@@ -10753,8 +10750,8 @@
   v29 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotY);
   v28 = stru_5C6E00->Cos(pBLVRenderParams->sPartyRotX);
   v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX);
-  v11 = -pBLVRenderParams->vPartyPos.y;
-  v26 = -pBLVRenderParams->vPartyPos.x;
+  //v11 = -pBLVRenderParams->vPartyPos.y;
+  //v26 = -pBLVRenderParams->vPartyPos.x;
   v27 = v9;
   v12 = -pBLVRenderParams->vPartyPos.z;
   if ( pBLVRenderParams->sPartyRotX )
@@ -10762,17 +10759,17 @@
     v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
     v13 = v28;
     v17 = -65536 * pBLVRenderParams->vPartyPos.z;
-    v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
+    v7->field_0_party_dir_x = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
                 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
-    v7->field_4 = v8 * v11 - v29 * v26;
+    v7->field_4_party_dir_y = v8 * -pBLVRenderParams->vPartyPos.y - v29 * -pBLVRenderParams->vPartyPos.x;
     v14 = v27;
     v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
   }
   else
   {
-    v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
+    v7->field_0_party_dir_x = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
     v13 = v28;
-    v7->field_4 = v8 * v11 - v29 * v26;
+    v7->field_4_party_dir_y = v8 * -pBLVRenderParams->vPartyPos.y - v29 * -pBLVRenderParams->vPartyPos.x;
     v14 = v27;
     v15 = v12 << 16;
   }
@@ -10817,14 +10814,14 @@
   v7->field_20 = v20;
   v22 = v7->field_C;
   v7->field_20 = -v7->field_20;
-  v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
-      + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
+  v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0_party_dir_x) >> 16)
+      + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4_party_dir_y) >> 16)
       + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
   v30 = v7->field_18;
-  v24 = v7->field_0;
+  v24 = v7->field_0_party_dir_x;
   v7->field_24 = v23;
   v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
-  result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
+  result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4_party_dir_y) >> 16;
   v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
   return result;
 }
@@ -10843,14 +10840,14 @@
   this->field_18 = -this->field_18;
   this->field_1C = -this->field_1C;
   this->field_20 = -this->field_20;
-  v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
+  v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0_party_dir_x) >> 16;
   v3 = this->field_18;
-  v4 = this->field_0;
+  v4 = this->field_0_party_dir_x;
   this->field_24 = v2
-                 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
+                 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4_party_dir_y) >> 16)
                  + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
   v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
-  result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
+  result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4_party_dir_y) >> 16;
   this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
   return result;
 }