diff Viewport.cpp @ 1572:19f1735fca80

Слияние
author Ritor1
date Sun, 08 Sep 2013 17:07:58 +0600
parents 30db6d265ceb
children 75fafd8ced59
line wrap: on
line diff
--- a/Viewport.cpp	Sun Sep 08 17:07:47 2013 +0600
+++ b/Viewport.cpp	Sun Sep 08 17:07:58 2013 +0600
@@ -95,67 +95,72 @@
 
 //----- (00443219) --------------------------------------------------------
  void ViewingParams::_443219()
-    {
-    this->sViewCenterY += 512;
-    AdjustPosition();
-    }
+ {
+   this->sViewCenterY += 512;
+   
+   AdjustPosition();
+ }
 
 //----- (00443225) --------------------------------------------------------
 void ViewingParams::_443225()
-    {
-    this->sViewCenterX -= 512;
-    AdjustPosition();
-    }
+{
+  this->sViewCenterX -= 512;
+  
+  AdjustPosition();
+}
 
 //----- (00443231) --------------------------------------------------------
 void ViewingParams::_443231()
-    {
-    this->sViewCenterY -= 512;
-    AdjustPosition();
-    }
+{
+  this->sViewCenterY -= 512;
+
+  AdjustPosition();
+}
 
 //----- (0044323D) --------------------------------------------------------
 void ViewingParams::_44323D()
-    {
-    this->sViewCenterX += 512;
-    AdjustPosition();
-    }
+{
+  this->sViewCenterX += 512;
+
+  AdjustPosition();
+}
 
 //----- (00443249) --------------------------------------------------------
 void ViewingParams::CenterOnParty()
-    {
-    int v1; // edx@1
+{
+  this->field_2C = (32768 * (__int64)this->field_2C) >> 16;
+  if (this->field_2C < 384)
+    this->field_2C = 384;
 
-    v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
-    this->field_2C = v1;
-    if ( v1 < 384 )
-        this->field_2C = 384;
-    this->sViewCenterX = pParty->vPosition.x;
-    this->sViewCenterY = pParty->vPosition.y;
-    AdjustPosition();
-    }
+  this->sViewCenterX = pParty->vPosition.x;
+  this->sViewCenterY = pParty->vPosition.y;
+
+  AdjustPosition();
+}
 
 //----- (00443291) --------------------------------------------------------
 void ViewingParams::CenterOnParty2()
-    {
-    int v1; // edx@1
+{
     int v2; // eax@1
 
-    v1 = 2 * this->field_2C;
-    v2 = 1536;
-    this->field_2C = v1;
-    if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
-        v2 = 3072;
-    if ( v1 > v2 )
+    if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
+      v2 = 1536;
+    else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
+      v2 = 3072;
+    else assert(false);
+    
+    this->field_2C *= 2;
+    if (this->field_2C > v2 )
         this->field_2C = v2;
+
     this->sViewCenterX = pParty->vPosition.x;
     this->sViewCenterY = pParty->vPosition.y;
     AdjustPosition();
-    }
+}
 
 //----- (004432E7) --------------------------------------------------------
 void ViewingParams::AdjustPosition()
-    {
+{
     ViewingParams *v1; // esi@1
     int v2; // ebx@1
     signed int v3; // edx@1
@@ -167,7 +172,7 @@
 
     v1 = this;
     v2 = this->indoor_center_y;
-    v3 = 88 >> this->field_2C / 384;
+    v3 = 88 >> (this->field_2C / 384);
     v4 = (44 - v3) << 9;
     if ( v1->sViewCenterY > v2 + v4 )
         v1->sViewCenterY = v2 + v4;
@@ -295,7 +300,7 @@
           _449B7E_toggle_bit(pParty->_quest_bits, 184, 1);
         if ( pSpriteObjects[v21].stru_24.uItemID == 455 )
           _449B7E_toggle_bit(pParty->_quest_bits, 185, 1);
-        if ( !pParty->AddItem(&pSpriteObjects[v21].stru_24) )
+        if ( !pParty->AddItemToParty(&pSpriteObjects[v21].stru_24) )
           pParty->SetHoldingItem(&pSpriteObjects[v21].stru_24);
       }
       SpriteObject::OnInteraction(a2.y);
@@ -533,7 +538,7 @@
       pIcons_LOD->SyncLoadedFilesCount();
       return;
     }
-    if ( !pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].field_16_event_id )
+    if ( !pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].uEventID )
     {
       if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() )
       {
@@ -544,7 +549,7 @@
       }
       return;
     }
-    pEventID = pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].field_16_event_id;
+    pEventID = pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].uEventID;
   }
   if ( PID_TYPE(v0) == OBJECT_BModel && HIWORD(v0) < clickable_distance)
   {