changeset 1421:4fff79f04dbd

more label cleaning 4
author zipi
date Sun, 28 Jul 2013 19:14:15 +0100
parents e11c498c0dc6
children 350959f13283
files DecorationList.cpp GUIProgressBar.cpp Game.cpp GammaControl.cpp
diffstat 4 files changed, 31 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/DecorationList.cpp	Sun Jul 28 19:07:12 2013 +0100
+++ b/DecorationList.cpp	Sun Jul 28 19:14:15 2013 +0100
@@ -264,13 +264,12 @@
       ++uID;
       ++v4;
       if ( uID >= (signed int)v2->uNumDecorations )
-        goto LABEL_6;
+        return 0;
     }
     result = uID;
   }
   else
   {
-LABEL_6:
     result = 0;
   }
   return result;
--- a/GUIProgressBar.cpp	Sun Jul 28 19:07:12 2013 +0100
+++ b/GUIProgressBar.cpp	Sun Jul 28 19:14:15 2013 +0100
@@ -203,15 +203,19 @@
         floorf(v4 + 0.5f),//COERCE_UNSIGNED_INT64(v4 + 6.7553994e15),
         16,
         pRenderer->uTargetRMask);
-      goto LABEL_11;
+        pRenderer->EndScene();
+		pRenderer->Present();
+		return;
     }
-LABEL_6:
     pRenderer->EndScene();
     return;
   }
 
   if (!pLoadingBg.pPixels)
-    goto LABEL_6;
+  {
+	pRenderer->EndScene();
+    return;
+  }
 
   pRenderer->DrawTextureRGB(0, 0, &pLoadingBg);
   pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu);
@@ -220,7 +224,6 @@
     0x1D7u);
   pRenderer->DrawTextureTransparent(0xACu, 0x1CBu, &pLoadingProgress);
   pRenderer->ResetTextureClipRect();
-LABEL_11:
   pRenderer->EndScene();
   pRenderer->Present();
 }
\ No newline at end of file
--- a/Game.cpp	Sun Jul 28 19:07:12 2013 +0100
+++ b/Game.cpp	Sun Jul 28 19:14:15 2013 +0100
@@ -89,10 +89,12 @@
 
   if ( pVideoPlayer->AnyMovieLoaded() )
   {
-    if ( pRenderer->pRenderD3D )
-      goto LABEL_22;
-    pRenderer->BeginSceneD3D();
-    pMouse->DrawCursorToTarget();
+    if ( !pRenderer->pRenderD3D )
+    {
+		pRenderer->BeginSceneD3D();
+		pMouse->DrawCursorToTarget();
+		pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
+	}
   }
   else
   {
@@ -133,9 +135,8 @@
         pGame->pLightmapBuilder->DrawLightmapsType(2);
       }
     }
+    pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
   }
-  pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
-LABEL_22:
 
   //DEBUG: force redraw gui
   viewparams->bRedrawGameUI = true;
@@ -1025,10 +1026,13 @@
     || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
     && v3 <= 0x80 )
   {
-    if ( v4 > 0 || v4 >= 0 )
-      goto LABEL_12;
-    v3 = 0;
-    v4 = 0;
+    if ( v4 < 0 )
+	{
+		v3 = 0;
+		v4 = 0;
+		uSomeGammaStartTime = v2;
+		v8 = __PAIR__(v4, v3);
+	}
   }
   else
   {
@@ -1045,10 +1049,9 @@
     v5 = __CFADD__(v3, -128);
     v3 -= 128;
     v4 = v5 + v4 - 1;
+    uSomeGammaStartTime = v2;
+    v8 = __PAIR__(v4, v3);
   }
-  uSomeGammaStartTime = v2;
-  v8 = __PAIR__(v4, v3);
-LABEL_12:
   if ( uSomeGammaDeltaTime )
     v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
   else
--- a/GammaControl.cpp	Sun Jul 28 19:07:12 2013 +0100
+++ b/GammaControl.cpp	Sun Jul 28 19:14:15 2013 +0100
@@ -72,16 +72,18 @@
   {
     v3 = (double)v6 * 0.0039215689 * this->fGamma;
     if ( v3 >= 1.0 || (v4 = (signed __int64)(v3 * 65535.0), (signed int)v4 > 65535) )
-      goto LABEL_12;
-    if ( (signed int)v4 < 0 )
+	{
+		LODWORD(v4) = 65535;	
+	}
+    else if ( (signed int)v4 < 0 )
     {
       LODWORD(v4) = 0;
-      goto LABEL_8;
     }
+	else
+	{
     if ( (signed int)v4 > 65535 )
-LABEL_12:
       LODWORD(v4) = 65535;
-LABEL_8:
+	}
     ++v6;
     v2[256] = v4;
     *v2 = v4;