diff Outdoor.cpp @ 259:92a551e4dbeb

Слияние
author Ritor1
date Mon, 18 Feb 2013 09:44:59 +0600
parents 07eb7d649bd5
children 96bc024a5fed
line wrap: on
line diff
--- a/Outdoor.cpp	Mon Feb 18 09:44:44 2013 +0600
+++ b/Outdoor.cpp	Mon Feb 18 09:44:59 2013 +0600
@@ -46,23 +46,20 @@
 //----- (0047A59E) --------------------------------------------------------
 void OutdoorLocation::ExecDraw(unsigned int bRedraw)
 {
-  int v1; // edi@1
   //unsigned int v2; // ebx@1
   int v3; // ST18_4@3
   int v4; // ST04_4@19
   int v5; // eax@19
 
-  v1 = 0;
-  //v2 = bRedraw;
-  if ( viewparams->field_54 )
-    v1 = 2;
+  pIndoorCamera->flags = 0;
+  if (viewparams->draw_d3d_outlines)
+    pIndoorCamera->flags |= INDOOR_CAMERA_DRAW_D3D_OUTLINES;
+
   pIndoorCamera->sRotationX = pParty->sRotationX;
   pIndoorCamera->sRotationY = pParty->sRotationY;
   pIndoorCamera->pos.x = pParty->vPosition.x
                       - ((unsigned __int64)(stru_5C6E00->SinCos(pParty->sRotationY)
                                           * (signed __int64)pParty->y_rotation_granularity) >> 16);
-  //v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi);
-  pIndoorCamera->field_4C = v1;
   pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16);
   pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
   if (bRedraw || pRenderer->pRenderD3D)
@@ -2012,8 +2009,7 @@
       header.pMagic[2] != 'i' ||
       header.pMagic[3] != 'i' )
   {
-    MessageBoxW(nullptr, L"Can't load file!",
-                L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:746", 0);
+    MessageBoxW(nullptr, L"Can't load file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odmap.cpp:746", 0);
     Str2 = (char *)1;
   }
   //v74 = 0;
@@ -2411,28 +2407,14 @@
   int v3; // esi@5
   unsigned int result; // eax@9
 
-
-/*    v3 = *(&this->pTerrain.pTilemap[128 * uZ] + uX);
-    if ( v3 < 198 )
-    {
-      if ( v3 >= 90 )
-        v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
-    }
-    else
-    {
-      v3 = v3 + this->pTileTypes[3].uTileID - 198;
-    }
-    result = pTileTable->pTiles[v3].uBitmapID;
-  }
-  return result;*/
-   if (uX > 127 || uY > 127)
+   if ( uX < 0 || uX > 127 || uY < 0 || uY > 127)
    return 0;
 
  v3 = this->pTerrain.pTilemap[uY * 128 + uX];
  if (v3 < 198)
  {
   if (v3 >= 90)
-    v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
+    v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90;
  }
  else
    v3 = v3 + this->pTileTypes[3].uTileID - 198;
@@ -2456,29 +2438,16 @@
 int OutdoorLocation::ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY)
 {
   int v3; // esi@5
-  //int result; // eax@7
 
-/*  if ( (uX & 0x80000000u) != 0 || (signed int)uX > 127 || (uY & 0x80000000u) != 0 || (signed int)uY > 127 )
-  {
-    result = 0;
-  }
-  else
-  {
-    v3 = *(&this->pTerrain.pTilemap[128 * uY] + uX);
-    if ( v3 >= 90 )
-      v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
-    result = pTileTable->pTiles[v3].uAttributes;
-  }
-  return result;*/
-  if (uX > 127 || uY > 127)
+  if (uX < 0 || uX > 127 || uY < 0 || uY > 127)
     return 0;
   else
   {
     v3 = this->pTerrain.pTilemap[uY * 128 + uX];
     if ( v3 >= 90 )
-      v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
+      v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * ((v3 - 90) / 36) - 90;
   return pTileTable->pTiles[v3].uAttributes;
- }
+  }
 }
 
 //----- (0047EE16) --------------------------------------------------------