comparison UI/Books/UIMapBook.cpp @ 1445:6de9c1316852

Слияние
author Ritor1
date Sat, 03 Aug 2013 00:00:31 +0600
parents 7b1a94270756 4d13549db029
children 8b4f4c723edd
comparison
equal deleted inserted replaced
1444:7b1a94270756 1445:6de9c1316852
84 84
85 //----- (00410DEC) -------------------------------------------------------- 85 //----- (00410DEC) --------------------------------------------------------
86 unsigned int __cdecl DrawLloydBeaconsScreen() 86 unsigned int __cdecl DrawLloydBeaconsScreen()
87 { 87 {
88 Player *pPlayer; // esi@1 88 Player *pPlayer; // esi@1
89 char *v1; // eax@1 89 char *pText; // eax@1
90 unsigned __int16 v2; // ax@6 90 //unsigned __int16 v2; // ax@6
91 unsigned int result; // eax@11 91 //unsigned int result; // eax@11
92 unsigned int v4; // esi@13 92 //unsigned int v4; // esi@13
93 unsigned int v5; // ecx@13 93 //unsigned int v5; // ecx@13
94 char v6; // zf@13 94 //char v6; // zf@13
95 LloydBeacon *v7; // esi@14 95 //LloydBeacon *v7; // esi@14
96 int v8; // eax@14 96 int pTextHeight; // eax@14
97 unsigned __int64 v9; // kr08_8@14 97 int RemainingTime; // kr08_8@14
98 unsigned int v10; // esi@14 98 unsigned int pHours; // esi@14
99 unsigned int v11; // eax@14 99 unsigned int pDays; // eax@14
100 char *v12; // eax@19 100 char *pSelectionText; // eax@19
101 char *v13; // ecx@22 101 //char *v13; // ecx@22
102 int v14; // eax@27 102 //int v14; // eax@27
103 Texture *v19; // [sp-4h] [bp-8Ch]@4 103 Texture *v19; // [sp-4h] [bp-8Ch]@4
104 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1 104 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1
105 unsigned int v23; // [sp+64h] [bp-24h]@14 105 //unsigned int v23; // [sp+64h] [bp-24h]@14
106 __int64 v24; // [sp+68h] [bp-20h]@14 106 //__int64 v24; // [sp+68h] [bp-20h]@14
107 unsigned int v25; // [sp+70h] [bp-18h]@13 107 //unsigned int v25; // [sp+70h] [bp-18h]@13
108 char *Str; // [sp+74h] [bp-14h]@14 108 char *Str; // [sp+74h] [bp-14h]@14
109 int v27; // [sp+78h] [bp-10h]@11 109 int BeaconID; // [sp+78h] [bp-10h]@11
110 LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12 110 //LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12
111 RGBTexture *v29; // [sp+80h] [bp-8h]@12 111 //RGBTexture *v29; // [sp+80h] [bp-8h]@12
112 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6 112 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6
113 113
114 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid]; 114 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid];
115 pRenderer->DrawTextureIndexed(8u, 8u, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); 115 pRenderer->DrawTextureIndexed(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
116 v1 = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon 116 pText = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon
117 pWindow.uFrameX = game_viewport_x; 117 pWindow.uFrameX = game_viewport_x;
118 pWindow.uFrameY = game_viewport_y; 118 pWindow.uFrameY = game_viewport_y;
119 pWindow.uFrameWidth = 428; 119 pWindow.uFrameWidth = 428;
120 pWindow.uFrameHeight = game_viewport_height; 120 pWindow.uFrameHeight = game_viewport_height;
121 pWindow.uFrameZ = 435; 121 pWindow.uFrameZ = 435;
122 pWindow.uFrameW = game_viewport_w; 122 pWindow.uFrameW = game_viewport_w;
123 if ( !bRecallingBeacon ) 123 if ( !bRecallingBeacon )
124 v1 = pGlobalTXT_LocalizationStrings[375]; // Set Beacon 124 pText = pGlobalTXT_LocalizationStrings[375]; // Set Beacon
125 sprintf(pTmpBuf.data(), "%s", v1); 125 sprintf(pTmpBuf.data(), "%s", pText);
126 pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3u); 126 pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3);
127 if ( bRecallingBeacon ) 127 if ( bRecallingBeacon )
128 { 128 {
129 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on); 129 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on);
130 v19 = pTex_tab_an_6a__zoom_off; 130 v19 = pTex_tab_an_6a__zoom_off;
131 } 131 }
133 { 133 {
134 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6a__zoom_off); 134 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6a__zoom_off);
135 v19 = pTex_tab_an_6b__zoom_on; 135 v19 = pTex_tab_an_6b__zoom_on;
136 } 136 }
137 pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19); 137 pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19);
138 v2 = pPlayer->pActiveSkills[14];
139 uNumMaxBeacons = 1; 138 uNumMaxBeacons = 1;
140 if ( HIBYTE(v2) & 1 || (v2 & 0x80u) != 0 ) 139 if ( HIBYTE(pPlayer->pActiveSkills[14]) & 1 || (pPlayer->pActiveSkills[14] & 0x80u) != 0 )
141 { 140 {
142 uNumMaxBeacons = 5; 141 uNumMaxBeacons = 5;
143 } 142 }
144 else 143 else
145 { 144 {
146 if ( v2 & 0x40 ) 145 if ( pPlayer->pActiveSkills[14] & 0x40 )
147 uNumMaxBeacons = 3; 146 uNumMaxBeacons = 3;
148 } 147 }
149 result = 0;
150 v27 = 0;
151 if ( uNumMaxBeacons > 0 ) 148 if ( uNumMaxBeacons > 0 )
152 { 149 {
153 v29 = pSavegameThumbnails.data(); 150 for ( BeaconID = 0; BeaconID < uNumMaxBeacons; BeaconID++ )
154 v28 = pPlayer->pInstalledBeacons;
155 while ( 1 )
156 { 151 {
157 pWindow.uFrameWidth = 92; 152 pWindow.uFrameWidth = 92;
158 v4 = result;
159 pWindow.uFrameHeight = 68; 153 pWindow.uFrameHeight = 68;
160 v5 = pLloydsBeaconsPreviewXs[result]; 154 pWindow.uFrameY = pLloydsBeaconsPreviewYs[BeaconID];
161 pWindow.uFrameY = pLloydsBeaconsPreviewYs[result]; 155 pWindow.uFrameX = pLloydsBeaconsPreviewXs[BeaconID];
162 v25 = pWindow.uFrameY;
163 pWindow.uFrameX = v5;
164 pWindow.uFrameW = pWindow.uFrameY + 67; 156 pWindow.uFrameW = pWindow.uFrameY + 67;
165 v6 = v29->pPixels == 0; 157 pWindow.uFrameZ = pLloydsBeaconsPreviewXs[BeaconID] + 91;
166 pWindow.uFrameZ = v5 + 91; 158 //if ( pSavegameThumbnails[BeaconID].pPixels != 0 )
167 if ( !v6 ) 159 if ( pPlayer->pInstalledBeacons[BeaconID].SaveFileID != 0 )
168 break; 160 {
161 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook);
162 pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[BeaconID], pLloydsBeaconsPreviewYs[BeaconID], &pSavegameThumbnails[BeaconID]);
163 Str = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[BeaconID].SaveFileID)].pName;
164 pTextHeight = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0);
165 pWindow.uFrameY += -6 - pTextHeight;
166 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, Str, 3);
167 RemainingTime = pPlayer->pInstalledBeacons[BeaconID].uBeaconTime - pParty->uTimePlayed;
168 pHours = (signed __int64)((double)RemainingTime * 0.234375) / 60 / 60;
169 pDays = pHours / 24;
170 if ( pDays )
171 {
172 sprintf(pTmpBuf.data(), "%lu %s", pDays + 1, pGlobalTXT_LocalizationStrings[57]);//days
173 pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4;
174 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
175 continue;
176 }
177 else
178 {
179 if ( pHours + 1 <= 23 )
180 {
181 if ( pHours < 1 )
182 pSelectionText = pGlobalTXT_LocalizationStrings[109];// Hour
183 else
184 pSelectionText = pGlobalTXT_LocalizationStrings[110];// Hours
185 sprintf(pTmpBuf.data(), "%lu %s", pHours + 1, pSelectionText);
186 pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4;
187 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
188 continue;
189 }
190 }
191 sprintf(pTmpBuf.data(), "%lu %s", pDays + 1, pGlobalTXT_LocalizationStrings[56]);//Day
192 pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4;
193 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
194 continue;
195 }
169 if ( !bRecallingBeacon ) 196 if ( !bRecallingBeacon )
170 { 197 {
171 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook); 198 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook);
172 v14 = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0); 199 pTextHeight = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0);
173 pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - v14 / 2, 1, pGlobalTXT_LocalizationStrings[19], 3); 200 pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - pTextHeight / 2, 1, pGlobalTXT_LocalizationStrings[19], 3);//
174 } 201 }
175 LABEL_29: 202 }
176 ++v29; 203 }
177 ++v28;
178 result = v27++ + 1;
179 if ( v27 >= uNumMaxBeacons )
180 goto LABEL_30;
181 }
182 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook);
183 pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[v4], pLloydsBeaconsPreviewYs[v4], v29);
184 v7 = v28;
185 Str = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v28->field_18))].pName;
186 v8 = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0);
187 pWindow.uFrameY += -6 - v8;
188 pWindow.DrawTitleText(pSpellFont, 0, 0, 1u, Str, 3u);
189 v9 = v7->uBeaconTime - pParty->uTimePlayed;
190 LODWORD(v24) = LODWORD(v7->uBeaconTime) - LODWORD(pParty->uTimePlayed);
191 HIDWORD(v24) = HIDWORD(v9);
192 v23 = (unsigned __int64)((signed __int64)((double)v24 * 0.234375) / 60 / 60) >> 32;
193 v10 = (signed __int64)((double)v24 * 0.234375) / 60 / 60;
194 v11 = v10 / 0x18;
195 if ( (unsigned int)((signed __int64)((double)v24 * 0.234375) / 60 / 60) / 0x18 )
196 {
197 v13 = pGlobalTXT_LocalizationStrings[57]; // Days
198 if ( v11 > 1 )
199 {
200 sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
201 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
202 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
203 goto LABEL_29;
204 }
205 }
206 else
207 {
208 if ( (signed __int64)(__PAIR__(v23, v10) + 1) <= 23 )
209 {
210 if ( (v23 & 0x80000000u) != 0 || (signed int)v23 <= 0 && v10 <= 1 )
211 v12 = pGlobalTXT_LocalizationStrings[109];// Hour
212 else
213 v12 = pGlobalTXT_LocalizationStrings[110];// Hours
214 sprintf(pTmpBuf.data(), "%lu %s", v10 + 1, v12);
215 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
216 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
217 goto LABEL_29;
218 }
219 }
220 v13 = pGlobalTXT_LocalizationStrings[56]; // Day
221 sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
222 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
223 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
224 goto LABEL_29;
225 }
226 LABEL_30:
227 if ( byte_506360 ) 204 if ( byte_506360 )
228 {
229 /*result = pMessageQueue_50CBD0->uNumMessages;
230 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
231 {
232 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseAfterInstallBeacon;
233 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
234 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
235 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
236 ++pMessageQueue_50CBD0->uNumMessages;
237 }*/
238 pMessageQueue_50CBD0->AddMessage(UIMSG_CloseAfterInstallBeacon, 0, 0); 205 pMessageQueue_50CBD0->AddMessage(UIMSG_CloseAfterInstallBeacon, 0, 0);
239 } 206 return BeaconID;
240 return result;
241 } 207 }
242
243 208
244 //----- (00413980) -------------------------------------------------------- 209 //----- (00413980) --------------------------------------------------------
245 void BookUI_Map_Draw() 210 void BookUI_Map_Draw()
246 { 211 {
247 int v6; // eax@31 212 unsigned int map_id; // eax@35
248 unsigned int map_id; // eax@35 213 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3
249 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3 214 char party_coord[120]; // [sp+Ch] [bp-CCh]@37
250 char party_coord[120]; // [sp+Ch] [bp-CCh]@37 215 GUIWindow map_window; // [sp+84h] [bp-54h]@35
251 GUIWindow map_window; // [sp+84h] [bp-54h]@35 216 unsigned int textrX, textrY;
252 unsigned int textrX, textrY; 217
253 218 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
254 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12); 219 if ( BtnUp_flag || viewparams->field_2C / 128 >= 12 )
255 if ( BtnUp_flag || viewparams->field_2C / 128 >= 12 ) 220 {
256 { 221 buttnTxtr = pTex_tab_an_6a__zoom_off;
257 buttnTxtr = pTex_tab_an_6a__zoom_off; 222 textrY = pViewport->uViewportTL_Y + 2;
258 textrY = pViewport->uViewportTL_Y + 2; 223 textrX = pViewport->uViewportTL_X + 408;
259 textrX = pViewport->uViewportTL_X + 408; 224 }
260 } 225 else
261 else 226 {
262 { 227 buttnTxtr = pTex_tab_an_6b__zoom_on;
263 buttnTxtr = pTex_tab_an_6b__zoom_on; 228 textrY = pViewport->uViewportTL_Y + 1;
264 textrY = pViewport->uViewportTL_Y + 1; 229 textrX = pViewport->uViewportTL_X + 398;
265 textrX = pViewport->uViewportTL_X + 398; 230 }
266 } 231 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
267 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 232 if ( BtnDown_flag || viewparams->field_2C / 128 <= 3 )
268 if ( BtnDown_flag || viewparams->field_2C / 128 <= 3 ) 233 {
269 { 234 buttnTxtr = pTex_tab_an_7a__zoot_off;
270 buttnTxtr = pTex_tab_an_7a__zoot_off; 235 textrY = pViewport->uViewportTL_Y + 38;
271 textrY = pViewport->uViewportTL_Y + 38; 236 textrX = pViewport->uViewportTL_X + 408;
272 textrX = pViewport->uViewportTL_X + 408; 237 }
273 } 238 else
274 else 239 {
275 { 240 buttnTxtr = pTex_tab_an_7b__zoot_on;
276 buttnTxtr = pTex_tab_an_7b__zoot_on; 241 textrY = pViewport->uViewportTL_Y + 38;
277 textrY = pViewport->uViewportTL_Y + 38; 242 textrX = pViewport->uViewportTL_X + 398;
278 textrX = pViewport->uViewportTL_X + 398; 243 }
279 } 244 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
280 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 245 if ( Book_PageBtn3_flag )
281 if ( Book_PageBtn3_flag ) 246 {
282 { 247 buttnTxtr = pTexture_506390;
283 buttnTxtr = pTexture_506390; 248 textrY = pViewport->uViewportTL_Y + 113;
284 textrY = pViewport->uViewportTL_Y + 113; 249 textrX = pViewport->uViewportTL_X + 408;
285 textrX = pViewport->uViewportTL_X + 408; 250 }
286 } 251 else
287 else 252 {
288 { 253 buttnTxtr = pTexture_506394;
289 buttnTxtr = pTexture_506394; 254 textrY = pViewport->uViewportTL_Y + 113;
290 textrY = pViewport->uViewportTL_Y + 113; 255 textrX = pViewport->uViewportTL_X + 398;
291 textrX = pViewport->uViewportTL_X + 398; 256 }
292 } 257 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
293 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 258 if ( Book_PageBtn4_flag )
294 if ( Book_PageBtn4_flag ) 259 {
295 { 260 buttnTxtr = pTexture_506388;
296 buttnTxtr = pTexture_506388; 261 textrY = pViewport->uViewportTL_X + 150;
297 textrY = pViewport->uViewportTL_X + 150; 262 textrX = pViewport->uViewportTL_Y + 408;
298 textrX = pViewport->uViewportTL_Y + 408; 263 }
299 } 264 else
300 else 265 {
301 { 266 buttnTxtr = pTexture_50638C;
302 buttnTxtr = pTexture_50638C; 267 textrY = pViewport->uViewportTL_X + 150;
303 textrY = pViewport->uViewportTL_X + 150; 268 textrX = pViewport->uViewportTL_Y + 399;
304 textrX = pViewport->uViewportTL_Y + 399; 269 }
305 } 270 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
306 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 271 if ( Book_PageBtn5_flag )
307 if ( Book_PageBtn5_flag ) 272 {
308 { 273 buttnTxtr = pTexture_506380;
309 buttnTxtr = pTexture_506380; 274 textrY = pViewport->uViewportTL_Y + 188;
310 textrY = pViewport->uViewportTL_Y + 188; 275 textrX = pViewport->uViewportTL_X + 408;
311 textrX = pViewport->uViewportTL_X + 408; 276 }
312 } 277 else
313 else 278 {
314 { 279 buttnTxtr = pTexture_506384;
315 buttnTxtr = pTexture_506384; 280 textrY = pViewport->uViewportTL_Y + 188;
316 textrY = pViewport->uViewportTL_Y + 188; 281 textrX = pViewport->uViewportTL_X + 397;
317 textrX = pViewport->uViewportTL_X + 397; 282 }
318 } 283 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
319 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 284 if ( Book_PageBtn6_flag )
320 if ( Book_PageBtn6_flag ) 285 {
321 { 286 buttnTxtr = pTexture_506378;
322 buttnTxtr = pTexture_506378; 287 textrY = pViewport->uViewportTL_Y + 226;
323 textrY = pViewport->uViewportTL_Y + 226; 288 textrX = pViewport->uViewportTL_X + 408;
324 textrX = pViewport->uViewportTL_X + 408; 289 }
325 } 290 else
326 else 291 {
327 { 292 buttnTxtr = pTexture_50637C;
328 buttnTxtr = pTexture_50637C; 293 textrY = pViewport->uViewportTL_Y + 226;
329 textrY = pViewport->uViewportTL_Y + 226; 294 textrX = pViewport->uViewportTL_X + 397;
330 textrX = pViewport->uViewportTL_X + 397; 295 }
331 } 296 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
332 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); 297 if ( BtnDown_flag )
333 if ( BtnDown_flag ) 298 viewparams->CenterOnParty2();
334 viewparams->CenterOnParty2(); 299 if ( BtnUp_flag )
335 if ( BtnUp_flag ) 300 viewparams->CenterOnParty();
336 viewparams->CenterOnParty(); 301 if ( Book_PageBtn3_flag )
337 if ( Book_PageBtn3_flag ) 302 viewparams->_443219();
338 viewparams->_443219(); 303 if ( Book_PageBtn4_flag )
339 if ( Book_PageBtn4_flag ) 304 viewparams->_443231();
340 viewparams->_443231(); 305 if ( Book_PageBtn5_flag )
341 if ( Book_PageBtn5_flag ) 306 viewparams->_44323D();
342 viewparams->_44323D(); 307 if ( Book_PageBtn6_flag )
343 if ( Book_PageBtn6_flag ) 308 viewparams->_443225();
344 viewparams->_443225(); 309
345 310 if ( BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag )
346 if ( BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag ) 311 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
347 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); 312 BtnUp_flag = 0;
348 BtnUp_flag = 0; 313 BtnDown_flag = 0;
349 BtnDown_flag = 0; 314 Book_PageBtn6_flag = 0;
350 Book_PageBtn6_flag = 0; 315 Book_PageBtn5_flag = 0;
351 Book_PageBtn5_flag = 0; 316 Book_PageBtn4_flag = 0;
352 Book_PageBtn4_flag = 0; 317 Book_PageBtn3_flag = 0;
353 Book_PageBtn3_flag = 0; 318 DrawBook_Map_sub(97, 49, 361, 313, 0);
354 DrawBook_Map_sub(97, 49, 361, 313, 0); 319 pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
355 pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr); 320 map_window.uFrameWidth = game_viewport_width;
356 map_window.uFrameWidth = game_viewport_width; 321 map_window.uFrameHeight = game_viewport_height;
357 map_window.uFrameHeight = game_viewport_height; 322 map_window.uFrameX = game_viewport_x;
358 map_window.uFrameX = game_viewport_x; 323 map_window.uFrameY = game_viewport_y;
359 map_window.uFrameY = game_viewport_y; 324 map_window.uFrameZ = game_viewport_z;
360 map_window.uFrameZ = game_viewport_z; 325 map_window.uFrameW = game_viewport_w;
361 map_window.uFrameW = game_viewport_w; 326 map_id = pMapStats->GetMapInfo(pCurrentMapName.data());
362 map_id = pMapStats->GetMapInfo(pCurrentMapName.data()); 327 if ( map_id )
363 if ( map_id ) 328 map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3);
364 map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3); 329
365 330 map_window.uFrameX = 0;
366 map_window.uFrameX = 0; 331 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d"
367 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d" 332 map_window.DrawTitleText(pFontComic, 0, 320, ui_book_map_coordinates_color, party_coord, 0);
368 map_window.DrawTitleText(pFontComic, 0, 320, ui_book_map_coordinates_color, party_coord, 0); 333 }
369 }
370 334
371 //----- (00442955) -------------------------------------------------------- 335 //----- (00442955) --------------------------------------------------------
372 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) 336 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 )
373 { 337 {
374 int v5; // ebx@1 338 //unsigned int v11; // edx@11
375 int v6; // edi@1 339 //__int16 v12; // cx@12
376 BLVMapOutlines *v7; // eax@8 340 //signed int v13; // eax@15
377 unsigned __int8 v8; // zf@8 341 //int v14; // eax@16
378 unsigned __int8 v9; // sf@8 342 int v20; // eax@16
379 int v10; // esi@10 343 signed int v21; // esi@18
380 unsigned int v11; // edx@11 344 int v22; // ecx@21
381 __int16 v12; // cx@12 345 BLVMapOutline *v23; // ecx@21
382 signed int v13; // eax@15 346 Vec3_short_ *v24; // edx@21
383 int v14; // eax@16 347 Vec3_short_ *v25; // eax@21
384 Vec3_short_ *v15; // ecx@16 348 int v26; // ecx@21
385 int v16; // edx@16 349 unsigned __int16 *v27; // edi@21
386 int v17; // ecx@16 350 int v28; // edx@21
387 Vec3_short_ *v18; // eax@16 351 int v29; // eax@21
388 int v19; // ecx@16 352 double v30; // st7@23
389 int v20; // eax@16 353 signed __int64 v31; // qax@23
390 signed int v21; // esi@18 354 unsigned short *v32; // edx@23
391 int v22; // ecx@21 355 int textr_width; // esi@23
392 BLVMapOutline *v23; // ecx@21 356 signed int v34; // eax@23
393 Vec3_short_ *v24; // edx@21 357 signed int v35; // ecx@23
394 Vec3_short_ *v25; // eax@21 358 int v36; // esi@27
395 int v26; // ecx@21 359 int v37; // ecx@27
396 unsigned __int16 *v27; // edi@21 360 int v38; // edx@31
397 int v28; // edx@21 361 unsigned int v39; // eax@33
398 int v29; // eax@21 362 short *v40; // esi@33
399 double v30; // st7@23 363 short *v41; // edi@33
400 signed __int64 v31; // qax@23 364 unsigned __int8 v42; // cf@33
401 unsigned short *v32; // edx@23 365 unsigned int v43; // ecx@33
402 int textr_width; // esi@23 366 short *v44; // edi@33
403 signed int v34; // eax@23 367 short *v45; // esi@33
404 signed int v35; // ecx@23 368 int v46; // ecx@33
405 int v36; // esi@27 369 signed int v47; // esi@38
406 int v37; // ecx@27 370 signed int v48; // ecx@38
407 int v38; // edx@31 371 int v49; // eax@38
408 unsigned int v39; // eax@33 372 signed int v50; // edx@55
409 short *v40; // esi@33 373 unsigned int v51; // ecx@55
410 short *v41; // edi@33 374 int result; // eax@72
411 unsigned __int8 v42; // cf@33 375 int v53; // eax@75
412 unsigned int v43; // ecx@33 376 int v54; // esi@75
413 short *v44; // edi@33 377 int v55; // eax@75
414 short *v45; // esi@33 378 __int16 v56; // si@85
415 int v46; // ecx@33 379 double v57; // st7@85
416 signed int v47; // esi@38 380 int v58; // ebx@85
417 signed int v48; // ecx@38 381 signed __int64 v59; // qax@85
418 int v49; // eax@38 382 signed int v60; // edi@85
419 signed int v50; // edx@55 383 signed __int64 v61; // qax@85
420 unsigned int v51; // ecx@55 384 signed int v62; // ebx@85
421 int result; // eax@72 385 signed int v63; // esi@85
422 int v53; // eax@75 386 int v64; // eax@87
423 int v54; // esi@75 387 unsigned int v65; // ebx@95
424 int v55; // eax@75 388 unsigned short *v66; // edx@95
425 __int16 v56; // si@85 389 unsigned __int16 *v67; // esi@96
426 double v57; // st7@85 390 int v68; // edi@98
427 int v58; // ebx@85 391 unsigned __int16 v69; // cx@99
428 signed __int64 v59; // qax@85 392 unsigned int v70; // [sp-10h] [bp-48074h]@80
429 signed int v60; // edi@85 393 unsigned int v71; // [sp-Ch] [bp-48070h]@80
430 signed __int64 v61; // qax@85 394 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
431 signed int v62; // ebx@85 395 signed int v73; // [sp-4h] [bp-48068h]@59
432 signed int v63; // esi@85 396 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
433 int v64; // eax@87 397 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23
434 unsigned int v65; // ebx@95 398 int v76; // [sp+4800Ch] [bp-58h]@23
435 unsigned short *v66; // edx@95 399 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
436 unsigned __int16 *v67; // esi@96 400 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23
437 int v68; // edi@98 401 int v81; // [sp+48020h] [bp-44h]@23
438 unsigned __int16 v69; // cx@99 402 unsigned __int16* render16_data;
439 unsigned int v70; // [sp-10h] [bp-48074h]@80 403 unsigned char* texture8_data;
440 unsigned int v71; // [sp-Ch] [bp-48070h]@80 404 unsigned char* curr_line;
441 unsigned int v72; // [sp-8h] [bp-4806Ch]@80 405 int scale_increment;
442 signed int v73; // [sp-4h] [bp-48068h]@59 406 int scaled_posX;
443 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 407 int scaled_posY;
444 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 408 int stepX_r;
445 int v76; // [sp+4800Ch] [bp-58h]@23 409 int stepY_r;
446 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 410 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
447 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 411 int pCenterY; // [sp+4802Ch] [bp-38h]@1
448 unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1 412 int screenCenter_X; // [sp+48030h] [bp-34h]@1
449 413 int pCenterX; // [sp+48034h] [bp-30h]@1
450 int v81; // [sp+48020h] [bp-44h]@23 414 int v87; // [sp+48038h] [bp-2Ch]@16
451 unsigned __int16* render16_data; 415 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
452 unsigned char* texture8_data; 416 int black; // [sp+48040h] [bp-24h]@8
453 unsigned char* curr_line; 417 int screenCenterY; // [sp+48044h] [bp-20h]@1
454 int scale_increment; 418 unsigned int i; // [sp+48048h] [bp-1Ch]@9
455 int scaled_posX; 419 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16
456 int scaled_posY; 420 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
457 int stepX_r; 421 signed int screenWidth; // [sp+48054h] [bp-10h]@8
458 int stepY_r; 422 unsigned int v95; // [sp+48058h] [bp-Ch]@16
459 423 int v96; // [sp+4805Ch] [bp-8h]@10
460 424 const void *v97; // [sp+48060h] [bp-4h]@16
461 unsigned int teal; // [sp+48028h] [bp-3Ch]@8 425 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85
462 int v84; // [sp+4802Ch] [bp-38h]@1 426 int a5a; // [sp+48070h] [bp+Ch]@86
463 int screenCenter_X; // [sp+48030h] [bp-34h]@1 427
464 int v86; // [sp+48034h] [bp-30h]@1 428 screenCenter_X = (signed int)(tl_x + br_x) / 2;
465 int v87; // [sp+48038h] [bp-2Ch]@16 429 screenCenterY = (signed int)(tl_y + br_y) / 2;
466 unsigned int v88; // [sp+4803Ch] [bp-28h]@16 430 pRenderer->SetRasterClipRect(tl_x, tl_y, br_x, br_y);
467 int black; // [sp+48040h] [bp-24h]@8 431 pCenterX = viewparams->sViewCenterX;
468 int screenCenterY; // [sp+48044h] [bp-20h]@1 432 pCenterY = viewparams->sViewCenterY;
469 unsigned int i; // [sp+48048h] [bp-1Ch]@9 433 if ( viewparams->field_2C != 384 )
470 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 434 {
471 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 435 if ( viewparams->field_2C == 768 )
472 signed int screenWidth; // [sp+48054h] [bp-10h]@8 436 {
473 unsigned int v95; // [sp+48058h] [bp-Ch]@16 437 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
474 int v96; // [sp+4805Ch] [bp-8h]@10 438 viewparams->field_2C = 680;
475 const void *v97; // [sp+48060h] [bp-4h]@16 439 }
476 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 440 }
477 int a5a; // [sp+48070h] [bp+Ch]@86 441 else
478 442 {
479 tl_x = tl_x; 443 viewparams->sViewCenterX = viewparams->indoor_center_x;
480 tl_y = tl_y; 444 pCenterX = viewparams->indoor_center_x;
481 screenCenter_X = (signed int)(tl_x + br_x) >> 1; 445 pCenterY = viewparams->indoor_center_y;
482 screenCenterY = (signed int)(tl_y + br_y) >> 1; 446 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
483 surfPitch = pRenderer->uTargetSurfacePitch; 447 viewparams->field_2C = viewparams->field_2C - 34;
484 pRenderer->SetRasterClipRect(tl_x, tl_y, br_x, br_y); 448 }
485 v5 = viewparams->field_2C; 449 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
486 v6 = viewparams->sViewCenterX; 450 {
487 v86 = viewparams->sViewCenterX; 451 screenWidth = br_x - tl_x + 1;
488 v84 = viewparams->sViewCenterY; 452 screenHeight = br_y - tl_y + 1;
489 if ( viewparams->field_2C != 384 ) 453 render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch];
454 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
455 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
456 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / viewparams->field_2C;
457
458 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
459
460 teal = (unsigned int)(signed __int64)((double)(viewparams->sViewCenterX - 22528 / (viewparams->field_2C / 384) + 32768) / v30) << 16;
461 // v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
462
463 // v32 = map_texture_16;
464 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
465 stepY_r = (int)(signed __int64)((double)(- pCenterY - 22528 / (viewparams->field_2C / 384)+ 32768) / v30) << 16;
466 // v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
467 black = (signed __int16)(signed __int64)((double)(viewparams->sViewCenterX - 22528 / (viewparams->field_2C / 384) + 32768) / v30);
468
469 // v76 = textr_width;
470 scaled_posY = stepY_r >> 16;
471 //nearest neiborhood scaling
472 if ( texture8_data)
473 {
474 for( uint i = 0; i < screenHeight; ++i )
475 {
476 curr_line=&texture8_data[scaled_posY*textr_width];
477 stepX_r=teal;
478 for( uint j = 0; j < screenWidth; ++j )
490 { 479 {
491 if ( viewparams->field_2C == 768 ) 480 scaled_posX=stepX_r>>16;
481 map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)];
482 stepX_r+=scale_increment;
483 }
484 stepY_r+=scale_increment;
485 scaled_posY=stepY_r>>16;
486 }
487 }
488 //move visible square to render
489 for( uint i = 0; i < screenHeight; ++i )
490 {
491 if ( screenWidth > 0 )
492 memcpy((void*)&render16_data[pRenderer->uTargetSurfacePitch * i],(void*)&map_texture_16[i*screenWidth], screenWidth*2);
493 }
494 }
495 else
496 {
497 black = TargetColor(0, 0, 0);
498 teal = TargetColor(0, 0xFFu, 0xFFu);
499 uNumBlueFacesInBLVMinimap = 0;
500 if ( pIndoor->pMapOutlines->uNumOutlines )
501 {
502 for ( uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i )
503 {
504 if ( !(BYTE1(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].uAttributes) & 0x20
505 || (BYTE1(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].uAttributes) & 0x20) ))
506 {
507 if ( !(pIndoor->pMapOutlines->pOutlines[i].uFlags & 1) )
508 {
509 if ( !(!(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].uAttributes & 0x80)
510 && !(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].uAttributes & 0x80u) ))
492 { 511 {
493 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 512 pIndoor->pMapOutlines->pOutlines[i].uFlags = pIndoor->pMapOutlines->pOutlines[i].uFlags | 1;
494 v5 = 680; 513 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
495 } 514 }
515 }
516 if ( (!(pIndoor->pMapOutlines->pOutlines[i].uFlags & 1)
517 && !(!(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace1ID].uAttributes & 0x80)
518 && !(pIndoor->pFaces[pIndoor->pMapOutlines->pOutlines[i].uFace2ID].uAttributes & 0x80u) ))
519 || pIndoor->pMapOutlines->pOutlines[i].uFlags & 1)
520 {
521 v93 = (unsigned __int16 *)(pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX);
522 screenHeight = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y - pCenterY;
523 v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY;
524 v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX;
525 v97 = (const void *)v20;
526 v88 = (unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16;
527 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)viewparams->field_2C) >> 16;
528 v93 = (unsigned __int16 *)((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16);
529 screenHeight = (unsigned __int64)(v20 * (signed __int64)viewparams->field_2C) >> 16;
530 pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87,
531 screenCenter_X + ((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16), screenCenterY - screenHeight, black);
532 }
496 } 533 }
497 else 534 }
498 { 535 }
499 v6 = viewparams->indoor_center_x; 536 v21 = 0;
500 v86 = viewparams->indoor_center_x; 537 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
501 v84 = viewparams->indoor_center_y; 538 {
502 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 539 while ( 1 )
503 v5 = viewparams->field_2C - 34; 540 {
504 } 541 v22 = pBlueFacesInBLVMinimapIDs[v21];
505 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) 542 v87 = viewparams->field_2C;
506 { 543 v23 = &pIndoor->pMapOutlines->pOutlines[v22];
507 screenWidth = br_x - tl_x + 1; 544 v24 = &pIndoor->pVertices[v23->uVertex1ID];
508 screenHeight = br_y - tl_y + 1; 545 v25 = &pIndoor->pVertices[v23->uVertex2ID];
509 render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; 546 v26 = v25->x;
510 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; 547 v27 = (unsigned __int16 *)(v24->x - pCenterX);
511 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; 548 v28 = v24->y - pCenterY;
512 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5; 549 v29 = v25->y - pCenterY;
513 550 v93 = v27;
514 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); 551 screenHeight = v28;
515 552 v97 = (const void *)v29;
516 553 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)viewparams->field_2C) >> 16;
517 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16; 554 v88 = (unsigned __int64)(v28 * (signed __int64)viewparams->field_2C) >> 16;
518 // v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); 555 uint i = (unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->field_2C) >> 16;
519 556 v95 = (unsigned __int64)(v29 * (signed __int64)viewparams->field_2C) >> 16;
520 // v32 = map_texture_16; 557 pRenderer->RasterLine2D(screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)viewparams->field_2C) >> 16),
521 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; 558 screenCenterY - v88, screenCenter_X + ((unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->field_2C) >> 16), screenCenterY - v95, teal);
522 stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16; 559 ++v21;
523 // v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); 560 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
524 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); 561 break;
525 562 }
526 // v76 = textr_width; 563 viewparams->sViewCenterX = pCenterX;
527 scaled_posY = stepY_r >> 16; 564 }
528 //nearest neiborhood scaling 565 }
529 if ( texture8_data) 566 v47 = ((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X - 3;
530 { 567 v81 = pParty->vPosition.y - pCenterY;
531 for(uint i=0; i<screenHeight;++i) 568 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - pCenterY) * (signed __int64)viewparams->field_2C) >> 16);
569 v48 = 1;
570 v49 = screenCenterY - (int)v97 - 3;
571 if ( v47 >= (signed int)tl_x )
572 {
573 if ( v47 > (signed int)br_x )
574 {
575 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X - 6) > (signed int)br_x )
576 v48 = 0;
577 v47 = br_x;
578 }
579 }
580 else
581 {
582 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X) < (signed int)tl_x )
583 v48 = 0;
584 v47 = tl_x;
585 }
586 if ( v49 >= (signed int)tl_y )
587 {
588 if ( v49 > br_y )
589 {
590 if ( screenCenterY - (signed int)v97 - 6 > br_y )
591 v48 = 0;
592 v49 = br_y;
593 }
594 }
595 else
596 {
597 if ( screenCenterY - (signed int)v97 < (signed int)tl_y )
598 v48 = 0;
599 v49 = tl_y;
600 }
601 if ( v48 == 1 )
602 {
603 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
604 if ( (signed int)v51 <= 1920 )
605 v50 = 7;
606 if ( (signed int)v51 < 1664 )
607 v50 = 6;
608 if ( (signed int)v51 <= 1408 )
609 v50 = 5;
610 if ( (signed int)v51 < 1152 )
611 v50 = 4;
612 if ( (signed int)v51 <= 896 )
613 v50 = 3;
614 if ( (signed int)v51 < 640 )
615 v50 = 2;
616 if ( (signed int)v51 <= 384 )
617 v50 = 1;
618 if ( (signed int)v51 < 128 )
619 v50 = 0;
620 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50]));
621 }
622 result = TargetColor(0xFFu, 0xFFu, 0xFFu);
623 v95 = 0;
624 pCenterX = result;
625 if ( (signed int)uNumLevelDecorations > 0 )
626 {
627 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition;
628 do
629 {
630 if ( *(char *)(screenWidth - 2) & 8 )
631 {
632 v53 = *(int *)(screenWidth + 4) - pCenterY;
633 v93 = (unsigned __int16 *)(*(int *)screenWidth - viewparams->sViewCenterX);
634 screenHeight = v53;
635 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X;
636 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)viewparams->field_2C) >> 16);
637 v55 = screenCenterY - (int)v97;
638 if ( v54 >= pRenderer->raster_clip_x )
639 {
640 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
532 { 641 {
533 curr_line=&texture8_data[scaled_posY*textr_width]; 642 if ( viewparams->field_2C > 512 )
534 stepX_r=teal; 643 {
535 for(uint j=0; j<screenWidth;++j) 644 v96 = v55 + 1;
536 { 645 black = v55 - 1;
537 scaled_posX=stepX_r>>16; 646 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, pCenterX);
538 map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)]; 647 pRenderer->RasterLine2D(v54, black, v54, v96, pCenterX);
539 stepX_r+=scale_increment; 648 ++v54;
540 } 649 v72 = v96;
541 stepY_r+=scale_increment; 650 v71 = v54;
542 scaled_posY=stepY_r>>16; 651 v70 = black;
652 }
653 else
654 {
655 v72 = screenCenterY - (int)v97;
656 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->field_2C) >> 16) + screenCenter_X;
657 v70 = screenCenterY - (int)v97;
658 }
659 pRenderer->RasterLine2D(v54, v70, v71, v72, pCenterX);
543 } 660 }
661 }
544 } 662 }
545 //move visible square to render
546 for(uint i=0; i<screenHeight;++i)
547 {
548 if ( screenWidth > 0 )
549 {
550 memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2);
551 }
552 }
553 }
554 else
555 {
556 black = TargetColor(0, 0, 0);
557 teal = TargetColor(0, 0xFFu, 0xFFu);
558 v7 = pIndoor->pMapOutlines;
559 uNumBlueFacesInBLVMinimap = 0;
560 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
561 v9 = pIndoor->pMapOutlines->uNumOutlines < 0;
562 screenWidth = 0;
563 if ( !(v9 | v8) )
564 {
565 i = 0;
566 do
567 {
568 v10 = (int)((char *)v7 + i + 4);
569 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
570 if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) ))
571 {
572 v12 = *(short *)((char *)v7 + i + 14);
573 if ( !(v12 & 1) )
574 {
575 if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 ))
576 {
577 v96 = (signed int)screenWidth >> 3;
578 v13 = screenWidth;
579 *(short *)(v10 + 10) = v12 | 1;
580 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
581 }
582 }
583 if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1)
584 {
585 v14 = *(short *)v10;
586 v88 = v5;
587 v15 = &pIndoor->pVertices[v14];
588 v16 = v15->x;
589 v17 = v15->y - v84;
590 v93 = (unsigned __int16 *)(v16 - v6);
591 screenHeight = v17;
592 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
593 v19 = v18->x;
594 v20 = v18->y - v84;
595 v95 = v19 - v6;
596 v97 = (const void *)v20;
597 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
598 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16;
599 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
600 screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
601 pRenderer->RasterLine2D(
602 screenCenter_X + v88,
603 screenCenterY - v87,
604 screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
605 screenCenterY - screenHeight,
606 black);
607 v7 = pIndoor->pMapOutlines;
608 }
609 }
610 ++screenWidth;
611 i += 12;
612 }
613 while ( screenWidth < (signed int)v7->uNumOutlines );
614 }
615 v21 = 0;
616 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
617 {
618 while ( 1 )
619 {
620 v22 = pBlueFacesInBLVMinimapIDs[v21];
621 v87 = v5;
622 v23 = &v7->pOutlines[v22];
623 v24 = &pIndoor->pVertices[v23->uVertex1ID];
624 v25 = &pIndoor->pVertices[v23->uVertex2ID];
625 v26 = v25->x;
626 v27 = (unsigned __int16 *)(v24->x - v86);
627 v28 = v24->y - v84;
628 v29 = v25->y - v84;
629 v93 = v27;
630 screenHeight = v28;
631 v97 = (const void *)v29;
632 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
633 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
634 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
635 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
636 pRenderer->RasterLine2D(
637 screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
638 screenCenterY - v88,
639 screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
640 screenCenterY - v95,
641 teal);
642 ++v21;
643 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
644 break;
645 v7 = pIndoor->pMapOutlines;
646 }
647 v6 = v86;
648 }
649 }
650 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3;
651 v81 = pParty->vPosition.y - v84;
652 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
653 v48 = 1;
654 v49 = screenCenterY - (int)v97 - 3;
655 if ( v47 >= (signed int)tl_x )
656 {
657 if ( v47 > (signed int)br_x )
658 {
659 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x )
660 v48 = 0;
661 v47 = br_x;
662 }
663 }
664 else
665 {
666 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x )
667 v48 = 0;
668 v47 = tl_x;
669 }
670 if ( v49 >= (signed int)tl_y )
671 {
672 if ( v49 > br_y )
673 {
674 if ( screenCenterY - (signed int)v97 - 6 > br_y )
675 v48 = 0;
676 v49 = br_y;
677 }
678 }
679 else
680 {
681 if ( screenCenterY - (signed int)v97 < (signed int)tl_y )
682 v48 = 0;
683 v49 = tl_y;
684 }
685 if ( v48 == 1 )
686 {
687 v50 = 0;
688 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
689 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
690 {
691 if ( (signed int)v51 > 384 )
692 {
693 if ( (signed int)v51 >= 640 )
694 {
695 if ( (signed int)v51 > 896 )
696 {
697 if ( (signed int)v51 >= 1152 )
698 {
699 if ( (signed int)v51 > 1408 )
700 {
701 if ( (signed int)v51 >= 1664 )
702 {
703 if ( (signed int)v51 <= 1920 )
704 v73 = 7;
705 }
706 else
707 {
708 v73 = 6;
709 }
710 }
711 else
712 {
713 v73 = 5;
714 }
715 }
716 else
717 {
718 v73 = 4;
719 }
720 }
721 else
722 {
723 v73 = 3;
724 }
725 }
726 else
727 {
728 v73 = 2;
729 }
730 if( (signed int)v51 <=1920)
731 v50 = v73;
732 }
733 else
734 v50 = 1;
735 }
736 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50]));
737 }
738 result = TargetColor(0xFFu, 0xFFu, 0xFFu);
739 v95 = 0;
740 v86 = result;
741 if ( (signed int)uNumLevelDecorations > 0 )
742 {
743 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition;
744 do
745 {
746 if ( *(char *)(screenWidth - 2) & 8 )
747 {
748 v53 = *(int *)(screenWidth + 4) - v84;
749 v93 = (unsigned __int16 *)(*(int *)screenWidth - v6);
750 screenHeight = v53;
751 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
752 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
753 v55 = screenCenterY - (int)v97;
754 if ( v54 >= pRenderer->raster_clip_x )
755 {
756 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
757 {
758 v74 = v86;
759 if ( v5 > 512 )
760 {
761 v96 = v55 + 1;
762 black = v55 - 1;
763 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
764 pRenderer->RasterLine2D(v54, black, v54, v96, v86);
765 ++v54;
766 v74 = v86;
767 v72 = v96;
768 v71 = v54;
769 v70 = black;
770 }
771 else
772 {
773 v72 = screenCenterY - (int)v97;
774 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
775 v70 = screenCenterY - (int)v97;
776 }
777 pRenderer->RasterLine2D(v54, v70, v71, v72, v74);
778 }
779 }
780 }
781 ++v95; 663 ++v95;
782 result = v95; 664 result = v95;
783 screenWidth += 32; 665 screenWidth += 32;
784 } 666 }
785 while ( (signed int)v95 < (signed int)uNumLevelDecorations ); 667 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
786 } 668 }
787 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 669 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
788 { 670 {
789 screenCenterY = br_x - tl_x + 1; 671 screenCenterY = br_x - tl_x + 1;
790 v95 = br_y - tl_y + 1; 672 v95 = br_y - tl_y + 1;
791 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; 673 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * pRenderer->uTargetSurfacePitch];
792 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; 674 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
793 black = (1 << (v56 + 16)) / v5; 675 black = (1 << (v56 + 16)) / viewparams->field_2C;
794 v57 = (double)(1 << (16 - v56)); 676 v57 = (double)(1 << (16 - v56));
795 v58 = 22528 / (v5 / 384); 677 v58 = 22528 / (viewparams->field_2C / 384);
796 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57); 678 v59 = (signed __int64)((double)(viewparams->sViewCenterX - v58 + 32768) / v57);
797 v60 = (int)v59 << 16; 679 v60 = (int)v59 << 16;
798 v97 = (const void *)((int)v59 << 16); 680 v97 = (const void *)((int)v59 << 16);
799 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57); 681 v61 = (signed __int64)((double)(32768 - v58 - pCenterY) / v57);
800 pPalette_16 = (unsigned __int16 *)(v60 >> 16); 682 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
801 v62 = (int)v61 << 16; 683 v62 = (int)v61 << 16;
802 teal = v60 >> 16; 684 teal = v60 >> 16;
803 v63 = (signed __int16)v61; 685 v63 = (signed __int16)v61;
804 a4a = map_texture_16; 686 a4a = map_texture_16;
843 v65 = v95; 725 v65 = v95;
844 v66 = map_texture_16; 726 v66 = map_texture_16;
845 if ( (signed int)v95 > 0 ) 727 if ( (signed int)v95 > 0 )
846 { 728 {
847 v67 = v77; 729 v67 = v77;
848 result = 2 * (surfPitch - screenCenterY); 730 result = 2 * (pRenderer->uTargetSurfacePitch - screenCenterY);
849 do 731 do
850 { 732 {
851 if ( screenCenterY > 0 ) 733 if ( screenCenterY > 0 )
852 { 734 {
853 v68 = screenCenterY; 735 v68 = screenCenterY;
867 } 749 }
868 while ( v65 ); 750 while ( v65 );
869 } 751 }
870 } 752 }
871 } 753 }
872
873