changeset 1757:11f5c0ac170a

UITransition.cpp cleared
author Ritor1
date Mon, 30 Sep 2013 18:25:14 +0600
parents dc5d8edf629a
children 24e756a50073
files UI/UITransition.cpp
diffstat 1 files changed, 22 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/UI/UITransition.cpp	Mon Sep 30 18:06:01 2013 +0600
+++ b/UI/UITransition.cpp	Mon Sep 30 18:25:14 2013 +0600
@@ -102,14 +102,9 @@
     uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
 }
 
-
-
-
 //----- (00444C8F) --------------------------------------------------------
 void TravelUI_Load()
 {
-  unsigned int v1; // eax@6
-  GUIWindow *result; // eax@9
   char pContainer[32]; // [sp+0h] [bp-28h]@1
 
   pEventTimer->Pause();
@@ -124,65 +119,44 @@
 
   pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
   pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
-  v1 = pMapStats->GetMapInfo(pCurrentMapName);
-  if ( v1 )
-    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
+  if ( pMapStats->GetMapInfo(pCurrentMapName) )
+    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);// "Leave %s"
   else
     strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
   pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, sHouseName.data());
 }
 
-
-
 //----- (00444DCA) --------------------------------------------------------
 void TravelUI_Draw()
 {
-  unsigned int v0; // edi@1
-  MapInfo *v1; // edi@2
-  signed int v3; // eax@2
-  int v4; // eax@5
-  const char *v5; // [sp-Ch] [bp-90h]@3
-  signed int v6; // [sp-8h] [bp-8Ch]@3
-  GUIWindow v7; // [sp+Ch] [bp-78h]@1
+  GUIWindow travel_window; // [sp+Ch] [bp-78h]@1
   char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
-  unsigned int v9; // [sp+80h] [bp-4h]@1
 
-  memcpy(&v7, pPrimaryWindow, sizeof(v7));
-  v9 = pMapStats->GetMapInfo(pCurrentMapName);
+  memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window));
   pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
-  v0 = pMapStats->GetMapInfo(pDestinationMapName);
-  pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
+  pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureTransparent(468, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
-  pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_x_u));
-  pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
-  if ( v0 )
+  pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
+  pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
+  if ( pMapStats->GetMapInfo(pDestinationMapName) )
   {
-    v1 = &pMapStats->pInfos[v0];
-    v7.uFrameX = 493;
-    v7.uFrameWidth = 126;
-    v7.uFrameZ = 366;
-    v7.DrawTitleText(pFontCreate, 0, 4u, 0, v1->pName, 3);
-    v7.uFrameX = 483;
-    v7.uFrameWidth = 148;
-    v7.uFrameZ = 334;
-    v3 = GetTravelTime();
-    if ( v3 == 1 )
-    {
-      v6 = 1;
-      v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
-    }
+    travel_window.uFrameX = 493;
+    travel_window.uFrameWidth = 126;
+    travel_window.uFrameZ = 366;
+    travel_window.DrawTitleText(pFontCreate, 0, 4, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName, 3);
+    travel_window.uFrameX = 483;
+    travel_window.uFrameWidth = 148;
+    travel_window.uFrameZ = 334;
+    if ( GetTravelTime() == 1 )
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[663], 1, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d day to cross to %s."
     else
-    {
-      v6 = v3;
-      v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
-    }
-    sprintfex(pTmpBuf.data(), v5, v6, v1->pName);
+      sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[128], GetTravelTime(), pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d days to travel to %s."
+
     strcat(pTmpBuf.data(), "\n \n");
-    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
+    sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);
     strcat(pTmpBuf.data(), pTmpBuf2.data());
-    v4 = pFontCreate->CalcTextHeight(pTmpBuf.data(), &v7, 0, 0);
-    v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf.data(), 3);
+    travel_window.DrawTitleText(pFontCreate, 0, (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0)) / 2 + 101, 0, pTmpBuf.data(), 3);
     _unused_5B5924_is_travel_ui_drawn = 1;
   }
 }