706
|
1 #include <assert.h>
|
|
2
|
|
3 #include "MM7.h"
|
|
4
|
|
5 #include "MapInfo.h"
|
|
6 #include "Game.h"
|
|
7 #include "GUIWindow.h"
|
|
8 #include "GUIFont.h"
|
|
9 #include "GUIProgressBar.h"
|
|
10 #include "Party.h"
|
|
11 #include "AudioPlayer.h"
|
|
12 #include "Outdoor.h"
|
|
13 #include "IndoorCamera.h"
|
|
14 #include "Overlays.h"
|
|
15 #include "Monsters.h"
|
|
16 #include "Arcomage.h"
|
|
17 #include "LOD.h"
|
|
18 #include "Actor.h"
|
|
19 #include "Allocator.h"
|
|
20 #include "Events.h"
|
|
21 #include "Viewport.h"
|
|
22 #include "FrameTableInc.h"
|
|
23 #include "Math.h"
|
|
24 #include "SpriteObject.h"
|
|
25 #include "ObjectList.h"
|
|
26 #include "Chest.h"
|
|
27 #include "PaletteManager.h"
|
|
28 #include "DecorationList.h"
|
|
29 #include "SaveLoad.h"
|
|
30 #include "stru123.h"
|
|
31 #include "Time.h"
|
|
32 #include "IconFrameTable.h"
|
|
33 #include "Awards.h"
|
|
34 #include "Autonotes.h"
|
|
35 #include "stru160.h"
|
|
36 #include "stru279.h"
|
|
37 #include "TurnEngine.h"
|
924
|
38 #include "CastSpellInfo.h"
|
706
|
39 #include "Weather.h"
|
|
40 #include "stru272.h"
|
|
41 #include "stru298.h"
|
|
42 #include "StorylineTextTable.h"
|
|
43 #include "Events2D.h"
|
|
44 #include "texts.h"
|
|
45 #include "stru351.h"
|
|
46
|
|
47 #include "mm7_data.h"
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52 //----- (00411300) --------------------------------------------------------
|
|
53 void LoadSpellbook(unsigned int spell_school)
|
|
54 {
|
|
55 //unsigned int v1; // esi@1
|
|
56 Player *pPlayer; // ecx@1
|
|
57 char v3; // al@1
|
|
58 //int v4; // edi@5
|
|
59 //Texture *result; // eax@6
|
|
60 //unsigned char *v6; // edi@7
|
|
61 //unsigned int v7; // eax@7
|
|
62 //unsigned __int8 v8; // sf@8
|
|
63 //unsigned __int8 v9; // of@8
|
|
64 char pContainer[20]; // [sp+Ch] [bp-1Ch]@7
|
|
65 //Texture *v11; // [sp+20h] [bp-8h]@5
|
|
66 //int v12; // [sp+24h] [bp-4h]@5
|
|
67
|
|
68 byte_506550 = 0;
|
|
69 //v1 = uID;
|
|
70 pPlayer = pPlayers[uActiveCharacter];
|
|
71 v3 = pPlayer->uQuickSpell;
|
|
72 if ( v3 && (unsigned __int8)v3 / 11 == spell_school )
|
|
73 quick_spell_at_page = (unsigned __int8)v3 - 11 * spell_school;
|
|
74 else
|
|
75 quick_spell_at_page = 0;
|
|
76
|
|
77 for (uint i = 1; i < 12; ++i)
|
|
78 {
|
|
79 if (pPlayer->spellbook.pChapters[spell_school].bIsSpellAvailable[i - 1])
|
|
80 {
|
|
81 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]);
|
|
82 dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
|
|
83
|
|
84 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]);
|
|
85 dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
|
|
86 }
|
|
87 }
|
|
88 }
|
|
89
|
|
90 //----- (0041140B) --------------------------------------------------------
|
|
91 GUIWindow *__cdecl sub_41140B()
|
|
92 {
|
|
93 signed int v0; // esi@1
|
|
94 GUIButton *v1; // eax@3
|
|
95 GUIButton *v2; // esi@4
|
|
96 GUIWindow *result; // eax@5
|
|
97
|
|
98 v0 = 0;
|
|
99 do
|
|
100 {
|
|
101 dword_5063D8[11+v0]->Release();
|
|
102 dword_506408[11+v0]->Release();
|
|
103 --v0;
|
|
104 }
|
|
105 while ( v0 >= -11 );
|
|
106 pIcons_LOD->_40F9C5();
|
|
107 v1 = pGUIWindow_CurrentMenu->pControlsHead;
|
|
108 if ( v1 )
|
|
109 {
|
|
110 do
|
|
111 {
|
|
112 v2 = v1->pNext;
|
|
113 pAllocator->FreeChunk(v1);
|
|
114 v1 = v2;
|
|
115 }
|
|
116 while ( v2 );
|
|
117 }
|
|
118 pGUIWindow_CurrentMenu->pControlsHead = 0;
|
|
119 pGUIWindow_CurrentMenu->pControlsTail = 0;
|
|
120 result = pGUIWindow_CurrentMenu;
|
|
121 pGUIWindow_CurrentMenu->uNumControls = 0;
|
|
122 return result;
|
|
123 }
|
|
124
|
|
125 //----- (00411473) --------------------------------------------------------
|
|
126 void __cdecl sub_411473()
|
|
127 {
|
|
128 pTexture_pagemask->Release();
|
|
129 pTexture_506448->Release();
|
|
130 pTexture_50643C->Release();
|
|
131 for (uint i = 0; i < 8; ++i)
|
|
132 {
|
|
133 pSpellBookPagesTextr[i]->Release();
|
|
134 pTextures_tabs[i][0]->Release();
|
|
135 pTextures_tabs[i][1]->Release();
|
|
136 }
|
|
137 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
|
|
138 pIcons_LOD->_4114F2();
|
|
139 }
|
|
140
|
|
141
|
|
142 //----- (00411597) --------------------------------------------------------
|
|
143 void __cdecl OnCloseSpellook()
|
|
144 {
|
|
145 pAllocator->FreeChunk(pSpellFont);
|
|
146 pSpellFont = 0;
|
|
147 pAllocator->FreeChunk(pBookFont);
|
|
148 pBookFont = 0;
|
|
149 pAllocator->FreeChunk(pBook2Font);
|
|
150 pBook2Font = 0;
|
|
151 pAllocator->FreeChunk(pAutonoteFont);
|
|
152 pAutonoteFont = 0;
|
|
153 pTexture_mapbordr->Release();
|
|
154 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
|
|
155 pIcons_LOD->_4114F2();
|
|
156 dword_506364 = 0;
|
|
157 }
|
|
158 // 506364: using guessed type int dword_506364;
|
|
159
|
|
160
|
|
161
|
|
162
|
|
163
|
|
164
|
|
165
|
|
166 //----- (00412AF9) --------------------------------------------------------
|
|
167 void sub_412AF9()
|
|
168 {
|
|
169 int v0; // ecx@1
|
|
170
|
|
171 v0 = 0;
|
|
172 if ( uActiveCharacter )
|
|
173 v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2);
|
|
174 pRenderer->DrawTextureIndexed(8u, 8u, pSpellBookPagesTextr[v0]);
|
|
175 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C);
|
|
176 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448);
|
|
177 }
|
|
178
|
|
179 //----- (00412B58) --------------------------------------------------------
|
|
180 void __cdecl DrawSpellBookContent()
|
|
181 {
|
|
182 Player *v0; // ebx@1
|
|
183 int v1; // ebp@1
|
|
184 unsigned int v2; // eax@1
|
|
185 Texture *v3; // edi@1
|
|
186 int v4; // esi@1
|
|
187 Texture *v5; // eax@3
|
|
188 Texture *v6; // edx@5
|
|
189 int v7; // eax@8
|
|
190 int v8; // eax@11
|
|
191 POINT *v9; // esi@13
|
|
192 int v10; // eax@13
|
|
193 Texture *v11; // edx@14
|
|
194 int v12; // eax@15
|
|
195 signed int v13; // ecx@18
|
|
196 unsigned int v14; // esi@18
|
|
197 unsigned int v15; // edi@18
|
|
198 Texture *pPageTexture; // eax@21
|
|
199 unsigned int v17; // [sp-Ch] [bp-2Ch]@8
|
|
200 unsigned int v18; // [sp-Ch] [bp-2Ch]@15
|
|
201 unsigned int v19; // [sp-8h] [bp-28h]@8
|
|
202 unsigned int v20; // [sp-8h] [bp-28h]@15
|
|
203 Texture *v21; // [sp-4h] [bp-24h]@15
|
|
204 signed int v22; // [sp-4h] [bp-24h]@22
|
|
205 Texture *v23; // [sp+10h] [bp-10h]@5
|
|
206 POINT a2; // [sp+18h] [bp-8h]@13
|
|
207 POINT v24;
|
|
208 int v25;
|
|
209
|
|
210 sub_412AF9();
|
|
211 v0 = pPlayers[uActiveCharacter];
|
|
212 v1 = 11 * v0->lastOpenedSpellbookPage;
|
|
213 v2 = pIcons_LOD->FindTextureByName("Pending");
|
|
214 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
|
|
215 pRenderer->ClearZBuffer(0, 479);
|
|
216 v4 = 1;
|
|
217 if ( __OFSUB__(v1, v1 + 11) ^ 1 )
|
|
218 {
|
|
219 do
|
|
220 {
|
|
221 if ( *(&v0->_guilds_member_bits[v1 + 63] + v4) )
|
|
222 {
|
|
223 v5 = (Texture *)dword_506408[v4];
|
|
224 if ( v5 != v3 )
|
|
225 {
|
|
226 if ( quick_spell_at_page == v4 )
|
|
227 {
|
|
228 v6 = dword_5063D8[v4];
|
|
229 v23 = dword_5063D8[v4];
|
|
230 }
|
|
231 else
|
|
232 {
|
|
233 v23 = dword_506408[v4];
|
|
234 v6 = v5;
|
|
235 }
|
710
|
236 if ( v6->pLevelOfDetail0_prolly_alpha_mask )
|
706
|
237 {
|
|
238 v7 = v0->lastOpenedSpellbookPage;
|
|
239 // v7 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]);
|
|
240 v19 = pViewport->uViewportTL_Y + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos;
|
|
241 v17 = pViewport->uViewportTL_X + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos;
|
|
242 if ( BYTE1(v6->pBits) & 2 )
|
|
243 pRenderer->DrawTextureTransparent(v17, v19, v6);
|
|
244 else
|
|
245 pRenderer->DrawTextureIndexed(v17, v19, v6);
|
710
|
246 pRenderer->DrawMaskToZBuffer(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos,
|
706
|
247 pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4);
|
|
248 }
|
|
249 }
|
|
250 }
|
|
251 ++v4;
|
|
252 }
|
|
253 while ( v4 + v1 - 1 < v1 + 11 );
|
|
254 }
|
|
255 v9 = pMouse->GetCursorPos(&a2);
|
|
256 v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF;
|
|
257 if ( v10 )
|
|
258 {
|
|
259 v11 = dword_5063D8[v10];
|
710
|
260 if ( v11->pLevelOfDetail0_prolly_alpha_mask )
|
706
|
261 {
|
|
262 v21 = dword_5063D8[v10];
|
|
263 v12 = v0->lastOpenedSpellbookPage;
|
|
264 // v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]);
|
|
265 v20 = pViewport->uViewportTL_Y + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos;
|
|
266 v18 = pViewport->uViewportTL_X + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos;
|
|
267 if ( BYTE1(v11->pBits) & 2 )
|
|
268 pRenderer->DrawTextureTransparent(v18, v20, v21);
|
|
269 else
|
|
270 pRenderer->DrawTextureIndexed(v18, v20, v21);
|
|
271 }
|
|
272 }
|
|
273 v13 = 0;
|
|
274 a2.x = (LONG)&v0->pActiveSkills[12];
|
|
275 v14 = (unsigned int)&v0->pActiveSkills[12];
|
|
276 v15 = (unsigned int)&v0->pActiveSkills[12];
|
|
277 v25 = 0;
|
|
278 do
|
|
279 {
|
|
280 if ( *(short *)a2.x )
|
|
281 {
|
|
282 if ( v0->lastOpenedSpellbookPage == v13 )
|
|
283 {
|
|
284 pPageTexture = pTextures_tabs[v13][1];
|
|
285 switch ( v13 )
|
|
286 {
|
|
287 case 0:
|
|
288 v14 = 406;
|
|
289 v22 = 9;
|
|
290 goto LABEL_27;
|
|
291 case 1:
|
|
292 v14 = 406;
|
|
293 goto LABEL_38;
|
|
294 case 2:
|
|
295 v14 = 406;
|
|
296 v22 = 84;
|
|
297 goto LABEL_27;
|
|
298 case 3:
|
|
299 v14 = 406;
|
|
300 goto LABEL_26;
|
|
301 case 4:
|
|
302 v14 = 407;
|
|
303 goto LABEL_29;
|
|
304 case 5:
|
|
305 v15 = 196;
|
|
306 goto LABEL_34;
|
|
307 case 6:
|
|
308 v15 = 234;
|
|
309 goto LABEL_34;
|
|
310 case 7:
|
|
311 v15 = 272;
|
|
312 goto LABEL_34;
|
|
313 case 8:
|
|
314 v15 = 309;
|
|
315 LABEL_34:
|
|
316 v14 = 405;
|
|
317 break;
|
|
318 default:
|
|
319 break;
|
|
320 }
|
|
321 }
|
|
322 else
|
|
323 {
|
|
324 pPageTexture = pTextures_tabs[v13][0];
|
|
325 switch ( v13 )
|
|
326 {
|
|
327 case 0:
|
|
328 v14 = 415;
|
|
329 v22 = 10;
|
|
330 goto LABEL_27;
|
|
331 case 1:
|
|
332 v14 = 415;
|
|
333 LABEL_38:
|
|
334 v22 = 46;
|
|
335 goto LABEL_27;
|
|
336 case 2:
|
|
337 v14 = 415;
|
|
338 v22 = 83;
|
|
339 goto LABEL_27;
|
|
340 case 3:
|
|
341 v14 = 415;
|
|
342 LABEL_26:
|
|
343 v22 = 121;
|
|
344 LABEL_27:
|
|
345 v15 = v22;
|
|
346 break;
|
|
347 case 4:
|
|
348 v14 = 415;
|
|
349 LABEL_29:
|
|
350 v15 = 158;
|
|
351 break;
|
|
352 case 5:
|
|
353 v15 = 196;
|
|
354 goto LABEL_46;
|
|
355 case 6:
|
|
356 v15 = 234;
|
|
357 goto LABEL_46;
|
|
358 case 7:
|
|
359 v15 = 271;
|
|
360 goto LABEL_46;
|
|
361 case 8:
|
|
362 v15 = 307;
|
|
363 LABEL_46:
|
|
364 v14 = 416;
|
|
365 break;
|
|
366 default:
|
|
367 break;
|
|
368 }
|
|
369 }
|
|
370 pRenderer->DrawTextureTransparent(v14, v15, pPageTexture);
|
|
371 v13 = v25;
|
|
372 }
|
|
373 a2.x += 2;
|
|
374 ++v13;
|
|
375 v25 = v13;
|
|
376 }
|
|
377 while ( v13 < 9 );
|
|
378 }
|
|
379 // 506408: using guessed type int dword_506408[];
|
|
380 // 50654C: using guessed type int dword_50654C;
|
|
381
|
|
382 //----- (00412E85) --------------------------------------------------------
|
|
383 char __cdecl DrawBook_History()
|
|
384 {
|
|
385 unsigned int v0; // eax@3
|
|
386 unsigned int v1; // eax@7
|
|
387 int v2; // eax@10
|
|
388 const char *v3; // eax@10
|
|
389 signed int v4; // ecx@12
|
|
390 int v5; // ecx@14
|
|
391 int v6; // eax@21
|
|
392 int v7; // esi@21
|
|
393 char *v8; // eax@21
|
|
394 int v9; // eax@22
|
|
395 unsigned int v11; // [sp-8h] [bp-64h]@3
|
|
396 unsigned int v12; // [sp-8h] [bp-64h]@7
|
|
397 Texture *v13; // [sp-4h] [bp-60h]@3
|
|
398 Texture *v14; // [sp-4h] [bp-60h]@7
|
|
399 GUIWindow a1; // [sp+8h] [bp-54h]@10
|
|
400
|
|
401 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11);
|
|
402 if ( dword_506548 || !dword_506528 )
|
|
403 {
|
|
404 v13 = pTex_tab_an_6a__zoom_off;
|
|
405 v11 = pViewport->uViewportTL_Y + 2;
|
|
406 v0 = pViewport->uViewportTL_X + 407;
|
|
407 }
|
|
408 else
|
|
409 {
|
|
410 v13 = pTex_tab_an_6b__zoom_on;
|
|
411 v11 = pViewport->uViewportTL_Y + 1;
|
|
412 v0 = pViewport->uViewportTL_X + 398;
|
|
413 }
|
|
414 pRenderer->DrawTextureTransparent(v0, v11, v13);
|
|
415 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
|
|
416 {
|
|
417 v14 = pTex_tab_an_7a__zoot_off;
|
|
418 v12 = pViewport->uViewportTL_Y + 38;
|
|
419 v1 = pViewport->uViewportTL_X + 407;
|
|
420 }
|
|
421 else
|
|
422 {
|
|
423 v14 = pTex_tab_an_7b__zoot_on;
|
|
424 v12 = pViewport->uViewportTL_Y + 38;
|
|
425 v1 = pViewport->uViewportTL_X + 398;
|
|
426 }
|
|
427 pRenderer->DrawTextureTransparent(v1, v12, v14);
|
|
428 if ( !byte_5C6D50[dword_506528] )
|
|
429 {
|
|
430 v2 = achievedAwardsIndex[dword_506528];
|
819
|
431 a1.uFrameWidth = game_viewport_width;
|
|
432 a1.uFrameX = game_viewport_x;
|
|
433 a1.uFrameY = game_viewport_y;
|
|
434 a1.uFrameHeight = game_viewport_height;
|
706
|
435 v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[];
|
819
|
436 a1.uFrameZ = game_viewport_z;
|
|
437 a1.uFrameW = game_viewport_w;
|
706
|
438 if ( v3 )
|
|
439 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, v3, 3u);
|
|
440 }
|
|
441 a1.uFrameX = 48;
|
|
442 a1.uFrameY = 70;
|
|
443 a1.uFrameWidth = 360;
|
|
444 a1.uFrameHeight = 264;
|
|
445 v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3;
|
|
446 a1.uFrameZ = 407;
|
|
447 a1.uFrameHeight = v4 * 264 / v4;
|
|
448 a1.uFrameW = a1.uFrameHeight + 69;
|
|
449 if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
|
|
450 {
|
|
451 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
452 v5 = dword_50651C++;
|
|
453 dword_506528 += awards_count;
|
|
454 byte_506130[v5] = awards_count;
|
|
455 }
|
|
456 if ( dword_506548 && dword_50651C )
|
|
457 {
|
|
458 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
459 --dword_50651C;
|
|
460 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
|
|
461 }
|
|
462 if ( !awards_count || dword_506528 < 1 )
|
|
463 {
|
|
464 dword_506528 = 0;
|
|
465 dword_50651C = 0;
|
|
466 }
|
|
467 dword_506544 = 0;
|
|
468 v6 = achievedAwardsIndex[dword_506528];
|
|
469 dword_506548 = 0;
|
|
470 awards_count = 0;
|
|
471 //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
|
|
472 v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
|
|
473 v8 = BuilDialogueString(
|
|
474 pStorylineText->StoreLine[v6].pText,
|
|
475 uActiveCharacter - 1,
|
|
476 0,
|
|
477 0,
|
|
478 0,
|
|
479 (__int64 *)&pParty->field_3C._s_times[ v6 + 21]);
|
|
480 if ( v7 )
|
|
481 {
|
|
482 v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]);
|
|
483 LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0);
|
|
484 ++awards_count;
|
|
485 }
|
|
486 return (char)v8;
|
|
487 }
|
|
488
|
|
489
|
|
490 //----- (00413126) --------------------------------------------------------
|
|
491 void __cdecl DrawBook_Quests()
|
|
492 {
|
|
493 unsigned int v0; // eax@3
|
|
494 unsigned int v1; // eax@7
|
|
495 int v2; // ecx@11
|
|
496 int v3; // ebx@16
|
|
497 int v4; // eax@19
|
|
498 const char *v5; // edi@19
|
|
499 int v6; // eax@19
|
|
500 unsigned int v7; // edi@19
|
|
501 unsigned int v8; // [sp-8h] [bp-68h]@3
|
|
502 unsigned int v9; // [sp-8h] [bp-68h]@7
|
|
503 Texture *v10; // [sp-4h] [bp-64h]@3
|
|
504 Texture *v11; // [sp-4h] [bp-64h]@7
|
|
505 GUIWindow a1; // [sp+Ch] [bp-54h]@9
|
|
506
|
|
507 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
|
|
508 if ( dword_506548 || !dword_506528 )
|
|
509 {
|
|
510 v10 = pTex_tab_an_6a__zoom_off;
|
|
511 v8 = pViewport->uViewportTL_Y + 2;
|
|
512 v0 = pViewport->uViewportTL_X + 407;
|
|
513 }
|
|
514 else
|
|
515 {
|
|
516 v10 = pTex_tab_an_6b__zoom_on;
|
|
517 v8 = pViewport->uViewportTL_Y + 1;
|
|
518 v0 = pViewport->uViewportTL_X + 398;
|
|
519 }
|
|
520 pRenderer->DrawTextureTransparent(v0, v8, v10);
|
|
521 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
|
|
522 {
|
|
523 v11 = pTex_tab_an_7a__zoot_off;
|
|
524 v9 = pViewport->uViewportTL_Y + 38;
|
|
525 v1 = pViewport->uViewportTL_X + 407;
|
|
526 }
|
|
527 else
|
|
528 {
|
|
529 v11 = pTex_tab_an_7b__zoot_on;
|
|
530 v9 = pViewport->uViewportTL_Y + 38;
|
|
531 v1 = pViewport->uViewportTL_X + 398;
|
|
532 }
|
|
533 pRenderer->DrawTextureTransparent(v1, v9, v11);
|
819
|
534 a1.uFrameWidth = game_viewport_width;
|
|
535 a1.uFrameHeight = game_viewport_height;
|
|
536 a1.uFrameX = game_viewport_x;
|
|
537 a1.uFrameY = game_viewport_y;
|
|
538 a1.uFrameZ = game_viewport_z;
|
|
539 a1.uFrameW = game_viewport_w;
|
706
|
540 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[174], 3u);
|
|
541 a1.uFrameX = 48;
|
|
542 a1.uFrameY = 70;
|
|
543 a1.uFrameWidth = 360;
|
|
544 a1.uFrameHeight = 264;
|
|
545 a1.uFrameZ = 407;
|
|
546 a1.uFrameW = 333;
|
|
547 if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
|
|
548 {
|
|
549 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
550 v2 = dword_50651C++;
|
|
551 dword_506528 += awards_count;
|
|
552 byte_506130[v2] = awards_count;
|
|
553 }
|
|
554 if ( dword_506548 && dword_50651C )
|
|
555 {
|
|
556 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
557 --dword_50651C;
|
|
558 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
|
|
559 }
|
|
560 if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) )
|
|
561 {
|
|
562 v3 = 0;
|
|
563 dword_50651C = 0;
|
|
564 dword_506528 = 0;
|
|
565 }
|
|
566 dword_506544 = 0;
|
|
567 dword_506548 = 0;
|
|
568 awards_count = 0;
|
|
569 while ( v3 < awards_count2 )
|
|
570 {
|
|
571 v4 = achievedAwardsIndex[v3];
|
|
572 ++awards_count;
|
|
573 v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4];
|
|
574 a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0);
|
|
575 v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0);
|
|
576 v7 = a1.uFrameY + v6;
|
|
577 if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight )
|
|
578 break;
|
|
579 pRenderer->DrawTextureTransparent(100, v7 + 12, pSpellBookPagesTextr_10);
|
|
580 ++v3;
|
|
581 a1.uFrameY = v7 + 24;
|
|
582 }
|
|
583 }
|
|
584
|
|
585
|
|
586 //----- (0041338E) --------------------------------------------------------
|
|
587 void __cdecl DrawBook_Autonotes()
|
|
588 {
|
|
589 unsigned int v0; // eax@3
|
|
590 unsigned int v1; // eax@7
|
|
591 signed int v2; // ebp@11
|
|
592 unsigned int v3; // eax@18
|
|
593 unsigned int v4; // eax@24
|
|
594 unsigned int v5; // eax@30
|
|
595 unsigned int v6; // eax@36
|
|
596 unsigned int v7; // eax@42
|
|
597 signed int v8; // ebp@47
|
|
598 int v9; // eax@52
|
|
599 int v10; // eax@56
|
|
600 int v11; // edx@57
|
|
601 int v12; // ebp@64
|
|
602 int v13; // eax@65
|
|
603 const char *v14; // edi@65
|
|
604 int v15; // eax@65
|
|
605 unsigned int v16; // edi@65
|
|
606 unsigned int v17; // [sp-8h] [bp-70h]@3
|
|
607 unsigned int v18; // [sp-8h] [bp-70h]@7
|
|
608 unsigned int v19; // [sp-8h] [bp-70h]@18
|
|
609 unsigned int v20; // [sp-8h] [bp-70h]@24
|
|
610 unsigned int v21; // [sp-8h] [bp-70h]@30
|
|
611 unsigned int v22; // [sp-8h] [bp-70h]@36
|
|
612 unsigned int v23; // [sp-8h] [bp-70h]@42
|
|
613 Texture *v24; // [sp-4h] [bp-6Ch]@3
|
|
614 Texture *v25; // [sp-4h] [bp-6Ch]@7
|
|
615 Texture *v26; // [sp-4h] [bp-6Ch]@18
|
|
616 Texture *v27; // [sp-4h] [bp-6Ch]@24
|
|
617 Texture *v28; // [sp-4h] [bp-6Ch]@30
|
|
618 Texture *v29; // [sp-4h] [bp-6Ch]@36
|
|
619 Texture *v30; // [sp-4h] [bp-6Ch]@42
|
|
620 signed __int16 v31; // [sp+10h] [bp-58h]@1
|
|
621 char *v32; // [sp+10h] [bp-58h]@49
|
|
622 GUIWindow a1; // [sp+14h] [bp-54h]@46
|
|
623
|
|
624 v31 = 0;
|
|
625 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
|
|
626 if ( dword_506548 || !dword_506528 )
|
|
627 {
|
|
628 v24 = pTex_tab_an_6a__zoom_off;
|
|
629 v17 = pViewport->uViewportTL_Y + 2;
|
|
630 v0 = pViewport->uViewportTL_X + 407;
|
|
631 }
|
|
632 else
|
|
633 {
|
|
634 v24 = pTex_tab_an_6b__zoom_on;
|
|
635 v17 = pViewport->uViewportTL_Y + 1;
|
|
636 v0 = pViewport->uViewportTL_X + 398;
|
|
637 }
|
|
638 pRenderer->DrawTextureTransparent(v0, v17, v24);
|
|
639 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
|
|
640 {
|
|
641 v25 = pTex_tab_an_7a__zoot_off;
|
|
642 v18 = pViewport->uViewportTL_Y + 38;
|
|
643 v1 = pViewport->uViewportTL_X + 407;
|
|
644 }
|
|
645 else
|
|
646 {
|
|
647 v25 = pTex_tab_an_7b__zoot_on;
|
|
648 v18 = pViewport->uViewportTL_Y + 38;
|
|
649 v1 = pViewport->uViewportTL_X + 398;
|
|
650 }
|
|
651 pRenderer->DrawTextureTransparent(v1, v18, v25);
|
|
652 if ( !dword_506540 )
|
|
653 {
|
|
654 if ( dword_506568 )
|
|
655 {
|
|
656 pRenderer->DrawTextureTransparent(
|
|
657 pViewport->uViewportTL_X + 408,
|
|
658 pViewport->uViewportTL_Y + 113,
|
|
659 pTexture_506390);
|
|
660 v2 = 1;
|
|
661 goto LABEL_16;
|
|
662 }
|
|
663 goto LABEL_14;
|
|
664 }
|
|
665 if ( !dword_506568 )
|
|
666 {
|
|
667 LABEL_14:
|
|
668 v2 = 1;
|
|
669 goto LABEL_15;
|
|
670 }
|
|
671 v2 = 1;
|
|
672 v31 = 1;
|
|
673 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
674 LABEL_15:
|
|
675 dword_506568 = 0;
|
|
676 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
|
|
677 LABEL_16:
|
|
678 if ( dword_50653C )
|
|
679 {
|
|
680 if ( dword_506568 != v2 )
|
|
681 {
|
|
682 v31 = v2;
|
|
683 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
684 }
|
|
685 }
|
|
686 else
|
|
687 {
|
|
688 if ( dword_506568 != v2 )
|
|
689 {
|
|
690 v26 = pTexture_506388;
|
|
691 v19 = pViewport->uViewportTL_Y + 150;
|
|
692 v3 = pViewport->uViewportTL_X + 408;
|
|
693 goto LABEL_22;
|
|
694 }
|
|
695 }
|
|
696 v26 = pTexture_50638C;
|
|
697 dword_506568 = v2;
|
|
698 v19 = pViewport->uViewportTL_Y + 150;
|
|
699 v3 = pViewport->uViewportTL_X + 399;
|
|
700 LABEL_22:
|
|
701 pRenderer->DrawTextureTransparent(v3, v19, v26);
|
|
702 if ( dword_506538 )
|
|
703 {
|
|
704 if ( dword_506568 != 2 )
|
|
705 {
|
|
706 v31 = v2;
|
|
707 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
708 }
|
|
709 }
|
|
710 else
|
|
711 {
|
|
712 if ( dword_506568 != 2 )
|
|
713 {
|
|
714 v27 = pTexture_506380;
|
|
715 v20 = pViewport->uViewportTL_Y + 188;
|
|
716 v4 = pViewport->uViewportTL_X + 408;
|
|
717 goto LABEL_28;
|
|
718 }
|
|
719 }
|
|
720 v27 = pTexture_506384;
|
|
721 dword_506568 = 2;
|
|
722 v20 = pViewport->uViewportTL_Y + 188;
|
|
723 v4 = pViewport->uViewportTL_X + 397;
|
|
724 LABEL_28:
|
|
725 pRenderer->DrawTextureTransparent(v4, v20, v27);
|
|
726 if ( dword_506534 )
|
|
727 {
|
|
728 if ( dword_506568 != 3 )
|
|
729 {
|
|
730 v31 = v2;
|
|
731 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
732 }
|
|
733 }
|
|
734 else
|
|
735 {
|
|
736 if ( dword_506568 != 3 )
|
|
737 {
|
|
738 v28 = pTexture_506378;
|
|
739 v21 = pViewport->uViewportTL_Y + 226;
|
|
740 v5 = pViewport->uViewportTL_X + 408;
|
|
741 goto LABEL_34;
|
|
742 }
|
|
743 }
|
|
744 v28 = pTexture_50637C;
|
|
745 dword_506568 = 3;
|
|
746 v21 = pViewport->uViewportTL_Y + 226;
|
|
747 v5 = pViewport->uViewportTL_X + 397;
|
|
748 LABEL_34:
|
|
749 pRenderer->DrawTextureTransparent(v5, v21, v28);
|
|
750 if ( dword_506530 )
|
|
751 {
|
|
752 if ( dword_506568 != 4 )
|
|
753 {
|
|
754 v31 = v2;
|
|
755 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
756 }
|
|
757 }
|
|
758 else
|
|
759 {
|
|
760 if ( dword_506568 != 4 )
|
|
761 {
|
|
762 v29 = pTexture_506370;
|
|
763 v22 = pViewport->uViewportTL_Y + 263;
|
|
764 v6 = pViewport->uViewportTL_X + 408;
|
|
765 goto LABEL_40;
|
|
766 }
|
|
767 }
|
|
768 v29 = pTexture_506374;
|
|
769 dword_506568 = 4;
|
|
770 v22 = pViewport->uViewportTL_Y + 264;
|
|
771 v6 = pViewport->uViewportTL_X + 397;
|
|
772 LABEL_40:
|
|
773 pRenderer->DrawTextureTransparent(v6, v22, v29);
|
|
774 if ( dword_50652C )
|
|
775 {
|
|
776 if ( dword_506568 != 5 )
|
|
777 {
|
|
778 v31 = v2;
|
|
779 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
780 }
|
|
781 }
|
|
782 else
|
|
783 {
|
|
784 if ( dword_506568 != 5 )
|
|
785 {
|
|
786 v30 = pTexture_506368;
|
|
787 v23 = pViewport->uViewportTL_Y + 302;
|
|
788 v7 = pViewport->uViewportTL_X + 408;
|
|
789 goto LABEL_46;
|
|
790 }
|
|
791 }
|
|
792 v30 = pTexture_50636C;
|
|
793 dword_506568 = 5;
|
|
794 v23 = pViewport->uViewportTL_Y + 302;
|
|
795 v7 = pViewport->uViewportTL_X + 397;
|
|
796 LABEL_46:
|
|
797 pRenderer->DrawTextureTransparent(v7, v23, v30);
|
819
|
798 a1.uFrameWidth = game_viewport_width;
|
|
799 a1.uFrameHeight = game_viewport_height;
|
|
800 a1.uFrameX = game_viewport_x;
|
|
801 a1.uFrameY = game_viewport_z;
|
|
802 a1.uFrameZ = game_viewport_z;
|
|
803 a1.uFrameW = game_viewport_w;
|
706
|
804 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[154], 3u);
|
|
805 a1.uFrameX = 48;
|
|
806 a1.uFrameY = 70;
|
|
807 a1.uFrameWidth = 360;
|
|
808 a1.uFrameHeight = 264;
|
|
809 a1.uFrameZ = 407;
|
|
810 a1.uFrameW = 333;
|
|
811 if ( v31 )
|
|
812 {
|
|
813 awards_count2 = 0;
|
|
814 dword_506528 = 0;
|
|
815 dword_50651C = 0;
|
|
816 awards_count = 0;
|
|
817 v8 = 0;
|
|
818 do
|
|
819 {
|
|
820 //if ( dword_72371C[2 * v8] == dword_506568 )
|
|
821 if ( pAutonoteTxt[v8-1].eType == dword_506568 )
|
|
822 {
|
|
823 //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8];
|
|
824 v32 = (char *)pAutonoteTxt[v8-1].pText;
|
|
825 if ( (short)v8 )
|
|
826 {
|
|
827 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 )
|
|
828 {
|
|
829 v9 = awards_count++;
|
|
830 achievedAwardsIndex[v9] = (signed __int16)v8;
|
|
831 }
|
|
832 }
|
|
833 }
|
|
834 ++v8;
|
|
835 }
|
|
836 while ( v8 < 196 );
|
|
837 awards_count2 = awards_count;
|
|
838 }
|
|
839 else
|
|
840 {
|
|
841 if ( dword_506544 )
|
|
842 {
|
|
843 v10 = awards_count + dword_506528;
|
|
844 if ( awards_count + dword_506528 < awards_count2 )
|
|
845 {
|
|
846 v11 = dword_50651C++;
|
|
847 byte_506130[v11] = awards_count;
|
|
848 dword_506528 = v10;
|
|
849 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
850 }
|
|
851 }
|
|
852 if ( dword_506548 && dword_50651C )
|
|
853 {
|
|
854 --dword_50651C;
|
|
855 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
|
|
856 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
857 }
|
|
858 if ( !awards_count || dword_506528 < 1 )
|
|
859 {
|
|
860 dword_506528 = 0;
|
|
861 dword_50651C = 0;
|
|
862 }
|
|
863 }
|
|
864 v12 = dword_506528;
|
|
865 dword_50652C = 0;
|
|
866 dword_506544 = 0;
|
|
867 dword_506548 = 0;
|
|
868 awards_count = 0;
|
|
869 dword_506530 = 0;
|
|
870 dword_506534 = 0;
|
|
871 dword_506538 = 0;
|
|
872 dword_50653C = 0;
|
|
873 dword_506540 = 0;
|
|
874 while ( v12 < awards_count2 )
|
|
875 {
|
|
876 v13 = achievedAwardsIndex[v12];
|
|
877 ++awards_count;
|
|
878 //v14 = (&dword_723718_autonote_related)[8 * v13];
|
|
879 v14 = pAutonoteTxt[v13-1].pText;
|
|
880 //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0);
|
|
881 a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0);
|
|
882 v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0);
|
|
883 v16 = a1.uFrameY + v15;
|
|
884 if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight )
|
|
885 break;
|
|
886 pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10);
|
|
887 ++v12;
|
|
888 a1.uFrameY = v16 + 24;
|
|
889 }
|
|
890 }
|
|
891
|
|
892
|
|
893 //----- (00413980) --------------------------------------------------------
|
|
894 void DrawBook_Maps()
|
|
895 {
|
|
896
|
|
897 int v6; // eax@31
|
|
898 unsigned int map_id; // eax@35
|
|
899 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3
|
|
900 char party_coord[120]; // [sp+Ch] [bp-CCh]@37
|
|
901 GUIWindow map_window; // [sp+84h] [bp-54h]@35
|
|
902 unsigned int textrX, textrY;
|
|
903
|
|
904 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
|
|
905 if ( dword_506548 || viewparams->field_2C / 128 >= 12 )
|
|
906 {
|
|
907 buttnTxtr = pTex_tab_an_6a__zoom_off;
|
|
908 textrY = pViewport->uViewportTL_Y + 2;
|
|
909 textrX = pViewport->uViewportTL_X + 408;
|
|
910 }
|
|
911 else
|
|
912 {
|
|
913 buttnTxtr = pTex_tab_an_6b__zoom_on;
|
|
914 textrY = pViewport->uViewportTL_Y + 1;
|
|
915 textrX = pViewport->uViewportTL_X + 398;
|
|
916 }
|
|
917 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
918 if ( dword_506544 || viewparams->field_2C / 128 <= 3 )
|
|
919 {
|
|
920 buttnTxtr = pTex_tab_an_7a__zoot_off;
|
|
921 textrY = pViewport->uViewportTL_Y + 38;
|
|
922 textrX = pViewport->uViewportTL_X + 408;
|
|
923 }
|
|
924 else
|
|
925 {
|
|
926 buttnTxtr = pTex_tab_an_7b__zoot_on;
|
|
927 textrY = pViewport->uViewportTL_Y + 38;
|
|
928 textrX = pViewport->uViewportTL_X + 398;
|
|
929 }
|
|
930 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
931 if ( dword_506540 )
|
|
932 {
|
|
933 buttnTxtr = pTexture_506390;
|
|
934 textrY = pViewport->uViewportTL_Y + 113;
|
|
935 textrX = pViewport->uViewportTL_X + 408;
|
|
936 }
|
|
937 else
|
|
938 {
|
|
939 buttnTxtr = pTexture_506394;
|
|
940 textrY = pViewport->uViewportTL_Y + 113;
|
|
941 textrX = pViewport->uViewportTL_X + 398;
|
|
942 }
|
|
943 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
944 if ( dword_50653C )
|
|
945 {
|
|
946 buttnTxtr = pTexture_506388;
|
|
947 textrY = pViewport->uViewportTL_X + 150;
|
|
948 textrX = pViewport->uViewportTL_Y + 408;
|
|
949 }
|
|
950 else
|
|
951 {
|
|
952 buttnTxtr = pTexture_50638C;
|
|
953 textrY = pViewport->uViewportTL_X + 150;
|
|
954 textrX = pViewport->uViewportTL_Y + 399;
|
|
955 }
|
|
956 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
957 if ( dword_506538 )
|
|
958 {
|
|
959 buttnTxtr = pTexture_506380;
|
|
960 textrY = pViewport->uViewportTL_Y + 188;
|
|
961 textrX = pViewport->uViewportTL_X + 408;
|
|
962 }
|
|
963 else
|
|
964 {
|
|
965 buttnTxtr = pTexture_506384;
|
|
966 textrY = pViewport->uViewportTL_Y + 188;
|
|
967 textrX = pViewport->uViewportTL_X + 397;
|
|
968 }
|
|
969 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
970 if ( dword_506534 )
|
|
971 {
|
|
972 buttnTxtr = pTexture_506378;
|
|
973 textrY = pViewport->uViewportTL_Y + 226;
|
|
974 textrX = pViewport->uViewportTL_X + 408;
|
|
975 }
|
|
976 else
|
|
977 {
|
|
978 buttnTxtr = pTexture_50637C;
|
|
979 textrY = pViewport->uViewportTL_Y + 226;
|
|
980 textrX = pViewport->uViewportTL_X + 397;
|
|
981 }
|
|
982 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
|
|
983 if ( dword_506544 )
|
|
984 viewparams->CenterOnParty2();
|
|
985 if ( dword_506548 )
|
|
986 viewparams->CenterOnParty();
|
|
987 if ( dword_506540 )
|
|
988 viewparams->_443219();
|
|
989 if ( dword_50653C )
|
|
990 viewparams->_443231();
|
|
991 if ( dword_506538 )
|
|
992 viewparams->_44323D();
|
|
993 if ( dword_506534 )
|
|
994 viewparams->_443225();
|
|
995
|
|
996 if ( dword_506548 | dword_506544 | dword_506540 | dword_50653C | dword_506538 | dword_506534 )
|
|
997 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
|
|
998 dword_506548 = 0;
|
|
999 dword_506544 = 0;
|
|
1000 dword_506534 = 0;
|
|
1001 dword_506538 = 0;
|
|
1002 dword_50653C = 0;
|
|
1003 dword_506540 = 0;
|
|
1004 DrawBook_Map_sub(97, 49, 361, 313, 0);
|
|
1005 pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
|
819
|
1006 map_window.uFrameWidth = game_viewport_width;
|
|
1007 map_window.uFrameHeight = game_viewport_height;
|
|
1008 map_window.uFrameX = game_viewport_x;
|
|
1009 map_window.uFrameY = game_viewport_y;
|
|
1010 map_window.uFrameZ = game_viewport_z;
|
|
1011 map_window.uFrameW = game_viewport_w;
|
706
|
1012 map_id = pMapStats->GetMapInfo(pCurrentMapName);
|
|
1013 if ( map_id )
|
|
1014 map_window.DrawTitleText(pBook2Font, -14, 12, 0, pMapStats->pInfos[map_id].pName, 3);
|
|
1015 map_window.uFrameX = 0;
|
|
1016 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d"
|
|
1017 map_window.DrawTitleText(pFontComic, 0, 320, 0, party_coord, 0);
|
|
1018 }
|
|
1019
|
|
1020 //----- (00442955) --------------------------------------------------------
|
|
1021 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 )
|
|
1022 {
|
|
1023 int v5; // ebx@1
|
|
1024 int v6; // edi@1
|
|
1025 BLVMapOutlines *v7; // eax@8
|
|
1026 unsigned __int8 v8; // zf@8
|
|
1027 unsigned __int8 v9; // sf@8
|
|
1028 int v10; // esi@10
|
|
1029 unsigned int v11; // edx@11
|
|
1030 __int16 v12; // cx@12
|
|
1031 signed int v13; // eax@15
|
|
1032 int v14; // eax@16
|
|
1033 Vec3_short_ *v15; // ecx@16
|
|
1034 int v16; // edx@16
|
|
1035 int v17; // ecx@16
|
|
1036 Vec3_short_ *v18; // eax@16
|
|
1037 int v19; // ecx@16
|
|
1038 int v20; // eax@16
|
|
1039 signed int v21; // esi@18
|
|
1040 int v22; // ecx@21
|
|
1041 BLVMapOutline *v23; // ecx@21
|
|
1042 Vec3_short_ *v24; // edx@21
|
|
1043 Vec3_short_ *v25; // eax@21
|
|
1044 int v26; // ecx@21
|
|
1045 unsigned __int16 *v27; // edi@21
|
|
1046 int v28; // edx@21
|
|
1047 int v29; // eax@21
|
|
1048 double v30; // st7@23
|
|
1049 signed __int64 v31; // qax@23
|
|
1050 unsigned short *v32; // edx@23
|
|
1051 int textr_width; // esi@23
|
|
1052 signed int v34; // eax@23
|
|
1053 signed int v35; // ecx@23
|
|
1054 int v36; // esi@27
|
|
1055 int v37; // ecx@27
|
|
1056 int v38; // edx@31
|
|
1057 unsigned int v39; // eax@33
|
|
1058 short *v40; // esi@33
|
|
1059 short *v41; // edi@33
|
|
1060 unsigned __int8 v42; // cf@33
|
|
1061 unsigned int v43; // ecx@33
|
|
1062 short *v44; // edi@33
|
|
1063 short *v45; // esi@33
|
|
1064 int v46; // ecx@33
|
|
1065 signed int v47; // esi@38
|
|
1066 signed int v48; // ecx@38
|
|
1067 int v49; // eax@38
|
|
1068 signed int v50; // edx@55
|
|
1069 unsigned int v51; // ecx@55
|
|
1070 int result; // eax@72
|
|
1071 int v53; // eax@75
|
|
1072 int v54; // esi@75
|
|
1073 int v55; // eax@75
|
|
1074 __int16 v56; // si@85
|
|
1075 double v57; // st7@85
|
|
1076 int v58; // ebx@85
|
|
1077 signed __int64 v59; // qax@85
|
|
1078 signed int v60; // edi@85
|
|
1079 signed __int64 v61; // qax@85
|
|
1080 signed int v62; // ebx@85
|
|
1081 signed int v63; // esi@85
|
|
1082 int v64; // eax@87
|
|
1083 unsigned int v65; // ebx@95
|
|
1084 unsigned short *v66; // edx@95
|
|
1085 unsigned __int16 *v67; // esi@96
|
|
1086 int v68; // edi@98
|
|
1087 unsigned __int16 v69; // cx@99
|
|
1088 unsigned int v70; // [sp-10h] [bp-48074h]@80
|
|
1089 unsigned int v71; // [sp-Ch] [bp-48070h]@80
|
|
1090 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
|
|
1091 signed int v73; // [sp-4h] [bp-48068h]@59
|
|
1092 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
|
|
1093 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23
|
|
1094 int v76; // [sp+4800Ch] [bp-58h]@23
|
|
1095 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
|
|
1096 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23
|
|
1097 unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1
|
|
1098
|
|
1099 int v81; // [sp+48020h] [bp-44h]@23
|
|
1100 unsigned __int16* render16_data;
|
|
1101 unsigned char* texture8_data;
|
|
1102 unsigned char* curr_line;
|
|
1103 int scale_increment;
|
|
1104 int scaled_posX;
|
|
1105 int scaled_posY;
|
|
1106 int stepX_r;
|
|
1107 int stepY_r;
|
|
1108
|
|
1109
|
|
1110 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
|
|
1111 int v84; // [sp+4802Ch] [bp-38h]@1
|
|
1112 int screenCenter_X; // [sp+48030h] [bp-34h]@1
|
|
1113 int v86; // [sp+48034h] [bp-30h]@1
|
|
1114 int v87; // [sp+48038h] [bp-2Ch]@16
|
|
1115 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
|
|
1116 int black; // [sp+48040h] [bp-24h]@8
|
|
1117 int screenCenterY; // [sp+48044h] [bp-20h]@1
|
|
1118 unsigned int i; // [sp+48048h] [bp-1Ch]@9
|
|
1119 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16
|
|
1120 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
|
|
1121 signed int screenWidth; // [sp+48054h] [bp-10h]@8
|
|
1122 unsigned int v95; // [sp+48058h] [bp-Ch]@16
|
|
1123 int v96; // [sp+4805Ch] [bp-8h]@10
|
|
1124 const void *v97; // [sp+48060h] [bp-4h]@16
|
|
1125 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85
|
|
1126 int a5a; // [sp+48070h] [bp+Ch]@86
|
|
1127
|
|
1128 tl_x = tl_x;
|
|
1129 tl_y = tl_y;
|
|
1130 screenCenter_X = (signed int)(tl_x + br_x) >> 1;
|
|
1131 screenCenterY = (signed int)(tl_y + br_y) >> 1;
|
|
1132 surfPitch = pRenderer->uTargetSurfacePitch;
|
709
|
1133 pRenderer->SetRasterClipRect(tl_x, tl_y, br_x, br_y);
|
706
|
1134 v5 = viewparams->field_2C;
|
|
1135 v6 = viewparams->sViewCenterX;
|
|
1136 v86 = viewparams->sViewCenterX;
|
|
1137 v84 = viewparams->sViewCenterY;
|
|
1138 if ( viewparams->field_2C != 384 )
|
|
1139 {
|
|
1140 if ( viewparams->field_2C == 768 )
|
|
1141 {
|
|
1142 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
|
|
1143 v5 = 680;
|
|
1144 }
|
|
1145 }
|
|
1146 else
|
|
1147 {
|
711
|
1148 v6 = viewparams->indoor_center_x;
|
|
1149 v86 = viewparams->indoor_center_x;
|
|
1150 v84 = viewparams->indoor_center_y;
|
706
|
1151 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
|
|
1152 v5 = viewparams->field_2C - 34;
|
|
1153 }
|
|
1154 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
|
|
1155 {
|
|
1156 screenWidth = br_x - tl_x + 1;
|
|
1157 screenHeight = br_y - tl_y + 1;
|
|
1158 render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch];
|
710
|
1159 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
|
706
|
1160 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
|
|
1161 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
|
|
1162
|
|
1163 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
|
|
1164
|
|
1165
|
|
1166 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
|
|
1167 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
|
|
1168
|
|
1169 v32 = map_texture_16;
|
|
1170 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
|
|
1171 stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16;
|
|
1172 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
|
|
1173 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
|
|
1174
|
|
1175 v76 = textr_width;
|
|
1176 scaled_posY = stepY_r >> 16;
|
|
1177 //nearest neiborhood scaling
|
|
1178 if ( texture8_data)
|
|
1179 {
|
|
1180 for(uint i=0; i<screenHeight;++i)
|
|
1181 {
|
|
1182 curr_line=&texture8_data[scaled_posY*textr_width];
|
|
1183 stepX_r=teal;
|
|
1184 for(uint j=0; j<screenWidth;++j)
|
|
1185 {
|
|
1186 scaled_posX=stepX_r>>16;
|
|
1187 map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)];
|
|
1188 stepX_r+=scale_increment;
|
|
1189 }
|
|
1190 stepY_r+=scale_increment;
|
|
1191 scaled_posY=stepY_r>>16;
|
|
1192 }
|
|
1193 }
|
|
1194 //move visible square to render
|
|
1195 for(uint i=0; i<screenHeight;++i)
|
|
1196 {
|
|
1197 if ( screenWidth > 0 )
|
|
1198 {
|
|
1199 memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2);
|
|
1200 }
|
|
1201 }
|
|
1202 }
|
|
1203 else
|
|
1204 {
|
|
1205 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
|
|
1206 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
|
|
1207 v7 = pIndoor->pMapOutlines;
|
|
1208 uNumBlueFacesInBLVMinimap = 0;
|
|
1209 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
|
|
1210 v9 = pIndoor->pMapOutlines->uNumOutlines < 0;
|
|
1211 screenWidth = 0;
|
|
1212 if ( !(v9 | v8) )
|
|
1213 {
|
|
1214 i = 0;
|
|
1215 do
|
|
1216 {
|
|
1217 v10 = (int)((char *)v7 + i + 4);
|
|
1218 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
|
|
1219 if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) ))
|
|
1220 {
|
|
1221 v12 = *(short *)((char *)v7 + i + 14);
|
|
1222 if ( !(v12 & 1) )
|
|
1223 {
|
|
1224 if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 ))
|
|
1225 {
|
|
1226 v96 = (signed int)screenWidth >> 3;
|
|
1227 v13 = screenWidth;
|
|
1228 *(short *)(v10 + 10) = v12 | 1;
|
|
1229 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
|
|
1230 }
|
|
1231 }
|
|
1232 if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1)
|
|
1233 {
|
|
1234 v14 = *(short *)v10;
|
|
1235 v88 = v5;
|
|
1236 v15 = &pIndoor->pVertices[v14];
|
|
1237 v16 = v15->x;
|
|
1238 v17 = v15->y - v84;
|
|
1239 v93 = (unsigned __int16 *)(v16 - v6);
|
|
1240 screenHeight = v17;
|
|
1241 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
|
|
1242 v19 = v18->x;
|
|
1243 v20 = v18->y - v84;
|
|
1244 v95 = v19 - v6;
|
|
1245 v97 = (const void *)v20;
|
|
1246 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
|
|
1247 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16;
|
|
1248 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
|
|
1249 screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
|
709
|
1250 pRenderer->RasterLine2D(
|
706
|
1251 screenCenter_X + v88,
|
|
1252 screenCenterY - v87,
|
|
1253 screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
|
|
1254 screenCenterY - screenHeight,
|
|
1255 black);
|
|
1256 v7 = pIndoor->pMapOutlines;
|
|
1257 }
|
|
1258 }
|
|
1259 ++screenWidth;
|
|
1260 i += 12;
|
|
1261 }
|
|
1262 while ( screenWidth < (signed int)v7->uNumOutlines );
|
|
1263 }
|
|
1264 v21 = 0;
|
|
1265 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
|
|
1266 {
|
|
1267 while ( 1 )
|
|
1268 {
|
|
1269 v22 = pBlueFacesInBLVMinimapIDs[v21];
|
|
1270 v87 = v5;
|
|
1271 v23 = &v7->pOutlines[v22];
|
|
1272 v24 = &pIndoor->pVertices[v23->uVertex1ID];
|
|
1273 v25 = &pIndoor->pVertices[v23->uVertex2ID];
|
|
1274 v26 = v25->x;
|
|
1275 v27 = (unsigned __int16 *)(v24->x - v86);
|
|
1276 v28 = v24->y - v84;
|
|
1277 v29 = v25->y - v84;
|
|
1278 v93 = v27;
|
|
1279 screenHeight = v28;
|
|
1280 v97 = (const void *)v29;
|
|
1281 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
|
|
1282 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
|
|
1283 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
|
|
1284 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
|
709
|
1285 pRenderer->RasterLine2D(
|
706
|
1286 screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
|
|
1287 screenCenterY - v88,
|
|
1288 screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
|
|
1289 screenCenterY - v95,
|
|
1290 teal);
|
|
1291 ++v21;
|
|
1292 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
|
|
1293 break;
|
|
1294 v7 = pIndoor->pMapOutlines;
|
|
1295 }
|
|
1296 v6 = v86;
|
|
1297 }
|
|
1298 }
|
|
1299 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3;
|
|
1300 v81 = pParty->vPosition.y - v84;
|
|
1301 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
|
|
1302 v48 = 1;
|
|
1303 v49 = screenCenterY - (int)v97 - 3;
|
|
1304 if ( v47 >= (signed int)tl_x )
|
|
1305 {
|
|
1306 if ( v47 > (signed int)br_x )
|
|
1307 {
|
|
1308 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x )
|
|
1309 v48 = 0;
|
|
1310 v47 = br_x;
|
|
1311 }
|
|
1312 }
|
|
1313 else
|
|
1314 {
|
|
1315 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x )
|
|
1316 v48 = 0;
|
|
1317 v47 = tl_x;
|
|
1318 }
|
|
1319 if ( v49 >= (signed int)tl_y )
|
|
1320 {
|
|
1321 if ( v49 > br_y )
|
|
1322 {
|
|
1323 if ( screenCenterY - (signed int)v97 - 6 > br_y )
|
|
1324 v48 = 0;
|
|
1325 v49 = br_y;
|
|
1326 }
|
|
1327 }
|
|
1328 else
|
|
1329 {
|
|
1330 if ( screenCenterY - (signed int)v97 < (signed int)tl_y )
|
|
1331 v48 = 0;
|
|
1332 v49 = tl_y;
|
|
1333 }
|
|
1334 if ( v48 == 1 )
|
|
1335 {
|
|
1336 v50 = 0;
|
|
1337 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
|
|
1338 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
|
|
1339 {
|
|
1340 if ( (signed int)v51 > 384 )
|
|
1341 {
|
|
1342 if ( (signed int)v51 >= 640 )
|
|
1343 {
|
|
1344 if ( (signed int)v51 > 896 )
|
|
1345 {
|
|
1346 if ( (signed int)v51 >= 1152 )
|
|
1347 {
|
|
1348 if ( (signed int)v51 > 1408 )
|
|
1349 {
|
|
1350 if ( (signed int)v51 >= 1664 )
|
|
1351 {
|
|
1352 if ( (signed int)v51 <= 1920 )
|
|
1353 v73 = 7;
|
|
1354 }
|
|
1355 else
|
|
1356 {
|
|
1357 v73 = 6;
|
|
1358 }
|
|
1359 }
|
|
1360 else
|
|
1361 {
|
|
1362 v73 = 5;
|
|
1363 }
|
|
1364 }
|
|
1365 else
|
|
1366 {
|
|
1367 v73 = 4;
|
|
1368 }
|
|
1369 }
|
|
1370 else
|
|
1371 {
|
|
1372 v73 = 3;
|
|
1373 }
|
|
1374 }
|
|
1375 else
|
|
1376 {
|
|
1377 v73 = 2;
|
|
1378 }
|
|
1379 if( (signed int)v51 <=1920)
|
|
1380 v50 = v73;
|
|
1381 }
|
|
1382 else
|
|
1383 v50 = 1;
|
|
1384 }
|
|
1385 pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
|
|
1386 }
|
|
1387 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
|
|
1388 v95 = 0;
|
|
1389 v86 = result;
|
|
1390 if ( (signed int)uNumLevelDecorations > 0 )
|
|
1391 {
|
|
1392 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition;
|
|
1393 do
|
|
1394 {
|
|
1395 if ( *(char *)(screenWidth - 2) & 8 )
|
|
1396 {
|
|
1397 v53 = *(int *)(screenWidth + 4) - v84;
|
|
1398 v93 = (unsigned __int16 *)(*(int *)screenWidth - v6);
|
|
1399 screenHeight = v53;
|
|
1400 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
|
|
1401 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
|
|
1402 v55 = screenCenterY - (int)v97;
|
709
|
1403 if ( v54 >= pRenderer->raster_clip_x )
|
706
|
1404 {
|
709
|
1405 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
|
706
|
1406 {
|
|
1407 v74 = v86;
|
|
1408 if ( v5 > 512 )
|
|
1409 {
|
|
1410 v96 = v55 + 1;
|
|
1411 black = v55 - 1;
|
709
|
1412 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
|
|
1413 pRenderer->RasterLine2D(v54, black, v54, v96, v86);
|
706
|
1414 ++v54;
|
|
1415 v74 = v86;
|
|
1416 v72 = v96;
|
|
1417 v71 = v54;
|
|
1418 v70 = black;
|
|
1419 }
|
|
1420 else
|
|
1421 {
|
|
1422 v72 = screenCenterY - (int)v97;
|
|
1423 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
|
|
1424 v70 = screenCenterY - (int)v97;
|
|
1425 }
|
709
|
1426 pRenderer->RasterLine2D(v54, v70, v71, v72, v74);
|
706
|
1427 }
|
|
1428 }
|
|
1429 }
|
|
1430 ++v95;
|
|
1431 result = v95;
|
|
1432 screenWidth += 32;
|
|
1433 }
|
|
1434 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
|
|
1435 }
|
|
1436 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
|
|
1437 {
|
|
1438 screenCenterY = br_x - tl_x + 1;
|
|
1439 v95 = br_y - tl_y + 1;
|
|
1440 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch];
|
|
1441 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
|
|
1442 black = (1 << (v56 + 16)) / v5;
|
|
1443 v57 = (double)(1 << (16 - v56));
|
|
1444 v58 = 22528 / (v5 / 384);
|
|
1445 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
|
|
1446 v60 = (int)v59 << 16;
|
|
1447 v97 = (const void *)((int)v59 << 16);
|
|
1448 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
|
|
1449 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
|
|
1450 v62 = (int)v61 << 16;
|
|
1451 teal = v60 >> 16;
|
|
1452 v63 = (signed __int16)v61;
|
|
1453 a4a = map_texture_16;
|
|
1454 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
|
|
1455 screenCenter_X = 0;
|
|
1456 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X )
|
|
1457 {
|
|
1458 a5a = 0;
|
|
1459 if ( screenCenterY > 0 )
|
|
1460 {
|
|
1461 v96 = (v63 - 80) / 4;
|
|
1462 v64 = teal;
|
|
1463 do
|
|
1464 {
|
|
1465 v81 = (v64 - 80) / 4;
|
|
1466 if ( !pOutdoor->_47F04C(v81, v96) )
|
|
1467 {
|
|
1468 if ( pOutdoor->_47F097(v81, v96) )
|
|
1469 {
|
|
1470 if ( !((a5a + screenCenter_X) % 2) )
|
|
1471 *a4a = i;
|
|
1472 }
|
|
1473 else
|
|
1474 {
|
|
1475 *a4a = 0;
|
|
1476 }
|
|
1477 }
|
|
1478 ++a4a;
|
|
1479 v97 = (char *)v97 + black;
|
|
1480 v64 = (signed int)v97 >> 16;
|
|
1481 ++a5a;
|
|
1482 }
|
|
1483 while ( a5a < screenCenterY );
|
|
1484 }
|
|
1485 v62 += black;
|
|
1486 v97 = (const void *)v60;
|
|
1487 a4a += screenCenterY - a5a;
|
|
1488 v63 = v62 >> 16;
|
|
1489 ++screenCenter_X;
|
|
1490 teal = (unsigned int)pPalette_16;
|
|
1491 }
|
|
1492 v65 = v95;
|
|
1493 v66 = map_texture_16;
|
|
1494 if ( (signed int)v95 > 0 )
|
|
1495 {
|
|
1496 v67 = v77;
|
|
1497 result = 2 * (surfPitch - screenCenterY);
|
|
1498 do
|
|
1499 {
|
|
1500 if ( screenCenterY > 0 )
|
|
1501 {
|
|
1502 v68 = screenCenterY;
|
|
1503 do
|
|
1504 {
|
|
1505 v69 = *(short *)v66;
|
|
1506 if ( !*(short *)v66 || v69 == (short)i )
|
|
1507 *v67 = v69;
|
|
1508 ++v66;
|
|
1509 ++v67;
|
|
1510 --v68;
|
|
1511 }
|
|
1512 while ( v68 );
|
|
1513 }
|
|
1514 v67 = (unsigned __int16 *)((char *)v67 + result);
|
|
1515 --v65;
|
|
1516 }
|
|
1517 while ( v65 );
|
|
1518 }
|
|
1519 }
|
|
1520 }
|
|
1521
|
|
1522
|
|
1523
|
|
1524
|
|
1525 //----- (00413CC6) --------------------------------------------------------
|
|
1526 void __thiscall SellectDrawBook(unsigned int uBook)
|
|
1527 {
|
|
1528 enum WindowType pWindowType; // esi@1
|
|
1529
|
|
1530 pWindowType = (enum WindowType)uBook;
|
|
1531 pRenderer->DrawTextureIndexed(471u, 445u, (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
|
|
1532 switch ( pWindowType )
|
|
1533 {
|
|
1534 case WINDOW_Lloyd: // 177
|
|
1535 DrawLloydBeaconsScreen();
|
|
1536 break;
|
|
1537 case WINDOW_TownPortal: //195
|
|
1538 DrawTownPortalScreen();
|
|
1539 break;
|
|
1540 case WINDOW_QuestBook: //200
|
|
1541 DrawBook_Quests();
|
|
1542 break;
|
|
1543 case WINDOW_AutonotesBook: //201
|
|
1544 DrawBook_Autonotes();
|
|
1545 break;
|
|
1546 case WINDOW_MapsBook://202
|
|
1547 DrawBook_Maps();
|
|
1548 break;
|
|
1549 case WINDOW_CalendarBook://203
|
|
1550 DrawBook_Calendar();
|
|
1551 break;
|
|
1552 case WINDOW_HistoryBook://224
|
|
1553 DrawBook_History();
|
|
1554 break;
|
|
1555 }
|
|
1556 }
|