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