changeset 236:99ef31ffa74e

DrawBook_Map_sub remove goto part1
author zipi
date Sun, 17 Feb 2013 18:04:22 +0100
parents 0d9d30a1efc9
children b070b83a897b 1bfe546561c4 0fbb07ec6241
files mm7_3.cpp
diffstat 1 files changed, 114 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_3.cpp	Sun Feb 17 16:55:44 2013 +0100
+++ b/mm7_3.cpp	Sun Feb 17 18:04:22 2013 +0100
@@ -14627,9 +14627,8 @@
   {
     if ( viewparams->field_2C == 768 )
     {
-      if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
-        goto LABEL_23;
-      v5 = 680;
+      if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
+		v5 = 680;
     }
     if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
       goto LABEL_8;
@@ -14720,105 +14719,110 @@
       }
       while ( v96 );
     }
-    goto LABEL_38;
-  }
-  v6 = viewparams->field_38;
-  v86 = viewparams->field_38;
-  v84 = viewparams->field_3A;
-  if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
-    goto LABEL_23;
-  v5 = viewparams->field_2C - 34;
-LABEL_8:
-  black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
-  teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
-  v7 = (uint *)pIndoor->pMapOutlines;
-  uNumBlueFacesInBLVMinimap = 0;
-  v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
-  v9 = pIndoor->pMapOutlines->uNumOutlines < 0;
-  v94 = 0;
-  if ( !(v9 | v8) )
-  {
-    i = 0;
-    do
-    {
-      v10 = (int)((char *)v7 + i + 4);
-      v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
-      if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
-        goto LABEL_17;
-      v12 = *(short *)((char *)v7 + i + 14);
-      if ( !(v12 & 1) )
-      {
-        if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
-          goto LABEL_17;
-        v96 = (signed int)v94 >> 3;
-        v13 = v94;
-        *(short *)(v10 + 10) = v12 | 1;
-        pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
-      }
-      v14 = *(short *)v10;
-      v88 = v5;
-      v15 = &pIndoor->pVertices[v14];
-      v16 = v15->x;
-      v17 = v15->y - v84;
-      v93 = (unsigned __int16 *)(v16 - v6);
-      v92 = v17;
-      v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
-      v19 = v18->x;
-      v20 = v18->y - v84;
-      v95 = v19 - v6;
-      v97 = (const void *)v20;
-      v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
-      v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
-      v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
-      v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
-      pRenderer->Line2D(
-        v85 + v88,
-        v90 - v87,
-        v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
-        v90 - v92,
-        black);
-      v7 = (uint *)pIndoor->pMapOutlines;
-LABEL_17:
-      ++v94;
-      i += 12;
-    }
-    while ( (signed int)v94 < (signed int)*v7 );
-  }
-  v21 = 0;
-  if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
-  {
-    while ( 1 )
-    {
-      v22 = pBlueFacesInBLVMinimapIDs[v21];
-      v87 = v5;
-      v23 = (int)&v7[3 * v22 + 1];
-      v24 = &pIndoor->pVertices[*(short *)v23];
-      v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
-      v26 = v25->x;
-      v27 = (unsigned __int16 *)(v24->x - v86);
-      v28 = v24->y - v84;
-      v29 = v25->y - v84;
-      v93 = v27;
-      v92 = v28;
-      v97 = (const void *)v29;
-      v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
-      v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
-      i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
-      v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
-      pRenderer->Line2D(
-        v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
-        v90 - v88,
-        v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
-        v90 - v95,
-        teal);
-      ++v21;
-      if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
-        break;
-      v7 = (uint *)pIndoor->pMapOutlines;
-    }
-    v6 = v86;
-  }
-LABEL_38:
+  }
+  else
+  {
+	  v6 = viewparams->field_38;
+	  v86 = viewparams->field_38;
+	  v84 = viewparams->field_3A;
+	  if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
+		goto LABEL_23;
+	  v5 = viewparams->field_2C - 34;
+	LABEL_8:
+	  black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
+	  teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
+	  v7 = (uint *)pIndoor->pMapOutlines;
+	  uNumBlueFacesInBLVMinimap = 0;
+	  v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
+	  v9 = pIndoor->pMapOutlines->uNumOutlines < 0;
+	  v94 = 0;
+	  if ( !(v9 | v8) )
+	  {
+		i = 0;
+		do
+		{
+		  v10 = (int)((char *)v7 + i + 4);
+		  v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
+		  if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) ))
+		  {
+			  v12 = *(short *)((char *)v7 + i + 14);
+			  if ( !(v12 & 1) )
+			  {
+				if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 ))
+				{
+					v96 = (signed int)v94 >> 3;
+					v13 = v94;
+					*(short *)(v10 + 10) = v12 | 1;
+					pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
+				}
+			  }
+			  if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1)
+			  {
+				  v14 = *(short *)v10;
+				  v88 = v5;
+				  v15 = &pIndoor->pVertices[v14];
+				  v16 = v15->x;
+				  v17 = v15->y - v84;
+				  v93 = (unsigned __int16 *)(v16 - v6);
+				  v92 = v17;
+				  v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
+				  v19 = v18->x;
+				  v20 = v18->y - v84;
+				  v95 = v19 - v6;
+				  v97 = (const void *)v20;
+				  v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
+				  v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
+				  v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
+				  v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
+				  pRenderer->Line2D(
+					v85 + v88,
+					v90 - v87,
+					v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
+					v90 - v92,
+					black);
+				  v7 = (uint *)pIndoor->pMapOutlines;
+			  }
+		  }
+		  ++v94;
+		  i += 12;
+		}
+		while ( (signed int)v94 < (signed int)*v7 );
+	  }
+	  v21 = 0;
+	  if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
+	  {
+		while ( 1 )
+		{
+		  v22 = pBlueFacesInBLVMinimapIDs[v21];
+		  v87 = v5;
+		  v23 = (int)&v7[3 * v22 + 1];
+		  v24 = &pIndoor->pVertices[*(short *)v23];
+		  v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
+		  v26 = v25->x;
+		  v27 = (unsigned __int16 *)(v24->x - v86);
+		  v28 = v24->y - v84;
+		  v29 = v25->y - v84;
+		  v93 = v27;
+		  v92 = v28;
+		  v97 = (const void *)v29;
+		  v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
+		  v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
+		  i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
+		  v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
+		  pRenderer->Line2D(
+			v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
+			v90 - v88,
+			v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
+			v90 - v95,
+			teal);
+		  ++v21;
+		  if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
+			break;
+		  v7 = (uint *)pIndoor->pMapOutlines;
+		}
+		v6 = v86;
+	  }
+  }
   v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
   v81 = pParty->vPosition.y - v84;
   v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
@@ -14872,9 +14876,8 @@
               {
                 if ( (signed int)v51 >= 1664 )
                 {
-                  if ( (signed int)v51 > 1920 )
-                    goto LABEL_71;
-                  v73 = 7;
+                  if ( (signed int)v51 <= 1920 )
+				    v73 = 7;
                 }
                 else
                 {
@@ -14900,12 +14903,12 @@
         {
           v73 = 2;
         }
-        v50 = v73;
-        goto LABEL_71;
-      }
-      v50 = 1;
-    }
-LABEL_71:
+		if( (signed int)v51 <=1920)
+          v50 = v73;
+      }
+	  else
+        v50 = 1;
+    }
     pRenderer->_4A6776(
       v47,
       v49,