diff mm7_3.cpp @ 1438:bc99e1a48bea

m
author Ritor1
date Mon, 22 Jul 2013 18:00:34 +0600
parents 47975067d6a8
children 468f434a8d8a
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Jul 06 09:07:04 2013 +0600
+++ b/mm7_3.cpp	Mon Jul 22 18:00:34 2013 +0600
@@ -5958,36 +5958,21 @@
 {
   int v0; // esi@2
   int v1; // eax@2
-  //double v2; // st7@2
-  //double v3; // st6@2
-  //double v4; // st5@2
-  //double v5; // st4@2
-  //double v6; // st7@2
-  //char *v7; // esi@3
   int v8; // eax@4
   int v9; // eax@4
   int v10; // ebx@4
   signed __int64 v11; // qax@6
-  double v12; // st7@6
+  //double v12; // st7@6
   int v13; // edi@6
   int v14; // ecx@6
-  int v15; // eax@8
+  //int v15; // eax@8
   int v16; // eax@12
   signed __int64 v17; // qtt@13
-  signed int v18; // ecx@13
-  //Texture *v19; // eax@15
-  //double v20; // st6@15
-  //double v21; // st7@15
-  //double v22; // st6@15
-  //unsigned __int8 v23; // sf@15
-  //unsigned __int8 v24; // of@15
+  signed int pShading; // ecx@13
   stru148 pSky; // [sp+14h] [bp-150h]@1
-  //double v26; // [sp+120h] [bp-44h]@4
-  //float v27; // [sp+128h] [bp-3Ch]@4
   float v28; // [sp+12Ch] [bp-38h]@2
   int v29; // [sp+130h] [bp-34h]@4
   int v30; // [sp+134h] [bp-30h]@1
-  //int v31; // [sp+138h] [bp-2Ch]@2
   int v32; // [sp+13Ch] [bp-28h]@6
   int v33; // [sp+140h] [bp-24h]@2
   int v34; // [sp+144h] [bp-20h]@1
@@ -6021,10 +6006,10 @@
   pSky.dimming_level = 0;//затемнение
   pSky.uNumVertices = 4;//количество вершин
 
-  //tilt(наклон)---------------------------------------------------------------
-  pSky.v_18.x = -stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16);
+  //centering(центруем)---------------------------------------------------------------
+  pSky.v_18.x = -stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16);//-3216
   pSky.v_18.y = 0;
-  pSky.v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16);
+  pSky.v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16);//-65457
   //---------------------------------------------------------------------------
 
   pSky.field_24 = 0x2000000;
@@ -6047,7 +6032,7 @@
   //--------------------------------------------------------------------------
 
   //pParty->sRotationY / 2048.0f
-  // move sky(двидение неба)--------------include-----------------------------
+  // move sky(движение неба)--------------include-----------------------------
     float t = (GetTickCount() % 96000) / 96000.0f;
     array_50AC10[0].u = t - pParty->sRotationY / 1024.0f;
     array_50AC10[0].v = t - pParty->sRotationX / 512.0f;
@@ -6063,21 +6048,21 @@
   //--------------------------------------------------------------------------
 
   //rotate skydome(вращение купола неба)--------------------------------------
-  v36 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5;//центр экрана
-  v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);
+  v36 = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) * 0.5;//центр экрана 230
+  v33 = 65536 / (signed int)(v36 / tan(0.6457717418670654) + 0.5);//214
 
   for (uint i = 0; i < pSky.uNumVertices; ++i)
   {
-    v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);
-    v39 = (unsigned __int64)(pSky.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;
-    v8 = v39 + pSky.ptr_38->field_C;
-
-    v39 = (unsigned __int64)(pSky.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;
-    v36 = v39 + pSky.ptr_38->field_18;
-
-    v9 = (unsigned __int64)(pSky.v_18.z * v33 * (v30 - v29)) / 65536;
-    v10 = pSky.v_18.x + v9;
-    v39 = pSky.v_18.x + v9;
+    v29 = floorf(array_50AC10[i].vWorldViewProjY + 0.5f);//8
+    v39 = (unsigned __int64)(pSky.ptr_38->field_14 * v33 * (v30 - v29)) / 65536;//0
+    v8 = v39 + pSky.ptr_38->field_C;//0
+
+    v39 = (unsigned __int64)(pSky.ptr_38->field_20 * v33 * (v30 - v29)) / 65536;//0
+    v36 = v39 + pSky.ptr_38->field_18;//65536
+
+    v9 = (unsigned __int64)(pSky.v_18.z * v33 * (v30 - v29)) / 65536;//27917
+    v10 = pSky.v_18.x + v9;//24701
+    v39 = pSky.v_18.x + v9;//24701
     if ( pSky.v_18.x + v9 > 0 )
     {
       v10 = 0;
@@ -6085,14 +6070,15 @@
     }
     //v11 = (signed __int64)array_50AC10[i].vWorldViewProjX;
     v38 = v10;
-    v12 = array_50AC10[i].vWorldViewProjY - 1.0;
+    //v12 = array_50AC10[i].vWorldViewProjY - 1.0;
     v13 = v33 * (pViewport->uScreenCenterX - (signed __int64)array_50AC10[i].vWorldViewProjX);
     v34 = -pSky.field_24;
-    v32 = (signed __int64)v12;
+    v32 = (signed __int64)array_50AC10[i].vWorldViewProjY - 1.0;
     v14 = v33 * (v30 - v32);
+
     while ( 1 )
     {
-      //v40 = v14;
+      v40 = v14;
       if ( !v10 )
       {
         v37 = pSky.v_18.z;
@@ -6105,13 +6091,12 @@
         break;
       }
       v37 = abs(v34 >> 14);
-      v15 = abs(v10);
-      if ( v37 <= v15 || v32 <= pViewport->uViewportTL_Y )
+      if ( abs(v34 >> 14) <= abs(v10) || v32 <= pViewport->uViewportTL_Y )
       {
         if ( v39 <= 0 )
           break;
       }
-      //v14 = v40;
+      v14 = v40;
       v37 = pSky.v_18.z;
       v16 = (unsigned __int64)(pSky.v_18.z * v14) >> 16;
       --v32;
@@ -6121,24 +6106,25 @@
       v38 = pSky.v_18.x + v16;
       break;
     }
+
     LODWORD(v17) = v34 << 16;
     HIDWORD(v17) = v34 >> 16;
-    v18 = v17 / v38;
-    if ( v18 < 0 )
-      v18 = pOutdoorCamera->shading_dist_mist;
+    pShading = v17 / v38;
+    if ( pShading < 0 )
+      pShading = pOutdoorCamera->shading_dist_mist;
 
     v37 += ((unsigned __int64)(pSky.ptr_38->field_10 * v13) >> 16);
     v36 += ((unsigned __int64)(pSky.ptr_38->field_1C * v13) >> 16);
-    v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v37, v18) / 8;
-    v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v36, v18) / 8;
+    v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v37, pShading) / 8;
+    v36 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v36, pShading) / 8;
 
     //array_50AC10[i].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
-    //array_50AC10[i].vWorldPosition.x = v36 / (_this.pTexture->uTextureHeight * 65536.0);
+    //array_50AC10[i].vWorldPosition.x = v36 / (pSky.pTexture->uTextureHeight * 65536.0);
     //array_50AC10[i].vWorldPosition.y = 1.0 / (pOutdoorCamera->shading_dist_mist >> 16);
-    //array_50AC10[i].vWorldPosition.z = v35 / (_this.pTexture->uTextureWidth * 65536.0);
+    //array_50AC10[i].vWorldPosition.z = v35 / (pSky.pTexture->uTextureWidth * 65536.0);
     //array_50AC10[i]._rhw = 1.0f / (v18 >> 16);
-    //array_50AC10[i].u = (double)v35 / (65536.0 * _this.pTexture->uTextureWidth);
-    //array_50AC10[i].v = (double)v36 / (65536.0 * _this.pTexture->uTextureHeight);
+    //array_50AC10[i].u = (double)v35 / (65536.0 * pSky.pTexture->uTextureWidth);
+    //array_50AC10[i].v = (double)v36 / (65536.0 * pSky.pTexture->uTextureHeight);
   //-----------------------------------------------------------------------------------------
 
     array_50AC10[i]._rhw = 1.0f;