annotate UI/Books/UIMapBook.cpp @ 1385:5644aecb5082

Player::AddItem and Player::AddItem2 fixed my bug
author Grumpy7
date Tue, 16 Jul 2013 23:35:40 +0200
parents ae435824ac4d
children 28f87f5234a1
rev   line source
1312
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
1 #ifdef _MSC_VER
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
3 #endif
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
4
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
5 #include <assert.h>
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
6
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
7 #include "..\..\MM7.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
8 #include "..\..\Render.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
9 #include "..\..\Mouse.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
10 #include "..\UIBooks.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
11 #include "..\..\MapInfo.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
12 #include "..\..\GUIWindow.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
13 #include "..\..\GUIFont.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
14 #include "..\..\Party.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
15 #include "..\..\AudioPlayer.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
16 #include "..\..\Outdoor.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
17 #include "..\..\LOD.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
18 #include "..\..\Allocator.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
19 #include "..\..\Viewport.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
20 #include "..\..\Math.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
21 #include "..\..\texts.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
22 //
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
23 #include "..\..\mm7_data.h"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
24
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
25 //__int16 word_4E1D3A[777]; // weak
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
26 std::array<__int16, 6> pTownPortalBook_xs = {{260, 324, 147, 385, 390, 19}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
27 std::array<__int16, 6> pTownPortalBook_ys = {{206, 84, 182, 239, 17, 283}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
28 std::array<__int16, 6> pTownPortalBook_ws = {{ 80, 66, 68, 72, 67, 74}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
29 std::array<__int16, 6> pTownPortalBook_hs = {{ 55, 56, 65, 67, 67, 59}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
30
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
31
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
32 std::array<unsigned int, 5> pLloydsBeaconsPreviewXs = {{61, 281, 61, 281, 171}}; // 004E249C
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
33 std::array<unsigned int, 5> pLloydsBeaconsPreviewYs = {{84, 84, 228, 228, 155}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
34 std::array<unsigned int, 5> pLloydsBeacons_SomeXs = {{59, 279, 59, 279, 169}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
35 std::array<unsigned int, 5> pLloydsBeacons_SomeYs = {{82, 82, 226, 226, 153}};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
36
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
37
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
38
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
39
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
40
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
41
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
42 //----- (00411150) --------------------------------------------------------
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
43 void BookUI_DrawTownPortalMap()
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
44 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
45 //signed int v0; // edi@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
46 //__int16 v1; // dx@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
47 //POINT *v2; // edi@17
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
48 int v3; // edi@17
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
49 //__int16 v4; // dx@24
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
50 GUIWindow v6; // [sp+Ch] [bp-64h]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
51 //POINT v7; // [sp+60h] [bp-10h]@17
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
52 POINT a2; // [sp+68h] [bp-8h]@17
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
53
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
54 pRenderer->ClearZBuffer(0, 479);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
55 pRenderer->DrawTextureTransparent(8, 8, pTexture_CurrentBook);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
56 pRenderer->DrawTextureTransparent(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
57
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
58 v6.uFrameX = game_viewport_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
59 v6.uFrameY = game_viewport_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
60 v6.uFrameWidth = game_viewport_width;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
61 v6.uFrameHeight = game_viewport_height;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
62 v6.uFrameZ = game_viewport_z;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
63 v6.uFrameW = game_viewport_w;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
64
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
65 const uint fountain_bits_lut[] = {PARTY_QUEST_FOUNTAIN_HARMONDALE,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
66 PARTY_QUEST_FOUNTAIN_PIERPONT,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
67 PARTY_QUEST_FOUNTAIN_NIGHON,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
68 PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
69 PARTY_QUEST_FOUNTAIN_CELESTIA,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
70 PARTY_QUEST_FOUNTAIN_THE_PIT};
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
71 for (uint i = 0; i < 6; ++i)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
72 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
73
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
74 if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[i]))
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
75 pRenderer->DrawMaskToZBuffer(pTownPortalBook_xs[i],
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
76 pTownPortalBook_ys[i],
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
77 pTexture_TownPortalIcons[i], i + 1);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
78 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
79
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
80 /* v0 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
81 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
82 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
83 if ( !v0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
84 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
85 v1 = 206;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
86 LABEL_14:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
87 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v1) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
88 goto LABEL_16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
89 goto LABEL_15;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
90 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
91 if ( v0 == 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
92 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
93 v1 = 208;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
94 goto LABEL_14;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
95 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
96 if ( v0 == 2 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
97 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
98 v1 = 207;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
99 goto LABEL_14;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
100 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
101 if ( v0 == 3 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
102 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
103 v1 = 211;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
104 goto LABEL_14;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
105 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
106 if ( v0 == 4 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
107 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
108 v1 = 209;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
109 goto LABEL_14;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
110 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
111 if ( v0 == 5 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
112 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
113 v1 = 210;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
114 goto LABEL_14;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
115 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
116 LABEL_15:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
117 pRenderer->DrawMaskToZBuffer(
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
118 pTownPortalBook_xs[v0],
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
119 pTownPortalBook_ys[v0],
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
120 *(&pTexture_TownPortalHarmn + v0),
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
121 v0 + 1);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
122 LABEL_16:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
123 ++v0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
124 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
125 while ( v0 < 6 );*/
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
126
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
127 pMouse->GetCursorPos(&a2);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
128 //v2 = pMouse->GetCursorPos(&a2);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
129 v3 = pRenderer->pActiveZBuffer[a2.x + pSRZBufferLineOffsets[a2.y]] & 0xFFFF;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
130
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
131 if (v3)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
132 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
133 if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1]))
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
134 pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
135 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
136 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
137
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
138
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
139 /* if ( !v3 ) // Town Portal
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
140 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
141 v6.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3); // "Town Portal"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
142 return;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
143 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
144 if ( v3 == 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
145 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
146 v4 = 206;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
147 LABEL_30:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
148 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v4) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
149 goto LABEL_31;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
150 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u); // "Town Portal"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
151 return;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
152 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
153 if ( v3 == 2 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
154 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
155 v4 = 208;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
156 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
157 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
158 if ( v3 == 3 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
159 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
160 v4 = 207;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
161 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
162 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
163 if ( v3 == 4 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
164 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
165 v4 = 211;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
166 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
167 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
168 if ( v3 == 5 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
169 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
170 v4 = 209;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
171 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
172 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
173 if ( v3 == 6 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
174 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
175 v4 = 210;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
176 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
177 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
178 LABEL_31:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
179 pRenderer->DrawTextureIndexed(word_4E1D3A[v3], pTownPortalBook_xs[v3 + 5], *(&pTex_tab_an_6b__zoom_on + v3));
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
180 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);*/
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
181 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
182 // 4E1D3A: using guessed type __int16 word_4E1D3A[];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
183
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
184 //----- (00410DEC) --------------------------------------------------------
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
185 unsigned int __cdecl DrawLloydBeaconsScreen()
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
186 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
187 Player *pPlayer; // esi@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
188 char *v1; // eax@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
189 unsigned __int16 v2; // ax@6
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
190 unsigned int result; // eax@11
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
191 unsigned int v4; // esi@13
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
192 unsigned int v5; // ecx@13
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
193 char v6; // zf@13
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
194 LloydBeacon *v7; // esi@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
195 int v8; // eax@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
196 unsigned __int64 v9; // kr08_8@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
197 unsigned int v10; // esi@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
198 unsigned int v11; // eax@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
199 char *v12; // eax@19
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
200 char *v13; // ecx@22
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
201 int v14; // eax@27
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
202 Texture *v19; // [sp-4h] [bp-8Ch]@4
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
203 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
204 unsigned int v23; // [sp+64h] [bp-24h]@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
205 __int64 v24; // [sp+68h] [bp-20h]@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
206 unsigned int v25; // [sp+70h] [bp-18h]@13
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
207 char *Str; // [sp+74h] [bp-14h]@14
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
208 int v27; // [sp+78h] [bp-10h]@11
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
209 LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
210 RGBTexture *v29; // [sp+80h] [bp-8h]@12
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
211 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
212
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
213 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
214 pRenderer->DrawTextureIndexed(8u, 8u, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
215 v1 = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
216 pWindow.uFrameX = game_viewport_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
217 pWindow.uFrameY = game_viewport_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
218 pWindow.uFrameWidth = 428;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
219 pWindow.uFrameHeight = game_viewport_height;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
220 pWindow.uFrameZ = 435;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
221 pWindow.uFrameW = game_viewport_w;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
222 if ( !bRecallingBeacon )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
223 v1 = pGlobalTXT_LocalizationStrings[375]; // Set Beacon
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
224 sprintf(pTmpBuf.data(), "%s", v1);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
225 pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3u);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
226 if ( bRecallingBeacon )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
227 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
228 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
229 v19 = pTex_tab_an_6a__zoom_off;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
230 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
231 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
232 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
233 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6a__zoom_off);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
234 v19 = pTex_tab_an_6b__zoom_on;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
235 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
236 pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
237 v2 = pPlayer->pActiveSkills[14];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
238 uNumMaxBeacons = 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
239 if ( HIBYTE(v2) & 1 || (v2 & 0x80u) != 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
240 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
241 uNumMaxBeacons = 5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
242 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
243 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
244 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
245 if ( v2 & 0x40 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
246 uNumMaxBeacons = 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
247 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
248 result = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
249 v27 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
250 if ( uNumMaxBeacons > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
251 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
252 v29 = pSavegameThumbnails.data();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
253 v28 = pPlayer->pInstalledBeacons;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
254 while ( 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
255 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
256 pWindow.uFrameWidth = 92;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
257 v4 = result;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
258 pWindow.uFrameHeight = 68;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
259 v5 = pLloydsBeaconsPreviewXs[result];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
260 pWindow.uFrameY = pLloydsBeaconsPreviewYs[result];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
261 v25 = pWindow.uFrameY;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
262 pWindow.uFrameX = v5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
263 pWindow.uFrameW = pWindow.uFrameY + 67;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
264 v6 = v29->pPixels == 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
265 pWindow.uFrameZ = v5 + 91;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
266 if ( !v6 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
267 break;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
268 if ( !bRecallingBeacon )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
269 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
270 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
271 v14 = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
272 pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - v14 / 2, 1, pGlobalTXT_LocalizationStrings[19], 3);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
273 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
274 LABEL_29:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
275 ++v29;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
276 ++v28;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
277 result = v27++ + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
278 if ( v27 >= uNumMaxBeacons )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
279 goto LABEL_30;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
280 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
281 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
282 pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[v4], pLloydsBeaconsPreviewYs[v4], v29);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
283 v7 = v28;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
284 Str = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v28->field_18))].pName;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
285 v8 = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
286 pWindow.uFrameY += -6 - v8;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
287 pWindow.DrawTitleText(pSpellFont, 0, 0, 1u, Str, 3u);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
288 v9 = v7->uBeaconTime - pParty->uTimePlayed;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
289 LODWORD(v24) = LODWORD(v7->uBeaconTime) - LODWORD(pParty->uTimePlayed);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
290 HIDWORD(v24) = HIDWORD(v9);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
291 v23 = (unsigned __int64)((signed __int64)((double)v24 * 0.234375) / 60 / 60) >> 32;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
292 v10 = (signed __int64)((double)v24 * 0.234375) / 60 / 60;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
293 v11 = v10 / 0x18;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
294 if ( (unsigned int)((signed __int64)((double)v24 * 0.234375) / 60 / 60) / 0x18 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
295 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
296 v13 = pGlobalTXT_LocalizationStrings[57]; // Days
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
297 if ( v11 > 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
298 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
299 sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
300 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
301 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
302 goto LABEL_29;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
303 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
304 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
305 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
306 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
307 if ( (signed __int64)(__PAIR__(v23, v10) + 1) <= 23 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
308 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
309 if ( (v23 & 0x80000000u) != 0 || (signed int)v23 <= 0 && v10 <= 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
310 v12 = pGlobalTXT_LocalizationStrings[109];// Hour
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
311 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
312 v12 = pGlobalTXT_LocalizationStrings[110];// Hours
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
313 sprintf(pTmpBuf.data(), "%lu %s", v10 + 1, v12);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
314 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
315 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
316 goto LABEL_29;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
317 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
318 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
319 v13 = pGlobalTXT_LocalizationStrings[56]; // Day
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
320 sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
321 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
322 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
323 goto LABEL_29;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
324 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
325 LABEL_30:
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
326 if ( byte_506360 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
327 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
328 /*result = pMessageQueue_50CBD0->uNumMessages;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
329 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
330 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
331 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseAfterInstallBeacon;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
332 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
333 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
334 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
335 ++pMessageQueue_50CBD0->uNumMessages;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
336 }*/
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
337 pMessageQueue_50CBD0->AddMessage(UIMSG_CloseAfterInstallBeacon, 0, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
338 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
339 return result;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
340 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
341
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
342
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
343 //----- (00413980) --------------------------------------------------------
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
344 void BookUI_Map_Draw()
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
345 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
346 int v6; // eax@31
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
347 unsigned int map_id; // eax@35
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
348 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
349 char party_coord[120]; // [sp+Ch] [bp-CCh]@37
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
350 GUIWindow map_window; // [sp+84h] [bp-54h]@35
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
351 unsigned int textrX, textrY;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
352
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
353 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
354 if ( BtnUp_flag || viewparams->field_2C / 128 >= 12 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
355 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
356 buttnTxtr = pTex_tab_an_6a__zoom_off;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
357 textrY = pViewport->uViewportTL_Y + 2;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
358 textrX = pViewport->uViewportTL_X + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
359 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
360 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
361 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
362 buttnTxtr = pTex_tab_an_6b__zoom_on;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
363 textrY = pViewport->uViewportTL_Y + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
364 textrX = pViewport->uViewportTL_X + 398;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
365 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
366 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
367 if ( BtnDown_flag || viewparams->field_2C / 128 <= 3 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
368 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
369 buttnTxtr = pTex_tab_an_7a__zoot_off;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
370 textrY = pViewport->uViewportTL_Y + 38;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
371 textrX = pViewport->uViewportTL_X + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
372 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
373 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
374 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
375 buttnTxtr = pTex_tab_an_7b__zoot_on;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
376 textrY = pViewport->uViewportTL_Y + 38;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
377 textrX = pViewport->uViewportTL_X + 398;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
378 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
379 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
380 if ( Book_PageBtn3_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
381 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
382 buttnTxtr = pTexture_506390;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
383 textrY = pViewport->uViewportTL_Y + 113;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
384 textrX = pViewport->uViewportTL_X + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
385 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
386 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
387 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
388 buttnTxtr = pTexture_506394;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
389 textrY = pViewport->uViewportTL_Y + 113;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
390 textrX = pViewport->uViewportTL_X + 398;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
391 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
392 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
393 if ( Book_PageBtn4_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
394 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
395 buttnTxtr = pTexture_506388;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
396 textrY = pViewport->uViewportTL_X + 150;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
397 textrX = pViewport->uViewportTL_Y + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
398 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
399 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
400 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
401 buttnTxtr = pTexture_50638C;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
402 textrY = pViewport->uViewportTL_X + 150;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
403 textrX = pViewport->uViewportTL_Y + 399;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
404 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
405 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
406 if ( Book_PageBtn5_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
407 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
408 buttnTxtr = pTexture_506380;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
409 textrY = pViewport->uViewportTL_Y + 188;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
410 textrX = pViewport->uViewportTL_X + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
411 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
412 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
413 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
414 buttnTxtr = pTexture_506384;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
415 textrY = pViewport->uViewportTL_Y + 188;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
416 textrX = pViewport->uViewportTL_X + 397;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
417 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
418 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
419 if ( Book_PageBtn6_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
420 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
421 buttnTxtr = pTexture_506378;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
422 textrY = pViewport->uViewportTL_Y + 226;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
423 textrX = pViewport->uViewportTL_X + 408;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
424 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
425 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
426 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
427 buttnTxtr = pTexture_50637C;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
428 textrY = pViewport->uViewportTL_Y + 226;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
429 textrX = pViewport->uViewportTL_X + 397;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
430 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
431 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
432 if ( BtnDown_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
433 viewparams->CenterOnParty2();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
434 if ( BtnUp_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
435 viewparams->CenterOnParty();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
436 if ( Book_PageBtn3_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
437 viewparams->_443219();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
438 if ( Book_PageBtn4_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
439 viewparams->_443231();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
440 if ( Book_PageBtn5_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
441 viewparams->_44323D();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
442 if ( Book_PageBtn6_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
443 viewparams->_443225();
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
444
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
445 if ( BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
446 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
447 BtnUp_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
448 BtnDown_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
449 Book_PageBtn6_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
450 Book_PageBtn5_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
451 Book_PageBtn4_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
452 Book_PageBtn3_flag = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
453 DrawBook_Map_sub(97, 49, 361, 313, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
454 pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
455 map_window.uFrameWidth = game_viewport_width;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
456 map_window.uFrameHeight = game_viewport_height;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
457 map_window.uFrameX = game_viewport_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
458 map_window.uFrameY = game_viewport_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
459 map_window.uFrameZ = game_viewport_z;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
460 map_window.uFrameW = game_viewport_w;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
461 map_id = pMapStats->GetMapInfo(pCurrentMapName.data());
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
462 if ( map_id )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
463 map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
464
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
465 map_window.uFrameX = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
466 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d"
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
467 map_window.DrawTitleText(pFontComic, 0, 320, ui_book_map_coordinates_color, party_coord, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
468 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
469
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
470 //----- (00442955) --------------------------------------------------------
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
471 void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
472 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
473 int v5; // ebx@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
474 int v6; // edi@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
475 BLVMapOutlines *v7; // eax@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
476 unsigned __int8 v8; // zf@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
477 unsigned __int8 v9; // sf@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
478 int v10; // esi@10
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
479 unsigned int v11; // edx@11
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
480 __int16 v12; // cx@12
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
481 signed int v13; // eax@15
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
482 int v14; // eax@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
483 Vec3_short_ *v15; // ecx@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
484 int v16; // edx@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
485 int v17; // ecx@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
486 Vec3_short_ *v18; // eax@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
487 int v19; // ecx@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
488 int v20; // eax@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
489 signed int v21; // esi@18
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
490 int v22; // ecx@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
491 BLVMapOutline *v23; // ecx@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
492 Vec3_short_ *v24; // edx@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
493 Vec3_short_ *v25; // eax@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
494 int v26; // ecx@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
495 unsigned __int16 *v27; // edi@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
496 int v28; // edx@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
497 int v29; // eax@21
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
498 double v30; // st7@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
499 signed __int64 v31; // qax@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
500 unsigned short *v32; // edx@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
501 int textr_width; // esi@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
502 signed int v34; // eax@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
503 signed int v35; // ecx@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
504 int v36; // esi@27
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
505 int v37; // ecx@27
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
506 int v38; // edx@31
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
507 unsigned int v39; // eax@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
508 short *v40; // esi@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
509 short *v41; // edi@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
510 unsigned __int8 v42; // cf@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
511 unsigned int v43; // ecx@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
512 short *v44; // edi@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
513 short *v45; // esi@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
514 int v46; // ecx@33
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
515 signed int v47; // esi@38
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
516 signed int v48; // ecx@38
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
517 int v49; // eax@38
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
518 signed int v50; // edx@55
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
519 unsigned int v51; // ecx@55
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
520 int result; // eax@72
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
521 int v53; // eax@75
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
522 int v54; // esi@75
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
523 int v55; // eax@75
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
524 __int16 v56; // si@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
525 double v57; // st7@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
526 int v58; // ebx@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
527 signed __int64 v59; // qax@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
528 signed int v60; // edi@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
529 signed __int64 v61; // qax@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
530 signed int v62; // ebx@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
531 signed int v63; // esi@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
532 int v64; // eax@87
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
533 unsigned int v65; // ebx@95
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
534 unsigned short *v66; // edx@95
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
535 unsigned __int16 *v67; // esi@96
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
536 int v68; // edi@98
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
537 unsigned __int16 v69; // cx@99
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
538 unsigned int v70; // [sp-10h] [bp-48074h]@80
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
539 unsigned int v71; // [sp-Ch] [bp-48070h]@80
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
540 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
541 signed int v73; // [sp-4h] [bp-48068h]@59
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
542 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
543 unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
544 int v76; // [sp+4800Ch] [bp-58h]@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
545 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
546 unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
547 unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
548
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
549 int v81; // [sp+48020h] [bp-44h]@23
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
550 unsigned __int16* render16_data;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
551 unsigned char* texture8_data;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
552 unsigned char* curr_line;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
553 int scale_increment;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
554 int scaled_posX;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
555 int scaled_posY;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
556 int stepX_r;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
557 int stepY_r;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
558
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
559
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
560 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
561 int v84; // [sp+4802Ch] [bp-38h]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
562 int screenCenter_X; // [sp+48030h] [bp-34h]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
563 int v86; // [sp+48034h] [bp-30h]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
564 int v87; // [sp+48038h] [bp-2Ch]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
565 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
566 int black; // [sp+48040h] [bp-24h]@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
567 int screenCenterY; // [sp+48044h] [bp-20h]@1
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
568 unsigned int i; // [sp+48048h] [bp-1Ch]@9
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
569 unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
570 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
571 signed int screenWidth; // [sp+48054h] [bp-10h]@8
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
572 unsigned int v95; // [sp+48058h] [bp-Ch]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
573 int v96; // [sp+4805Ch] [bp-8h]@10
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
574 const void *v97; // [sp+48060h] [bp-4h]@16
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
575 unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
576 int a5a; // [sp+48070h] [bp+Ch]@86
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
577
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
578 tl_x = tl_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
579 tl_y = tl_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
580 screenCenter_X = (signed int)(tl_x + br_x) >> 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
581 screenCenterY = (signed int)(tl_y + br_y) >> 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
582 surfPitch = pRenderer->uTargetSurfacePitch;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
583 pRenderer->SetRasterClipRect(tl_x, tl_y, br_x, br_y);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
584 v5 = viewparams->field_2C;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
585 v6 = viewparams->sViewCenterX;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
586 v86 = viewparams->sViewCenterX;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
587 v84 = viewparams->sViewCenterY;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
588 if ( viewparams->field_2C != 384 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
589 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
590 if ( viewparams->field_2C == 768 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
591 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
592 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
593 v5 = 680;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
594 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
595 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
596 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
597 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
598 v6 = viewparams->indoor_center_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
599 v86 = viewparams->indoor_center_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
600 v84 = viewparams->indoor_center_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
601 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
602 v5 = viewparams->field_2C - 34;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
603 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
604 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
605 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
606 screenWidth = br_x - tl_x + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
607 screenHeight = br_y - tl_y + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
608 render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
609 texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
610 pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
611 scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
612
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
613 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
614
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
615
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
616 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
617 // v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
618
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
619 // v32 = map_texture_16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
620 textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
621 stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
622 // v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
623 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
624
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
625 // v76 = textr_width;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
626 scaled_posY = stepY_r >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
627 //nearest neiborhood scaling
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
628 if ( texture8_data)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
629 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
630 for(uint i=0; i<screenHeight;++i)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
631 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
632 curr_line=&texture8_data[scaled_posY*textr_width];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
633 stepX_r=teal;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
634 for(uint j=0; j<screenWidth;++j)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
635 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
636 scaled_posX=stepX_r>>16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
637 map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
638 stepX_r+=scale_increment;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
639 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
640 stepY_r+=scale_increment;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
641 scaled_posY=stepY_r>>16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
642 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
643 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
644 //move visible square to render
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
645 for(uint i=0; i<screenHeight;++i)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
646 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
647 if ( screenWidth > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
648 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
649 memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
650 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
651 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
652 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
653 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
654 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
655 black = TargetColor(0, 0, 0);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
656 teal = TargetColor(0, 0xFFu, 0xFFu);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
657 v7 = pIndoor->pMapOutlines;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
658 uNumBlueFacesInBLVMinimap = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
659 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
660 v9 = pIndoor->pMapOutlines->uNumOutlines < 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
661 screenWidth = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
662 if ( !(v9 | v8) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
663 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
664 i = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
665 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
666 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
667 v10 = (int)((char *)v7 + i + 4);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
668 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
669 if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) ))
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
670 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
671 v12 = *(short *)((char *)v7 + i + 14);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
672 if ( !(v12 & 1) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
673 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
674 if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 ))
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
675 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
676 v96 = (signed int)screenWidth >> 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
677 v13 = screenWidth;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
678 *(short *)(v10 + 10) = v12 | 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
679 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
680 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
681 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
682 if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
683 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
684 v14 = *(short *)v10;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
685 v88 = v5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
686 v15 = &pIndoor->pVertices[v14];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
687 v16 = v15->x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
688 v17 = v15->y - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
689 v93 = (unsigned __int16 *)(v16 - v6);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
690 screenHeight = v17;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
691 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
692 v19 = v18->x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
693 v20 = v18->y - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
694 v95 = v19 - v6;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
695 v97 = (const void *)v20;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
696 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
697 v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
698 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
699 screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
700 pRenderer->RasterLine2D(
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
701 screenCenter_X + v88,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
702 screenCenterY - v87,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
703 screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
704 screenCenterY - screenHeight,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
705 black);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
706 v7 = pIndoor->pMapOutlines;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
707 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
708 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
709 ++screenWidth;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
710 i += 12;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
711 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
712 while ( screenWidth < (signed int)v7->uNumOutlines );
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
713 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
714 v21 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
715 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
716 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
717 while ( 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
718 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
719 v22 = pBlueFacesInBLVMinimapIDs[v21];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
720 v87 = v5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
721 v23 = &v7->pOutlines[v22];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
722 v24 = &pIndoor->pVertices[v23->uVertex1ID];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
723 v25 = &pIndoor->pVertices[v23->uVertex2ID];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
724 v26 = v25->x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
725 v27 = (unsigned __int16 *)(v24->x - v86);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
726 v28 = v24->y - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
727 v29 = v25->y - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
728 v93 = v27;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
729 screenHeight = v28;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
730 v97 = (const void *)v29;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
731 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
732 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
733 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
734 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
735 pRenderer->RasterLine2D(
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
736 screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
737 screenCenterY - v88,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
738 screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
739 screenCenterY - v95,
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
740 teal);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
741 ++v21;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
742 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
743 break;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
744 v7 = pIndoor->pMapOutlines;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
745 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
746 v6 = v86;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
747 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
748 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
749 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
750 v81 = pParty->vPosition.y - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
751 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
752 v48 = 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
753 v49 = screenCenterY - (int)v97 - 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
754 if ( v47 >= (signed int)tl_x )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
755 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
756 if ( v47 > (signed int)br_x )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
757 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
758 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
759 v48 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
760 v47 = br_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
761 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
762 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
763 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
764 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
765 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
766 v48 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
767 v47 = tl_x;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
768 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
769 if ( v49 >= (signed int)tl_y )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
770 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
771 if ( v49 > br_y )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
772 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
773 if ( screenCenterY - (signed int)v97 - 6 > br_y )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
774 v48 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
775 v49 = br_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
776 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
777 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
778 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
779 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
780 if ( screenCenterY - (signed int)v97 < (signed int)tl_y )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
781 v48 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
782 v49 = tl_y;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
783 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
784 if ( v48 == 1 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
785 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
786 v50 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
787 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
788 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
789 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
790 if ( (signed int)v51 > 384 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
791 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
792 if ( (signed int)v51 >= 640 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
793 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
794 if ( (signed int)v51 > 896 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
795 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
796 if ( (signed int)v51 >= 1152 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
797 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
798 if ( (signed int)v51 > 1408 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
799 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
800 if ( (signed int)v51 >= 1664 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
801 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
802 if ( (signed int)v51 <= 1920 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
803 v73 = 7;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
804 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
805 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
806 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
807 v73 = 6;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
808 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
809 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
810 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
811 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
812 v73 = 5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
813 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
814 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
815 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
816 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
817 v73 = 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
818 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
819 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
820 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
821 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
822 v73 = 3;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
823 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
824 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
825 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
826 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
827 v73 = 2;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
828 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
829 if( (signed int)v51 <=1920)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
830 v50 = v73;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
831 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
832 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
833 v50 = 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
834 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
835 pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50]));
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
836 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
837 result = TargetColor(0xFFu, 0xFFu, 0xFFu);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
838 v95 = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
839 v86 = result;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
840 if ( (signed int)uNumLevelDecorations > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
841 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
842 screenWidth = (unsigned int)&pLevelDecorations[0].vPosition;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
843 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
844 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
845 if ( *(char *)(screenWidth - 2) & 8 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
846 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
847 v53 = *(int *)(screenWidth + 4) - v84;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
848 v93 = (unsigned __int16 *)(*(int *)screenWidth - v6);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
849 screenHeight = v53;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
850 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
851 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
852 v55 = screenCenterY - (int)v97;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
853 if ( v54 >= pRenderer->raster_clip_x )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
854 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
855 if ( v54 <= pRenderer->raster_clip_z && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
856 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
857 v74 = v86;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
858 if ( v5 > 512 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
859 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
860 v96 = v55 + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
861 black = v55 - 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
862 pRenderer->RasterLine2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
863 pRenderer->RasterLine2D(v54, black, v54, v96, v86);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
864 ++v54;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
865 v74 = v86;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
866 v72 = v96;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
867 v71 = v54;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
868 v70 = black;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
869 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
870 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
871 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
872 v72 = screenCenterY - (int)v97;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
873 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
874 v70 = screenCenterY - (int)v97;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
875 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
876 pRenderer->RasterLine2D(v54, v70, v71, v72, v74);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
877 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
878 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
879 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
880 ++v95;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
881 result = v95;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
882 screenWidth += 32;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
883 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
884 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
885 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
886 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
887 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
888 screenCenterY = br_x - tl_x + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
889 v95 = br_y - tl_y + 1;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
890 v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch];
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
891 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
892 black = (1 << (v56 + 16)) / v5;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
893 v57 = (double)(1 << (16 - v56));
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
894 v58 = 22528 / (v5 / 384);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
895 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
896 v60 = (int)v59 << 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
897 v97 = (const void *)((int)v59 << 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
898 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
899 pPalette_16 = (unsigned __int16 *)(v60 >> 16);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
900 v62 = (int)v61 << 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
901 teal = v60 >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
902 v63 = (signed __int16)v61;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
903 a4a = map_texture_16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
904 result = TargetColor(0xCu, 0xCu, 0xCu);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
905 screenCenter_X = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
906 for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
907 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
908 a5a = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
909 if ( screenCenterY > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
910 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
911 v96 = (v63 - 80) / 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
912 v64 = teal;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
913 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
914 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
915 v81 = (v64 - 80) / 4;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
916 if ( !pOutdoor->_47F04C(v81, v96) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
917 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
918 if ( pOutdoor->_47F097(v81, v96) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
919 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
920 if ( !((a5a + screenCenter_X) % 2) )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
921 *a4a = i;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
922 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
923 else
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
924 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
925 *a4a = 0;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
926 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
927 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
928 ++a4a;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
929 v97 = (char *)v97 + black;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
930 v64 = (signed int)v97 >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
931 ++a5a;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
932 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
933 while ( a5a < screenCenterY );
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
934 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
935 v62 += black;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
936 v97 = (const void *)v60;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
937 a4a += screenCenterY - a5a;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
938 v63 = v62 >> 16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
939 ++screenCenter_X;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
940 teal = (unsigned int)pPalette_16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
941 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
942 v65 = v95;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
943 v66 = map_texture_16;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
944 if ( (signed int)v95 > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
945 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
946 v67 = v77;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
947 result = 2 * (surfPitch - screenCenterY);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
948 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
949 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
950 if ( screenCenterY > 0 )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
951 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
952 v68 = screenCenterY;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
953 do
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
954 {
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
955 v69 = *(short *)v66;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
956 if ( !*(short *)v66 || v69 == (short)i )
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
957 *v67 = v69;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
958 ++v66;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
959 ++v67;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
960 --v68;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
961 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
962 while ( v68 );
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
963 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
964 v67 = (unsigned __int16 *)((char *)v67 + result);
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
965 --v65;
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
966 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
967 while ( v65 );
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
968 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
969 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
970 }
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
971
ae435824ac4d books code splitted to separate files
Gloval
parents:
diff changeset
972