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