diff UIBooks.cpp @ 1048:d36681a9e4f8

Слияние
author Ritor1
date Thu, 23 May 2013 11:17:01 +0600
parents 39f42990698f
children f17cfb070f7a
line wrap: on
line diff
--- a/UIBooks.cpp	Thu May 23 11:16:46 2013 +0600
+++ b/UIBooks.cpp	Thu May 23 11:17:01 2013 +0600
@@ -27,6 +27,151 @@
 
 
 
+//----- (00411150) --------------------------------------------------------
+void BookUI_DrawTownPortalMap()
+{
+  //signed int v0; // edi@1
+  //__int16 v1; // dx@8
+  //POINT *v2; // edi@17
+  int v3; // edi@17
+  //__int16 v4; // dx@24
+  GUIWindow v6; // [sp+Ch] [bp-64h]@1
+  //POINT v7; // [sp+60h] [bp-10h]@17
+  POINT a2; // [sp+68h] [bp-8h]@17
+
+  pRenderer->ClearZBuffer(0, 479);
+  pRenderer->DrawTextureTransparent(8, 8, pTexture_CurrentBook);
+  pRenderer->DrawTextureTransparent(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+
+  v6.uFrameX = game_viewport_x;
+  v6.uFrameY = game_viewport_y;
+  v6.uFrameWidth = game_viewport_width;
+  v6.uFrameHeight = game_viewport_height;
+  v6.uFrameZ = game_viewport_z;
+  v6.uFrameW = game_viewport_w;
+  
+  const uint fountain_bits_lut[] = {PARTY_QUEST_FOUNTAIN_HARMONDALE,
+                                    PARTY_QUEST_FOUNTAIN_PIERPONT,
+                                    PARTY_QUEST_FOUNTAIN_NIGHON,
+                                    PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE,
+                                    PARTY_QUEST_FOUNTAIN_CELESTIA,
+                                    PARTY_QUEST_FOUNTAIN_THE_PIT};
+  for (uint i = 0; i < 6; ++i)
+  {
+
+    if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[i]))
+      pRenderer->DrawMaskToZBuffer(pTownPortalBook_xs[i],
+                                   pTownPortalBook_ys[i],
+                                   pTexture_TownPortalIcons[i], i + 1);
+  }
+
+/*  v0 = 0;
+  do
+  {
+    if ( !v0 )
+    {
+      v1 = 206;
+LABEL_14:
+      if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v1) )
+        goto LABEL_16;
+      goto LABEL_15;
+    }
+    if ( v0 == 1 )
+    {
+      v1 = 208;
+      goto LABEL_14;
+    }
+    if ( v0 == 2 )
+    {
+      v1 = 207;
+      goto LABEL_14;
+    }
+    if ( v0 == 3 )
+    {
+      v1 = 211;
+      goto LABEL_14;
+    }
+    if ( v0 == 4 )
+    {
+      v1 = 209;
+      goto LABEL_14;
+    }
+    if ( v0 == 5 )
+    {
+      v1 = 210;
+      goto LABEL_14;
+    }
+LABEL_15:
+    pRenderer->DrawMaskToZBuffer(
+      pTownPortalBook_xs[v0],
+      pTownPortalBook_ys[v0],
+      *(&pTexture_TownPortalHarmn + v0),
+      v0 + 1);
+LABEL_16:
+    ++v0;
+  }
+  while ( v0 < 6 );*/
+
+  pMouse->GetCursorPos(&a2);
+  //v2 = pMouse->GetCursorPos(&a2);
+  v3 = pRenderer->pActiveZBuffer[a2.x + pSRZBufferLineOffsets[a2.y]] & 0xFFFF;
+
+  if (v3)
+  {
+    if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1]))
+      pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
+  }
+  v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);
+
+
+/*  if ( !v3 )                                    // Town Portal
+  {
+    v6.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3);  // "Town Portal"
+    return;
+  }
+  if ( v3 == 1 )
+  {
+    v4 = 206;
+LABEL_30:
+    if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v4) )
+      goto LABEL_31;
+    v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);  // "Town Portal"
+    return;
+  }
+  if ( v3 == 2 )
+  {
+    v4 = 208;
+    goto LABEL_30;
+  }
+  if ( v3 == 3 )
+  {
+    v4 = 207;
+    goto LABEL_30;
+  }
+  if ( v3 == 4 )
+  {
+    v4 = 211;
+    goto LABEL_30;
+  }
+  if ( v3 == 5 )
+  {
+    v4 = 209;
+    goto LABEL_30;
+  }
+  if ( v3 == 6 )
+  {
+    v4 = 210;
+    goto LABEL_30;
+  }
+LABEL_31:
+  pRenderer->DrawTextureIndexed(word_4E1D3A[v3], pTownPortalBook_xs[v3 + 5], *(&pTex_tab_an_6b__zoom_on + v3));
+  v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);*/
+}
+// 4E1D3A: using guessed type __int16 word_4E1D3A[];
+
+
+
+
 //----- (00413CC6) --------------------------------------------------------
 void BookUI_Draw(WindowType book)
 {
@@ -40,7 +185,7 @@
     case WINDOW_JournalBook:   BookUI_Journal_Draw();    break;
 
     case WINDOW_LloydsBeacon:  DrawLloydBeaconsScreen(); break;
-    case WINDOW_TownPortal:    DrawTownPortalScreen();   break;
+    case WINDOW_TownPortal:    BookUI_DrawTownPortalMap();   break;
   }
 }