diff mm7_3.cpp @ 1854:a02d72dd7653

Merge
author Grumpy7
date Mon, 14 Oct 2013 00:24:57 +0200
parents 4359a15360e3
children a86c60679949
line wrap: on
line diff
--- a/mm7_3.cpp	Mon Oct 14 00:24:28 2013 +0200
+++ b/mm7_3.cpp	Mon Oct 14 00:24:57 2013 +0200
@@ -4958,10 +4958,12 @@
       //rotate skydome(вращение купола неба)--------------------------------------
       // В игре принята своя система измерения углов. Полный угол (180). Значению угла 0 соответствует 
       // направление на север и/или юг (либо на восток и/или запад), значению 65536 еденицам(0х10000) соответствует угол 90.
-      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->field_14 * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
+	  // две переменные хранят данные по углу обзора. field_14 по западу и востоку. field_20 по югу и северу
+      // от -25080 до 25080
+      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_west_east * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
       v35 = v39 + pSkyPolygon.ptr_38->angle_from_north;
 
-      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
+      v39 = (unsigned __int64)(pSkyPolygon.ptr_38->viewing_angle_from_north_south * (signed __int64)(v33 * (v30 - array_50AC10[i].vWorldViewProjY))) >> 16;
       v36 = v39 + pSkyPolygon.ptr_38->angle_from_east;
 
       v38 = pSkyPolygon.v_18.z;
@@ -5002,7 +5004,7 @@
       }
       LODWORD(v17) = LODWORD(v34) << 16;
       HIDWORD(v17) = v34 >> 16;
-      v40 = v17 / v38;
+      //v40 = v17 / v38;
       v18 = v17 / v38;
       if ( v18 < 0 )
         v18 = pODMRenderParams->shading_dist_mist;
@@ -5725,13 +5727,13 @@
 
     this->angle_from_north = fixpoint_mul(v17, v25) + fixpoint_mul(a4, v27);
     this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7);
-    this->field_14 = fixpoint_mul(a4, v25) - fixpoint_mul(v17, v27);
+    this->viewing_angle_from_west_east = fixpoint_mul(a4, v25) - fixpoint_mul(v17, v27);
   }
   else
   {
     this->angle_from_north = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7);
     this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7);
-    this->field_14 = a4;
+    this->viewing_angle_from_west_east = a4;
   }
 
   if (pGame->pIndoorCameraD3D->sRotationX)
@@ -5740,25 +5742,25 @@
 
     this->angle_from_east = fixpoint_mul(v19, v25) + fixpoint_mul(a7, v27);
     this->angle_from_south = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7);
-    this->viewing_angle = fixpoint_mul(a7, v25) - fixpoint_mul(v19, v27);
+    this->viewing_angle_from_north_south = fixpoint_mul(a7, v25) - fixpoint_mul(v19, v27);
   }
   else
   {
     this->angle_from_east = fixpoint_mul(a5, v9) + fixpoint_mul(a6, v7);
     this->angle_from_south = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7);
-    this->viewing_angle = a7;
+    this->viewing_angle_from_north_south = a7;
   }
 
   this->angle_from_east = -this->angle_from_east;
   this->angle_from_south = -this->angle_from_south;
-  this->viewing_angle = -this->viewing_angle;
+  this->viewing_angle_from_north_south = -this->viewing_angle_from_north_south;
 
   this->field_24 = fixpoint_dot(this->angle_from_north,  this->field_0_party_dir_x,
                                 this->angle_from_west, this->field_4_party_dir_y,
-                                this->field_14, this->field_8_party_dir_z);
+                                this->viewing_angle_from_west_east, this->field_8_party_dir_z);
   this->field_28 = fixpoint_dot(this->angle_from_east, this->field_0_party_dir_x,
                                 this->angle_from_south, this->field_4_party_dir_y,
-                                this->viewing_angle, this->field_8_party_dir_z);
+                                this->viewing_angle_from_north_south, this->field_8_party_dir_z);
 }
 
 //----- (0048694B) --------------------------------------------------------
@@ -5766,14 +5768,14 @@
 {
   this->angle_from_east = -this->angle_from_east;
   this->angle_from_south = -this->angle_from_south;
-  this->viewing_angle = -this->viewing_angle;
+  this->viewing_angle_from_north_south = -this->viewing_angle_from_north_south;
 
   this->field_24 = fixpoint_dot(this->angle_from_north, this->field_0_party_dir_x,
                                 this->angle_from_west, this->field_4_party_dir_y,
-                                this->field_14, this->field_8_party_dir_z);
+                                this->viewing_angle_from_west_east, this->field_8_party_dir_z);
   this->field_28 = fixpoint_dot(this->angle_from_east, this->field_0_party_dir_x,
                                 this->angle_from_south, this->field_4_party_dir_y,
-                                this->viewing_angle, this->field_8_party_dir_z);
+                                this->viewing_angle_from_north_south, this->field_8_party_dir_z);
 }
 
 //----- (0044100D) --------------------------------------------------------