annotate UI/UITransition.cpp @ 2356:08c4f1799ca1

Elements of VideoPlayer structure moved
author Ritor1
date Thu, 10 Apr 2014 17:34:50 +0600
parents d6887ee81068
children 2fe8feb3dcd1
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2215
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2 #include <io.h>
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2253
diff changeset
4 #include "..\ErrorHandling.h"
d6887ee81068 header file include cleanup
Grumpy7
parents: 2253
diff changeset
5 #include "..\mm7_unsorted_subs.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
6 #include "..\mm7_data.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
7 #include "..\VideoPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\MapInfo.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
10 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
11 #include "..\GUIProgressBar.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
14 #include "..\Outdoor.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\LOD.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 1757
diff changeset
16 #include "..\Timer.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
17 #include "..\stru159.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
18 #include "..\Events2D.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
19 #include "..\texts.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
20 #include "UIHouses.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22
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 //----- (00444839) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
26 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
27 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
28 const char *v15; // eax@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
29 char pContainer[40]; // [sp+Ch] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
31 dword_59117C_teleportx = x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32 dword_591178_teleporty = y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
33 dword_591174_teleportz = z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
34 dword_591170_teleport_directiony = directiony;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
35 dword_59116C_teleport_directionx = directionx;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36 dword_591168_teleport_speedz = a8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37 dword_591164_teleport_map_name = (char *)pLocationName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 uCurrentHouse_Animation = anim_id;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39 pEventTimer->Pause();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
40 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42 switch (pParty->alignment)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
47 default: Error("Invalid alignment: %u", pParty->alignment);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
50 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
51 pTexture_outside = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[exit_pic_id], TEXTURE_16BIT_PALETTE);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 if (anim_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
54 if ( !IndoorLocation::GetLocationIndex(pLocationName) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].video_name, 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56 }
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
57 else if ( !IndoorLocation::GetLocationIndex(pLocationName) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
59 if ( pMapStats->GetMapInfo(pCurrentMapName) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
60 {
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
61 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName); // "Leave %s"
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
62 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
63 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
64 //PlayHouseSound(anim_id, HouseSound_Greeting);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
65 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
66 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
67 if ( IndoorLocation::GetLocationIndex(pLocationName) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
68 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
69 return;
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
70 }
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
71 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
72 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
73 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
74 //PlayHouseSound(anim_id, HouseSound_Greeting);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
75 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
76 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
77 if ( IndoorLocation::GetLocationIndex(pLocationName) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
78 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
79 return;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 v15 = pLocationName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 if ( *pLocationName == 48 )
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1299
diff changeset
83 v15 = pCurrentMapName;
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
84 if ( pMapStats->GetMapInfo(v15) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
86 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[pMapStats->GetMapInfo(v15)].pName);//Войти в ^Pv[%s]
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
87 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
88 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
89 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
90 if ( IndoorLocation::GetLocationIndex(pLocationName) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
91 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
92 return;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 }
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
94 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[73]);//Войти
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
95 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Transition, 0, sHouseName.data());
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
96 //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
97 //PlayHouseSound(anim_id, HouseSound_Greeting);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
99 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
100 if ( IndoorLocation::GetLocationIndex(pLocationName) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1751
diff changeset
101 uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
102 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
103
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 //----- (00444C8F) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
105 void TravelUI_Load()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
106 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
107 char pContainer[32]; // [sp+0h] [bp-28h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
108
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
109 pEventTimer->Pause();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
110
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 switch (pParty->alignment)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
112 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
113 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
116 default: Error("Invalid alignment: %u", pParty->alignment);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE);
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
121 if ( pMapStats->GetMapInfo(pCurrentMapName) )
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
122 sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);// "Leave %s"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124 strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit"
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
125 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_ChangeLocation, 0, sHouseName.data());
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 //----- (00444DCA) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 void TravelUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 {
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
131 GUIWindow travel_window; // [sp+Ch] [bp-78h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
134 memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
136 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
137 pRenderer->DrawTextureTransparent(468, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
139 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
140 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
141 if ( pMapStats->GetMapInfo(pDestinationMapName) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 {
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
143 travel_window.uFrameX = 493;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
144 travel_window.uFrameWidth = 126;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
145 travel_window.uFrameZ = 366;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
146 travel_window.DrawTitleText(pFontCreate, 0, 4, 0, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName, 3);
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
147 travel_window.uFrameX = 483;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
148 travel_window.uFrameWidth = 148;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
149 travel_window.uFrameZ = 334;
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
150 if ( GetTravelTime() == 1 )
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
151 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[663], 1, pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d day to cross to %s."
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 else
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
153 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[128], GetTravelTime(), pMapStats->pInfos[pMapStats->GetMapInfo(pDestinationMapName)].pName);// "It will take %d days to travel to %s."
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
154
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 strcat(pTmpBuf.data(), "\n \n");
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
156 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 strcat(pTmpBuf.data(), pTmpBuf2.data());
1757
11f5c0ac170a UITransition.cpp cleared
Ritor1
parents: 1756
diff changeset
158 travel_window.DrawTitleText(pFontCreate, 0, (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0)) / 2 + 101, 0, pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159 _unused_5B5924_is_travel_ui_drawn = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
161 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 //----- (00444A51) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164 void TransitionUI_Draw()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 unsigned int v4; // [sp-10h] [bp-7Ch]@12
1755
Ritor1
parents: 1744
diff changeset
167 GUIWindow transition_window; // [sp+Ch] [bp-60h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 unsigned int v9; // [sp+60h] [bp-Ch]@1
1755
Ritor1
parents: 1744
diff changeset
169 unsigned int map_id; // [sp+64h] [bp-8h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170
1755
Ritor1
parents: 1744
diff changeset
171 memcpy(&transition_window, pPrimaryWindow, sizeof(transition_window));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
173 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 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
175 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
1755
Ritor1
parents: 1744
diff changeset
180 map_id = pMapStats->GetMapInfo(pCurrentMapName);
2356
08c4f1799ca1 Elements of VideoPlayer structure moved
Ritor1
parents: 2336
diff changeset
181 if ( (pMovie || v9) && *dword_591164_teleport_map_name != ' ' )
1755
Ritor1
parents: 1744
diff changeset
182 map_id = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
Ritor1
parents: 1744
diff changeset
183 transition_window.uFrameX = 493;
Ritor1
parents: 1744
diff changeset
184 transition_window.uFrameWidth = 126;
Ritor1
parents: 1744
diff changeset
185 transition_window.uFrameZ = 366;
Ritor1
parents: 1744
diff changeset
186 transition_window.DrawTitleText(pFontCreate, 0, 5, 0, pMapStats->pInfos[map_id].pName, 3);
Ritor1
parents: 1744
diff changeset
187 transition_window.uFrameX = 483;
Ritor1
parents: 1744
diff changeset
188 transition_window.uFrameWidth = 148;
Ritor1
parents: 1744
diff changeset
189 transition_window.uFrameZ = 334;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 if ( uCurrentHouse_Animation )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 {
1755
Ritor1
parents: 1744
diff changeset
193 v4 = (212 - pFontCreate->CalcTextHeight(pTransitionStrings[uCurrentHouse_Animation], &transition_window, 0, 0)) / 2 + 101;
Ritor1
parents: 1744
diff changeset
194 transition_window.DrawTitleText(pFontCreate, 0, v4, 0, pTransitionStrings[uCurrentHouse_Animation], 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
195 }
1755
Ritor1
parents: 1744
diff changeset
196 else if ( map_id )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
197 {
1755
Ritor1
parents: 1744
diff changeset
198 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[409], pMapStats->pInfos[map_id].pName);// "Do you wish to leave %s?"
Ritor1
parents: 1744
diff changeset
199 v4 = (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &transition_window, 0, 0)) / 2 + 101;
Ritor1
parents: 1744
diff changeset
200 transition_window.DrawTitleText(pFontCreate, 0, v4, 0, pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
201 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1477
diff changeset
202 else Error("Troubles in da house");
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
203
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
204 _unused_5B5924_is_travel_ui_drawn = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
205 }