diff UI/UiGame.cpp @ 2169:5b27c035a241

small cleaning
author Ritor1
date Mon, 20 Jan 2014 00:02:22 +0600
parents 00bd098f6435
children f0b5ca2dfb73
line wrap: on
line diff
--- a/UI/UiGame.cpp	Fri Jan 17 22:44:57 2014 +0600
+++ b/UI/UiGame.cpp	Mon Jan 20 00:02:22 2014 +0600
@@ -1956,55 +1956,64 @@
       BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i];
       BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
       BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
-      //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes;
-        //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes;
       if (pFace1->Visible() && pFace2->Visible())
       {
         if ( pOutline->uFlags & 1 )
-          goto LABEL_15;
+        {
+          if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
+             (pFace1->Clickable() || pFace2->Clickable()) &&
+             (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
+          {
+            if (uNumBlueFacesInBLVMinimap < 49)
+              pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
+          }
+          else
+          {
+            pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+            pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
+            pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+            pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
+            v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
+            if ( v15 > 100 )
+              v15 = 100;
+            pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]);
+          }
+          continue;
+        }
         if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80)
-          goto LABEL_ABC;
-      }
-      continue;
-
-LABEL_ABC:
-      pOutline->uFlags = pOutline->uFlags | 1;
-      pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
-
-LABEL_15:
-      //v12 = &pIndoor->pFaces[pOutline->uFace1ID];
-      if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
-          (pFace1->Clickable() || pFace2->Clickable()) &&
-          (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
-      {
-        if (uNumBlueFacesInBLVMinimap < 49)
-          pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
-      }
-      else
-      {
-        long long _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
-        uint _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
-        int _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
-        pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x);
-        pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y);
-        pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x);
-        pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y);
-        v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
-        if ( v15 > 100 )
-          v15 = 100;
-		//if ( i == 1000 )//pY < 0 && pW > 16 )
-			//__debugbreak();
-        pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]);
+        {
+          pOutline->uFlags = pOutline->uFlags | 1;
+          pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
+          if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
+             (pFace1->Clickable() || pFace2->Clickable()) &&
+             (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
+          {
+            if (uNumBlueFacesInBLVMinimap < 49)
+              pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
+          }
+          else
+          {
+            pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+            pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
+            pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+            pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
+            v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
+            if ( v15 > 100 )
+              v15 = 100;
+            pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]);
+          }
+          continue;
+        }
       }
     }
 
     for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i)
     {
       BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
-      pX = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x) << 16) - uZoom, pParty->vPosition.x);
-      pY = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y) << 16) - uZoom, pParty->vPosition.y);
-      pZ = uCenterX + fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x) << 16) - uZoom, pParty->vPosition.x);
-      pW = uCenterY - fixpoint_mul((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y) << 16) - uZoom, pParty->vPosition.y);
+      pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+      pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
+      pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
+      pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
       pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color);
     }
   }