annotate UITransition.cpp @ 1034:aa848c90181f

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