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