annotate UI/UIBooks.cpp @ 1311:1dee26137a92

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