diff mm7_3.cpp @ 692:066e2b29b30f

viewport.cpp added
author Gloval
date Sat, 16 Mar 2013 21:57:32 +0400
parents c0bfb386b15f
children e0a1fccc89b1
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Mar 16 14:33:23 2013 +0200
+++ b/mm7_3.cpp	Sat Mar 16 21:57:32 2013 +0400
@@ -5864,8 +5864,8 @@
 draw:
     struct RenderVertexD3D3  v[6];
 
-    v[0].pos.x = pViewport->uScreenX;
-    v[0].pos.y = pViewport->uScreenY;
+    v[0].pos.x = pViewport->uScreen_TL_X;
+    v[0].pos.y = pViewport->uScreen_TL_Y;
     v[0].pos.z = 0.99989998;
     v[0].rhw = 1;
     v[0].diffuse = 0xFFFFFFFF;
@@ -5873,8 +5873,8 @@
     v[0].texcoord.x = 0;
     v[0].texcoord.y = 0;
     
-    v[1].pos.x = pViewport->uScreenX + pViewport->uScreenWidth;
-    v[1].pos.y = pViewport->uScreenY + pViewport->uScreenHeight;
+    v[1].pos.x = pViewport->uScreen_TL_X + pViewport->uScreenWidth;
+    v[1].pos.y = pViewport->uScreen_TL_Y + pViewport->uScreenHeight;
     v[1].pos.z = 0.99989998;
     v[1].rhw = 1;
     v[1].diffuse = 0xFFFFFFFF;
@@ -5882,8 +5882,8 @@
     v[1].texcoord.x = (float)pViewport->uScreenWidth / skybox_width;
     v[1].texcoord.y = (float)pViewport->uScreenHeight / skybox_height;
 
-    v[2].pos.x = pViewport->uScreenX + pViewport->uScreenWidth;
-    v[2].pos.y = pViewport->uScreenY;
+    v[2].pos.x = pViewport->uScreen_TL_X + pViewport->uScreenWidth;
+    v[2].pos.y = pViewport->uScreen_TL_Y;
     v[2].pos.z = 0.99989998;
     v[2].rhw = 1;
     v[2].diffuse = 0xFFFFFFFF;
@@ -5893,8 +5893,8 @@
 
     memcpy(&v[3], &v[0], sizeof(*v));
 
-    v[4].pos.x = pViewport->uScreenX;
-    v[4].pos.y = pViewport->uScreenY + pViewport->uScreenHeight;
+    v[4].pos.x = pViewport->uScreen_TL_X;
+    v[4].pos.y = pViewport->uScreen_TL_Y + pViewport->uScreenHeight;
     v[4].pos.z = 0.99989998;
     v[4].rhw = 1;
     v[4].diffuse = 0xFFFFFFFF;
@@ -12822,188 +12822,7 @@
   }
 }
 
-//----- (00443219) --------------------------------------------------------
-void ViewingParams::_443219()
-    {
-  this->sPartyPosZ += 512;
-  _4432E7();
-}
-
-//----- (00443225) --------------------------------------------------------
-void ViewingParams::_443225()
-    {
-  this->sPartyPosX -= 512;
-  _4432E7();
-}
-
-//----- (00443231) --------------------------------------------------------
-void ViewingParams::_443231()
-    {
-  this->sPartyPosZ -= 512;
-   _4432E7();
-}
-
-//----- (0044323D) --------------------------------------------------------
-void ViewingParams::_44323D()
-    {
-  this->sPartyPosX += 512;
-   _4432E7();
-}
-
-//----- (00443249) --------------------------------------------------------
-void ViewingParams::_443249()
-    {
-  int v1; // edx@1
-
-  v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
-  this->field_2C = v1;
-  if ( v1 < 384 )
-    this->field_2C = 384;
-  this->sPartyPosX = pParty->vPosition.x;
-  this->sPartyPosZ = pParty->vPosition.y;
-  _4432E7();
-}
-
-//----- (00443291) --------------------------------------------------------
-void ViewingParams::_443291()
-    {
-  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 )
-    this->field_2C = v2;
-  this->sPartyPosX = pParty->vPosition.x;
-  this->sPartyPosZ = pParty->vPosition.y;
-  _4432E7();
-}
-
-//----- (004432E7) --------------------------------------------------------
-void ViewingParams::_4432E7()
-    {
-  ViewingParams *v1; // esi@1
-  int v2; // ebx@1
-  signed int v3; // edx@1
-  int v4; // ecx@1
-  int v5; // edi@3
-  int v6; // eax@3
-  int v7; // eax@5
-  int result; // eax@7
-
-  v1 = this;
-  v2 = this->field_3A;
-  v3 = 88 >> this->field_2C / 384;
-  v4 = (44 - v3) << 9;
-  if ( v1->sPartyPosZ > v2 + v4 )
-    v1->sPartyPosZ = v2 + v4;
-
-  v5 = v1->field_38;
-  v6 = (v3 - 44) << 9;
-  if ( v1->sPartyPosX < v5 + v6 )
-    v1->sPartyPosX = v5 + v6;
-
-  v7 = v2 + v6;
-  if ( v1->sPartyPosZ < v7 )
-    v1->sPartyPosZ = v7;
-
-  result = v5 + v4;
-  if ( v1->sPartyPosX > v5 + v4 )
-    v1->sPartyPosX = result;
-}
-
-//----- (00443343) --------------------------------------------------------
-void ViewingParams::InitGrayPalette()
-    {
-  for  (unsigned short i=0; i<256; ++i)
-      pPalette[i]=GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(i, i, i);
-}
-
-//----- (00443365) --------------------------------------------------------
-int ViewingParams::_443365()
-{
-  ViewingParams *v1; // esi@1
-  __int16 *v2; // edi@3
-  Vec3_short_ *v3; // eax@4
-  unsigned int v4; // edx@4
-  signed int v5; // eax@8
-  Vec3_short_ *v6; // eax@12
-  signed int v7; // edi@12
-  signed int v8; // eax@16
-  char v9; // zf@20
-  int result; // eax@21
-  unsigned int v11; // [sp+4h] [bp-1Ch]@3
-  unsigned int *v12; // [sp+8h] [bp-18h]@3
-  unsigned int v13; // [sp+Ch] [bp-14h]@8
-  unsigned int v14; // [sp+10h] [bp-10h]@2
-  unsigned int v15; // [sp+14h] [bp-Ch]@2
-  unsigned int v16; // [sp+18h] [bp-8h]@2
-  unsigned int v17; // [sp+1Ch] [bp-4h]@2
-
-  v1 = this;
-  InitGrayPalette();
-  if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
-  {
-    v16 = 0x40000000u;
-    v14 = 0x40000000u;
-    v17 = 0xC0000000u;
-    v15 = 0xC0000000u;
-    if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 )
-    {
-      v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines);
-      v11 = pIndoor->pMapOutlines->uNumOutlines;
-      v12 = (uint *)pIndoor->pMapOutlines->pOutlines;
-      do
-      {
-        v3 = &pIndoor->pVertices[*v2];
-        v4 = v3->x;
-        if ( (signed int)v4 < (signed int)v16 )
-          v16 = v3->x;
-        if ( (signed int)v4 > (signed int)v17 )
-          v17 = v3->x;
-        v5 = v3->y;
-        v13 = v5;
-        if ( v5 < (signed int)v14 )
-          v14 = v4;
-        if ( v5 > (signed int)v15 )
-          v15 = v4;
-        v6 = &pIndoor->pVertices[v2[1]];
-        v7 = v6->x;
-        if ( v7 < (signed int)v16 )
-          v16 = v4;
-        if ( v7 > (signed int)v17 )
-          v17 = v4;
-        v8 = v6->y;
-        if ( v8 < (signed int)v14 )
-          v14 = v13;
-        if ( v8 > (signed int)v15 )
-          v15 = v13;
-        v2 = (__int16 *)(v12 + 3);
-        v9 = v11-- == 1;
-        v12 += 3;
-      }
-      while ( !v9 );
-    }
-    v1->uMinimapZoom = 1024;
-    v1->field_38 = (signed int)(v16 + v17) / 2;
-    v1->field_28 = 10;
-    result = (signed int)(v14 + v15) / 2;
-    v1->field_3A = result;
-  }
-  else
-  {
-    v1->field_38 = 0;
-    v1->field_3A = 0;
-    v1->uMinimapZoom = dword_576E2C;
-    result = dword_576E28;
-    v1->field_28 = dword_576E28;
-  }
-  v1->field_2C = 384;
-  return result;
-}
+
 
 
 //----- (00443801) --------------------------------------------------------