annotate UI/UITransition.cpp @ 1490:db0dfdb9871e

Fix indentation.
author yoctozepto
date Thu, 29 Aug 2013 22:36:48 +0200
parents 7ef4b64f6329
children c4ab816fcc5e
rev   line source
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1 #ifdef _MSC_VER
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3 #endif
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5 #include <assert.h>
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6 #include <io.h>
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\mm7_data.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\VideoPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
10 #include "..\MapInfo.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
11 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\GUIProgressBar.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
14 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
16 #include "..\Outdoor.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
17 #include "..\LOD.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
18 #include "..\Time.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
19 #include "..\stru159.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
20 #include "..\Events2D.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
21 #include "..\texts.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22 #include "UIHouses.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
28 //----- (00444839) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
29 void TransitionUI_Load(uint anim_id, uint exit_pic_id, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
30 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
31 //unsigned int v9; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32 //int v10; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
33 //signed int v11; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
34 unsigned int v12; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
35 const char *v13; // ST0C_4@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36 unsigned int v14; // eax@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37 const char *v15; // eax@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 unsigned int v16; // eax@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39 //unsigned int result; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
40 const char *v18; // [sp-8h] [bp-40h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41 //const char *v19; // [sp-4h] [bp-3Ch]@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42 char *v20; // [sp-4h] [bp-3Ch]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 const char *v21; // [sp-4h] [bp-3Ch]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 char pContainer[40]; // [sp+Ch] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 unsigned int v23; // [sp+34h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
47 //v9 = a1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 //v10 = a2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49 v23 = IndoorLocation::GetLocationIndex(pLocationName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
50 dword_59117C_teleportx = x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
51 dword_591178_teleporty = y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 dword_591174_teleportz = z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 dword_591170_teleport_directiony = directiony;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
54 dword_59116C_teleport_directionx = directionx;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55 dword_591168_teleport_speedz = a8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56 dword_591164_teleport_map_name = (char *)pLocationName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
57 uCurrentHouse_Animation = anim_id;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 pEventTimer->Pause();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
59 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
61 switch (pParty->alignment)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
63 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
64 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
65 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
66 default: assert(false);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
67 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
69 v12 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
70 v13 = pHouse_ExitPictures[exit_pic_id];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
71 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
72 pTexture_outside = pIcons_LOD->LoadTexturePtr(v13, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
73 if (anim_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
74 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
75 if ( !v23 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
76 //pVideoPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_0, 1u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
77 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].video_name, 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79 else if ( !v23 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 {
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
81 v14 = pMapStats->GetMapInfo(pCurrentMapName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 if ( v14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
83 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
84 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v14].pName); // "Leave %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85 goto LABEL_20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
86 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
87 v21 = pGlobalTXT_LocalizationStrings[79];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
88 goto LABEL_19;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
89 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
90 v15 = pLocationName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
91 if ( *pLocationName == 48 )
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
92 v15 = pCurrentMapName;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 v16 = pMapStats->GetMapInfo(v15);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
94 if ( v16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
95 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
96 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[v16].pName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
97 goto LABEL_20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
99 v21 = pGlobalTXT_LocalizationStrings[73];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
100 LABEL_19:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
101 strcpy(sHouseName.data(), v21);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
102 LABEL_20:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
103 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
105 if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
106 PlayHouseSound(anim_id, HouseSound_Greeting);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
107 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
108 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
109 if ( v23 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
110 uCurrentHouse_Animation = v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
112
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
113
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
116 //----- (00444C8F) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 void TravelUI_Load()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 //signed int v0; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 unsigned int v1; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121 GUIWindow *result; // eax@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
122 //const char *v3; // [sp-4h] [bp-2Ch]@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 char pContainer[32]; // [sp+0h] [bp-28h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
125 pEventTimer->Pause();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127 switch (pParty->alignment)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
131 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 default: assert(false);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
134
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
136 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
137 v1 = pMapStats->GetMapInfo(pCurrentMapName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 if ( v1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
139 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
140 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
141 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, sHouseName.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
143 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
144
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
145
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
147 //----- (00444DCA) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
148 void TravelUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
150 unsigned int v0; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
151 MapInfo *v1; // edi@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 signed int v3; // eax@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
153 int v4; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
154 const char *v5; // [sp-Ch] [bp-90h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 signed int v6; // [sp-8h] [bp-8Ch]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
156 GUIWindow v7; // [sp+Ch] [bp-78h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
158 unsigned int v9; // [sp+80h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 memcpy(&v7, pPrimaryWindow, sizeof(v7));
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
161 v9 = pMapStats->GetMapInfo(pCurrentMapName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 v0 = pMapStats->GetMapInfo(pDestinationMapName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
167 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_x_u));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169 if ( v0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
171 v1 = &pMapStats->pInfos[v0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172 v7.uFrameX = 493;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
173 v7.uFrameWidth = 126;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 v7.uFrameZ = 366;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
175 v7.DrawTitleText(pFontCreate, 0, 4u, 0, v1->pName, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 v7.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 v7.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 v7.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 v3 = GetTravelTime();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
180 if ( v3 == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
181 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
182 v6 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
183 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
184 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
185 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
186 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
187 v6 = v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
188 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
189 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190 sprintfex(pTmpBuf.data(), v5, v6, v1->pName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
193 strcat(pTmpBuf.data(), pTmpBuf2.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
194 v4 = pFontCreate->CalcTextHeight(pTmpBuf.data(), &v7, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
195 v7.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
196 _unused_5B5924_is_travel_ui_drawn = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
197 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
198 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
199
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
200
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
201
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
202 //----- (00444A51) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
203 void TransitionUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
204 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
205 MapInfo *pMapInfo; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
206 char *v1; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
207 std::string v3; // [sp-18h] [bp-84h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
208 unsigned int v4; // [sp-10h] [bp-7Ch]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
209 int v5; // [sp-Ch] [bp-78h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
210 const char *v6; // [sp-8h] [bp-74h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
211 signed int v7; // [sp-4h] [bp-70h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
212 GUIWindow v8; // [sp+Ch] [bp-60h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
213 unsigned int v9; // [sp+60h] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
214 unsigned int v10; // [sp+64h] [bp-8h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
215 int a3; // [sp+6Bh] [bp-1h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
216
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
217 memcpy(&v8, pPrimaryWindow, sizeof(v8));
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
218 v10 = pMapStats->GetMapInfo(pCurrentMapName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
219 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
220 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
221 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
222 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
223 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
224 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
225 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
226 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
227 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != ' ' )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
228 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
229 pMapInfo = &pMapStats->pInfos[v10];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
230 v8.uFrameX = 493;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
231 v8.uFrameWidth = 126;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
232 v8.uFrameZ = 366;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
233 v8.DrawTitleText(pFontCreate, 0, 5u, 0, pMapInfo->pName, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
234 v8.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
235 v8.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
236 v8.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
237
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
238 v1 = "";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
239 if ( uCurrentHouse_Animation )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
240 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
241 v1 = pTransitionStrings[uCurrentHouse_Animation];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
242 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
243 v8.DrawTitleText(pFontCreate, 0, v4, 0, v1, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
244 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
245 else if ( v10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
246 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
247 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapInfo->pName);// "Do you wish to leave %s?"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
248 v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &v8, 0, 0)) / 2 + 101;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
249 v8.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
250 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
251 else assert(false);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
252
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
253 _unused_5B5924_is_travel_ui_drawn = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
254 }